Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // OS X implementaion of VideoCaptureDevice, using QTKit as native capture API. | |
| 6 | |
| 7 #ifndef MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ | |
| 8 #define MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ | |
| 9 | |
| 10 #include "media/video/capture/video_capture_device.h" | |
| 11 | |
| 12 #include <string> | |
| 13 | |
| 14 @class VideoCaptureDeviceMacQTKit; | |
| 15 | |
| 16 namespace media { | |
| 17 | |
| 18 // Called by Video | |
|
dmac
2011/10/06 23:36:22
can we give it a slightly better description?
mflodman_chromium_OOO
2011/10/07 13:03:51
I got interrupted when writing that comment and mi
| |
| 19 class VideoCaptureDeviceMac : public VideoCaptureDevice { | |
| 20 public: | |
| 21 explicit VideoCaptureDeviceMac(const Name& device_name); | |
| 22 virtual ~VideoCaptureDeviceMac(); | |
| 23 | |
| 24 // VideoCaptureDevice implementation. | |
| 25 virtual void Allocate(int width, | |
|
dmac
2011/10/06 23:36:22
Mark the overridden virtuals with OVERRIDE
mflodman_chromium_OOO
2011/10/07 13:03:51
Done.
| |
| 26 int height, | |
| 27 int frame_rate, | |
| 28 VideoCaptureDevice::EventHandler* observer); | |
| 29 virtual void Start(); | |
| 30 virtual void Stop(); | |
| 31 virtual void DeAllocate(); | |
| 32 virtual const Name& device_name(); | |
| 33 | |
| 34 bool Init(); | |
| 35 | |
| 36 // Called to deliver captured video frames. | |
| 37 int IncomingFrame(void* video_frame, int video_frame_length, | |
| 38 const Capability& frame_info); | |
| 39 | |
| 40 private: | |
| 41 void SetErrorState(const std::string& reason); | |
| 42 | |
| 43 // Flag indicating the internal state. | |
| 44 enum InternalState { | |
| 45 kIdle, | |
| 46 kAllocated, | |
| 47 kCapturing, | |
| 48 kError | |
| 49 }; | |
| 50 | |
| 51 VideoCaptureDevice::Name device_name_; | |
| 52 VideoCaptureDevice::EventHandler* observer_; | |
| 53 InternalState state_; | |
| 54 | |
| 55 VideoCaptureDeviceMacQTKit* capture_device_; | |
| 56 | |
| 57 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceMac); | |
| 58 }; | |
| 59 | |
| 60 } // namespace media | |
| 61 | |
| 62 #endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ | |
| OLD | NEW |