From 69f8be3875190c92d4172b2fe08a5170474e707b Mon Sep 17 00:00:00 2001 From: "wu@webrtc.org" Date: Thu, 16 Feb 2012 18:32:02 +0000 Subject: [PATCH] Change the ExternalRenderer to provide both rtp timestamp and the render time. Review URL: https://webrtc-codereview.appspot.com/394006 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1708 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/video_engine/include/vie_render.h | 7 +++++-- .../test/auto_test/helpers/vie_to_file_renderer.cc | 5 +++-- .../test/auto_test/helpers/vie_to_file_renderer.h | 5 +++-- .../test/auto_test/primitives/framedrop_primitives.cc | 6 ++++-- .../test/auto_test/primitives/framedrop_primitives.h | 3 ++- .../test/auto_test/source/vie_autotest_render.cc | 5 +++-- src/video_engine/vie_renderer.cc | 5 +++-- 7 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/video_engine/include/vie_render.h b/src/video_engine/include/vie_render.h index 872ce23bd6..0b8328e254 100644 --- a/src/video_engine/include/vie_render.h +++ b/src/video_engine/include/vie_render.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -36,7 +36,10 @@ class WEBRTC_DLLEXPORT ExternalRenderer { // This method is called when a new frame should be rendered. virtual int DeliverFrame(unsigned char* buffer, int buffer_size, - unsigned int time_stamp) = 0; + // RTP timestamp in 90kHz. + uint32_t time_stamp, + // Wallclock render time in miliseconds + int64_t render_time) = 0; protected: virtual ~ExternalRenderer() {} diff --git a/src/video_engine/test/auto_test/helpers/vie_to_file_renderer.cc b/src/video_engine/test/auto_test/helpers/vie_to_file_renderer.cc index 726da075fc..d9c8da31ba 100644 --- a/src/video_engine/test/auto_test/helpers/vie_to_file_renderer.cc +++ b/src/video_engine/test/auto_test/helpers/vie_to_file_renderer.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -73,7 +73,8 @@ void ViEToFileRenderer::ForgetOutputFile() { int ViEToFileRenderer::DeliverFrame(unsigned char *buffer, int buffer_size, - unsigned int time_stamp) { + uint32_t time_stamp, + int64_t render_time) { assert(output_file_ != NULL); int written = std::fwrite(buffer, sizeof(unsigned char), diff --git a/src/video_engine/test/auto_test/helpers/vie_to_file_renderer.h b/src/video_engine/test/auto_test/helpers/vie_to_file_renderer.h index 36dae550dc..08559af7f2 100644 --- a/src/video_engine/test/auto_test/helpers/vie_to_file_renderer.h +++ b/src/video_engine/test/auto_test/helpers/vie_to_file_renderer.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -43,7 +43,8 @@ class ViEToFileRenderer: public webrtc::ExternalRenderer { unsigned int number_of_streams); int DeliverFrame(unsigned char* buffer, int buffer_size, - unsigned int time_stamp); + uint32_t time_stamp, + int64_t render_time); const std::string GetFullOutputPath() const; diff --git a/src/video_engine/test/auto_test/primitives/framedrop_primitives.cc b/src/video_engine/test/auto_test/primitives/framedrop_primitives.cc index 3e43197245..6767cc6d22 100644 --- a/src/video_engine/test/auto_test/primitives/framedrop_primitives.cc +++ b/src/video_engine/test/auto_test/primitives/framedrop_primitives.cc @@ -498,11 +498,13 @@ int FrameDropDetector::GetNumberOfFramesDroppedAt(State state) { } int FrameDropMonitoringRemoteFileRenderer::DeliverFrame( - unsigned char *buffer, int buffer_size, unsigned int time_stamp) { + unsigned char *buffer, int buffer_size, uint32_t time_stamp, + int64_t render_time) { // Register that this frame has been rendered: frame_drop_detector_->ReportFrameState(FrameDropDetector::kRendered, time_stamp); - return ViEToFileRenderer::DeliverFrame(buffer, buffer_size, time_stamp); + return ViEToFileRenderer::DeliverFrame(buffer, buffer_size, + time_stamp, render_time); } int FrameDropMonitoringRemoteFileRenderer::FrameSizeChange( diff --git a/src/video_engine/test/auto_test/primitives/framedrop_primitives.h b/src/video_engine/test/auto_test/primitives/framedrop_primitives.h index e5091f14f9..80575c3aa0 100644 --- a/src/video_engine/test/auto_test/primitives/framedrop_primitives.h +++ b/src/video_engine/test/auto_test/primitives/framedrop_primitives.h @@ -220,7 +220,8 @@ class FrameDropMonitoringRemoteFileRenderer : public ViEToFileRenderer { int FrameSizeChange(unsigned int width, unsigned int height, unsigned int number_of_streams); int DeliverFrame(unsigned char* buffer, int buffer_size, - unsigned int time_stamp); + uint32_t time_stamp, + int64_t render_time); private: FrameDropDetector* frame_drop_detector_; }; diff --git a/src/video_engine/test/auto_test/source/vie_autotest_render.cc b/src/video_engine/test/auto_test/source/vie_autotest_render.cc index 27fc156920..2a73a6c2ce 100644 --- a/src/video_engine/test/auto_test/source/vie_autotest_render.cc +++ b/src/video_engine/test/auto_test/source/vie_autotest_render.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -56,7 +56,8 @@ public: } virtual int DeliverFrame(unsigned char* buffer, int bufferSize, - unsigned int time_stamp) + uint32_t time_stamp, + int64_t render_time) { if (bufferSize != _width * _height * 3 / 2) { diff --git a/src/video_engine/vie_renderer.cc b/src/video_engine/vie_renderer.cc index 530ae55692..7e56b7a7c4 100644 --- a/src/video_engine/vie_renderer.cc +++ b/src/video_engine/vie_renderer.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. + * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source @@ -226,7 +226,8 @@ WebRtc_Word32 ViEExternalRendererImpl::RenderFrame( if (out_frame) { external_renderer_->DeliverFrame(out_frame->Buffer(), out_frame->Length(), - video_frame.TimeStamp()); + video_frame.TimeStamp(), + video_frame.RenderTimeMs()); } return 0; }