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. | |
|
dmac
2011/10/07 17:38:55
s/implemmentaion/implementation/
mflodman_chromium_OOO
2011/10/10 12:56:52
Done.
| |
| 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> | |
|
scherkus (not reviewing)
2011/10/07 17:17:55
include order here shouuld be:
#include <stl head
mflodman_chromium_OOO
2011/10/10 12:56:52
Done.
| |
| 13 | |
| 14 #include "base/compiler_specific.h" | |
| 15 | |
| 16 @class VideoCaptureDeviceMacQTKit; | |
| 17 | |
| 18 namespace media { | |
| 19 | |
| 20 // Called by VideoCaptureManager to open, close and start, stop video capture | |
| 21 // devices. | |
| 22 class VideoCaptureDeviceMac : public VideoCaptureDevice { | |
| 23 public: | |
| 24 explicit VideoCaptureDeviceMac(const Name& device_name); | |
| 25 virtual ~VideoCaptureDeviceMac(); | |
| 26 | |
| 27 // VideoCaptureDevice implementation. | |
| 28 virtual void Allocate(int width, | |
| 29 int height, | |
| 30 int frame_rate, | |
| 31 VideoCaptureDevice::EventHandler* observer) OVERRIDE; | |
| 32 virtual void Start() OVERRIDE; | |
| 33 virtual void Stop() OVERRIDE; | |
| 34 virtual void DeAllocate() OVERRIDE; | |
| 35 virtual const Name& device_name() OVERRIDE; | |
| 36 | |
| 37 bool Init(); | |
| 38 | |
| 39 // Called to deliver captured video frames. | |
| 40 int IncomingFrame(void* video_frame, int video_frame_length, | |
|
scherkus (not reviewing)
2011/10/07 17:17:55
nit: this doesn't read as a verb
given you refer
mflodman_chromium_OOO
2011/10/10 12:56:52
Changed to ReceiveFrame.
| |
| 41 const Capability& frame_info); | |
| 42 | |
| 43 private: | |
| 44 void SetErrorState(const std::string& reason); | |
| 45 | |
| 46 // Flag indicating the internal state. | |
| 47 enum InternalState { | |
| 48 kNotInitialized, | |
| 49 kIdle, | |
| 50 kAllocated, | |
| 51 kCapturing, | |
| 52 kError | |
| 53 }; | |
| 54 | |
| 55 VideoCaptureDevice::Name device_name_; | |
| 56 VideoCaptureDevice::EventHandler* observer_; | |
| 57 InternalState state_; | |
| 58 | |
| 59 VideoCaptureDeviceMacQTKit* capture_device_; | |
| 60 | |
| 61 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceMac); | |
| 62 }; | |
| 63 | |
| 64 } // namespace media | |
| 65 | |
| 66 #endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ | |
| OLD | NEW |