Commit b8d754c5 authored by Dan Dennedy's avatar Dan Dennedy Committed by Rick Kern

lavc/videotoolbox: Fix videotoolbox compile error on OS X 10.8.

Fixes error:
libavcodec/videotoolbox.c:511:18: error: implicit declaration of function
'CMVideoFormatDescriptionCreateFromH264ParameterSets' is invalid in C99

This was added in 10.9:
https://developer.apple.com/reference/coremedia/1489818-cmvideoformatdescriptioncreatefr?language=objc
parent e07b8d68
...@@ -495,6 +495,8 @@ static CMVideoFormatDescriptionRef videotoolbox_format_desc_create(AVCodecContex ...@@ -495,6 +495,8 @@ static CMVideoFormatDescriptionRef videotoolbox_format_desc_create(AVCodecContex
{ {
CMFormatDescriptionRef cm_fmt_desc = NULL; CMFormatDescriptionRef cm_fmt_desc = NULL;
int status; int status;
#if TARGET_OS_IPHONE || defined(__MAC_10_9)
H264Context *h = codec_type == kCMVideoCodecType_H264 ? avctx->priv_data : NULL; H264Context *h = codec_type == kCMVideoCodecType_H264 ? avctx->priv_data : NULL;
if (h && h->ps.sps->data_size && h->ps.pps->data_size) { if (h && h->ps.sps->data_size && h->ps.pps->data_size) {
...@@ -522,6 +524,7 @@ static CMVideoFormatDescriptionRef videotoolbox_format_desc_create(AVCodecContex ...@@ -522,6 +524,7 @@ static CMVideoFormatDescriptionRef videotoolbox_format_desc_create(AVCodecContex
return NULL; return NULL;
} }
} else { } else {
#endif
status = CMVideoFormatDescriptionCreate(kCFAllocatorDefault, status = CMVideoFormatDescriptionCreate(kCFAllocatorDefault,
codec_type, codec_type,
width, width,
...@@ -533,7 +536,9 @@ static CMVideoFormatDescriptionRef videotoolbox_format_desc_create(AVCodecContex ...@@ -533,7 +536,9 @@ static CMVideoFormatDescriptionRef videotoolbox_format_desc_create(AVCodecContex
av_log(avctx, AV_LOG_ERROR, "Error creating format description: %d\n", status); av_log(avctx, AV_LOG_ERROR, "Error creating format description: %d\n", status);
return NULL; return NULL;
} }
#if TARGET_OS_IPHONE || defined(__MAC_10_9)
} }
#endif
return cm_fmt_desc; return cm_fmt_desc;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment