| OLD | NEW |
| 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/video_frame.h" | 9 #include "media/base/video_frame.h" |
| 10 #include "media/base/video_util.h" | 10 #include "media/base/video_util.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 if (state_ != STARTED) { | 84 if (state_ != STARTED) { |
| 85 return; | 85 return; |
| 86 } | 86 } |
| 87 | 87 |
| 88 frame_size_ = frame->natural_size(); | 88 frame_size_ = frame->natural_size(); |
| 89 | 89 |
| 90 TRACE_EVENT_INSTANT1("rtc_video_renderer", | 90 TRACE_EVENT_INSTANT1("rtc_video_renderer", |
| 91 "OnVideoFrame", | 91 "OnVideoFrame", |
| 92 TRACE_EVENT_SCOPE_THREAD, | 92 TRACE_EVENT_SCOPE_THREAD, |
| 93 "timestamp", | 93 "timestamp", |
| 94 frame->GetTimestamp().InMilliseconds()); | 94 frame->timestamp().InMilliseconds()); |
| 95 repaint_cb_.Run(frame); | 95 repaint_cb_.Run(frame); |
| 96 } | 96 } |
| 97 | 97 |
| 98 void RTCVideoRenderer::RenderSignalingFrame() { | 98 void RTCVideoRenderer::RenderSignalingFrame() { |
| 99 // This is necessary to make sure audio can play if the video tag src is | 99 // This is necessary to make sure audio can play if the video tag src is |
| 100 // a MediaStream video track that has been rejected, ended or disabled. | 100 // a MediaStream video track that has been rejected, ended or disabled. |
| 101 // It also ensure that the renderer don't hold a reference to a real video | 101 // It also ensure that the renderer don't hold a reference to a real video |
| 102 // frame if no more frames are provided. This is since there might be a | 102 // frame if no more frames are provided. This is since there might be a |
| 103 // finite number of available buffers. E.g, video that | 103 // finite number of available buffers. E.g, video that |
| 104 // originates from a video camera. | 104 // originates from a video camera. |
| 105 scoped_refptr<media::VideoFrame> video_frame = | 105 scoped_refptr<media::VideoFrame> video_frame = |
| 106 media::VideoFrame::CreateBlackFrame(frame_size_); | 106 media::VideoFrame::CreateBlackFrame(frame_size_); |
| 107 OnVideoFrame(video_frame); | 107 OnVideoFrame(video_frame); |
| 108 } | 108 } |
| 109 | 109 |
| 110 } // namespace content | 110 } // namespace content |
| OLD | NEW |