blob: 6b878e55d20ce26dbbe49650cbd0742c8d8fc04b [file] [log] [blame]
niklase@google.com470e71d2011-07-07 08:21:25 +00001/*
andrew@webrtc.orgc1354bd2012-07-27 18:21:16 +00002 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
niklase@google.com470e71d2011-07-07 08:21:25 +00003 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef WEBRTC_MODULES_VIDEO_CODING_TEST_VIDEO_SOURCE_H_
12#define WEBRTC_MODULES_VIDEO_CODING_TEST_VIDEO_SOURCE_H_
13
pbos@webrtc.orga4407322013-07-16 12:32:05 +000014#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
15#include "webrtc/typedefs.h"
niklase@google.com470e71d2011-07-07 08:21:25 +000016
17#include <string>
18
19enum VideoSize
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
Henrik Kjellander2557b862015-11-18 22:00:21 +010037 kNTSC, // 720*480 = 345 600
niklase@google.com470e71d2011-07-07 08:21:25 +000038 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
54class VideoSource
55{
56public:
57 VideoSource();
58 VideoSource(std::string fileName, VideoSize size, float frameRate, webrtc::VideoType type = webrtc::kI420);
pbos@webrtc.org7b859cc2013-04-02 15:54:38 +000059 VideoSource(std::string fileName, uint16_t width, uint16_t height,
niklase@google.com470e71d2011-07-07 08:21:25 +000060 float frameRate = 30, webrtc::VideoType type = webrtc::kI420);
61
62 std::string GetFileName() const { return _fileName; }
pbos@webrtc.org7b859cc2013-04-02 15:54:38 +000063 uint16_t GetWidth() const { return _width; }
64 uint16_t GetHeight() const { return _height; }
niklase@google.com470e71d2011-07-07 08:21:25 +000065 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
pkasting@chromium.org4591fbd2014-11-20 22:28:14 +000072 size_t GetFrameLength() const;
niklase@google.com470e71d2011-07-07 08:21:25 +000073
74private:
75 std::string _fileName;
pbos@webrtc.org7b859cc2013-04-02 15:54:38 +000076 uint16_t _width;
77 uint16_t _height;
niklase@google.com470e71d2011-07-07 08:21:25 +000078 webrtc::VideoType _type;
79 float _frameRate;
80};
81
82#endif // WEBRTC_MODULES_VIDEO_CODING_TEST_VIDEO_SOURCE_H_