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

Side by Side Diff: content/renderer/media/webrtc/webrtc_video_capturer_adapter.cc

Issue 1025653004: Clean up - VideoRendererInterface should not have SetSize anymore. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « content/renderer/media/webrtc/media_stream_remote_video_source.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/webrtc/webrtc_video_capturer_adapter.h" 5 #include "content/renderer/media/webrtc/webrtc_video_capturer_adapter.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/aligned_memory.h" 8 #include "base/memory/aligned_memory.h"
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "media/base/video_frame.h" 10 #include "media/base/video_frame.h"
11 #include "media/base/video_frame_pool.h" 11 #include "media/base/video_frame_pool.h"
12 #include "third_party/libjingle/source/talk/media/base/videoframefactory.h" 12 #include "third_party/libjingle/source/talk/media/base/videoframefactory.h"
13 #include "third_party/libjingle/source/talk/media/webrtc/webrtcvideoframe.h" 13 #include "third_party/libjingle/source/talk/media/webrtc/webrtcvideoframe.h"
14 #include "third_party/libyuv/include/libyuv/convert_from.h" 14 #include "third_party/libyuv/include/libyuv/convert_from.h"
15 #include "third_party/libyuv/include/libyuv/scale.h" 15 #include "third_party/libyuv/include/libyuv/scale.h"
16 #include "third_party/webrtc/common_video/interface/video_frame_buffer.h" 16 #include "third_party/webrtc/common_video/interface/video_frame_buffer.h"
17 #include "third_party/webrtc/common_video/rotation.h"
17 18
18 namespace content { 19 namespace content {
19 namespace { 20 namespace {
20 21
21 // Empty method used for keeping a reference to the original media::VideoFrame. 22 // Empty method used for keeping a reference to the original media::VideoFrame.
22 // The reference to |frame| is kept in the closure that calls this method. 23 // The reference to |frame| is kept in the closure that calls this method.
23 void ReleaseOriginalFrame(const scoped_refptr<media::VideoFrame>& frame) { 24 void ReleaseOriginalFrame(const scoped_refptr<media::VideoFrame>& frame) {
24 } 25 }
25 26
26 int WebRtcToMediaPlaneType(webrtc::PlaneType type) { 27 int WebRtcToMediaPlaneType(webrtc::PlaneType type) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 DCHECK(frame.get()); 90 DCHECK(frame.get());
90 // Create a CapturedFrame that only contains header information, not the 91 // Create a CapturedFrame that only contains header information, not the
91 // actual pixel data. 92 // actual pixel data.
92 captured_frame_.width = frame->natural_size().width(); 93 captured_frame_.width = frame->natural_size().width();
93 captured_frame_.height = frame->natural_size().height(); 94 captured_frame_.height = frame->natural_size().height();
94 captured_frame_.elapsed_time = elapsed_time; 95 captured_frame_.elapsed_time = elapsed_time;
95 captured_frame_.time_stamp = frame->timestamp().InMicroseconds() * 96 captured_frame_.time_stamp = frame->timestamp().InMicroseconds() *
96 base::Time::kNanosecondsPerMicrosecond; 97 base::Time::kNanosecondsPerMicrosecond;
97 captured_frame_.pixel_height = 1; 98 captured_frame_.pixel_height = 1;
98 captured_frame_.pixel_width = 1; 99 captured_frame_.pixel_width = 1;
99 captured_frame_.rotation = 0; 100 captured_frame_.rotation = webrtc::kVideoRotation_0;
100 captured_frame_.data = NULL; 101 captured_frame_.data = NULL;
101 captured_frame_.data_size = cricket::CapturedFrame::kUnknownDataSize; 102 captured_frame_.data_size = cricket::CapturedFrame::kUnknownDataSize;
102 captured_frame_.fourcc = static_cast<uint32>(cricket::FOURCC_ANY); 103 captured_frame_.fourcc = static_cast<uint32>(cricket::FOURCC_ANY);
103 104
104 frame_ = frame; 105 frame_ = frame;
105 } 106 }
106 107
107 void ReleaseFrame() { frame_ = NULL; } 108 void ReleaseFrame() { frame_ = NULL; }
108 109
109 const cricket::CapturedFrame* GetCapturedFrame() const { 110 const cricket::CapturedFrame* GetCapturedFrame() const {
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 DCHECK(frame_factory_ == frame_factory()); 278 DCHECK(frame_factory_ == frame_factory());
278 frame_factory_->SetFrame(frame, elapsed_time); 279 frame_factory_->SetFrame(frame, elapsed_time);
279 280
280 // This signals to libJingle that a new VideoFrame is available. 281 // This signals to libJingle that a new VideoFrame is available.
281 SignalFrameCaptured(this, frame_factory_->GetCapturedFrame()); 282 SignalFrameCaptured(this, frame_factory_->GetCapturedFrame());
282 283
283 frame_factory_->ReleaseFrame(); // Release the frame ASAP. 284 frame_factory_->ReleaseFrame(); // Release the frame ASAP.
284 } 285 }
285 286
286 } // namespace content 287 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc/media_stream_remote_video_source.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698