Index: webrtc/sdk/objc/Framework/Classes/RTCAVFoundationFormatMapper.h |
diff --git a/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCRtpReceiver.h b/webrtc/sdk/objc/Framework/Classes/RTCAVFoundationFormatMapper.h |
similarity index 19% |
copy from webrtc/sdk/objc/Framework/Headers/WebRTC/RTCRtpReceiver.h |
copy to webrtc/sdk/objc/Framework/Classes/RTCAVFoundationFormatMapper.h |
index e98a8f3bea1d650b2677dae2d377ff780a997489..34cf64644a63d6a1d33c2ed64ea56195b4462104 100644 |
--- a/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCRtpReceiver.h |
+++ b/webrtc/sdk/objc/Framework/Classes/RTCAVFoundationFormatMapper.h |
@@ -8,43 +8,46 @@ |
* be found in the AUTHORS file in the root of the source tree. |
*/ |
+#import <AVFoundation/AVFoundation.h> |
#import <Foundation/Foundation.h> |
-#import <WebRTC/RTCMacros.h> |
-#import <WebRTC/RTCMediaStreamTrack.h> |
-#import <WebRTC/RTCRtpParameters.h> |
+#include "webrtc/media/base/videocapturer.h" |
-NS_ASSUME_NONNULL_BEGIN |
- |
-RTC_EXPORT |
-@protocol RTCRtpReceiver <NSObject> |
- |
-/** A unique identifier for this receiver. */ |
-@property(nonatomic, readonly) NSString *receiverId; |
+/** |
+ * Helper class that encapsulates the mapping between cricket::VideoFormat and |
+ * AVCaptureDeviceFormat. |
+ */ |
+@interface RTCAVFoundationFormatMapper : NSObject |
-/** The currently active RTCRtpParameters, as defined in |
- * https://www.w3.org/TR/webrtc/#idl-def-RTCRtpParameters. |
+/** |
+ * 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.
|
* |
- * The WebRTC specification only defines RTCRtpParameters in terms of senders, |
- * but this API also applies them to receivers, similar to ORTC: |
- * http://ortc.org/wp-content/uploads/2016/03/ortc.html#rtcrtpparameters*. |
+ * The list of eligible formats for the provided device is filtered list |
+ * of all formats the device has. |
+ * The filtering is based on submedia type and framerate (for performance reasons). |
+ * This list of eligible AVCaptureDeviceFormat is then mapped onto set of cricket::VideoFormat. |
+ * @param device the capture device to be used |
+ * @return set of cricket::VideoFormat instances that map to the eligible formats for the device |
*/ |
-@property(nonatomic, readonly) RTCRtpParameters *parameters; |
++ (std::set<cricket::VideoFormat>)supportedVideoFormatsForDevice:(AVCaptureDevice *)device; |
-/** The RTCMediaStreamTrack associated with the receiver. |
- * Note: reading this property returns a new instance of |
- * RTCMediaStreamTrack. Use isEqual: instead of == to compare |
- * RTCMediaStreamTrack instances. |
+/** |
+ * Configures the provided capture session by setting new AVCaptureDeviceFormat to the device. |
+ * |
+ * The new device format is object from the list of eligible formats that maps to the |
+ * provided cricket::VideoFormat parameter. |
+ * The list of eligible formats for the provided device is filtered list |
+ * of all formats the device has. |
+ * The filtering is based on submedia type and framerate (for performance reasons). |
+ * The configuration of the session might not be successful if |
+ * the device fails to lock for configuration or |
+ * the new device format cannot be set as active format for the device. |
+ * @param format The cricket::VideoFormat to be used for retrieving the new AVCaptureDeviceFormat |
+ * @param device The device that will have new device format |
+ * @param session The capture session to be configured |
+ * @return YES if the session configuration was successful. No otherwise |
*/ |
-@property(nonatomic, readonly) RTCMediaStreamTrack *track; |
- |
++ (BOOL)setFormat:(const cricket::VideoFormat)format |
+ forCaptureDevice:(AVCaptureDevice *)device |
+ captureSession:(AVCaptureSession *)session; |
@end |
- |
-RTC_EXPORT |
-@interface RTCRtpReceiver : NSObject <RTCRtpReceiver> |
- |
-- (instancetype)init NS_UNAVAILABLE; |
- |
-@end |
- |
-NS_ASSUME_NONNULL_END |