Bug 1133633: Part2. Enable async decoding on mac. r=mattmoodrow

This commit is contained in:
Jean-Yves Avenard 2015-03-31 20:36:32 +11:00
parent 624eb59f55
commit a288b721e4
2 changed files with 13 additions and 4 deletions

View File

@ -211,7 +211,7 @@ AppleVTDecoder::SubmitFrame(mp4_demuxer::MP4Sample* aSample)
// For some reason this gives me a double-free error with stagefright.
AutoCFRelease<CMBlockBufferRef> block = nullptr;
AutoCFRelease<CMSampleBufferRef> sample = nullptr;
VTDecodeInfoFlags flags;
VTDecodeInfoFlags infoFlags;
OSStatus rv;
// FIXME: This copies the sample data. I think we can provide
@ -237,12 +237,15 @@ AppleVTDecoder::SubmitFrame(mp4_demuxer::MP4Sample* aSample)
NS_ERROR("Couldn't create CMSampleBuffer");
return NS_ERROR_FAILURE;
}
VTDecodeFrameFlags decodeFlags =
kVTDecodeFrame_EnableAsynchronousDecompression;
rv = VTDecompressionSessionDecodeFrame(mSession,
sample,
0,
decodeFlags,
CreateAppleFrameRef(aSample),
&flags);
if (rv != noErr && !(flags & kVTDecodeInfo_FrameDropped)) {
&infoFlags);
if (rv != noErr && !(infoFlags & kVTDecodeInfo_FrameDropped)) {
NS_WARNING("Couldn't pass frame to decoder");
return NS_ERROR_FAILURE;
}

View File

@ -25,6 +25,12 @@ enum {
kVTDecodeInfo_Asynchronous = 1UL << 0,
kVTDecodeInfo_FrameDropped = 1UL << 1,
};
enum {
kVTDecodeFrame_EnableAsynchronousDecompression = 1<<0,
kVTDecodeFrame_DoNotOutputFrame = 1<<1,
kVTDecodeFrame_1xRealTimePlayback = 1<<2,
kVTDecodeFrame_EnableTemporalProcessing = 1<<3,
};
typedef CFTypeRef VTSessionRef;
typedef struct OpaqueVTDecompressionSession* VTDecompressionSessionRef;