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

Side by Side Diff: media/capture/video/file_video_capture_device.cc

Issue 1418263006: Extend VideoCaptureDevice::Client::OnError() to have a tracked_objects::Location param. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/file_video_capture_device.h" 5 #include "media/capture/video/file_video_capture_device.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/string_piece.h" 9 #include "base/strings/string_piece.h"
10 #include "media/base/video_capture_types.h" 10 #include "media/base/video_capture_types.h"
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 void FileVideoCaptureDevice::OnAllocateAndStart( 326 void FileVideoCaptureDevice::OnAllocateAndStart(
327 const VideoCaptureParams& params, 327 const VideoCaptureParams& params,
328 scoped_ptr<VideoCaptureDevice::Client> client) { 328 scoped_ptr<VideoCaptureDevice::Client> client) {
329 DCHECK_EQ(capture_thread_.message_loop(), base::MessageLoop::current()); 329 DCHECK_EQ(capture_thread_.message_loop(), base::MessageLoop::current());
330 330
331 client_ = client.Pass(); 331 client_ = client.Pass();
332 332
333 DCHECK(!file_parser_); 333 DCHECK(!file_parser_);
334 file_parser_ = GetVideoFileParser(file_path_, &capture_format_); 334 file_parser_ = GetVideoFileParser(file_path_, &capture_format_);
335 if (!file_parser_) { 335 if (!file_parser_) {
336 client_->OnError("Could not open Video file"); 336 client_->OnError(FROM_HERE, "Could not open Video file");
337 return; 337 return;
338 } 338 }
339 339
340 DVLOG(1) << "Opened video file " << capture_format_.frame_size.ToString() 340 DVLOG(1) << "Opened video file " << capture_format_.frame_size.ToString()
341 << ", fps: " << capture_format_.frame_rate; 341 << ", fps: " << capture_format_.frame_rate;
342 342
343 capture_thread_.message_loop()->PostTask( 343 capture_thread_.message_loop()->PostTask(
344 FROM_HERE, base::Bind(&FileVideoCaptureDevice::OnCaptureTask, 344 FROM_HERE, base::Bind(&FileVideoCaptureDevice::OnCaptureTask,
345 base::Unretained(this))); 345 base::Unretained(this)));
346 } 346 }
(...skipping 30 matching lines...) Expand all
377 if (next_frame_time_ < current_time) 377 if (next_frame_time_ < current_time)
378 next_frame_time_ = current_time; 378 next_frame_time_ = current_time;
379 } 379 }
380 base::MessageLoop::current()->PostDelayedTask( 380 base::MessageLoop::current()->PostDelayedTask(
381 FROM_HERE, base::Bind(&FileVideoCaptureDevice::OnCaptureTask, 381 FROM_HERE, base::Bind(&FileVideoCaptureDevice::OnCaptureTask,
382 base::Unretained(this)), 382 base::Unretained(this)),
383 next_frame_time_ - current_time); 383 next_frame_time_ - current_time);
384 } 384 }
385 385
386 } // namespace media 386 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698