Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: content/renderer/media/rtc_video_renderer.cc

Issue 287313002: Pass a TimeTicks along video capture pipeline to represent capture time (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merged and land Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/media/rtc_video_renderer.h" 5 #include "content/renderer/media/rtc_video_renderer.h"
6 6
7 #include "base/debug/trace_event.h" 7 #include "base/debug/trace_event.h"
8 #include "base/message_loop/message_loop_proxy.h" 8 #include "base/message_loop/message_loop_proxy.h"
9 #include "media/base/bind_to_current_loop.h" 9 #include "media/base/bind_to_current_loop.h"
10 #include "media/base/video_frame.h" 10 #include "media/base/video_frame.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 } 82 }
83 83
84 void RTCVideoRenderer::OnEnabledChanged(bool enabled) { 84 void RTCVideoRenderer::OnEnabledChanged(bool enabled) {
85 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); 85 DCHECK(message_loop_proxy_->BelongsToCurrentThread());
86 if (!enabled) 86 if (!enabled)
87 RenderSignalingFrame(); 87 RenderSignalingFrame();
88 } 88 }
89 89
90 void RTCVideoRenderer::OnVideoFrame( 90 void RTCVideoRenderer::OnVideoFrame(
91 const scoped_refptr<media::VideoFrame>& frame, 91 const scoped_refptr<media::VideoFrame>& frame,
92 const media::VideoCaptureFormat& format) { 92 const media::VideoCaptureFormat& format,
93 const base::TimeTicks& estimated_capture_time) {
93 DCHECK(message_loop_proxy_->BelongsToCurrentThread()); 94 DCHECK(message_loop_proxy_->BelongsToCurrentThread());
94 if (state_ != STARTED) { 95 if (state_ != STARTED) {
95 return; 96 return;
96 } 97 }
97 98
98 frame_size_ = frame->natural_size(); 99 frame_size_ = frame->natural_size();
99 100
100 TRACE_EVENT_INSTANT1("rtc_video_renderer", 101 TRACE_EVENT_INSTANT1("rtc_video_renderer",
101 "OnVideoFrame", 102 "OnVideoFrame",
102 TRACE_EVENT_SCOPE_THREAD, 103 TRACE_EVENT_SCOPE_THREAD,
103 "timestamp", 104 "timestamp",
104 frame->timestamp().InMilliseconds()); 105 frame->timestamp().InMilliseconds());
105 repaint_cb_.Run(frame); 106 repaint_cb_.Run(frame);
106 } 107 }
107 108
108 void RTCVideoRenderer::RenderSignalingFrame() { 109 void RTCVideoRenderer::RenderSignalingFrame() {
109 // This is necessary to make sure audio can play if the video tag src is 110 // This is necessary to make sure audio can play if the video tag src is
110 // a MediaStream video track that has been rejected, ended or disabled. 111 // a MediaStream video track that has been rejected, ended or disabled.
111 // It also ensure that the renderer don't hold a reference to a real video 112 // It also ensure that the renderer don't hold a reference to a real video
112 // frame if no more frames are provided. This is since there might be a 113 // frame if no more frames are provided. This is since there might be a
113 // finite number of available buffers. E.g, video that 114 // finite number of available buffers. E.g, video that
114 // originates from a video camera. 115 // originates from a video camera.
115 scoped_refptr<media::VideoFrame> video_frame = 116 scoped_refptr<media::VideoFrame> video_frame =
116 media::VideoFrame::CreateBlackFrame(frame_size_); 117 media::VideoFrame::CreateBlackFrame(frame_size_);
117 OnVideoFrame(video_frame, media::VideoCaptureFormat()); 118 OnVideoFrame(video_frame, media::VideoCaptureFormat(), base::TimeTicks());
118 } 119 }
119 120
120 } // namespace content 121 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/rtc_video_renderer.h ('k') | content/renderer/media/video_capture_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698