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

Side by Side 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: Added comments following avi@ ones. 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/media.gyp ('k') | media/video/capture/mac/avfoundation_glue.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 true if the OS version supports AVFoundation and the
23 // AVFoundation bundle could be loaded correctly, or false 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(const char* symbol);
41
42 DISALLOW_IMPLICIT_CONSTRUCTORS(AVFoundationGlue);
43 };
44
45 // Originally AVCaptureDevice and coming from AVCaptureDevice.h
46 @interface CrAVCaptureDevice : NSObject
47
48 - (BOOL)hasMediaType:(NSString*)mediaType;
49
50 - (NSString*)uniqueID;
51
52 @end
53
54 @interface AVCaptureDeviceGlue : NSObject
55
56 + (NSArray*)devices;
57
58 + (BOOL)hasMediaType:(NSString*)mediaType
59 forCaptureDevice:(CrAVCaptureDevice*)device;
60
61 + (NSString*)uniqueID:(CrAVCaptureDevice*)device;
62
63 @end
64
65 #endif // MEDIA_VIDEO_CAPTURE_MAC_AVFOUNDATION_GLUE_H_
OLDNEW
« no previous file with comments | « media/media.gyp ('k') | media/video/capture/mac/avfoundation_glue.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698