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

Side by Side Diff: content/browser/renderer_host/media/video_capture_controller.cc

Issue 24079003: Add VideoCaptureDevice::GetDeviceSupportedFormats to interface + implementation for Linux and Fake (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed inexistent video_capture_device_dummy; also removed from media.gyp targets. Created 7 years, 2 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 | « no previous file | media/media.gyp » ('j') | media/video/capture/fake_video_capture_device.h » ('J')
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/browser/renderer_host/media/video_capture_controller.h" 5 #include "content/browser/renderer_host/media/video_capture_controller.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 bool flip_vert, 117 bool flip_vert,
118 bool flip_horiz) OVERRIDE; 118 bool flip_horiz) OVERRIDE;
119 virtual void OnIncomingCapturedVideoFrame( 119 virtual void OnIncomingCapturedVideoFrame(
120 const scoped_refptr<media::VideoFrame>& frame, 120 const scoped_refptr<media::VideoFrame>& frame,
121 base::Time timestamp) OVERRIDE; 121 base::Time timestamp) OVERRIDE;
122 virtual void OnError() OVERRIDE; 122 virtual void OnError() OVERRIDE;
123 virtual void OnFrameInfo( 123 virtual void OnFrameInfo(
124 const media::VideoCaptureCapability& info) OVERRIDE; 124 const media::VideoCaptureCapability& info) OVERRIDE;
125 virtual void OnFrameInfoChanged( 125 virtual void OnFrameInfoChanged(
126 const media::VideoCaptureCapability& info) OVERRIDE; 126 const media::VideoCaptureCapability& info) OVERRIDE;
127 virtual void OnDeviceSupportedFormatsEnumerated(
128 const media::VideoCaptureFormats& formats) OVERRIDE;
127 129
128 private: 130 private:
129 // The controller to which we post events. 131 // The controller to which we post events.
130 const base::WeakPtr<VideoCaptureController> controller_; 132 const base::WeakPtr<VideoCaptureController> controller_;
131 133
132 // The pool of shared-memory buffers used for capturing. 134 // The pool of shared-memory buffers used for capturing.
133 scoped_refptr<VideoCaptureBufferPool> buffer_pool_; 135 scoped_refptr<VideoCaptureBufferPool> buffer_pool_;
134 136
135 // Chopped pixels in width/height in case video capture device has odd 137 // Chopped pixels in width/height in case video capture device has odd
136 // numbers for width/height. 138 // numbers for width/height.
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 } 672 }
671 673
672 void VideoCaptureController::VideoCaptureDeviceClient::OnFrameInfoChanged( 674 void VideoCaptureController::VideoCaptureDeviceClient::OnFrameInfoChanged(
673 const media::VideoCaptureCapability& info) { 675 const media::VideoCaptureCapability& info) {
674 BrowserThread::PostTask(BrowserThread::IO, 676 BrowserThread::PostTask(BrowserThread::IO,
675 FROM_HERE, 677 FROM_HERE,
676 base::Bind(&VideoCaptureController::DoFrameInfoChangedOnIOThread, 678 base::Bind(&VideoCaptureController::DoFrameInfoChangedOnIOThread,
677 controller_, info)); 679 controller_, info));
678 } 680 }
679 681
682 void VideoCaptureController::VideoCaptureDeviceClient::
683 OnDeviceSupportedFormatsEnumerated(
684 const media::VideoCaptureFormats& formats) {
685 NOTIMPLEMENTED();
686 }
687
680 VideoCaptureController::~VideoCaptureController() { 688 VideoCaptureController::~VideoCaptureController() {
681 buffer_pool_ = NULL; // Release all buffers. 689 buffer_pool_ = NULL; // Release all buffers.
682 STLDeleteContainerPointers(controller_clients_.begin(), 690 STLDeleteContainerPointers(controller_clients_.begin(),
683 controller_clients_.end()); 691 controller_clients_.end());
684 } 692 }
685 693
686 void VideoCaptureController::DoIncomingCapturedFrameOnIOThread( 694 void VideoCaptureController::DoIncomingCapturedFrameOnIOThread(
687 const scoped_refptr<media::VideoFrame>& reserved_frame, 695 const scoped_refptr<media::VideoFrame>& reserved_frame,
688 base::Time timestamp) { 696 base::Time timestamp) {
689 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 697 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 } 819 }
812 return NULL; 820 return NULL;
813 } 821 }
814 822
815 int VideoCaptureController::GetClientCount() { 823 int VideoCaptureController::GetClientCount() {
816 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); 824 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
817 return controller_clients_.size(); 825 return controller_clients_.size();
818 } 826 }
819 827
820 } // namespace content 828 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | media/media.gyp » ('j') | media/video/capture/fake_video_capture_device.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698