| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #ifndef WEBRTC_MODULES_VIDEO_CODING_TEST_VIDEO_SOURCE_H_ | 11 #ifndef WEBRTC_MODULES_VIDEO_CODING_TEST_VIDEO_SOURCE_H_ |
| 12 #define WEBRTC_MODULES_VIDEO_CODING_TEST_VIDEO_SOURCE_H_ | 12 #define WEBRTC_MODULES_VIDEO_CODING_TEST_VIDEO_SOURCE_H_ |
| 13 | 13 |
| 14 #include <string> |
| 15 |
| 14 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" | 16 #include "webrtc/common_video/libyuv/include/webrtc_libyuv.h" |
| 15 #include "webrtc/typedefs.h" | 17 #include "webrtc/typedefs.h" |
| 16 | 18 |
| 17 #include <string> | 19 enum VideoSize { |
| 20 kUndefined, |
| 21 kSQCIF, // 128*96 = 12 288 |
| 22 kQQVGA, // 160*120 = 19 200 |
| 23 kQCIF, // 176*144 = 25 344 |
| 24 kCGA, // 320*200 = 64 000 |
| 25 kQVGA, // 320*240 = 76 800 |
| 26 kSIF, // 352*240 = 84 480 |
| 27 kWQVGA, // 400*240 = 96 000 |
| 28 kCIF, // 352*288 = 101 376 |
| 29 kW288p, // 512*288 = 147 456 (WCIF) |
| 30 k448p, // 576*448 = 281 088 |
| 31 kVGA, // 640*480 = 307 200 |
| 32 k432p, // 720*432 = 311 040 |
| 33 kW432p, // 768*432 = 331 776 |
| 34 k4SIF, // 704*480 = 337 920 |
| 35 kW448p, // 768*448 = 344 064 |
| 36 kNTSC, // 720*480 = 345 600 |
| 37 kFW448p, // 800*448 = 358 400 |
| 38 kWVGA, // 800*480 = 384 000 |
| 39 k4CIF, // 704*576 = 405 504 |
| 40 kSVGA, // 800*600 = 480 000 |
| 41 kW544p, // 960*544 = 522 240 |
| 42 kW576p, // 1024*576 = 589 824 (W4CIF) |
| 43 kHD, // 960*720 = 691 200 |
| 44 kXGA, // 1024*768 = 786 432 |
| 45 kWHD, // 1280*720 = 921 600 |
| 46 kFullHD, // 1440*1080 = 1 555 200 |
| 47 kWFullHD, // 1920*1080 = 2 073 600 |
| 18 | 48 |
| 19 enum VideoSize | 49 kNumberOfVideoSizes |
| 20 { | |
| 21 kUndefined, | |
| 22 kSQCIF, // 128*96 = 12 288 | |
| 23 kQQVGA, // 160*120 = 19 200 | |
| 24 kQCIF, // 176*144 = 25 344 | |
| 25 kCGA, // 320*200 = 64 000 | |
| 26 kQVGA, // 320*240 = 76 800 | |
| 27 kSIF, // 352*240 = 84 480 | |
| 28 kWQVGA, // 400*240 = 96 000 | |
| 29 kCIF, // 352*288 = 101 376 | |
| 30 kW288p, // 512*288 = 147 456 (WCIF) | |
| 31 k448p, // 576*448 = 281 088 | |
| 32 kVGA, // 640*480 = 307 200 | |
| 33 k432p, // 720*432 = 311 040 | |
| 34 kW432p, // 768*432 = 331 776 | |
| 35 k4SIF, // 704*480 = 337 920 | |
| 36 kW448p, // 768*448 = 344 064 | |
| 37 kNTSC, // 720*480 = 345 600 | |
| 38 kFW448p, // 800*448 = 358 400 | |
| 39 kWVGA, // 800*480 = 384 000 | |
| 40 k4CIF, // 704*576 = 405 504 | |
| 41 kSVGA, // 800*600 = 480 000 | |
| 42 kW544p, // 960*544 = 522 240 | |
| 43 kW576p, // 1024*576 = 589 824 (W4CIF) | |
| 44 kHD, // 960*720 = 691 200 | |
| 45 kXGA, // 1024*768 = 786 432 | |
| 46 kWHD, // 1280*720 = 921 600 | |
| 47 kFullHD, // 1440*1080 = 1 555 200 | |
| 48 kWFullHD, // 1920*1080 = 2 073 600 | |
| 49 | |
| 50 kNumberOfVideoSizes | |
| 51 }; | |
| 52 | |
| 53 | |
| 54 class VideoSource | |
| 55 { | |
| 56 public: | |
| 57 VideoSource(); | |
| 58 VideoSource(std::string fileName, VideoSize size, float frameRate, webrtc::Vid
eoType type = webrtc::kI420); | |
| 59 VideoSource(std::string fileName, uint16_t width, uint16_t height, | |
| 60 float frameRate = 30, webrtc::VideoType type = webrtc::kI420); | |
| 61 | |
| 62 std::string GetFileName() const { return _fileName; } | |
| 63 uint16_t GetWidth() const { return _width; } | |
| 64 uint16_t GetHeight() const { return _height; } | |
| 65 webrtc::VideoType GetType() const { return _type; } | |
| 66 float GetFrameRate() const { return _frameRate; } | |
| 67 int GetWidthHeight( VideoSize size); | |
| 68 | |
| 69 // Returns the filename with the path (including the leading slash) removed. | |
| 70 std::string GetName() const; | |
| 71 | |
| 72 size_t GetFrameLength() const; | |
| 73 | |
| 74 private: | |
| 75 std::string _fileName; | |
| 76 uint16_t _width; | |
| 77 uint16_t _height; | |
| 78 webrtc::VideoType _type; | |
| 79 float _frameRate; | |
| 80 }; | 50 }; |
| 81 | 51 |
| 82 #endif // WEBRTC_MODULES_VIDEO_CODING_TEST_VIDEO_SOURCE_H_ | 52 class VideoSource { |
| 53 public: |
| 54 VideoSource(); |
| 55 VideoSource(std::string fileName, |
| 56 VideoSize size, |
| 57 float frameRate, |
| 58 webrtc::VideoType type = webrtc::kI420); |
| 59 VideoSource(std::string fileName, |
| 60 uint16_t width, |
| 61 uint16_t height, |
| 62 float frameRate = 30, |
| 63 webrtc::VideoType type = webrtc::kI420); |
| 64 |
| 65 std::string GetFileName() const { return _fileName; } |
| 66 uint16_t GetWidth() const { return _width; } |
| 67 uint16_t GetHeight() const { return _height; } |
| 68 webrtc::VideoType GetType() const { return _type; } |
| 69 float GetFrameRate() const { return _frameRate; } |
| 70 int GetWidthHeight(VideoSize size); |
| 71 |
| 72 // Returns the filename with the path (including the leading slash) removed. |
| 73 std::string GetName() const; |
| 74 |
| 75 size_t GetFrameLength() const; |
| 76 |
| 77 private: |
| 78 std::string _fileName; |
| 79 uint16_t _width; |
| 80 uint16_t _height; |
| 81 webrtc::VideoType _type; |
| 82 float _frameRate; |
| 83 }; |
| 84 |
| 85 #endif // WEBRTC_MODULES_VIDEO_CODING_TEST_VIDEO_SOURCE_H_ |
| OLD | NEW |