diff --git a/webrtc/modules/video_coding/codecs/i420/main/interface/i420.h b/webrtc/modules/video_coding/codecs/i420/main/interface/i420.h index 4e7508614..1e99e699b 100644 --- a/webrtc/modules/video_coding/codecs/i420/main/interface/i420.h +++ b/webrtc/modules/video_coding/codecs/i420/main/interface/i420.h @@ -38,7 +38,7 @@ class I420Encoder : public VideoEncoder { // <0 - Error virtual int InitEncode(const VideoCodec* codecSettings, int /*numberOfCores*/, - uint32_t /*maxPayloadSize*/); + uint32_t /*maxPayloadSize*/) OVERRIDE; // "Encode" an I420 image (as a part of a video stream). The encoded image // will be returned to the user via the encode complete callback. @@ -50,9 +50,10 @@ class I420Encoder : public VideoEncoder { // // Return value : WEBRTC_VIDEO_CODEC_OK if OK. // <0 - Error - virtual int Encode(const I420VideoFrame& inputImage, - const CodecSpecificInfo* /*codecSpecificInfo*/, - const std::vector* /*frame_types*/); + virtual int Encode( + const I420VideoFrame& inputImage, + const CodecSpecificInfo* /*codecSpecificInfo*/, + const std::vector* /*frame_types*/) OVERRIDE; // Register an encode complete callback object. // @@ -60,22 +61,26 @@ class I420Encoder : public VideoEncoder { // - callback : Callback object which handles encoded images. // // Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise. - virtual int RegisterEncodeCompleteCallback(EncodedImageCallback* callback); + virtual int RegisterEncodeCompleteCallback( + EncodedImageCallback* callback) OVERRIDE; // Free encoder memory. // // Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise. - virtual int Release(); + virtual int Release() OVERRIDE; - virtual int SetRates(uint32_t /*newBitRate*/, uint32_t /*frameRate*/) { + virtual int SetRates(uint32_t /*newBitRate*/, + uint32_t /*frameRate*/) OVERRIDE { return WEBRTC_VIDEO_CODEC_OK; } - virtual int SetChannelParameters(uint32_t /*packetLoss*/, int /*rtt*/) { + virtual int SetChannelParameters(uint32_t /*packetLoss*/, + int /*rtt*/) OVERRIDE { return WEBRTC_VIDEO_CODEC_OK; } - virtual int CodecConfigParameters(uint8_t* /*buffer*/, int /*size*/) { + virtual int CodecConfigParameters(uint8_t* /*buffer*/, + int /*size*/) OVERRIDE { return WEBRTC_VIDEO_CODEC_OK; } @@ -100,10 +105,10 @@ class I420Decoder : public VideoDecoder { // Return value : WEBRTC_VIDEO_CODEC_OK. // <0 - Errors virtual int InitDecode(const VideoCodec* codecSettings, - int /*numberOfCores*/); + int /*numberOfCores*/) OVERRIDE; virtual int SetCodecConfigParameters(const uint8_t* /*buffer*/, - int /*size*/) { + int /*size*/) OVERRIDE { return WEBRTC_VIDEO_CODEC_OK; } @@ -123,7 +128,7 @@ class I420Decoder : public VideoDecoder { bool missingFrames, const RTPFragmentationHeader* /*fragmentation*/, const CodecSpecificInfo* /*codecSpecificInfo*/, - int64_t /*renderTimeMs*/); + int64_t /*renderTimeMs*/) OVERRIDE; // Register a decode complete callback object. // @@ -131,23 +136,25 @@ class I420Decoder : public VideoDecoder { // - callback : Callback object which handles decoded images. // // Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise. - virtual int RegisterDecodeCompleteCallback(DecodedImageCallback* callback); + virtual int RegisterDecodeCompleteCallback( + DecodedImageCallback* callback) OVERRIDE; // Free decoder memory. // // Return value : WEBRTC_VIDEO_CODEC_OK if OK. // <0 - Error - virtual int Release(); + virtual int Release() OVERRIDE; // Reset decoder state and prepare for a new call. // // Return value : WEBRTC_VIDEO_CODEC_OK. // <0 - Error - virtual int Reset(); + virtual int Reset() OVERRIDE; private: - static const uint8_t* ExtractHeader(const uint8_t* buffer, uint16_t* width, - uint16_t* height); + static const uint8_t* ExtractHeader(const uint8_t* buffer, + uint16_t* width, + uint16_t* height); I420VideoFrame _decodedImage; int _width; diff --git a/webrtc/modules/video_coding/codecs/test/packet_manipulator.h b/webrtc/modules/video_coding/codecs/test/packet_manipulator.h index c586de091..75550a0ff 100644 --- a/webrtc/modules/video_coding/codecs/test/packet_manipulator.h +++ b/webrtc/modules/video_coding/codecs/test/packet_manipulator.h @@ -92,7 +92,7 @@ class PacketManipulatorImpl : public PacketManipulator { const NetworkingConfig& config, bool verbose); virtual ~PacketManipulatorImpl(); - virtual int ManipulatePackets(webrtc::EncodedImage* encoded_image); + virtual int ManipulatePackets(webrtc::EncodedImage* encoded_image) OVERRIDE; virtual void InitializeRandomSeed(unsigned int seed); protected: // Returns a uniformly distributed random value between 0.0 and 1.0 diff --git a/webrtc/modules/video_coding/codecs/test/predictive_packet_manipulator.h b/webrtc/modules/video_coding/codecs/test/predictive_packet_manipulator.h index 3b895cc92..fcd506410 100644 --- a/webrtc/modules/video_coding/codecs/test/predictive_packet_manipulator.h +++ b/webrtc/modules/video_coding/codecs/test/predictive_packet_manipulator.h @@ -33,7 +33,7 @@ class PredictivePacketManipulator : public PacketManipulatorImpl { void AddRandomResult(double result); protected: // Returns a uniformly distributed random value between 0.0 and 1.0 - virtual double RandomUniform(); + virtual double RandomUniform() OVERRIDE; private: std::queue random_results_; diff --git a/webrtc/modules/video_coding/codecs/test/stats.cc b/webrtc/modules/video_coding/codecs/test/stats.cc index b85e65967..17a88aff1 100644 --- a/webrtc/modules/video_coding/codecs/test/stats.cc +++ b/webrtc/modules/video_coding/codecs/test/stats.cc @@ -17,6 +17,20 @@ namespace webrtc { namespace test { +FrameStatistic::FrameStatistic() + : encoding_successful(false), + decoding_successful(false), + encode_return_code(0), + decode_return_code(0), + encode_time_in_us(0), + decode_time_in_us(0), + frame_number(0), + packets_dropped(0), + total_packets(0), + bit_rate_in_kbps(0), + encoded_frame_length_in_bytes(0), + frame_type(kDeltaFrame) {} + Stats::Stats() {} Stats::~Stats() {} diff --git a/webrtc/modules/video_coding/codecs/test/stats.h b/webrtc/modules/video_coding/codecs/test/stats.h index 464535d20..299877335 100644 --- a/webrtc/modules/video_coding/codecs/test/stats.h +++ b/webrtc/modules/video_coding/codecs/test/stats.h @@ -20,14 +20,8 @@ namespace test { // Contains statistics of a single frame that has been processed. struct FrameStatistic { - FrameStatistic() : - encoding_successful(false), decoding_successful(false), - encode_return_code(0), decode_return_code(0), - encode_time_in_us(0), decode_time_in_us(0), - frame_number(0), packets_dropped(0), total_packets(0), - bit_rate_in_kbps(0), encoded_frame_length_in_bytes(0), - frame_type(kDeltaFrame) { - }; + FrameStatistic(); + bool encoding_successful; bool decoding_successful; int encode_return_code; @@ -35,7 +29,7 @@ struct FrameStatistic { int encode_time_in_us; int decode_time_in_us; int frame_number; - // How many packets were discarded of the encoded frame data (if any) + // How many packets were discarded of the encoded frame data (if any). int packets_dropped; int total_packets; diff --git a/webrtc/modules/video_coding/codecs/test/videoprocessor.cc b/webrtc/modules/video_coding/codecs/test/videoprocessor.cc index a68845aa1..0409128cd 100644 --- a/webrtc/modules/video_coding/codecs/test/videoprocessor.cc +++ b/webrtc/modules/video_coding/codecs/test/videoprocessor.cc @@ -20,6 +20,23 @@ namespace webrtc { namespace test { +TestConfig::TestConfig() + : name(""), + description(""), + test_number(0), + input_filename(""), + output_filename(""), + output_dir("out"), + networking_config(), + exclude_frame_types(kExcludeOnlyFirstKeyFrame), + frame_length_in_bytes(-1), + use_single_core(false), + keyframe_interval(0), + codec_settings(NULL), + verbose(true) {} + +TestConfig::~TestConfig() {} + VideoProcessorImpl::VideoProcessorImpl(webrtc::VideoEncoder* encoder, webrtc::VideoDecoder* decoder, FrameReader* frame_reader, diff --git a/webrtc/modules/video_coding/codecs/test/videoprocessor.h b/webrtc/modules/video_coding/codecs/test/videoprocessor.h index 1b5c502fc..20bcab577 100644 --- a/webrtc/modules/video_coding/codecs/test/videoprocessor.h +++ b/webrtc/modules/video_coding/codecs/test/videoprocessor.h @@ -40,13 +40,8 @@ const char* ExcludeFrameTypesToStr(ExcludeFrameTypes e); // Test configuration for a test run struct TestConfig { - TestConfig() - : name(""), description(""), test_number(0), - input_filename(""), output_filename(""), output_dir("out"), - networking_config(), exclude_frame_types(kExcludeOnlyFirstKeyFrame), - frame_length_in_bytes(-1), use_single_core(false), keyframe_interval(0), - codec_settings(NULL), verbose(true) { - }; + TestConfig(); + ~TestConfig(); // Name of the test. This is purely metadata and does not affect // the test in any way. @@ -168,8 +163,8 @@ class VideoProcessorImpl : public VideoProcessor { const TestConfig& config, Stats* stats); virtual ~VideoProcessorImpl(); - virtual bool Init(); - virtual bool ProcessFrame(int frame_number); + virtual bool Init() OVERRIDE; + virtual bool ProcessFrame(int frame_number) OVERRIDE; private: // Invoked by the callback when a frame has completed encoding. @@ -181,13 +176,13 @@ class VideoProcessorImpl : public VideoProcessor { int GetElapsedTimeMicroseconds(const webrtc::TickTime& start, const webrtc::TickTime& stop); // Updates the encoder with the target bit rate and the frame rate. - void SetRates(int bit_rate, int frame_rate); + virtual void SetRates(int bit_rate, int frame_rate) OVERRIDE; // Return the size of the encoded frame in bytes. - int EncodedFrameSize(); + virtual int EncodedFrameSize() OVERRIDE; // Return the number of dropped frames. - int NumberDroppedFrames(); + virtual int NumberDroppedFrames() OVERRIDE; // Return the number of spatial resizes. - int NumberSpatialResizes(); + virtual int NumberSpatialResizes() OVERRIDE; webrtc::VideoEncoder* encoder_; webrtc::VideoDecoder* decoder_; @@ -226,14 +221,14 @@ class VideoProcessorImpl : public VideoProcessor { // Callback class required to implement according to the VideoEncoder API. class VideoProcessorEncodeCompleteCallback - : public webrtc::EncodedImageCallback { + : public webrtc::EncodedImageCallback { public: - explicit VideoProcessorEncodeCompleteCallback(VideoProcessorImpl* vp) - : video_processor_(vp) { - } - int32_t Encoded(webrtc::EncodedImage& encoded_image, - const webrtc::CodecSpecificInfo* codec_specific_info = NULL, - const webrtc::RTPFragmentationHeader* fragmentation = NULL); + explicit VideoProcessorEncodeCompleteCallback(VideoProcessorImpl* vp) + : video_processor_(vp) {} + virtual int32_t Encoded( + webrtc::EncodedImage& encoded_image, + const webrtc::CodecSpecificInfo* codec_specific_info = NULL, + const webrtc::RTPFragmentationHeader* fragmentation = NULL) OVERRIDE; private: VideoProcessorImpl* video_processor_; @@ -246,7 +241,7 @@ class VideoProcessorImpl : public VideoProcessor { explicit VideoProcessorDecodeCompleteCallback(VideoProcessorImpl* vp) : video_processor_(vp) { } - int32_t Decoded(webrtc::I420VideoFrame& image); + virtual int32_t Decoded(webrtc::I420VideoFrame& image) OVERRIDE; private: VideoProcessorImpl* video_processor_;