OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #import <AVFoundation/AVFoundation.h> | |
11 #import <Foundation/Foundation.h> | 12 #import <Foundation/Foundation.h> |
12 | 13 |
13 #import <WebRTC/RTCMacros.h> | 14 #include "webrtc/media/base/videocapturer.h" |
14 #import <WebRTC/RTCMediaStreamTrack.h> | |
15 #import <WebRTC/RTCRtpParameters.h> | |
16 | 15 |
17 NS_ASSUME_NONNULL_BEGIN | 16 /** |
17 * Helper class that encapsulates the mapping between cricket::VideoFormat and | |
18 * AVCaptureDeviceFormat. | |
19 */ | |
20 @interface RTCAVFoundationFormatMapper : NSObject | |
18 | 21 |
19 RTC_EXPORT | 22 /** |
20 @protocol RTCRtpReceiver <NSObject> | 23 * Maps the list of eligible AVCaptureDeviceFormat to cricket::VideoFormat. |
magjed_webrtc
2016/11/21 10:59:46
nit: I think we should move some of these comments
daniela-webrtc
2016/11/21 13:24:56
Done.
| |
24 * | |
25 * The list of eligible formats for the provided device is filtered list | |
26 * of all formats the device has. | |
27 * The filtering is based on submedia type and framerate (for performance reason s). | |
28 * This list of eligible AVCaptureDeviceFormat is then mapped onto set of cricke t::VideoFormat. | |
29 * @param device the capture device to be used | |
30 * @return set of cricket::VideoFormat instances that map to the eligible format s for the device | |
31 */ | |
32 + (std::set<cricket::VideoFormat>)supportedVideoFormatsForDevice:(AVCaptureDevic e *)device; | |
21 | 33 |
22 /** A unique identifier for this receiver. */ | 34 /** |
23 @property(nonatomic, readonly) NSString *receiverId; | 35 * Configures the provided capture session by setting new AVCaptureDeviceFormat to the device. |
24 | |
25 /** The currently active RTCRtpParameters, as defined in | |
26 * https://www.w3.org/TR/webrtc/#idl-def-RTCRtpParameters. | |
27 * | 36 * |
28 * The WebRTC specification only defines RTCRtpParameters in terms of senders, | 37 * The new device format is object from the list of eligible formats that maps t o the |
29 * but this API also applies them to receivers, similar to ORTC: | 38 * provided cricket::VideoFormat parameter. |
30 * http://ortc.org/wp-content/uploads/2016/03/ortc.html#rtcrtpparameters*. | 39 * The list of eligible formats for the provided device is filtered list |
40 * of all formats the device has. | |
41 * The filtering is based on submedia type and framerate (for performance reason s). | |
42 * The configuration of the session might not be successful if | |
43 * the device fails to lock for configuration or | |
44 * the new device format cannot be set as active format for the device. | |
45 * @param format The cricket::VideoFormat to be used for retrieving the new AVCa ptureDeviceFormat | |
46 * @param device The device that will have new device format | |
47 * @param session The capture session to be configured | |
48 * @return YES if the session configuration was successful. No otherwise | |
31 */ | 49 */ |
32 @property(nonatomic, readonly) RTCRtpParameters *parameters; | 50 + (BOOL)setFormat:(const cricket::VideoFormat)format |
33 | 51 forCaptureDevice:(AVCaptureDevice *)device |
34 /** The RTCMediaStreamTrack associated with the receiver. | 52 captureSession:(AVCaptureSession *)session; |
35 * Note: reading this property returns a new instance of | |
36 * RTCMediaStreamTrack. Use isEqual: instead of == to compare | |
37 * RTCMediaStreamTrack instances. | |
38 */ | |
39 @property(nonatomic, readonly) RTCMediaStreamTrack *track; | |
40 | |
41 @end | 53 @end |
42 | |
43 RTC_EXPORT | |
44 @interface RTCRtpReceiver : NSObject <RTCRtpReceiver> | |
45 | |
46 - (instancetype)init NS_UNAVAILABLE; | |
47 | |
48 @end | |
49 | |
50 NS_ASSUME_NONNULL_END | |
OLD | NEW |