OLD | NEW |
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 #ifndef MEDIA_VIDEO_CAPTURE_MAC_PLATFORM_VIDEO_CAPTURING_MAC_H_ | 5 #ifndef MEDIA_CAPTURE_VIDEO_MAC_PLATFORM_VIDEO_CAPTURING_MAC_H_ |
6 #define MEDIA_VIDEO_CAPTURE_MAC_PLATFORM_VIDEO_CAPTURING_MAC_H_ | 6 #define MEDIA_CAPTURE_VIDEO_MAC_PLATFORM_VIDEO_CAPTURING_MAC_H_ |
7 | 7 |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 | 9 |
10 namespace media { | 10 namespace media { |
11 class VideoCaptureDeviceMac; | 11 class VideoCaptureDeviceMac; |
12 } | 12 } |
13 | 13 |
14 // Protocol representing platform-dependent video capture on Mac, implemented | 14 // Protocol representing platform-dependent video capture on Mac, implemented |
15 // by both QTKit and AVFoundation APIs. | 15 // by both QTKit and AVFoundation APIs. |
16 @protocol PlatformVideoCapturingMac<NSObject> | 16 @protocol PlatformVideoCapturingMac<NSObject> |
17 | 17 |
18 // This method initializes the instance by calling NSObject |init| and registers | 18 // This method initializes the instance by calling NSObject |init| and registers |
19 // internally a frame receiver at the same time. The frame receiver is supposed | 19 // internally a frame receiver at the same time. The frame receiver is supposed |
20 // to be initialised before and outlive the VideoCapturingDeviceMac | 20 // to be initialised before and outlive the VideoCapturingDeviceMac |
21 // implementation. | 21 // implementation. |
22 - (id)initWithFrameReceiver:(media::VideoCaptureDeviceMac*)frameReceiver; | 22 - (id)initWithFrameReceiver:(media::VideoCaptureDeviceMac*)frameReceiver; |
23 | 23 |
24 // Sets the frame receiver. This method executes the registration in mutual | 24 // Sets the frame receiver. This method executes the registration in mutual |
25 // exclusion. | 25 // exclusion. |
26 // TODO(mcasas): This method and stopCapture() are always called in sequence and | 26 // TODO(mcasas): This method and stopCapture() are always called in sequence and |
27 // this one is only used to clear the frameReceiver, investigate if both can be | 27 // this one is only used to clear the frameReceiver, investigate if both can be |
28 // merged. | 28 // merged. |
29 - (void)setFrameReceiver:(media::VideoCaptureDeviceMac*)frameReceiver; | 29 - (void)setFrameReceiver:(media::VideoCaptureDeviceMac*)frameReceiver; |
30 | 30 |
31 // Sets which capture device to use by name passed as deviceId argument. The | 31 // Sets which capture device to use by name passed as deviceId argument. The |
32 // device names are usually obtained via VideoCaptureDevice::GetDeviceNames() | 32 // device names are usually obtained via VideoCaptureDevice::GetDeviceNames() |
33 // method. This method will also configure all device properties except those in | 33 // method. This method will also configure all device properties except those in |
34 // setCaptureHeight:width:frameRate. If |deviceId| is nil, capture is stopped | 34 // setCaptureHeight:width:frameRate. If |deviceId| is nil, capture is stopped |
35 // and all potential configuration is torn down. Returns YES on sucess, NO | 35 // and all potential configuration is torn down. Returns YES on success, NO |
36 // otherwise. | 36 // otherwise. |
37 - (BOOL)setCaptureDevice:(NSString*)deviceId; | 37 - (BOOL)setCaptureDevice:(NSString*)deviceId; |
38 | 38 |
39 // Configures the capture properties. | 39 // Configures the capture properties. |
40 - (BOOL)setCaptureHeight:(int)height | 40 - (BOOL)setCaptureHeight:(int)height |
41 width:(int)width | 41 width:(int)width |
42 frameRate:(float)frameRate; | 42 frameRate:(float)frameRate; |
43 | 43 |
44 // Starts video capturing, registers observers. Returns YES on sucess, NO | 44 // Starts video capturing, registers observers. Returns YES on success, NO |
45 // otherwise. | 45 // otherwise. |
46 - (BOOL)startCapture; | 46 - (BOOL)startCapture; |
47 | 47 |
48 // Stops video capturing, unregisters observers. | 48 // Stops video capturing, unregisters observers. |
49 - (void)stopCapture; | 49 - (void)stopCapture; |
50 | 50 |
51 @end | 51 @end |
52 | 52 |
53 #endif // MEDIA_VIDEO_CAPTURE_MAC_PLATFORM_VIDEO_CAPTURING_MAC_H_ | 53 #endif // MEDIA_CAPTURE_VIDEO_MAC_PLATFORM_VIDEO_CAPTURING_MAC_H_ |
OLD | NEW |