Lint fix for webrtc/modules/video_coding PART 3!
Trying to submit all changes at once proved impossible since there were
too many changes in too many files. The changes to PRESUBMIT.py
will be uploaded in the last CL.
(original CL: https://codereview.webrtc.org/1528503003/)
BUG=webrtc:5309
TBR=mflodman@webrtc.org
Review URL: https://codereview.webrtc.org/1540243002
Cr-Commit-Position: refs/heads/master@{#11105}
diff --git a/webrtc/modules/video_coding/test/receiver_tests.h b/webrtc/modules/video_coding/test/receiver_tests.h
index 9b9b377..d6bac07 100644
--- a/webrtc/modules/video_coding/test/receiver_tests.h
+++ b/webrtc/modules/video_coding/test/receiver_tests.h
@@ -11,6 +11,9 @@
#ifndef WEBRTC_MODULES_VIDEO_CODING_TEST_RECEIVER_TESTS_H_
#define WEBRTC_MODULES_VIDEO_CODING_TEST_RECEIVER_TESTS_H_
+#include <stdio.h>
+#include <string>
+
#include "webrtc/common_types.h"
#include "webrtc/modules/include/module_common_types.h"
#include "webrtc/modules/rtp_rtcp/include/rtp_rtcp.h"
@@ -19,12 +22,9 @@
#include "webrtc/modules/video_coding/test/video_source.h"
#include "webrtc/typedefs.h"
-#include <stdio.h>
-#include <string>
-
class RtpDataCallback : public webrtc::NullRtpData {
public:
- RtpDataCallback(webrtc::VideoCodingModule* vcm) : vcm_(vcm) {}
+ explicit RtpDataCallback(webrtc::VideoCodingModule* vcm) : vcm_(vcm) {}
virtual ~RtpDataCallback() {}
int32_t OnReceivedPayloadData(
@@ -40,4 +40,4 @@
int RtpPlay(const CmdArgs& args);
-#endif // WEBRTC_MODULES_VIDEO_CODING_TEST_RECEIVER_TESTS_H_
+#endif // WEBRTC_MODULES_VIDEO_CODING_TEST_RECEIVER_TESTS_H_
diff --git a/webrtc/modules/video_coding/test/rtp_player.cc b/webrtc/modules/video_coding/test/rtp_player.cc
index c9af450..9b64906 100644
--- a/webrtc/modules/video_coding/test/rtp_player.cc
+++ b/webrtc/modules/video_coding/test/rtp_player.cc
@@ -26,9 +26,9 @@
#include "webrtc/test/rtp_file_reader.h"
#if 1
-# define DEBUG_LOG1(text, arg)
+#define DEBUG_LOG1(text, arg)
#else
-# define DEBUG_LOG1(text, arg) (printf(text "\n", arg))
+#define DEBUG_LOG1(text, arg) (printf(text "\n", arg))
#endif
namespace webrtc {
@@ -41,7 +41,9 @@
class RawRtpPacket {
public:
- RawRtpPacket(const uint8_t* data, size_t length, uint32_t ssrc,
+ RawRtpPacket(const uint8_t* data,
+ size_t length,
+ uint32_t ssrc,
uint16_t seq_num)
: data_(new uint8_t[length]),
length_(length),
@@ -140,7 +142,7 @@
CriticalSectionScoped cs(crit_sect_.get());
int count = 0;
for (ConstRtpPacketIterator it = packets_.begin(); it != packets_.end();
- ++it) {
+ ++it) {
if ((*it)->resend_time_ms() >= 0) {
count++;
}
@@ -164,7 +166,7 @@
printf("Packets still lost: %zd\n", packets_.size());
printf("Sequence numbers:\n");
for (ConstRtpPacketIterator it = packets_.begin(); it != packets_.end();
- ++it) {
+ ++it) {
printf("%u, ", (*it)->seq_num());
}
printf("\n");
@@ -231,17 +233,14 @@
kDefaultTransmissionTimeOffsetExtensionId);
for (PayloadTypesIterator it = payload_types_.begin();
- it != payload_types_.end(); ++it) {
+ it != payload_types_.end(); ++it) {
VideoCodec codec;
memset(&codec, 0, sizeof(codec));
- strncpy(codec.plName, it->name().c_str(), sizeof(codec.plName)-1);
+ strncpy(codec.plName, it->name().c_str(), sizeof(codec.plName) - 1);
codec.plType = it->payload_type();
codec.codecType = it->codec_type();
- if (handler->rtp_module_->RegisterReceivePayload(codec.plName,
- codec.plType,
- 90000,
- 0,
- codec.maxBitrate) < 0) {
+ if (handler->rtp_module_->RegisterReceivePayload(
+ codec.plName, codec.plType, 90000, 0, codec.maxBitrate) < 0) {
return -1;
}
}
@@ -267,7 +266,8 @@
private:
class Handler : public RtpStreamInterface {
public:
- Handler(uint32_t ssrc, const PayloadTypes& payload_types,
+ Handler(uint32_t ssrc,
+ const PayloadTypes& payload_types,
LostPackets* lost_packets)
: rtp_header_parser_(RtpHeaderParser::Create()),
rtp_payload_registry_(new RTPPayloadRegistry(
@@ -290,9 +290,7 @@
}
virtual uint32_t ssrc() const { return ssrc_; }
- virtual const PayloadTypes& payload_types() const {
- return payload_types_;
- }
+ virtual const PayloadTypes& payload_types() const { return payload_types_; }
rtc::scoped_ptr<RtpHeaderParser> rtp_header_parser_;
rtc::scoped_ptr<RTPPayloadRegistry> rtp_payload_registry_;
@@ -351,8 +349,7 @@
virtual int NextPacket(int64_t time_now) {
// Send any packets ready to be resent.
for (RawRtpPacket* packet = lost_packets_.NextPacketToResend(time_now);
- packet != NULL;
- packet = lost_packets_.NextPacketToResend(time_now)) {
+ packet != NULL; packet = lost_packets_.NextPacketToResend(time_now)) {
int ret = SendPacket(packet->data(), packet->length());
if (ret > 0) {
printf("Resend: %08x:%u\n", packet->ssrc(), packet->seq_num());
@@ -392,8 +389,7 @@
if (!packet_source_->NextPacket(&next_packet_)) {
end_of_file_ = true;
return 0;
- }
- else if (next_packet_.length == 0) {
+ } else if (next_packet_.length == 0) {
return 0;
}
}
@@ -406,7 +402,7 @@
virtual uint32_t TimeUntilNextPacket() const {
int64_t time_left = (next_rtp_time_ - first_packet_rtp_time_) -
- (clock_->TimeInMilliseconds() - first_packet_time_ms_);
+ (clock_->TimeInMilliseconds() - first_packet_time_ms_);
if (time_left < 0) {
return 0;
}
@@ -438,7 +434,7 @@
if (no_loss_startup_ > 0) {
no_loss_startup_--;
- } else if ((rand() + 1.0)/(RAND_MAX + 1.0) < loss_rate_) {
+ } else if ((rand() + 1.0) / (RAND_MAX + 1.0) < loss_rate_) { // NOLINT
uint16_t seq_num = header.sequenceNumber;
lost_packets_.AddPacket(new RawRtpPacket(data, length, ssrc, seq_num));
DEBUG_LOG1("Dropped packet: %d!", header.header.sequenceNumber);
@@ -470,9 +466,12 @@
};
RtpPlayerInterface* Create(const std::string& input_filename,
- PayloadSinkFactoryInterface* payload_sink_factory, Clock* clock,
- const PayloadTypes& payload_types, float loss_rate, int64_t rtt_ms,
- bool reordering) {
+ PayloadSinkFactoryInterface* payload_sink_factory,
+ Clock* clock,
+ const PayloadTypes& payload_types,
+ float loss_rate,
+ int64_t rtt_ms,
+ bool reordering) {
rtc::scoped_ptr<test::RtpFileReader> packet_source(
test::RtpFileReader::Create(test::RtpFileReader::kRtpDump,
input_filename));
diff --git a/webrtc/modules/video_coding/test/rtp_player.h b/webrtc/modules/video_coding/test/rtp_player.h
index c227f1c..e50fb9a 100644
--- a/webrtc/modules/video_coding/test/rtp_player.h
+++ b/webrtc/modules/video_coding/test/rtp_player.h
@@ -24,12 +24,12 @@
class PayloadCodecTuple {
public:
- PayloadCodecTuple(uint8_t payload_type, const std::string& codec_name,
+ PayloadCodecTuple(uint8_t payload_type,
+ const std::string& codec_name,
VideoCodecType codec_type)
: name_(codec_name),
payload_type_(payload_type),
- codec_type_(codec_type) {
- }
+ codec_type_(codec_type) {}
const std::string& name() const { return name_; }
uint8_t payload_type() const { return payload_type_; }
@@ -87,11 +87,14 @@
};
RtpPlayerInterface* Create(const std::string& inputFilename,
- PayloadSinkFactoryInterface* payloadSinkFactory, Clock* clock,
- const PayloadTypes& payload_types, float lossRate, int64_t rttMs,
- bool reordering);
+ PayloadSinkFactoryInterface* payloadSinkFactory,
+ Clock* clock,
+ const PayloadTypes& payload_types,
+ float lossRate,
+ int64_t rttMs,
+ bool reordering);
} // namespace rtpplayer
} // namespace webrtc
-#endif // WEBRTC_MODULES_VIDEO_CODING_TEST_RTP_PLAYER_H_
+#endif // WEBRTC_MODULES_VIDEO_CODING_TEST_RTP_PLAYER_H_
diff --git a/webrtc/modules/video_coding/test/stream_generator.cc b/webrtc/modules/video_coding/test/stream_generator.cc
index 304fe2e..167d55f 100644
--- a/webrtc/modules/video_coding/test/stream_generator.cc
+++ b/webrtc/modules/video_coding/test/stream_generator.cc
@@ -22,8 +22,7 @@
namespace webrtc {
StreamGenerator::StreamGenerator(uint16_t start_seq_num, int64_t current_time)
- : packets_(), sequence_number_(start_seq_num), start_time_(current_time) {
-}
+ : packets_(), sequence_number_(start_seq_num), start_time_(current_time) {}
void StreamGenerator::Init(uint16_t start_seq_num, int64_t current_time) {
packets_.clear();
@@ -41,8 +40,8 @@
const int packet_size =
(kFrameSize + num_media_packets / 2) / num_media_packets;
bool marker_bit = (i == num_media_packets - 1);
- packets_.push_back(GeneratePacket(
- sequence_number_, timestamp, packet_size, (i == 0), marker_bit, type));
+ packets_.push_back(GeneratePacket(sequence_number_, timestamp, packet_size,
+ (i == 0), marker_bit, type));
++sequence_number_;
}
for (int i = 0; i < num_empty_packets; ++i) {
@@ -104,7 +103,9 @@
return true;
}
-void StreamGenerator::DropLastPacket() { packets_.pop_back(); }
+void StreamGenerator::DropLastPacket() {
+ packets_.pop_back();
+}
uint16_t StreamGenerator::NextSequenceNumber() const {
if (packets_.empty())
@@ -112,7 +113,9 @@
return packets_.front().seqNum;
}
-int StreamGenerator::PacketsRemaining() const { return packets_.size(); }
+int StreamGenerator::PacketsRemaining() const {
+ return packets_.size();
+}
std::list<VCMPacket>::iterator StreamGenerator::GetPacketIterator(int index) {
std::list<VCMPacket>::iterator it = packets_.begin();
diff --git a/webrtc/modules/video_coding/test/test_util.cc b/webrtc/modules/video_coding/test/test_util.cc
index fc670ad..7ff663e 100644
--- a/webrtc/modules/video_coding/test/test_util.cc
+++ b/webrtc/modules/video_coding/test/test_util.cc
@@ -28,12 +28,12 @@
rtt(0),
inputFile(webrtc::test::ProjectRootPath() + "/resources/foreman_cif.yuv"),
outputFile(webrtc::test::OutputPath() +
- "video_coding_test_output_352x288.yuv") {
-}
+ "video_coding_test_output_352x288.yuv") {}
namespace {
-void SplitFilename(const std::string& filename, std::string* basename,
+void SplitFilename(const std::string& filename,
+ std::string* basename,
std::string* extension) {
assert(basename);
assert(extension);
@@ -41,7 +41,7 @@
std::string::size_type idx;
idx = filename.rfind('.');
- if(idx != std::string::npos) {
+ if (idx != std::string::npos) {
*basename = filename.substr(0, idx);
*extension = filename.substr(idx + 1);
} else {
@@ -50,21 +50,24 @@
}
}
-std::string AppendWidthHeightCount(const std::string& filename, int width,
- int height, int count) {
+std::string AppendWidthHeightCount(const std::string& filename,
+ int width,
+ int height,
+ int count) {
std::string basename;
std::string extension;
SplitFilename(filename, &basename, &extension);
std::stringstream ss;
- ss << basename << "_" << count << "." << width << "_" << height << "." <<
- extension;
+ ss << basename << "_" << count << "." << width << "_" << height << "."
+ << extension;
return ss.str();
}
} // namespace
FileOutputFrameReceiver::FileOutputFrameReceiver(
- const std::string& base_out_filename, uint32_t ssrc)
+ const std::string& base_out_filename,
+ uint32_t ssrc)
: out_filename_(),
out_file_(NULL),
timing_file_(NULL),
@@ -80,8 +83,8 @@
SplitFilename(base_out_filename, &basename, &extension);
}
std::stringstream ss;
- ss << basename << "_" << std::hex << std::setw(8) << std::setfill('0') <<
- ssrc << "." << extension;
+ ss << basename << "_" << std::hex << std::setw(8) << std::setfill('0') << ssrc
+ << "." << extension;
out_filename_ = ss.str();
}
@@ -113,8 +116,8 @@
printf("New size: %dx%d\n", video_frame.width(), video_frame.height());
width_ = video_frame.width();
height_ = video_frame.height();
- std::string filename_with_width_height = AppendWidthHeightCount(
- out_filename_, width_, height_, count_);
+ std::string filename_with_width_height =
+ AppendWidthHeightCount(out_filename_, width_, height_, count_);
++count_;
out_file_ = fopen(filename_with_width_height.c_str(), "wb");
if (out_file_ == NULL) {
@@ -122,7 +125,7 @@
}
}
fprintf(timing_file_, "%u, %u\n", video_frame.timestamp(),
- webrtc::MaskWord64ToUWord32(video_frame.render_time_ms()));
+ webrtc::MaskWord64ToUWord32(video_frame.render_time_ms()));
if (PrintVideoFrame(video_frame, out_file_) < 0) {
return -1;
}
@@ -130,7 +133,7 @@
}
webrtc::RtpVideoCodecTypes ConvertCodecType(const char* plname) {
- if (strncmp(plname,"VP8" , 3) == 0) {
+ if (strncmp(plname, "VP8", 3) == 0) {
return webrtc::kRtpVideoVp8;
} else {
// Default value.
diff --git a/webrtc/modules/video_coding/test/test_util.h b/webrtc/modules/video_coding/test/test_util.h
index 30f337d..45b88b9 100644
--- a/webrtc/modules/video_coding/test/test_util.h
+++ b/webrtc/modules/video_coding/test/test_util.h
@@ -33,11 +33,13 @@
virtual bool Reset() { return true; }
- virtual webrtc::EventTypeWrapper Wait(unsigned long max_time) {
+ virtual webrtc::EventTypeWrapper Wait(unsigned long max_time) { // NOLINT
return webrtc::kEventTimeout;
}
- virtual bool StartTimer(bool periodic, unsigned long time) { return true; }
+ virtual bool StartTimer(bool periodic, unsigned long time) { // NOLINT
+ return true;
+ }
virtual bool StopTimer() { return true; }
};
@@ -46,9 +48,7 @@
public:
virtual ~NullEventFactory() {}
- virtual webrtc::EventWrapper* CreateEvent() {
- return new NullEvent;
- }
+ virtual webrtc::EventWrapper* CreateEvent() { return new NullEvent; }
};
class FileOutputFrameReceiver : public webrtc::VCMReceiveCallback {
@@ -57,7 +57,7 @@
virtual ~FileOutputFrameReceiver();
// VCMReceiveCallback
- virtual int32_t FrameToRender(webrtc::VideoFrame& video_frame);
+ virtual int32_t FrameToRender(webrtc::VideoFrame& video_frame); // NOLINT
private:
std::string out_filename_;
diff --git a/webrtc/modules/video_coding/test/tester_main.cc b/webrtc/modules/video_coding/test/tester_main.cc
index 0184ff1..33ca820 100644
--- a/webrtc/modules/video_coding/test/tester_main.cc
+++ b/webrtc/modules/video_coding/test/tester_main.cc
@@ -8,7 +8,6 @@
* be found in the AUTHORS file in the root of the source tree.
*/
-
#include <stdlib.h>
#include <string.h>
@@ -21,12 +20,15 @@
DEFINE_int32(width, 352, "Width in pixels of the frames in the input file.");
DEFINE_int32(height, 288, "Height in pixels of the frames in the input file.");
DEFINE_int32(rtt, 0, "RTT (round-trip time), in milliseconds.");
-DEFINE_string(input_filename, webrtc::test::ProjectRootPath() +
- "/resources/foreman_cif.yuv", "Input file.");
-DEFINE_string(output_filename, webrtc::test::OutputPath() +
- "video_coding_test_output_352x288.yuv", "Output file.");
+DEFINE_string(input_filename,
+ webrtc::test::ProjectRootPath() + "/resources/foreman_cif.yuv",
+ "Input file.");
+DEFINE_string(output_filename,
+ webrtc::test::OutputPath() +
+ "video_coding_test_output_352x288.yuv",
+ "Output file.");
-using namespace webrtc;
+namespace webrtc {
/*
* Build with EVENT_DEBUG defined
@@ -36,36 +38,37 @@
int vcmMacrosTests = 0;
int vcmMacrosErrors = 0;
-int ParseArguments(CmdArgs& args) {
- args.width = FLAGS_width;
- args.height = FLAGS_height;
- if (args.width < 1 || args.height < 1) {
+int ParseArguments(CmdArgs* args) {
+ args->width = FLAGS_width;
+ args->height = FLAGS_height;
+ if (args->width < 1 || args->height < 1) {
return -1;
}
- args.codecName = FLAGS_codec;
- if (args.codecName == "VP8") {
- args.codecType = kVideoCodecVP8;
- } else if (args.codecName == "VP9") {
- args.codecType = kVideoCodecVP9;
- } else if (args.codecName == "I420") {
- args.codecType = kVideoCodecI420;
+ args->codecName = FLAGS_codec;
+ if (args->codecName == "VP8") {
+ args->codecType = kVideoCodecVP8;
+ } else if (args->codecName == "VP9") {
+ args->codecType = kVideoCodecVP9;
+ } else if (args->codecName == "I420") {
+ args->codecType = kVideoCodecI420;
} else {
- printf("Invalid codec: %s\n", args.codecName.c_str());
+ printf("Invalid codec: %s\n", args->codecName.c_str());
return -1;
}
- args.inputFile = FLAGS_input_filename;
- args.outputFile = FLAGS_output_filename;
- args.rtt = FLAGS_rtt;
+ args->inputFile = FLAGS_input_filename;
+ args->outputFile = FLAGS_output_filename;
+ args->rtt = FLAGS_rtt;
return 0;
}
+} // namespace webrtc
-int main(int argc, char **argv) {
+int main(int argc, char** argv) {
// Initialize WebRTC fileutils.h so paths to resources can be resolved.
webrtc::test::SetExecutablePath(argv[0]);
google::ParseCommandLineFlags(&argc, &argv, true);
CmdArgs args;
- if (ParseArguments(args) != 0) {
+ if (webrtc::ParseArguments(&args) != 0) {
printf("Unable to parse input arguments\n");
return -1;
}
diff --git a/webrtc/modules/video_coding/test/vcm_payload_sink_factory.cc b/webrtc/modules/video_coding/test/vcm_payload_sink_factory.cc
index 26a0d01..d4ee93f 100644
--- a/webrtc/modules/video_coding/test/vcm_payload_sink_factory.cc
+++ b/webrtc/modules/video_coding/test/vcm_payload_sink_factory.cc
@@ -22,9 +22,8 @@
namespace webrtc {
namespace rtpplayer {
-class VcmPayloadSinkFactory::VcmPayloadSink
- : public PayloadSinkInterface,
- public VCMPacketRequestCallback {
+class VcmPayloadSinkFactory::VcmPayloadSink : public PayloadSinkInterface,
+ public VCMPacketRequestCallback {
public:
VcmPayloadSink(VcmPayloadSinkFactory* factory,
RtpStreamInterface* stream,
@@ -43,9 +42,7 @@
vcm_->RegisterReceiveCallback(frame_receiver_.get());
}
- virtual ~VcmPayloadSink() {
- factory_->Remove(this);
- }
+ virtual ~VcmPayloadSink() { factory_->Remove(this); }
// PayloadSinkInterface
int32_t OnReceivedPayloadData(const uint8_t* payload_data,
@@ -136,8 +133,7 @@
}
const PayloadTypes& plt = stream->payload_types();
- for (PayloadTypesIterator it = plt.begin(); it != plt.end();
- ++it) {
+ for (PayloadTypesIterator it = plt.begin(); it != plt.end(); ++it) {
if (it->codec_type() != kVideoCodecULPFEC &&
it->codec_type() != kVideoCodecRED) {
VideoCodec codec;
diff --git a/webrtc/modules/video_coding/test/vcm_payload_sink_factory.h b/webrtc/modules/video_coding/test/vcm_payload_sink_factory.h
index 1de1cd6..dae53b0 100644
--- a/webrtc/modules/video_coding/test/vcm_payload_sink_factory.h
+++ b/webrtc/modules/video_coding/test/vcm_payload_sink_factory.h
@@ -29,9 +29,11 @@
class VcmPayloadSinkFactory : public PayloadSinkFactoryInterface {
public:
VcmPayloadSinkFactory(const std::string& base_out_filename,
- Clock* clock, bool protection_enabled,
+ Clock* clock,
+ bool protection_enabled,
VCMVideoProtection protection_method,
- int64_t rtt_ms, uint32_t render_delay_ms,
+ int64_t rtt_ms,
+ uint32_t render_delay_ms,
uint32_t min_playout_delay_ms);
virtual ~VcmPayloadSinkFactory();
diff --git a/webrtc/modules/video_coding/test/video_rtp_play.cc b/webrtc/modules/video_coding/test/video_rtp_play.cc
index 0a6b7d1..cb092e3 100644
--- a/webrtc/modules/video_coding/test/video_rtp_play.cc
+++ b/webrtc/modules/video_coding/test/video_rtp_play.cc
@@ -48,9 +48,9 @@
output_file = webrtc::test::OutputPath() + "RtpPlay_decoded.yuv";
webrtc::SimulatedClock clock(0);
- webrtc::rtpplayer::VcmPayloadSinkFactory factory(output_file, &clock,
- kConfigProtectionEnabled, kConfigProtectionMethod, kConfigRttMs,
- kConfigRenderDelayMs, kConfigMinPlayoutDelayMs);
+ webrtc::rtpplayer::VcmPayloadSinkFactory factory(
+ output_file, &clock, kConfigProtectionEnabled, kConfigProtectionMethod,
+ kConfigRttMs, kConfigRenderDelayMs, kConfigMinPlayoutDelayMs);
rtc::scoped_ptr<webrtc::rtpplayer::RtpPlayerInterface> rtp_player(
webrtc::rtpplayer::Create(args.inputFile, &factory, &clock, payload_types,
kConfigLossRate, kConfigRttMs,
@@ -63,7 +63,7 @@
while ((ret = rtp_player->NextPacket(clock.TimeInMilliseconds())) == 0) {
ret = factory.DecodeAndProcessAll(true);
if (ret < 0 || (kConfigMaxRuntimeMs > -1 &&
- clock.TimeInMilliseconds() >= kConfigMaxRuntimeMs)) {
+ clock.TimeInMilliseconds() >= kConfigMaxRuntimeMs)) {
break;
}
clock.AdvanceTimeMilliseconds(1);
diff --git a/webrtc/modules/video_coding/test/video_source.h b/webrtc/modules/video_coding/test/video_source.h
index 6b878e5..19d7f50 100644
--- a/webrtc/modules/video_coding/test/video_source.h
+++ b/webrtc/modules/video_coding/test/video_source.h
@@ -11,72 +11,75 @@
#ifndef WEBRTC_MODULES_VIDEO_CODING_TEST_VIDEO_SOURCE_H_
#define WEBRTC_MODULES_VIDEO_CODING_TEST_VIDEO_SOURCE_H_
+#include <string>
+
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/typedefs.h"
-#include <string>
+enum VideoSize {
+ kUndefined,
+ kSQCIF, // 128*96 = 12 288
+ kQQVGA, // 160*120 = 19 200
+ kQCIF, // 176*144 = 25 344
+ kCGA, // 320*200 = 64 000
+ kQVGA, // 320*240 = 76 800
+ kSIF, // 352*240 = 84 480
+ kWQVGA, // 400*240 = 96 000
+ kCIF, // 352*288 = 101 376
+ kW288p, // 512*288 = 147 456 (WCIF)
+ k448p, // 576*448 = 281 088
+ kVGA, // 640*480 = 307 200
+ k432p, // 720*432 = 311 040
+ kW432p, // 768*432 = 331 776
+ k4SIF, // 704*480 = 337 920
+ kW448p, // 768*448 = 344 064
+ kNTSC, // 720*480 = 345 600
+ kFW448p, // 800*448 = 358 400
+ kWVGA, // 800*480 = 384 000
+ k4CIF, // 704*576 = 405 504
+ kSVGA, // 800*600 = 480 000
+ kW544p, // 960*544 = 522 240
+ kW576p, // 1024*576 = 589 824 (W4CIF)
+ kHD, // 960*720 = 691 200
+ kXGA, // 1024*768 = 786 432
+ kWHD, // 1280*720 = 921 600
+ kFullHD, // 1440*1080 = 1 555 200
+ kWFullHD, // 1920*1080 = 2 073 600
-enum VideoSize
- {
- kUndefined,
- kSQCIF, // 128*96 = 12 288
- kQQVGA, // 160*120 = 19 200
- kQCIF, // 176*144 = 25 344
- kCGA, // 320*200 = 64 000
- kQVGA, // 320*240 = 76 800
- kSIF, // 352*240 = 84 480
- kWQVGA, // 400*240 = 96 000
- kCIF, // 352*288 = 101 376
- kW288p, // 512*288 = 147 456 (WCIF)
- k448p, // 576*448 = 281 088
- kVGA, // 640*480 = 307 200
- k432p, // 720*432 = 311 040
- kW432p, // 768*432 = 331 776
- k4SIF, // 704*480 = 337 920
- kW448p, // 768*448 = 344 064
- kNTSC, // 720*480 = 345 600
- kFW448p, // 800*448 = 358 400
- kWVGA, // 800*480 = 384 000
- k4CIF, // 704*576 = 405 504
- kSVGA, // 800*600 = 480 000
- kW544p, // 960*544 = 522 240
- kW576p, // 1024*576 = 589 824 (W4CIF)
- kHD, // 960*720 = 691 200
- kXGA, // 1024*768 = 786 432
- kWHD, // 1280*720 = 921 600
- kFullHD, // 1440*1080 = 1 555 200
- kWFullHD, // 1920*1080 = 2 073 600
-
- kNumberOfVideoSizes
- };
-
-
-class VideoSource
-{
-public:
- VideoSource();
- VideoSource(std::string fileName, VideoSize size, float frameRate, webrtc::VideoType type = webrtc::kI420);
- VideoSource(std::string fileName, uint16_t width, uint16_t height,
- float frameRate = 30, webrtc::VideoType type = webrtc::kI420);
-
- std::string GetFileName() const { return _fileName; }
- uint16_t GetWidth() const { return _width; }
- uint16_t GetHeight() const { return _height; }
- webrtc::VideoType GetType() const { return _type; }
- float GetFrameRate() const { return _frameRate; }
- int GetWidthHeight( VideoSize size);
-
- // Returns the filename with the path (including the leading slash) removed.
- std::string GetName() const;
-
- size_t GetFrameLength() const;
-
-private:
- std::string _fileName;
- uint16_t _width;
- uint16_t _height;
- webrtc::VideoType _type;
- float _frameRate;
+ kNumberOfVideoSizes
};
-#endif // WEBRTC_MODULES_VIDEO_CODING_TEST_VIDEO_SOURCE_H_
+class VideoSource {
+ public:
+ VideoSource();
+ VideoSource(std::string fileName,
+ VideoSize size,
+ float frameRate,
+ webrtc::VideoType type = webrtc::kI420);
+ VideoSource(std::string fileName,
+ uint16_t width,
+ uint16_t height,
+ float frameRate = 30,
+ webrtc::VideoType type = webrtc::kI420);
+
+ std::string GetFileName() const { return _fileName; }
+ uint16_t GetWidth() const { return _width; }
+ uint16_t GetHeight() const { return _height; }
+ webrtc::VideoType GetType() const { return _type; }
+ float GetFrameRate() const { return _frameRate; }
+ int GetWidthHeight(VideoSize size);
+
+ // Returns the filename with the path (including the leading slash) removed.
+ std::string GetName() const;
+
+ size_t GetFrameLength() const;
+
+ private:
+ std::string _fileName;
+ uint16_t _width;
+ uint16_t _height;
+ webrtc::VideoType _type;
+ float _frameRate;
+};
+
+#endif // WEBRTC_MODULES_VIDEO_CODING_TEST_VIDEO_SOURCE_H_