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
This commit is contained in:
parent
12984f0d02
commit
69f8be3875
@ -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() {}
|
||||
|
@ -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),
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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(
|
||||
|
@ -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_;
|
||||
};
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user