| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // AVFoundation API is only introduced in Mac OS X > 10.6, and there is only one | 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 | 6 // build of Chromium, so the (potential) linking with AVFoundation has to happen |
| 7 // in runtime. For this to be clean, an AVFoundationGlue class is defined to try | 7 // in runtime. For this to be clean, an AVFoundationGlue class is defined to try |
| 8 // and load these AVFoundation system libraries. If it succeeds, subsequent | 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 | 9 // clients can use AVFoundation via the rest of the classes declared in this |
| 10 // file. | 10 // file. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "base/macros.h" | 21 #include "base/macros.h" |
| 22 #include "media/base/mac/coremedia_glue.h" | 22 #include "media/base/mac/coremedia_glue.h" |
| 23 #include "media/base/media_export.h" | 23 #include "media/base/media_export.h" |
| 24 | 24 |
| 25 class MEDIA_EXPORT AVFoundationGlue { | 25 class MEDIA_EXPORT AVFoundationGlue { |
| 26 public: | 26 public: |
| 27 // Must be called on the UI thread prior to attempting to use any other | 27 // Must be called on the UI thread prior to attempting to use any other |
| 28 // AVFoundation methods. | 28 // AVFoundation methods. |
| 29 static void InitializeAVFoundation(); | 29 static void InitializeAVFoundation(); |
| 30 | 30 |
| 31 // This method returns true if the OS version supports AVFoundation and the | |
| 32 // AVFoundation bundle could be loaded correctly, or false otherwise. | |
| 33 static bool IsAVFoundationSupported(); | |
| 34 | |
| 35 #if defined(__OBJC__) | 31 #if defined(__OBJC__) |
| 36 static NSBundle const* AVFoundationBundle(); | 32 static NSBundle const* AVFoundationBundle(); |
| 37 | 33 |
| 38 // Originally coming from AVCaptureDevice.h but in global namespace. | 34 // Originally coming from AVCaptureDevice.h but in global namespace. |
| 39 static NSString* AVCaptureDeviceWasConnectedNotification(); | 35 static NSString* AVCaptureDeviceWasConnectedNotification(); |
| 40 static NSString* AVCaptureDeviceWasDisconnectedNotification(); | 36 static NSString* AVCaptureDeviceWasDisconnectedNotification(); |
| 41 | 37 |
| 42 // Originally coming from AVMediaFormat.h but in global namespace. | 38 // Originally coming from AVMediaFormat.h but in global namespace. |
| 43 static NSString* AVMediaTypeVideo(); | 39 static NSString* AVMediaTypeVideo(); |
| 44 static NSString* AVMediaTypeAudio(); | 40 static NSString* AVMediaTypeAudio(); |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 @interface AVCaptureDeviceInputGlue : NSObject | 171 @interface AVCaptureDeviceInputGlue : NSObject |
| 176 | 172 |
| 177 + (CrAVCaptureDeviceInput*)deviceInputWithDevice:(CrAVCaptureDevice*)device | 173 + (CrAVCaptureDeviceInput*)deviceInputWithDevice:(CrAVCaptureDevice*)device |
| 178 error:(NSError**)outError; | 174 error:(NSError**)outError; |
| 179 | 175 |
| 180 @end | 176 @end |
| 181 | 177 |
| 182 #endif // defined(__OBJC__) | 178 #endif // defined(__OBJC__) |
| 183 | 179 |
| 184 #endif // MEDIA_BASE_MAC_AVFOUNDATION_GLUE_H_ | 180 #endif // MEDIA_BASE_MAC_AVFOUNDATION_GLUE_H_ |
| OLD | NEW |