Chromium Code Reviews| 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..43615ad5a0c7213515f08a6eb169771d0df9e4c6 |
| --- /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(); |
| + |
| + static NSBundle const* AvFoundationBundle(); |
|
Robert Sesek
2013/10/16 23:58:07
Why |Av| for the methods bug |AV| for the class?
mcasas
2013/10/17 08:16:36
Not sure if this will make you happy but here it g
Robert Sesek
2013/10/18 18:18:15
We generally capitalize initialisms in method name
|
| + |
| + 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, |
|
Robert Sesek
2013/10/16 23:58:07
Should this be public or private? It looks like it
mcasas
2013/10/17 08:16:36
Done. Private and removed handle, taking it in the
|
| + void* const handle); |
| + |
| + private: |
| + DISALLOW_IMPLICIT_CONSTRUCTORS(AVFoundationGlue); |
| +}; |
| + |
| +// Originally AVCaptureDevice and coming from AVCaptureDevice.h |
| +@interface CrAVCaptureDevice : NSObject |
| + |
| +- (BOOL)hasMediaType:(NSString*)mediaType; |
| + |
| +- (NSString*)uniqueID; |
| + |
| +@end |
| + |
| +@interface AVCaptureDeviceGlue : NSObject |
| + |
| ++ (NSArray*)devices; |
| + |
| ++ (BOOL)hasMediaType:(NSString*)mediaType |
| + forCaptureDevice:(CrAVCaptureDevice*)device; |
| + |
| ++ (NSString*)uniqueID:(CrAVCaptureDevice*)device; |
| + |
| +@end |
| + |
| +#endif // MEDIA_VIDEO_CAPTURE_MAC_AVFOUNDATION_GLUE_H_ |