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

Side by Side Diff: media/capture/video/win/video_capture_device_mf_win.cc

Issue 2673373003: getUserMeida: report device starting states (Closed)
Patch Set: address comments on PS#3 Created 3 years, 10 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
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 "media/capture/video/win/video_capture_device_mf_win.h" 5 #include "media/capture/video/win/video_capture_device_mf_win.h"
6 6
7 #include <mfapi.h> 7 #include <mfapi.h>
8 #include <mferror.h> 8 #include <mferror.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 10
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 ScopedComPtr<IMFMediaType> type; 232 ScopedComPtr<IMFMediaType> type;
233 hr = reader_->GetNativeMediaType( 233 hr = reader_->GetNativeMediaType(
234 kFirstVideoStream, found_capability.stream_index, type.Receive()); 234 kFirstVideoStream, found_capability.stream_index, type.Receive());
235 if (SUCCEEDED(hr)) { 235 if (SUCCEEDED(hr)) {
236 hr = reader_->SetCurrentMediaType(kFirstVideoStream, NULL, type.get()); 236 hr = reader_->SetCurrentMediaType(kFirstVideoStream, NULL, type.get());
237 if (SUCCEEDED(hr)) { 237 if (SUCCEEDED(hr)) {
238 hr = 238 hr =
239 reader_->ReadSample(kFirstVideoStream, 0, NULL, NULL, NULL, NULL); 239 reader_->ReadSample(kFirstVideoStream, 0, NULL, NULL, NULL, NULL);
240 if (SUCCEEDED(hr)) { 240 if (SUCCEEDED(hr)) {
241 capture_format_ = found_capability.supported_format; 241 capture_format_ = found_capability.supported_format;
242 client_->OnStarted();
242 capture_ = true; 243 capture_ = true;
243 return; 244 return;
244 } 245 }
245 } 246 }
246 } 247 }
247 } 248 }
248 } 249 }
249 250
250 OnError(FROM_HERE, hr); 251 OnError(FROM_HERE, hr);
251 } 252 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 HRESULT hr) { 311 HRESULT hr) {
311 if (client_.get()) { 312 if (client_.get()) {
312 client_->OnError( 313 client_->OnError(
313 from_here, 314 from_here,
314 base::StringPrintf("VideoCaptureDeviceMFWin: %s", 315 base::StringPrintf("VideoCaptureDeviceMFWin: %s",
315 logging::SystemErrorCodeToString(hr).c_str())); 316 logging::SystemErrorCodeToString(hr).c_str()));
316 } 317 }
317 } 318 }
318 319
319 } // namespace media 320 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698