Fix some chromium-style warnings in webrtc/modules/video_coding/
BUG=163 R=mikhal@webrtc.org Review URL: https://webrtc-codereview.appspot.com/1901005 git-svn-id: http://webrtc.googlecode.com/svn/trunk@4429 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
e6c3966530
commit
7f7162a003
@ -38,7 +38,7 @@ class I420Encoder : public VideoEncoder {
|
|||||||
// <0 - Error
|
// <0 - Error
|
||||||
virtual int InitEncode(const VideoCodec* codecSettings,
|
virtual int InitEncode(const VideoCodec* codecSettings,
|
||||||
int /*numberOfCores*/,
|
int /*numberOfCores*/,
|
||||||
uint32_t /*maxPayloadSize*/);
|
uint32_t /*maxPayloadSize*/) OVERRIDE;
|
||||||
|
|
||||||
// "Encode" an I420 image (as a part of a video stream). The encoded image
|
// "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.
|
// 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.
|
// Return value : WEBRTC_VIDEO_CODEC_OK if OK.
|
||||||
// <0 - Error
|
// <0 - Error
|
||||||
virtual int Encode(const I420VideoFrame& inputImage,
|
virtual int Encode(
|
||||||
|
const I420VideoFrame& inputImage,
|
||||||
const CodecSpecificInfo* /*codecSpecificInfo*/,
|
const CodecSpecificInfo* /*codecSpecificInfo*/,
|
||||||
const std::vector<VideoFrameType>* /*frame_types*/);
|
const std::vector<VideoFrameType>* /*frame_types*/) OVERRIDE;
|
||||||
|
|
||||||
// Register an encode complete callback object.
|
// Register an encode complete callback object.
|
||||||
//
|
//
|
||||||
@ -60,22 +61,26 @@ class I420Encoder : public VideoEncoder {
|
|||||||
// - callback : Callback object which handles encoded images.
|
// - callback : Callback object which handles encoded images.
|
||||||
//
|
//
|
||||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
||||||
virtual int RegisterEncodeCompleteCallback(EncodedImageCallback* callback);
|
virtual int RegisterEncodeCompleteCallback(
|
||||||
|
EncodedImageCallback* callback) OVERRIDE;
|
||||||
|
|
||||||
// Free encoder memory.
|
// Free encoder memory.
|
||||||
//
|
//
|
||||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
// 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;
|
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;
|
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;
|
return WEBRTC_VIDEO_CODEC_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,10 +105,10 @@ class I420Decoder : public VideoDecoder {
|
|||||||
// Return value : WEBRTC_VIDEO_CODEC_OK.
|
// Return value : WEBRTC_VIDEO_CODEC_OK.
|
||||||
// <0 - Errors
|
// <0 - Errors
|
||||||
virtual int InitDecode(const VideoCodec* codecSettings,
|
virtual int InitDecode(const VideoCodec* codecSettings,
|
||||||
int /*numberOfCores*/);
|
int /*numberOfCores*/) OVERRIDE;
|
||||||
|
|
||||||
virtual int SetCodecConfigParameters(const uint8_t* /*buffer*/,
|
virtual int SetCodecConfigParameters(const uint8_t* /*buffer*/,
|
||||||
int /*size*/) {
|
int /*size*/) OVERRIDE {
|
||||||
return WEBRTC_VIDEO_CODEC_OK;
|
return WEBRTC_VIDEO_CODEC_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,7 +128,7 @@ class I420Decoder : public VideoDecoder {
|
|||||||
bool missingFrames,
|
bool missingFrames,
|
||||||
const RTPFragmentationHeader* /*fragmentation*/,
|
const RTPFragmentationHeader* /*fragmentation*/,
|
||||||
const CodecSpecificInfo* /*codecSpecificInfo*/,
|
const CodecSpecificInfo* /*codecSpecificInfo*/,
|
||||||
int64_t /*renderTimeMs*/);
|
int64_t /*renderTimeMs*/) OVERRIDE;
|
||||||
|
|
||||||
// Register a decode complete callback object.
|
// Register a decode complete callback object.
|
||||||
//
|
//
|
||||||
@ -131,22 +136,24 @@ class I420Decoder : public VideoDecoder {
|
|||||||
// - callback : Callback object which handles decoded images.
|
// - callback : Callback object which handles decoded images.
|
||||||
//
|
//
|
||||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
// Return value : WEBRTC_VIDEO_CODEC_OK if OK, < 0 otherwise.
|
||||||
virtual int RegisterDecodeCompleteCallback(DecodedImageCallback* callback);
|
virtual int RegisterDecodeCompleteCallback(
|
||||||
|
DecodedImageCallback* callback) OVERRIDE;
|
||||||
|
|
||||||
// Free decoder memory.
|
// Free decoder memory.
|
||||||
//
|
//
|
||||||
// Return value : WEBRTC_VIDEO_CODEC_OK if OK.
|
// Return value : WEBRTC_VIDEO_CODEC_OK if OK.
|
||||||
// <0 - Error
|
// <0 - Error
|
||||||
virtual int Release();
|
virtual int Release() OVERRIDE;
|
||||||
|
|
||||||
// Reset decoder state and prepare for a new call.
|
// Reset decoder state and prepare for a new call.
|
||||||
//
|
//
|
||||||
// Return value : WEBRTC_VIDEO_CODEC_OK.
|
// Return value : WEBRTC_VIDEO_CODEC_OK.
|
||||||
// <0 - Error
|
// <0 - Error
|
||||||
virtual int Reset();
|
virtual int Reset() OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const uint8_t* ExtractHeader(const uint8_t* buffer, uint16_t* width,
|
static const uint8_t* ExtractHeader(const uint8_t* buffer,
|
||||||
|
uint16_t* width,
|
||||||
uint16_t* height);
|
uint16_t* height);
|
||||||
|
|
||||||
I420VideoFrame _decodedImage;
|
I420VideoFrame _decodedImage;
|
||||||
|
@ -92,7 +92,7 @@ class PacketManipulatorImpl : public PacketManipulator {
|
|||||||
const NetworkingConfig& config,
|
const NetworkingConfig& config,
|
||||||
bool verbose);
|
bool verbose);
|
||||||
virtual ~PacketManipulatorImpl();
|
virtual ~PacketManipulatorImpl();
|
||||||
virtual int ManipulatePackets(webrtc::EncodedImage* encoded_image);
|
virtual int ManipulatePackets(webrtc::EncodedImage* encoded_image) OVERRIDE;
|
||||||
virtual void InitializeRandomSeed(unsigned int seed);
|
virtual void InitializeRandomSeed(unsigned int seed);
|
||||||
protected:
|
protected:
|
||||||
// Returns a uniformly distributed random value between 0.0 and 1.0
|
// Returns a uniformly distributed random value between 0.0 and 1.0
|
||||||
|
@ -33,7 +33,7 @@ class PredictivePacketManipulator : public PacketManipulatorImpl {
|
|||||||
void AddRandomResult(double result);
|
void AddRandomResult(double result);
|
||||||
protected:
|
protected:
|
||||||
// Returns a uniformly distributed random value between 0.0 and 1.0
|
// Returns a uniformly distributed random value between 0.0 and 1.0
|
||||||
virtual double RandomUniform();
|
virtual double RandomUniform() OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::queue<double> random_results_;
|
std::queue<double> random_results_;
|
||||||
|
@ -17,6 +17,20 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace test {
|
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() {}
|
||||||
|
|
||||||
Stats::~Stats() {}
|
Stats::~Stats() {}
|
||||||
|
@ -20,14 +20,8 @@ namespace test {
|
|||||||
|
|
||||||
// Contains statistics of a single frame that has been processed.
|
// Contains statistics of a single frame that has been processed.
|
||||||
struct FrameStatistic {
|
struct FrameStatistic {
|
||||||
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) {
|
|
||||||
};
|
|
||||||
bool encoding_successful;
|
bool encoding_successful;
|
||||||
bool decoding_successful;
|
bool decoding_successful;
|
||||||
int encode_return_code;
|
int encode_return_code;
|
||||||
@ -35,7 +29,7 @@ struct FrameStatistic {
|
|||||||
int encode_time_in_us;
|
int encode_time_in_us;
|
||||||
int decode_time_in_us;
|
int decode_time_in_us;
|
||||||
int frame_number;
|
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 packets_dropped;
|
||||||
int total_packets;
|
int total_packets;
|
||||||
|
|
||||||
|
@ -20,6 +20,23 @@
|
|||||||
namespace webrtc {
|
namespace webrtc {
|
||||||
namespace test {
|
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,
|
VideoProcessorImpl::VideoProcessorImpl(webrtc::VideoEncoder* encoder,
|
||||||
webrtc::VideoDecoder* decoder,
|
webrtc::VideoDecoder* decoder,
|
||||||
FrameReader* frame_reader,
|
FrameReader* frame_reader,
|
||||||
|
@ -40,13 +40,8 @@ const char* ExcludeFrameTypesToStr(ExcludeFrameTypes e);
|
|||||||
|
|
||||||
// Test configuration for a test run
|
// Test configuration for a test run
|
||||||
struct TestConfig {
|
struct TestConfig {
|
||||||
TestConfig()
|
TestConfig();
|
||||||
: name(""), description(""), test_number(0),
|
~TestConfig();
|
||||||
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) {
|
|
||||||
};
|
|
||||||
|
|
||||||
// Name of the test. This is purely metadata and does not affect
|
// Name of the test. This is purely metadata and does not affect
|
||||||
// the test in any way.
|
// the test in any way.
|
||||||
@ -168,8 +163,8 @@ class VideoProcessorImpl : public VideoProcessor {
|
|||||||
const TestConfig& config,
|
const TestConfig& config,
|
||||||
Stats* stats);
|
Stats* stats);
|
||||||
virtual ~VideoProcessorImpl();
|
virtual ~VideoProcessorImpl();
|
||||||
virtual bool Init();
|
virtual bool Init() OVERRIDE;
|
||||||
virtual bool ProcessFrame(int frame_number);
|
virtual bool ProcessFrame(int frame_number) OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Invoked by the callback when a frame has completed encoding.
|
// Invoked by the callback when a frame has completed encoding.
|
||||||
@ -181,13 +176,13 @@ class VideoProcessorImpl : public VideoProcessor {
|
|||||||
int GetElapsedTimeMicroseconds(const webrtc::TickTime& start,
|
int GetElapsedTimeMicroseconds(const webrtc::TickTime& start,
|
||||||
const webrtc::TickTime& stop);
|
const webrtc::TickTime& stop);
|
||||||
// Updates the encoder with the target bit rate and the frame rate.
|
// 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.
|
// Return the size of the encoded frame in bytes.
|
||||||
int EncodedFrameSize();
|
virtual int EncodedFrameSize() OVERRIDE;
|
||||||
// Return the number of dropped frames.
|
// Return the number of dropped frames.
|
||||||
int NumberDroppedFrames();
|
virtual int NumberDroppedFrames() OVERRIDE;
|
||||||
// Return the number of spatial resizes.
|
// Return the number of spatial resizes.
|
||||||
int NumberSpatialResizes();
|
virtual int NumberSpatialResizes() OVERRIDE;
|
||||||
|
|
||||||
webrtc::VideoEncoder* encoder_;
|
webrtc::VideoEncoder* encoder_;
|
||||||
webrtc::VideoDecoder* decoder_;
|
webrtc::VideoDecoder* decoder_;
|
||||||
@ -229,11 +224,11 @@ class VideoProcessorImpl : public VideoProcessor {
|
|||||||
: public webrtc::EncodedImageCallback {
|
: public webrtc::EncodedImageCallback {
|
||||||
public:
|
public:
|
||||||
explicit VideoProcessorEncodeCompleteCallback(VideoProcessorImpl* vp)
|
explicit VideoProcessorEncodeCompleteCallback(VideoProcessorImpl* vp)
|
||||||
: video_processor_(vp) {
|
: video_processor_(vp) {}
|
||||||
}
|
virtual int32_t Encoded(
|
||||||
int32_t Encoded(webrtc::EncodedImage& encoded_image,
|
webrtc::EncodedImage& encoded_image,
|
||||||
const webrtc::CodecSpecificInfo* codec_specific_info = NULL,
|
const webrtc::CodecSpecificInfo* codec_specific_info = NULL,
|
||||||
const webrtc::RTPFragmentationHeader* fragmentation = NULL);
|
const webrtc::RTPFragmentationHeader* fragmentation = NULL) OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
VideoProcessorImpl* video_processor_;
|
VideoProcessorImpl* video_processor_;
|
||||||
@ -246,7 +241,7 @@ class VideoProcessorImpl : public VideoProcessor {
|
|||||||
explicit VideoProcessorDecodeCompleteCallback(VideoProcessorImpl* vp)
|
explicit VideoProcessorDecodeCompleteCallback(VideoProcessorImpl* vp)
|
||||||
: video_processor_(vp) {
|
: video_processor_(vp) {
|
||||||
}
|
}
|
||||||
int32_t Decoded(webrtc::I420VideoFrame& image);
|
virtual int32_t Decoded(webrtc::I420VideoFrame& image) OVERRIDE;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
VideoProcessorImpl* video_processor_;
|
VideoProcessorImpl* video_processor_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user