| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // AVFoundation API is only introduced in Mac OS X > 10.6, and there is only one |
| 6 // build of Chromium, so the (potential) linking with AVFoundation has to happen |
| 7 // in runtime. For this to be clean, a AVFoundationGlue class is defined to try |
| 8 // and load these AVFoundation system libraries. If it succeeds, subsequent |
| 9 // clients can use AVFoundation via the rest of the classes declared in this |
| 10 // file. |
| 11 |
| 12 #ifndef MEDIA_VIDEO_CAPTURE_MAC_AVFOUNDATION_GLUE_H_ |
| 13 #define MEDIA_VIDEO_CAPTURE_MAC_AVFOUNDATION_GLUE_H_ |
| 14 |
| 15 #import <Foundation/Foundation.h> |
| 16 |
| 17 #include "base/basictypes.h" |
| 18 #include "media/base/media_export.h" |
| 19 |
| 20 class MEDIA_EXPORT AVFoundationGlue { |
| 21 public: |
| 22 // This method returns YES if the OS version supports AVFoundation and the |
| 23 // AVFoundation bundle could be loaded correctly, or NO otherwise. |
| 24 static BOOL IsAVFoundationSupported(); |
| 25 |
| 26 static NSBundle const* AvFoundationBundle(); |
| 27 |
| 28 static void* AvFoundationLibraryHandle(); |
| 29 |
| 30 // Originally coming from AVCaptureDevice.h but in global namespace. |
| 31 static NSString* AvCaptureDeviceWasConnectedNotification(); |
| 32 static NSString* AvCaptureDeviceWasDisconnectedNotification(); |
| 33 |
| 34 // Originally coming from AVMediaFormat.h but in global namespace. |
| 35 static NSString* AvMediaTypeVideo(); |
| 36 static NSString* AvMediaTypeAudio(); |
| 37 static NSString* AvMediaTypeMuxed(); |
| 38 |
| 39 private: |
| 40 static NSString* ReadNSStringPtr(char const* const symbol); |
| 41 DISALLOW_IMPLICIT_CONSTRUCTORS(AVFoundationGlue); |
| 42 }; |
| 43 |
| 44 // Originally AVCaptureDevice and coming from AVCaptureDevice.h |
| 45 @interface CrAVCaptureDevice : NSObject |
| 46 |
| 47 - (BOOL)hasMediaType:(NSString*)mediaType; |
| 48 |
| 49 - (NSString*)uniqueID; |
| 50 |
| 51 @end |
| 52 |
| 53 @interface AVCaptureDeviceGlue : NSObject |
| 54 |
| 55 + (NSArray*)devices; |
| 56 |
| 57 + (BOOL)hasMediaType:(NSString*)mediaType |
| 58 forCaptureDevice:(CrAVCaptureDevice*)device; |
| 59 |
| 60 + (NSString*)uniqueID:(CrAVCaptureDevice*)device; |
| 61 |
| 62 @end |
| 63 |
| 64 #endif // MEDIA_VIDEO_CAPTURE_MAC_AVFOUNDATION_GLUE_H_ |
| OLD | NEW |