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

Unified Diff: media/video/capture/mac/avfoundation_glue.h

Issue 24615005: Added AVFoundation Glue and Device Monitoring for Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mark@'s comments addressed. Created 7 years, 2 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
Index: media/video/capture/mac/avfoundation_glue.h
diff --git a/media/video/capture/mac/avfoundation_glue.h b/media/video/capture/mac/avfoundation_glue.h
new file mode 100644
index 0000000000000000000000000000000000000000..56ed387571c275c662d7a6333e51d79466ffad47
--- /dev/null
+++ b/media/video/capture/mac/avfoundation_glue.h
@@ -0,0 +1,66 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// 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, a 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.
+
+#ifndef MEDIA_VIDEO_CAPTURE_MAC_AVFOUNDATION_GLUE_H_
+#define MEDIA_VIDEO_CAPTURE_MAC_AVFOUNDATION_GLUE_H_
+
+#import <Foundation/Foundation.h>
+
+#include "base/basictypes.h"
+#include "media/base/media_export.h"
+
+class MEDIA_EXPORT AVFoundationGlue {
+ public:
+ // This method returns YES if the OS version supports AVFoundation and the
+ // AVFoundation bundle could be loaded correctly, or NO otherwise.
+ static BOOL isAVFoundationSupported();
Robert Sesek 2013/10/14 17:26:44 C++ naming uses capitalization of the first charac
mcasas 2013/10/15 11:50:11 Done.
+
+ static NSBundle const* avFoundationBundle();
+
+ static void* avFoundationLibraryHandle();
+
+ // Originally coming from AVCaptureDevice.h but in global namespace.
+ static NSString* avCaptureDeviceWasConnectedNotification();
+ static NSString* avCaptureDeviceWasDisconnectedNotification();
+
+ // Originally coming from AVMediaFormat.h but in global namespace.
+ static NSString* avMediaTypeVideo();
+ static NSString* avMediaTypeAudio();
+ static NSString* avMediaTypeMuxed();
+
+ static NSString* readNSStringPtr(char const* const symbol,
+ void* const handle);
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(AVFoundationGlue);
+};
+
+// Originally AVCaptureDevice and coming from AVCaptureDevice.h
+@interface CrAVCaptureDevice : NSObject
+
+- (BOOL)hasMediaType:(NSString const*)mediaType;
+
+- (NSString*)uniqueID;
+
+@end
+
+@interface AVCaptureDeviceGlue : NSObject
+
++ (NSArray*)devices;
+
++ (BOOL)hasMediaType:(NSString const*)mediaType
+ forCaptureDevice:(CrAVCaptureDevice const*)device;
+
++ (NSString*)uniqueID:(CrAVCaptureDevice const*)device;
+
+@end
+
+#endif // MEDIA_VIDEO_CAPTURE_MAC_AVFOUNDATION_GLUE_H_

Powered by Google App Engine
This is Rietveld 408576698