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

Unified Diff: media/base/mac/avfoundation_glue.h

Issue 2146973002: RELAND: ImageCapture: Implement takePhoto() for Mac AVFoundation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a [captureSession_ canAddOutput:stillImageOutput_] guard Created 4 years, 5 months 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
« no previous file with comments | « no previous file | media/base/mac/avfoundation_glue.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/mac/avfoundation_glue.h
diff --git a/media/base/mac/avfoundation_glue.h b/media/base/mac/avfoundation_glue.h
index a5b430412fdcfe3da37983f4d41fcdf19bbb0451..4072b53874dd9302d2ad3310585d0f68a9f8c048 100644
--- a/media/base/mac/avfoundation_glue.h
+++ b/media/base/mac/avfoundation_glue.h
@@ -2,12 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// AVFoundation API is only introduced in Mac OS X > 10.6, and there is only one
-// build of Chromium, so the (potential) linking with AVFoundation has to happen
-// in runtime. For this to be clean, an AVFoundationGlue class is defined to try
-// and load these AVFoundation system libraries. If it succeeds, subsequent
-// clients can use AVFoundation via the rest of the classes declared in this
-// file.
+// TODO(mcasas): Remove this whole glue, https://crbug.com/579648. This glue was
+// introduced to support Mac OS X <= 10.6 where AVFoundation was not available,
+// and had to happen in runtime.
#ifndef MEDIA_BASE_MAC_AVFOUNDATION_GLUE_H_
#define MEDIA_BASE_MAC_AVFOUNDATION_GLUE_H_
@@ -51,6 +48,7 @@ class MEDIA_EXPORT AVFoundationGlue {
static Class AVCaptureSessionClass();
static Class AVCaptureVideoDataOutputClass();
+ static Class AVCaptureStillImageOutputClass();
#endif // defined(__OBJC__)
private:
@@ -95,6 +93,9 @@ MEDIA_EXPORT
MEDIA_EXPORT
@interface CrAVCaptureOutput : NSObject // Originally from AVCaptureOutput.h.
+
+- (NSArray*)connections;
+
@end
// Originally AVCaptureSession and coming from AVCaptureSession.h.
@@ -104,6 +105,8 @@ MEDIA_EXPORT
- (void)release;
- (void)addInput:(CrAVCaptureInput*)input;
- (void)removeInput:(CrAVCaptureInput*)input;
+- (NSArray*)outputs;
+- (BOOL)canAddOutput:(CrAVCaptureOutput*)output;
- (void)addOutput:(CrAVCaptureOutput*)output;
- (void)removeOutput:(CrAVCaptureOutput*)output;
- (BOOL)isRunning;
@@ -156,6 +159,17 @@ MEDIA_EXPORT
@end
+// Originally AVCaptureStillImageOutput and coming from AVCaptureOutput.h.
+MEDIA_EXPORT
+@interface CrAVCaptureStillImageOutput : CrAVCaptureOutput
+
+typedef void (^CompletionHandler)(CoreMediaGlue::CMSampleBufferRef, NSError*);
+- (void)
+captureStillImageAsynchronouslyFromConnection:(CrAVCaptureConnection*)connection
+ completionHandler:(CompletionHandler)handler;
+
+@end
+
// Class to provide access to class methods of AVCaptureDevice.
MEDIA_EXPORT
@interface AVCaptureDeviceGlue : NSObject
« no previous file with comments | « no previous file | media/base/mac/avfoundation_glue.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698