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

Unified Diff: webrtc/sdk/objc/Framework/Classes/RTCAVFoundationFormatMapper.h

Issue 2488973002: Split avfoundationcapturer classes in separate files. (Closed)
Patch Set: Fix comments. 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/sdk/objc/Framework/Classes/RTCAVFoundationFormatMapper.h
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCAVFoundationFormatMapper.h b/webrtc/sdk/objc/Framework/Classes/RTCAVFoundationFormatMapper.h
new file mode 100644
index 0000000000000000000000000000000000000000..b15eae56a741c494da8b2d0db06f379b49f4fa6b
--- /dev/null
+++ b/webrtc/sdk/objc/Framework/Classes/RTCAVFoundationFormatMapper.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright 2016 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#import <AVFoundation/AVFoundation.h>
+#import <Foundation/Foundation.h>
+
+#include "webrtc/media/base/videocapturer.h"
+
+/**
+ * Helper class that encapsulates the mapping between cricket::VideoFormat and
+ * AVCaptureDeviceFormat.
+ */
+@interface RTCAVFoundationFormatMapper : NSObject
+
+/**
+ * Return the list of eligible cricket::VideoFormat instances for the given device.
+ *
+ * The list of eligible formats for the provided device is filtered list based on
+ * submedia type (pixel color format) and framerate. This filetring is for performance reasons.
+ * @param device the capture device to be used
+ * @return set of cricket::VideoFormat instances that map to the eligible formats for the device
+ */
++ (std::set<cricket::VideoFormat>)supportedVideoFormatsForDevice:(AVCaptureDevice *)device;
+
+/**
+ * Sets new capture format for the provided device and session.
+ *
+ * The new device format must be one of the formats returned from
+ * supportedVideoFormatsForDevice:.
magjed_webrtc 2016/11/21 13:57:52 nit: remove colon.
daniela-webrtc 2016/11/21 16:29:50 Done.
+ * 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
+ */
++ (BOOL)setFormat:(const cricket::VideoFormat)format
+ forCaptureDevice:(AVCaptureDevice *)device
+ captureSession:(AVCaptureSession *)session;
+@end

Powered by Google App Engine
This is Rietveld 408576698