andrew@webrtc.org | a7b57da | 2012-10-22 18:19:23 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
| 11 | #ifndef WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_QTKIT_VIDEO_CAPTURE_QTKIT_H_ |
| 12 | #define WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_QTKIT_VIDEO_CAPTURE_QTKIT_H_ |
| 13 | |
| 14 | #import <QTKit/QTKit.h> |
| 15 | |
| 16 | #include <stdio.h> |
| 17 | |
| 18 | #include "../../video_capture_impl.h" |
| 19 | #include "video_capture_qtkit_utility.h" |
| 20 | #include "../../device_info_impl.h" |
| 21 | |
| 22 | |
| 23 | // Forward declaraion |
| 24 | @class VideoCaptureMacQTKitObjC; |
| 25 | @class VideoCaptureMacQTKitInfoObjC; |
| 26 | |
| 27 | namespace webrtc |
| 28 | { |
| 29 | namespace videocapturemodule |
| 30 | { |
| 31 | |
| 32 | class VideoCaptureMacQTKit : public VideoCaptureImpl |
| 33 | { |
| 34 | public: |
| 35 | VideoCaptureMacQTKit(const WebRtc_Word32 id); |
| 36 | virtual ~VideoCaptureMacQTKit(); |
| 37 | |
| 38 | /* |
| 39 | * Create a video capture module object |
| 40 | * |
| 41 | * id - unique identifier of this video capture module object |
| 42 | * deviceUniqueIdUTF8 - name of the device. Available names can be found |
| 43 | * by using GetDeviceName |
| 44 | * deviceUniqueIdUTF8Length - length of deviceUniqueIdUTF8 |
| 45 | */ |
| 46 | static void Destroy(VideoCaptureModule* module); |
| 47 | |
| 48 | WebRtc_Word32 Init(const WebRtc_Word32 id, |
| 49 | const char* deviceUniqueIdUTF8); |
| 50 | |
| 51 | |
| 52 | // Start/Stop |
| 53 | virtual WebRtc_Word32 StartCapture( |
| 54 | const VideoCaptureCapability& capability); |
| 55 | virtual WebRtc_Word32 StopCapture(); |
| 56 | |
| 57 | // Properties of the set device |
| 58 | |
| 59 | virtual bool CaptureStarted(); |
| 60 | |
| 61 | WebRtc_Word32 CaptureSettings(VideoCaptureCapability& settings); |
| 62 | |
| 63 | protected: |
| 64 | // Help functions |
| 65 | WebRtc_Word32 SetCameraOutput(); |
| 66 | |
| 67 | private: |
| 68 | VideoCaptureMacQTKitObjC* _captureDevice; |
| 69 | VideoCaptureMacQTKitInfoObjC* _captureInfo; |
| 70 | bool _isCapturing; |
| 71 | WebRtc_Word32 _id; |
| 72 | WebRtc_Word32 _captureWidth; |
| 73 | WebRtc_Word32 _captureHeight; |
| 74 | WebRtc_Word32 _captureFrameRate; |
| 75 | char _currentDeviceNameUTF8[MAX_NAME_LENGTH]; |
| 76 | char _currentDeviceUniqueIdUTF8[MAX_NAME_LENGTH]; |
| 77 | char _currentDeviceProductUniqueIDUTF8[MAX_NAME_LENGTH]; |
| 78 | WebRtc_Word32 _frameCount; |
| 79 | }; |
| 80 | } // namespace videocapturemodule |
| 81 | } // namespace webrtc |
| 82 | |
| 83 | #endif // WEBRTC_MODULES_VIDEO_CAPTURE_MAIN_SOURCE_MAC_QTKIT_VIDEO_CAPTURE_QTKIT_H_ |