#define PIX_FMT_YUYV422 PIX_FMT_YUV422
#endif
-#if LIBAVCODEC_VERSION_MAJOR > 52
+#if LIBAVCODEC_VERSION_MAJOR >= 53
#include <libavutil/opt.h>
#define CODEC_TYPE_VIDEO AVMEDIA_TYPE_VIDEO
#define CODEC_TYPE_AUDIO AVMEDIA_TYPE_AUDIO
else
codec = avcodec_find_encoder( c->codec_id );
-#if LIBAVCODEC_VERSION_MAJOR > 52
+#if LIBAVCODEC_VERSION_MAJOR >= 53
// Process properties as AVOptions on the AVCodec
if ( codec && codec->priv_class )
{
else
codec = avcodec_find_encoder( video_enc->codec_id );
-#if LIBAVCODEC_VERSION_MAJOR > 52
+#if LIBAVCODEC_VERSION_MAJOR >= 53
// Process properties as AVOptions on the AVCodec
if ( codec && codec->priv_class )
{
{
mlt_properties p = mlt_properties_load( fpre );
apply_properties( oc, p, AV_OPT_FLAG_ENCODING_PARAM );
-#if LIBAVFORMAT_VERSION_MAJOR > 52
+#if LIBAVFORMAT_VERSION_MAJOR >= 53
if ( oc->oformat && oc->oformat->priv_class && oc->priv_data )
apply_properties( oc->priv_data, p, AV_OPT_FLAG_ENCODING_PARAM );
#endif
mlt_properties_close( p );
}
apply_properties( oc, properties, AV_OPT_FLAG_ENCODING_PARAM );
-#if LIBAVFORMAT_VERSION_MAJOR > 52
+#if LIBAVFORMAT_VERSION_MAJOR >= 53
if ( oc->oformat && oc->oformat->priv_class && oc->priv_data )
apply_properties( oc->priv_data, properties, AV_OPT_FLAG_ENCODING_PARAM );
#endif
// Open the output file, if needed
if ( !( fmt->flags & AVFMT_NOFILE ) )
{
-#if LIBAVFORMAT_VERSION_MAJOR > 52
+#if LIBAVFORMAT_VERSION_MAJOR >= 53
if ( avio_open( &oc->pb, filename, AVIO_FLAG_WRITE ) < 0 )
#else
if ( url_fopen( &oc->pb, filename, URL_WRONLY ) < 0 )
// Close the output file
if ( !( fmt->flags & AVFMT_NOFILE ) )
-#if LIBAVFORMAT_VERSION_MAJOR > 52
+#if LIBAVFORMAT_VERSION_MAJOR >= 53
avio_close( oc->pb );
-#elif LIBAVFORMAT_VERSION_INT >= ((52<<16)+(0<<8)+0)
+#elif LIBAVFORMAT_VERSION_MAJOR >= 52
url_fclose( oc->pb );
#else
url_fclose( &oc->pb );
#ifdef AVDEVICE
#include <libavdevice/avdevice.h>
#endif
-#if LIBAVCODEC_VERSION_MAJOR > 52
+#if LIBAVCODEC_VERSION_MAJOR >= 53
#include <libavutil/opt.h>
#else
#include <libavcodec/opt.h>
int flags = ( type == consumer_type )? AV_OPT_FLAG_ENCODING_PARAM : AV_OPT_FLAG_DECODING_PARAM;
add_parameters( params, avformat, flags, NULL, NULL );
-#if LIBAVFORMAT_VERSION_MAJOR > 52
+#if LIBAVFORMAT_VERSION_MAJOR >= 53
avformat_init();
if ( type == producer_type )
{
#endif
add_parameters( params, avcodec, flags, NULL, NULL );
-#if LIBAVCODEC_VERSION_MAJOR > 52
+#if LIBAVCODEC_VERSION_MAJOR >= 53
AVCodec *c = NULL;
while ( ( c = av_codec_next( c ) ) )
if ( c->priv_class )
#ifdef SWSCALE
# include <libswscale/swscale.h>
#endif
-#if LIBAVCODEC_VERSION_MAJOR > 52
+#if LIBAVCODEC_VERSION_MAJOR >= 53
#include <libavutil/samplefmt.h>
#elif (LIBAVCODEC_VERSION_INT >= ((51<<16)+(71<<8)+0))
const char *avcodec_get_sample_fmt_name(int sample_fmt);
#define PIX_FMT_YUYV422 PIX_FMT_YUV422
#endif
-#if LIBAVCODEC_VERSION_MAJOR > 52
+#if LIBAVCODEC_VERSION_MAJOR >= 53
#include <libavutil/opt.h>
#define CODEC_TYPE_VIDEO AVMEDIA_TYPE_VIDEO
#define CODEC_TYPE_AUDIO AVMEDIA_TYPE_AUDIO
if ( self->audio_index < 0 )
self->audio_index = i;
mlt_properties_set( meta_media, key, "audio" );
-#if LIBAVCODEC_VERSION_MAJOR > 52
+#if LIBAVCODEC_VERSION_MAJOR >= 53
snprintf( key, sizeof(key), "meta.media.%d.codec.sample_fmt", i );
mlt_properties_set( meta_media, key, av_get_sample_fmt_name( codec_context->sample_fmt ) );
#elif (LIBAVCODEC_VERSION_INT >= ((51<<16)+(71<<8)+0))
char *url = strchr( protocol, ':' );
// Only if there is not a protocol specification that avformat can handle
-#if LIBAVFORMAT_VERSION_MAJOR > 52
+#if LIBAVFORMAT_VERSION_MAJOR >= 53
if ( url && avio_check( URL, 0 ) < 0 )
#else
if ( url && !url_exist( URL ) )
if ( format->pb )
{
// protocols can indicate if they support seeking
-#if LIBAVFORMAT_VERSION_MAJOR > 52
+#if LIBAVFORMAT_VERSION_MAJOR >= 53
self->seekable = format->pb->seekable;
#else
URLContext *uc = url_fileno( format->pb );
if ( !error && self->video_format )
{
apply_properties( self->video_format, properties, AV_OPT_FLAG_DECODING_PARAM );
-#if LIBAVFORMAT_VERSION_MAJOR > 52
+#if LIBAVFORMAT_VERSION_MAJOR >= 53
if ( self->video_format->iformat && self->video_format->iformat->priv_class && self->video_format->priv_data )
apply_properties( self->video_format->priv_data, properties, AV_OPT_FLAG_DECODING_PARAM );
#endif
// And open again for our audio context
av_open_input_file( &self->audio_format, filename, NULL, 0, NULL );
apply_properties( self->audio_format, properties, AV_OPT_FLAG_DECODING_PARAM );
-#if LIBAVFORMAT_VERSION_MAJOR > 52
+#if LIBAVFORMAT_VERSION_MAJOR >= 53
if ( self->audio_format->iformat && self->audio_format->iformat->priv_class && self->audio_format->priv_data )
apply_properties( self->audio_format->priv_data, properties, AV_OPT_FLAG_DECODING_PARAM );
#endif
// Process properties as AVOptions
apply_properties( codec_context, properties, AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM );
-#if LIBAVCODEC_VERSION_MAJOR > 52
+#if LIBAVCODEC_VERSION_MAJOR >= 53
if ( codec->priv_class && codec_context->priv_data )
apply_properties( codec_context->priv_data, properties, AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM );
#endif
static int sample_bytes( AVCodecContext *context )
{
-#if LIBAVCODEC_VERSION_MAJOR > 52
+#if LIBAVCODEC_VERSION_MAJOR >= 53
return av_get_bits_per_sample_fmt( context->sample_fmt ) / 8;
#else
return av_get_bits_per_sample_format( context->sample_fmt ) / 8;
// Process properties as AVOptions
apply_properties( codec_context, properties, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM );
-#if LIBAVCODEC_VERSION_MAJOR > 52
+#if LIBAVCODEC_VERSION_MAJOR >= 53
if ( codec && codec->priv_class && codec_context->priv_data )
apply_properties( codec_context->priv_data, properties, AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM );
#endif