diff options
Diffstat (limited to 'chromium/media/video/capture/mac/coremedia_glue.h')
-rw-r--r-- | chromium/media/video/capture/mac/coremedia_glue.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/chromium/media/video/capture/mac/coremedia_glue.h b/chromium/media/video/capture/mac/coremedia_glue.h new file mode 100644 index 00000000000..a1f21eb1480 --- /dev/null +++ b/chromium/media/video/capture/mac/coremedia_glue.h @@ -0,0 +1,46 @@ +// 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. + +#ifndef MEDIA_VIDEO_CAPTURE_MAC_COREMEDIA_GLUE_H_ +#define MEDIA_VIDEO_CAPTURE_MAC_COREMEDIA_GLUE_H_ + +#import <CoreVideo/CoreVideo.h> +#import <Foundation/Foundation.h> + +#include "base/basictypes.h" +#include "media/base/media_export.h" + +// CoreMedia API is only introduced in Mac OS X > 10.6, the (potential) linking +// with it has to happen in runtime. If it succeeds, subsequent clients can use +// CoreMedia via the class declared in this file, where the original naming has +// been kept as much as possible. +class MEDIA_EXPORT CoreMediaGlue { + public: + // Originally from CMTime.h + typedef int64_t CMTimeValue; + typedef int32_t CMTimeScale; + typedef int64_t CMTimeEpoch; + typedef uint32_t CMTimeFlags; + typedef struct { + CMTimeValue value; + CMTimeScale timescale; + CMTimeFlags flags; + CMTimeEpoch epoch; + } CMTime; + + // Originally from CMSampleBuffer.h. + typedef struct OpaqueCMSampleBuffer* CMSampleBufferRef; + + // Originally from CMTime.h. + static CMTime CMTimeMake(int64_t value, int32_t timescale); + + // Originally from CMSampleBuffer.h. + static CVImageBufferRef CMSampleBufferGetImageBuffer( + CMSampleBufferRef buffer); + + private: + DISALLOW_IMPLICIT_CONSTRUCTORS(CoreMediaGlue); +}; + +#endif // MEDIA_VIDEO_CAPTURE_MAC_COREMEDIA_GLUE_H_ |