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

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

Issue 22876027: Consolidate duplicated frame / capability structures in video_capture_types.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased: changed media::VideoCaptureCapability::kI420 -> media::PIXEL_FORMAT_I420 etc. Created 7 years, 3 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/common/media/media_param_traits.cc ('k') | content/renderer/media/video_capture_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 9
10 namespace content { 10 namespace content {
(...skipping 17 matching lines...) Expand all
28 DVLOG(3) << " RtcVideoCapturer::Start "; 28 DVLOG(3) << " RtcVideoCapturer::Start ";
29 if (state_ == VIDEO_CAPTURE_STATE_STARTED) { 29 if (state_ == VIDEO_CAPTURE_STATE_STARTED) {
30 DVLOG(1) << "Got a StartCapture when already started!!! "; 30 DVLOG(1) << "Got a StartCapture when already started!!! ";
31 return cricket::CS_FAILED; 31 return cricket::CS_FAILED;
32 } 32 }
33 33
34 media::VideoCaptureCapability cap; 34 media::VideoCaptureCapability cap;
35 cap.width = capture_format.width; 35 cap.width = capture_format.width;
36 cap.height = capture_format.height; 36 cap.height = capture_format.height;
37 cap.frame_rate = capture_format.framerate(); 37 cap.frame_rate = capture_format.framerate();
38 cap.color = media::VideoCaptureCapability::kI420; 38 cap.color = media::PIXEL_FORMAT_I420;
39 39
40 SetCaptureFormat(&capture_format); 40 SetCaptureFormat(&capture_format);
41 41
42 state_ = VIDEO_CAPTURE_STATE_STARTED; 42 state_ = VIDEO_CAPTURE_STATE_STARTED;
43 start_time_ = base::Time::Now(); 43 start_time_ = base::Time::Now();
44 delegate_->StartCapture(cap, 44 delegate_->StartCapture(cap,
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
48 // cropped to meet the requirement if the camera returns a different 48 // cropped to meet the requirement if the camera returns a different
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 converted_state = cricket::CS_FAILED; 144 converted_state = cricket::CS_FAILED;
145 break; 145 break;
146 default: 146 default:
147 NOTREACHED(); 147 NOTREACHED();
148 break; 148 break;
149 } 149 }
150 SignalStateChange(this, converted_state); 150 SignalStateChange(this, converted_state);
151 } 151 }
152 152
153 } // namespace content 153 } // namespace content
OLDNEW
« no previous file with comments | « content/common/media/media_param_traits.cc ('k') | content/renderer/media/video_capture_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698