Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(367)

Side by Side Diff: webrtc/sdk/objc/Framework/Classes/RTCVideoFormatMapper.h

Issue 2488973002: Split avfoundationcapturer classes in separate files. (Closed)
Patch Set: Add wrapper class for static methosd Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
magjed_webrtc 2016/11/17 14:11:31 I think the name of this class too generic for wha
daniela-webrtc 2016/11/21 10:14:20 Done.
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 RTCVideoFormatMapper : NSObject
18 21
19 RTC_EXPORT 22 /**
20 @protocol RTCRtpReceiver <NSObject> 23 * Maps the list of eligible AVCaptureDeviceFormat to cricket::VideoFormat.
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>)getSupportedVideoFormatsForDevice:(AVCaptureDe vice *)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 device The device that will have new device format
46 * @param session The capture session to be configured
47 * @param format The cricket::VideoFormat to be used for retrieving the new AVCa ptureDeviceFormat
48 * @return YES if the session configuration was successful. No otherwise
31 */ 49 */
32 @property(nonatomic, readonly) RTCRtpParameters *parameters; 50 + (BOOL)setFormatForCaptureDevice:(AVCaptureDevice *)device
33 51 captureSession:(AVCaptureSession *)session
34 /** The RTCMediaStreamTrack associated with the receiver. 52 format:(const cricket::VideoFormat)format;
kthelgason 2016/11/21 08:38:14 suggestion: rename to setFormat:(format)forCapture
daniela-webrtc 2016/11/21 10:14:20 Done.
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 53
41 @end 54 @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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698