Remove default arguments in EncodedImageCallback.

BUG=
R=mflodman@webrtc.org, pbos@webrtc.org, stefan@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/39719004

Cr-Commit-Position: refs/heads/master@{#8289}
git-svn-id: http://webrtc.googlecode.com/svn/trunk@8289 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
changbin.shao@webrtc.org 2015-02-09 09:14:03 +00:00
parent 6c930c7183
commit f31f56d8d4
5 changed files with 33 additions and 43 deletions

View File

@ -119,7 +119,7 @@ int I420Encoder::Encode(const I420VideoFrame& inputImage,
return WEBRTC_VIDEO_CODEC_MEMORY;
_encodedImage._length = ret_length + kI420HeaderSize;
_encodedCompleteCallback->Encoded(_encodedImage);
_encodedCompleteCallback->Encoded(_encodedImage, NULL, NULL);
return WEBRTC_VIDEO_CODEC_OK;
}

View File

@ -208,47 +208,39 @@ VCMEncodedFrameCallback::SetTransportCallback(VCMPacketizationCallback* transpor
return VCM_OK;
}
int32_t
VCMEncodedFrameCallback::Encoded(
const EncodedImage &encodedImage,
int32_t VCMEncodedFrameCallback::Encoded(
const EncodedImage& encodedImage,
const CodecSpecificInfo* codecSpecificInfo,
const RTPFragmentationHeader* fragmentationHeader)
{
post_encode_callback_->Encoded(encodedImage);
const RTPFragmentationHeader* fragmentationHeader) {
post_encode_callback_->Encoded(encodedImage, NULL, NULL);
if (_sendCallback == NULL) {
return VCM_UNINITIALIZED;
}
if (_sendCallback != NULL)
{
#ifdef DEBUG_ENCODER_BIT_STREAM
if (_bitStreamAfterEncoder != NULL)
{
fwrite(encodedImage._buffer, 1, encodedImage._length, _bitStreamAfterEncoder);
}
if (_bitStreamAfterEncoder != NULL) {
fwrite(encodedImage._buffer, 1, encodedImage._length,
_bitStreamAfterEncoder);
}
#endif
RTPVideoHeader rtpVideoHeader;
RTPVideoHeader* rtpVideoHeaderPtr = &rtpVideoHeader;
CopyCodecSpecific(codecSpecificInfo, &rtpVideoHeaderPtr);
RTPVideoHeader rtpVideoHeader;
RTPVideoHeader* rtpVideoHeaderPtr = &rtpVideoHeader;
CopyCodecSpecific(codecSpecificInfo, &rtpVideoHeaderPtr);
int32_t callbackReturn = _sendCallback->SendData(
_payloadType,
encodedImage,
*fragmentationHeader,
rtpVideoHeaderPtr);
if (callbackReturn < 0)
{
return callbackReturn;
}
}
else
{
return VCM_UNINITIALIZED;
}
if (_mediaOpt != NULL) {
_mediaOpt->UpdateWithEncodedData(encodedImage);
if (_internalSource)
return _mediaOpt->DropFrame(); // Signal to encoder to drop next frame.
}
return VCM_OK;
int32_t callbackReturn = _sendCallback->SendData(
_payloadType, encodedImage, *fragmentationHeader, rtpVideoHeaderPtr);
if (callbackReturn < 0) {
return callbackReturn;
}
if (_mediaOpt != NULL) {
_mediaOpt->UpdateWithEncodedData(encodedImage);
if (_internalSource)
return _mediaOpt->DropFrame(); // Signal to encoder to drop next frame.
}
return VCM_OK;
}
void

View File

@ -365,7 +365,7 @@ int32_t VideoReceiver::Decode(uint16_t maxWaitTimeMs) {
if (pre_decode_image_callback_) {
EncodedImage encoded_image(frame->EncodedImage());
pre_decode_image_callback_->Encoded(encoded_image);
pre_decode_image_callback_->Encoded(encoded_image, NULL, NULL);
}
#ifdef DEBUG_DECODER_BIT_STREAM

View File

@ -29,11 +29,9 @@ class EncodedImageCallback {
virtual ~EncodedImageCallback() {}
// Callback function which is called when an image has been encoded.
// TODO(pbos): Remove default arguments.
virtual int32_t Encoded(
const EncodedImage& encoded_image,
const CodecSpecificInfo* codec_specific_info = NULL,
const RTPFragmentationHeader* fragmentation = NULL) = 0;
virtual int32_t Encoded(const EncodedImage& encoded_image,
const CodecSpecificInfo* codec_specific_info,
const RTPFragmentationHeader* fragmentation) = 0;
};
class VideoEncoder {

View File

@ -132,7 +132,7 @@ int32_t TbI420Encoder::Encode(
}
_encodedImage._length = reqSize;
_encodedCompleteCallback->Encoded(_encodedImage);
_encodedCompleteCallback->Encoded(_encodedImage, NULL, NULL);
return WEBRTC_VIDEO_CODEC_OK;
}