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.
5 #ifndef MEDIA_VIDEO_CAPTURE_MAC_COREMEDIA_GLUE_H_
6 #define MEDIA_VIDEO_CAPTURE_MAC_COREMEDIA_GLUE_H_
8 #import <CoreVideo/CoreVideo.h>
9 #import <Foundation/Foundation.h>
11 #include "base/basictypes.h"
12 #include "media/base/media_export.h"
14 // CoreMedia API is only introduced in Mac OS X > 10.6, the (potential) linking
15 // with it has to happen in runtime. If it succeeds, subsequent clients can use
16 // CoreMedia via the class declared in this file, where the original naming has
17 // been kept as much as possible.
18 class MEDIA_EXPORT CoreMediaGlue
{
20 // Originally from CMTime.h
21 typedef int64_t CMTimeValue
;
22 typedef int32_t CMTimeScale
;
23 typedef int64_t CMTimeEpoch
;
24 typedef uint32_t CMTimeFlags
;
27 CMTimeScale timescale
;
32 // Originally from CMFormatDescription.h.
33 typedef const struct opaqueCMFormatDescription
* CMFormatDescriptionRef
;
34 typedef CMFormatDescriptionRef CMVideoFormatDescriptionRef
;
40 kCMPixelFormat_422YpCbCr8_yuvs
= 'yuvs',
43 kCMVideoCodecType_JPEG_OpenDML
= 'dmb1',
46 // Originally from CMSampleBuffer.h.
47 typedef struct OpaqueCMSampleBuffer
* CMSampleBufferRef
;
49 // Originally from CMTime.h.
50 static CMTime
CMTimeMake(int64_t value
, int32_t timescale
);
52 // Originally from CMSampleBuffer.h.
53 static CVImageBufferRef
CMSampleBufferGetImageBuffer(
54 CMSampleBufferRef buffer
);
56 // Originally from CMFormatDescription.h.
57 static FourCharCode
CMFormatDescriptionGetMediaSubType(
58 CMFormatDescriptionRef desc
);
59 static CMVideoDimensions
CMVideoFormatDescriptionGetDimensions(
60 CMVideoFormatDescriptionRef videoDesc
);
63 DISALLOW_IMPLICIT_CONSTRUCTORS(CoreMediaGlue
);
66 #endif // MEDIA_VIDEO_CAPTURE_MAC_COREMEDIA_GLUE_H_