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

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

Issue 2488973002: Split avfoundationcapturer classes in separate files. (Closed)
Patch Set: 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/RTCAVFoundationVideoCapturerInternal.h
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCAVFoundationVideoCapturerInternal.h b/webrtc/sdk/objc/Framework/Classes/RTCAVFoundationVideoCapturerInternal.h
new file mode 100644
index 0000000000000000000000000000000000000000..cce2580629a60b6f4ac547017b1b4a2c12ab1030
--- /dev/null
+++ b/webrtc/sdk/objc/Framework/Classes/RTCAVFoundationVideoCapturerInternal.h
@@ -0,0 +1,46 @@
+/*
+ * 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 <Foundation/Foundation.h>
+#import <AVFoundation/AVFoundation.h>
+
+#include "avfoundationvideocapturer.h"
+
+NS_ASSUME_NONNULL_BEGIN
+// This class used to capture frames using AVFoundation APIs on iOS. It is meant
+// to be owned by an instance of AVFoundationVideoCapturer. The reason for this
+// because other webrtc objects own cricket::VideoCapturer, which is not
+// ref counted. To prevent bad behavior we do not expose this class directly.
+@interface RTCAVFoundationVideoCapturerInternal
kthelgason 2016/11/10 09:28:10 Don't we prefer classname+private.h over classname
daniela-webrtc 2016/11/11 13:08:58 I think they are different concepts. Class+Private
+ : NSObject<AVCaptureVideoDataOutputSampleBufferDelegate>
+
+@property(nonatomic, readonly) AVCaptureSession *captureSession;
+@property(nonatomic, readonly) dispatch_queue_t frameQueue;
+@property(nonatomic, readonly) BOOL canUseBackCamera;
+@property(nonatomic, assign) BOOL useBackCamera; // Defaults to NO.
+@property(atomic, assign) BOOL isRunning; // Whether the capture session is running.
+@property(atomic, assign) BOOL hasStarted; // Whether we have an unmatched start.
+
+// We keep a pointer back to AVFoundationVideoCapturer to make callbacks on it
+// when we receive frames. This is safe because this object should be owned by
+// it.
+- (instancetype)initWithCapturer:(webrtc::AVFoundationVideoCapturer *)capturer;
+- (AVCaptureDevice *)getActiveCaptureDevice;
+
+- (nullable AVCaptureDevice *)frontCaptureDevice;
+- (nullable AVCaptureDevice *)backCaptureDevice;
+
+// Starts and stops the capture session asynchronously. We cannot do this
+// synchronously without blocking a WebRTC thread.
+- (void)start;
+- (void)stop;
+
+@end
+NS_ASSUME_NONNULL_END

Powered by Google App Engine
This is Rietveld 408576698