Updating XTBs based on .GRDs from branch master
[chromium-blink-merge.git] / media / capture / video / mac / platform_video_capturing_mac.h
blob13cc6a2c669d0718560759ea8557dc8e52b2a83c
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>
10 namespace media {
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
21 // implementation.
22 - (id)initWithFrameReceiver:(media::VideoCaptureDeviceMac*)frameReceiver;
24 // Sets the frame receiver. This method executes the registration in mutual
25 // exclusion.
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
28 // merged.
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
36 // otherwise.
37 - (BOOL)setCaptureDevice:(NSString*)deviceId;
39 // Configures the capture properties.
40 - (BOOL)setCaptureHeight:(int)height
41 width:(int)width
42 frameRate:(float)frameRate;
44 // Starts video capturing, registers observers. Returns YES on sucess, NO
45 // otherwise.
46 - (BOOL)startCapture;
48 // Stops video capturing, unregisters observers.
49 - (void)stopCapture;
51 @end
53 #endif // MEDIA_VIDEO_CAPTURE_MAC_PLATFORM_VIDEO_CAPTURING_MAC_H_