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

Side by Side Diff: trunk/src/content/renderer/media/rtc_video_capturer.cc

Issue 84393002: Revert 236927 "Reorganize media::VideoCapture* types" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 1 month 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_capturer.h" 5 #include "content/renderer/media/rtc_video_capturer.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
9 #include "media/base/video_frame.h"
10 9
11 namespace content { 10 namespace content {
12 11
13 RtcVideoCapturer::RtcVideoCapturer(const media::VideoCaptureSessionId id, 12 RtcVideoCapturer::RtcVideoCapturer(const media::VideoCaptureSessionId id,
14 VideoCaptureImplManager* vc_manager, 13 VideoCaptureImplManager* vc_manager,
15 bool is_screencast) 14 bool is_screencast)
16 : is_screencast_(is_screencast), 15 : is_screencast_(is_screencast),
17 delegate_(new RtcVideoCaptureDelegate(id, vc_manager)), 16 delegate_(new RtcVideoCaptureDelegate(id, vc_manager)),
18 state_(VIDEO_CAPTURE_STATE_STOPPED) {} 17 state_(VIDEO_CAPTURE_STATE_STOPPED) {}
19 18
20 RtcVideoCapturer::~RtcVideoCapturer() { 19 RtcVideoCapturer::~RtcVideoCapturer() {
21 DCHECK(VIDEO_CAPTURE_STATE_STOPPED); 20 DCHECK(VIDEO_CAPTURE_STATE_STOPPED);
22 DVLOG(3) << " RtcVideoCapturer::dtor"; 21 DVLOG(3) << " RtcVideoCapturer::dtor";
23 } 22 }
24 23
25 cricket::CaptureState RtcVideoCapturer::Start( 24 cricket::CaptureState RtcVideoCapturer::Start(
26 const cricket::VideoFormat& capture_format) { 25 const cricket::VideoFormat& capture_format) {
27 DVLOG(3) << " RtcVideoCapturer::Start "; 26 DVLOG(3) << " RtcVideoCapturer::Start ";
28 if (state_ == VIDEO_CAPTURE_STATE_STARTED) { 27 if (state_ == VIDEO_CAPTURE_STATE_STARTED) {
29 DVLOG(1) << "Got a StartCapture when already started!!! "; 28 DVLOG(1) << "Got a StartCapture when already started!!! ";
30 return cricket::CS_FAILED; 29 return cricket::CS_FAILED;
31 } 30 }
32 31
33 media::VideoCaptureParams request; 32 media::VideoCaptureParams request;
34 request.requested_format = media::VideoCaptureFormat( 33 request.requested_format =
35 gfx::Size(capture_format.width, capture_format.height), 34 media::VideoCaptureFormat(capture_format.width,
36 capture_format.framerate(), 35 capture_format.height,
37 media::PIXEL_FORMAT_I420); 36 capture_format.framerate(),
37 media::ConstantResolutionVideoCaptureDevice);
38 38
39 SetCaptureFormat(&capture_format); 39 SetCaptureFormat(&capture_format);
40 40
41 state_ = VIDEO_CAPTURE_STATE_STARTED; 41 state_ = VIDEO_CAPTURE_STATE_STARTED;
42 first_frame_timestamp_ = media::kNoTimestamp(); 42 first_frame_timestamp_ = media::kNoTimestamp();
43 delegate_->StartCapture( 43 delegate_->StartCapture(
44 request, 44 request,
45 base::Bind(&RtcVideoCapturer::OnFrameCaptured, base::Unretained(this)), 45 base::Bind(&RtcVideoCapturer::OnFrameCaptured, base::Unretained(this)),
46 base::Bind(&RtcVideoCapturer::OnStateChange, base::Unretained(this))); 46 base::Bind(&RtcVideoCapturer::OnStateChange, base::Unretained(this)));
47 // Update the desired aspect ratio so that later the video frame can be 47 // Update the desired aspect ratio so that later the video frame can be
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 converted_state = cricket::CS_FAILED; 150 converted_state = cricket::CS_FAILED;
151 break; 151 break;
152 default: 152 default:
153 NOTREACHED(); 153 NOTREACHED();
154 break; 154 break;
155 } 155 }
156 SignalStateChange(this, converted_state); 156 SignalStateChange(this, converted_state);
157 } 157 }
158 158
159 } // namespace content 159 } // namespace content
OLDNEW
« no previous file with comments | « trunk/src/content/renderer/media/rtc_video_capture_delegate.cc ('k') | trunk/src/content/renderer/media/video_capture_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698