Revert "Changed argument occurences of const I420VideoFrame* to const I420VideoFrame& and non-const I420VideoFrame& to I420VideoFrame*."
This reverts commit r8731. Reason for revert: Breakes Chromium FYI bots. TBR=hbos, tommi Review URL: https://webrtc-codereview.appspot.com/40359004 Cr-Commit-Position: refs/heads/master@{#8733} git-svn-id: http://webrtc.googlecode.com/svn/trunk@8733 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -81,7 +81,7 @@ class VCMPacketizationCallback {
|
||||
// Callback class used for passing decoded frames which are ready to be rendered.
|
||||
class VCMReceiveCallback {
|
||||
public:
|
||||
virtual int32_t FrameToRender(I420VideoFrame* videoFrame) = 0;
|
||||
virtual int32_t FrameToRender(I420VideoFrame& videoFrame) = 0;
|
||||
virtual int32_t ReceivedDecodedReferenceFrame(
|
||||
const uint64_t pictureId) {
|
||||
return -1;
|
||||
|
||||
@ -46,7 +46,7 @@ VCMReceiveCallback* VCMDecodedFrameCallback::UserReceiveCallback()
|
||||
return _receiveCallback;
|
||||
}
|
||||
|
||||
int32_t VCMDecodedFrameCallback::Decoded(I420VideoFrame* decodedImage)
|
||||
int32_t VCMDecodedFrameCallback::Decoded(I420VideoFrame& decodedImage)
|
||||
{
|
||||
// TODO(holmer): We should improve this so that we can handle multiple
|
||||
// callbacks from one call to Decode().
|
||||
@ -55,7 +55,7 @@ int32_t VCMDecodedFrameCallback::Decoded(I420VideoFrame* decodedImage)
|
||||
{
|
||||
CriticalSectionScoped cs(_critSect);
|
||||
frameInfo = static_cast<VCMFrameInformation*>(
|
||||
_timestampMap.Pop(decodedImage->timestamp()));
|
||||
_timestampMap.Pop(decodedImage.timestamp()));
|
||||
callback = _receiveCallback;
|
||||
}
|
||||
|
||||
@ -66,14 +66,14 @@ int32_t VCMDecodedFrameCallback::Decoded(I420VideoFrame* decodedImage)
|
||||
}
|
||||
|
||||
_timing.StopDecodeTimer(
|
||||
decodedImage->timestamp(),
|
||||
decodedImage.timestamp(),
|
||||
frameInfo->decodeStartTimeMs,
|
||||
_clock->TimeInMilliseconds(),
|
||||
frameInfo->renderTimeMs);
|
||||
|
||||
if (callback != NULL)
|
||||
{
|
||||
decodedImage->set_render_time_ms(frameInfo->renderTimeMs);
|
||||
decodedImage.set_render_time_ms(frameInfo->renderTimeMs);
|
||||
callback->FrameToRender(decodedImage);
|
||||
}
|
||||
return WEBRTC_VIDEO_CODEC_OK;
|
||||
|
||||
@ -39,7 +39,7 @@ public:
|
||||
void SetUserReceiveCallback(VCMReceiveCallback* receiveCallback);
|
||||
VCMReceiveCallback* UserReceiveCallback();
|
||||
|
||||
virtual int32_t Decoded(I420VideoFrame* decodedImage);
|
||||
virtual int32_t Decoded(I420VideoFrame& decodedImage);
|
||||
virtual int32_t ReceivedDecodedReferenceFrame(const uint64_t pictureId);
|
||||
virtual int32_t ReceivedDecodedFrame(const uint64_t pictureId);
|
||||
|
||||
|
||||
@ -147,13 +147,13 @@ VCMNTDecodeCompleteCallback::~VCMNTDecodeCompleteCallback()
|
||||
fclose(_decodedFile);
|
||||
}
|
||||
int32_t
|
||||
VCMNTDecodeCompleteCallback::FrameToRender(webrtc::I420VideoFrame* videoFrame)
|
||||
VCMNTDecodeCompleteCallback::FrameToRender(webrtc::I420VideoFrame& videoFrame)
|
||||
{
|
||||
if (videoFrame->width() != _currentWidth ||
|
||||
videoFrame->height() != _currentHeight)
|
||||
if (videoFrame.width() != _currentWidth ||
|
||||
videoFrame.height() != _currentHeight)
|
||||
{
|
||||
_currentWidth = videoFrame->width();
|
||||
_currentHeight = videoFrame->height();
|
||||
_currentWidth = videoFrame.width();
|
||||
_currentHeight = videoFrame.height();
|
||||
if (_decodedFile != NULL)
|
||||
{
|
||||
fclose(_decodedFile);
|
||||
@ -161,11 +161,11 @@ VCMNTDecodeCompleteCallback::FrameToRender(webrtc::I420VideoFrame* videoFrame)
|
||||
}
|
||||
_decodedFile = fopen(_outname.c_str(), "wb");
|
||||
}
|
||||
if (PrintI420VideoFrame(*videoFrame, _decodedFile) < 0) {
|
||||
if (PrintI420VideoFrame(videoFrame, _decodedFile) < 0) {
|
||||
return -1;
|
||||
}
|
||||
_decodedBytes += webrtc::CalcBufferSize(webrtc::kI420, videoFrame->width(),
|
||||
videoFrame->height());
|
||||
_decodedBytes += webrtc::CalcBufferSize(webrtc::kI420, videoFrame.width(),
|
||||
videoFrame.height());
|
||||
return VCM_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@ public:
|
||||
void SetUserReceiveCallback(webrtc::VCMReceiveCallback* receiveCallback);
|
||||
|
||||
// will write decoded frame into file
|
||||
int32_t FrameToRender(webrtc::I420VideoFrame* videoFrame) override;
|
||||
int32_t FrameToRender(webrtc::I420VideoFrame& videoFrame) override;
|
||||
|
||||
size_t DecodedBytes();
|
||||
private:
|
||||
|
||||
@ -237,7 +237,7 @@ QualityModesTest::Perform(const CmdArgs& args)
|
||||
_vcm->EnableFrameDropper(false);
|
||||
|
||||
I420VideoFrame sourceFrame;
|
||||
I420VideoFrame* decimatedFrame = NULL;
|
||||
I420VideoFrame *decimatedFrame = NULL;
|
||||
uint8_t* tmpBuffer = new uint8_t[_lengthSourceFrame];
|
||||
double startTime = clock()/(double)CLOCKS_PER_SEC;
|
||||
_vcm->SetChannelParameters(static_cast<uint32_t>(1000 * _bitRate), 0, 0);
|
||||
@ -483,18 +483,18 @@ VCMQMDecodeCompleteCallback::~VCMQMDecodeCompleteCallback()
|
||||
}
|
||||
|
||||
int32_t
|
||||
VCMQMDecodeCompleteCallback::FrameToRender(I420VideoFrame* videoFrame)
|
||||
VCMQMDecodeCompleteCallback::FrameToRender(I420VideoFrame& videoFrame)
|
||||
{
|
||||
++frames_cnt_since_drop_;
|
||||
|
||||
// When receiving the first coded frame the last_frame variable is not set
|
||||
if (last_frame_.IsZeroSize()) {
|
||||
last_frame_.CopyFrame(*videoFrame);
|
||||
last_frame_.CopyFrame(videoFrame);
|
||||
}
|
||||
|
||||
// Check if there were frames skipped.
|
||||
int num_frames_skipped = static_cast<int>( 0.5f +
|
||||
(videoFrame->timestamp() - (last_frame_.timestamp() + (9e4 / frame_rate_))) /
|
||||
(videoFrame.timestamp() - (last_frame_.timestamp() + (9e4 / frame_rate_))) /
|
||||
(9e4 / frame_rate_));
|
||||
|
||||
// If so...put the last frames into the encoded stream to make up for the
|
||||
@ -510,9 +510,9 @@ VCMQMDecodeCompleteCallback::FrameToRender(I420VideoFrame* videoFrame)
|
||||
DataLog::InsertCell(
|
||||
feature_table_name_,"num frames since drop",frames_cnt_since_drop_);
|
||||
|
||||
if (_origWidth == videoFrame->width() && _origHeight == videoFrame->height())
|
||||
if (_origWidth == videoFrame.width() && _origHeight == videoFrame.height())
|
||||
{
|
||||
if (PrintI420VideoFrame(*videoFrame, _decodedFile) < 0) {
|
||||
if (PrintI420VideoFrame(videoFrame, _decodedFile) < 0) {
|
||||
return -1;
|
||||
}
|
||||
_frameCnt++;
|
||||
@ -531,9 +531,9 @@ VCMQMDecodeCompleteCallback::FrameToRender(I420VideoFrame* videoFrame)
|
||||
return -1;
|
||||
}
|
||||
|
||||
_decodedBytes += CalcBufferSize(kI420, videoFrame->width(),
|
||||
videoFrame->height());
|
||||
videoFrame->SwapFrame(&last_frame_);
|
||||
_decodedBytes += CalcBufferSize(kI420, videoFrame.width(),
|
||||
videoFrame.height());
|
||||
videoFrame.SwapFrame(&last_frame_);
|
||||
return VCM_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@ public:
|
||||
virtual ~VCMQMDecodeCompleteCallback();
|
||||
void SetUserReceiveCallback(webrtc::VCMReceiveCallback* receiveCallback);
|
||||
// will write decoded frame into file
|
||||
int32_t FrameToRender(webrtc::I420VideoFrame* videoFrame);
|
||||
int32_t FrameToRender(webrtc::I420VideoFrame& videoFrame);
|
||||
size_t DecodedBytes();
|
||||
void SetOriginalFrameDimensions(int32_t width, int32_t height);
|
||||
int32_t buildInterpolator();
|
||||
|
||||
@ -185,13 +185,13 @@ VCMRTPEncodeCompleteCallback::EncodeComplete()
|
||||
// Decoded Frame Callback Implementation
|
||||
|
||||
int32_t
|
||||
VCMDecodeCompleteCallback::FrameToRender(I420VideoFrame* videoFrame)
|
||||
VCMDecodeCompleteCallback::FrameToRender(I420VideoFrame& videoFrame)
|
||||
{
|
||||
if (PrintI420VideoFrame(*videoFrame, _decodedFile) < 0) {
|
||||
if (PrintI420VideoFrame(videoFrame, _decodedFile) < 0) {
|
||||
return -1;
|
||||
}
|
||||
_decodedBytes += CalcBufferSize(kI420, videoFrame->width(),
|
||||
videoFrame->height());
|
||||
_decodedBytes += CalcBufferSize(kI420, videoFrame.width(),
|
||||
videoFrame.height());
|
||||
return VCM_OK;
|
||||
}
|
||||
|
||||
|
||||
@ -136,7 +136,7 @@ public:
|
||||
_decodedFile(decodedFile), _decodedBytes(0) {}
|
||||
virtual ~VCMDecodeCompleteCallback() {}
|
||||
// Write decoded frame into file
|
||||
int32_t FrameToRender(webrtc::I420VideoFrame* videoFrame) override;
|
||||
int32_t FrameToRender(webrtc::I420VideoFrame& videoFrame) override;
|
||||
size_t DecodedBytes();
|
||||
private:
|
||||
FILE* _decodedFile;
|
||||
|
||||
@ -113,7 +113,7 @@ FileOutputFrameReceiver::~FileOutputFrameReceiver() {
|
||||
}
|
||||
|
||||
int32_t FileOutputFrameReceiver::FrameToRender(
|
||||
webrtc::I420VideoFrame* video_frame) {
|
||||
webrtc::I420VideoFrame& video_frame) {
|
||||
if (timing_file_ == NULL) {
|
||||
std::string basename;
|
||||
std::string extension;
|
||||
@ -123,14 +123,14 @@ int32_t FileOutputFrameReceiver::FrameToRender(
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (out_file_ == NULL || video_frame->width() != width_ ||
|
||||
video_frame->height() != height_) {
|
||||
if (out_file_ == NULL || video_frame.width() != width_ ||
|
||||
video_frame.height() != height_) {
|
||||
if (out_file_) {
|
||||
fclose(out_file_);
|
||||
}
|
||||
printf("New size: %dx%d\n", video_frame->width(), video_frame->height());
|
||||
width_ = video_frame->width();
|
||||
height_ = video_frame->height();
|
||||
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_);
|
||||
++count_;
|
||||
@ -139,9 +139,9 @@ int32_t FileOutputFrameReceiver::FrameToRender(
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
fprintf(timing_file_, "%u, %u\n", video_frame->timestamp(),
|
||||
webrtc::MaskWord64ToUWord32(video_frame->render_time_ms()));
|
||||
if (PrintI420VideoFrame(*video_frame, out_file_) < 0) {
|
||||
fprintf(timing_file_, "%u, %u\n", video_frame.timestamp(),
|
||||
webrtc::MaskWord64ToUWord32(video_frame.render_time_ms()));
|
||||
if (PrintI420VideoFrame(video_frame, out_file_) < 0) {
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
|
||||
@ -87,7 +87,7 @@ class FileOutputFrameReceiver : public webrtc::VCMReceiveCallback {
|
||||
virtual ~FileOutputFrameReceiver();
|
||||
|
||||
// VCMReceiveCallback
|
||||
virtual int32_t FrameToRender(webrtc::I420VideoFrame* video_frame);
|
||||
virtual int32_t FrameToRender(webrtc::I420VideoFrame& video_frame);
|
||||
|
||||
private:
|
||||
std::string out_filename_;
|
||||
|
||||
Reference in New Issue
Block a user