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
3 // found in the LICENSE file.
5 #ifndef MEDIA_VIDEO_CAPTURE_MAC_PLATFORM_VIDEO_CAPTURING_MAC_H_
6 #define MEDIA_VIDEO_CAPTURE_MAC_PLATFORM_VIDEO_CAPTURING_MAC_H_
8 #import <Foundation/Foundation.h>
11 class VideoCaptureDeviceMac
;
14 // Protocol representing platform-dependent video capture on Mac, implemented
15 // by both QTKit and AVFoundation APIs.
16 @protocol PlatformVideoCapturingMac
<NSObject
>
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
20 // to be initialised before and outlive the VideoCapturingDeviceMac
22 - (id
)initWithFrameReceiver
:(media::VideoCaptureDeviceMac
*)frameReceiver
;
24 // Sets the frame receiver. This method executes the registration in mutual
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
29 - (void)setFrameReceiver
:(media::VideoCaptureDeviceMac
*)frameReceiver
;
31 // Sets which capture device to use by name passed as deviceId argument. The
32 // device names are usually obtained via VideoCaptureDevice::GetDeviceNames()
33 // method. This method will also configure all device properties except those in
34 // setCaptureHeight:width:frameRate. If |deviceId| is nil, capture is stopped
35 // and all potential configuration is torn down. Returns YES on sucess, NO
37 - (BOOL
)setCaptureDevice
:(NSString
*)deviceId
;
39 // Configures the capture properties.
40 - (BOOL
)setCaptureHeight
:(int)height
42 frameRate
:(float)frameRate
;
44 // Starts video capturing, registers observers. Returns YES on sucess, NO
48 // Stops video capturing, unregisters observers.
53 #endif // MEDIA_VIDEO_CAPTURE_MAC_PLATFORM_VIDEO_CAPTURING_MAC_H_