Index: gst-ffmpeg-0.10.4/ext/ffmpeg/gstffmpegcfg.c =================================================================== --- gst-ffmpeg-0.10.4.orig/ext/ffmpeg/gstffmpegcfg.c +++ gst-ffmpeg-0.10.4/ext/ffmpeg/gstffmpegcfg.c @@ -272,7 +272,9 @@ gst_ffmpeg_flags_get_type (void) {CODEC_FLAG_GRAY, "Only decode/encode grayscale", "gray"}, {CODEC_FLAG_NORMALIZE_AQP, "Normalize Adaptive Quantization (masking, etc)", "aqp"}, +#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) {CODEC_FLAG_TRELLIS_QUANT, "Trellis Quantization", "trellis"}, +#endif {CODEC_FLAG_GLOBAL_HEADER, "Global headers in extradata instead of every keyframe", "global-headers"}, @@ -669,6 +671,11 @@ gst_ffmpeg_cfg_init () "Prediction Method", GST_TYPE_FFMPEG_PRED_METHOD, FF_PRED_LEFT, G_PARAM_READWRITE); gst_ffmpeg_add_pspec (pspec, config.prediction_method, FALSE, huffyuv, NULL); +#if LIBAVCODEC_VERSION_INT >= ((52<<16)+(0<<8)+0) + pspec = g_param_spec_int ("trellis", "Trellis Quantization", + "Trellis RD quantization", 0, 1, 1, G_PARAM_READWRITE); + gst_ffmpeg_add_pspec (pspec, config.trellis, FALSE, mpeg, NULL); +#endif } /* ==== END CONFIGURATION SECTION ==== */ Index: gst-ffmpeg-0.10.4/ext/ffmpeg/gstffmpegcodecmap.c =================================================================== --- gst-ffmpeg-0.10.4.orig/ext/ffmpeg/gstffmpegcodecmap.c +++ gst-ffmpeg-0.10.4/ext/ffmpeg/gstffmpegcodecmap.c @@ -332,7 +332,11 @@ gst_ffmpeg_codecid_to_caps (enum CodecID NULL); if (context) { gst_caps_set_simple (caps, +#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) "depth", G_TYPE_INT, context->bits_per_sample, NULL); +#else + "depth", G_TYPE_INT, context->bits_per_coded_sample, NULL); +#endif } break; @@ -511,7 +515,11 @@ gst_ffmpeg_codecid_to_caps (enum CodecID caps = gst_ff_vid_caps_new (context, codec_id, "video/x-huffyuv", NULL); if (context) { gst_caps_set_simple (caps, +#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) "bpp", G_TYPE_INT, context->bits_per_sample, NULL); +#else + "bpp", G_TYPE_INT, context->bits_per_coded_sample, NULL); +#endif } break; @@ -627,7 +635,11 @@ gst_ffmpeg_codecid_to_caps (enum CodecID "layout", G_TYPE_STRING, "microsoft", NULL); if (context) { gst_caps_set_simple (caps, +#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) "depth", G_TYPE_INT, (gint) context->bits_per_sample, NULL); +#else + "depth", G_TYPE_INT, (gint) context->bits_per_coded_sample, NULL); +#endif } else { gst_caps_set_simple (caps, "depth", GST_TYPE_INT_RANGE, 1, 64, NULL); } @@ -638,7 +650,11 @@ gst_ffmpeg_codecid_to_caps (enum CodecID "layout", G_TYPE_STRING, "quicktime", NULL); if (context) { gst_caps_set_simple (caps, +#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) "depth", G_TYPE_INT, (gint) context->bits_per_sample, NULL); +#else + "depth", G_TYPE_INT, (gint) context->bits_per_coded_sample, NULL); +#endif } else { gst_caps_set_simple (caps, "depth", GST_TYPE_INT_RANGE, 1, 64, NULL); } @@ -688,7 +704,11 @@ gst_ffmpeg_codecid_to_caps (enum CodecID caps = gst_ff_vid_caps_new (context, codec_id, "video/x-camtasia", NULL); if (context) { gst_caps_set_simple (caps, +#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) "depth", G_TYPE_INT, (gint) context->bits_per_sample, NULL); +#else + "depth", G_TYPE_INT, (gint) context->bits_per_coded_sample, NULL); +#endif } else { gst_caps_set_simple (caps, "depth", GST_TYPE_INT_RANGE, 8, 32, NULL); } @@ -1026,7 +1046,11 @@ gst_ffmpeg_codecid_to_caps (enum CodecID caps = gst_ff_aud_caps_new (context, codec_id, "audio/x-alac", NULL); if (context) { gst_caps_set_simple (caps, +#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) "samplesize", G_TYPE_INT, context->bits_per_sample, NULL); +#else + "samplesize", G_TYPE_INT, context->bits_per_coded_sample, NULL); +#endif } break; @@ -1049,7 +1073,11 @@ gst_ffmpeg_codecid_to_caps (enum CodecID caps = gst_ff_aud_caps_new (context, codec_id, "audio/x-tta", NULL); if (context) { gst_caps_set_simple (caps, +#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) "samplesize", G_TYPE_INT, context->bits_per_sample, NULL); +#else + "samplesize", G_TYPE_INT, context->bits_per_coded_sample, NULL); +#endif } break; case CODEC_ID_VORBIS: @@ -1416,7 +1444,11 @@ gst_ffmpeg_caps_to_pixfmt (const GstCaps gst_structure_get_int (structure, "width", &context->width); gst_structure_get_int (structure, "height", &context->height); +#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) gst_structure_get_int (structure, "bpp", &context->bits_per_sample); +#else + gst_structure_get_int (structure, "bpp", &context->bits_per_coded_sample); +#endif fps = gst_structure_get_value (structure, "framerate"); if (fps != NULL && GST_VALUE_HOLDS_FRACTION (fps)) { @@ -1647,7 +1679,11 @@ gst_ffmpeg_caps_with_codecid (enum Codec gint depth; if (gst_structure_get_int (str, "depth", &depth)) { +#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) context->bits_per_sample = depth; +#else + context->bits_per_coded_sample = depth; +#endif } else { GST_WARNING ("No depth field in caps %" GST_PTR_FORMAT, caps); } @@ -1680,7 +1716,11 @@ gst_ffmpeg_caps_with_codecid (enum Codec context->bit_rate = bitrate; } case CODEC_ID_ALAC: +#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) gst_structure_get_int (str, "samplesize", &context->bits_per_sample); +#else + gst_structure_get_int (str, "samplesize", &context->bits_per_coded_sample); +#endif break; case CODEC_ID_DVVIDEO: Index: gst-ffmpeg-0.10.4/ext/ffmpeg/gstffmpegdec.c =================================================================== --- gst-ffmpeg-0.10.4.orig/ext/ffmpeg/gstffmpegdec.c +++ gst-ffmpeg-0.10.4/ext/ffmpeg/gstffmpegdec.c @@ -696,7 +696,11 @@ gst_ffmpegdec_setcaps (GstPad * pad, Gst /* workaround encoder bugs */ ffmpegdec->context->workaround_bugs |= FF_BUG_AUTODETECT; +#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) ffmpegdec->context->error_resilience = 1; +#else + ffmpegdec->context->error_recognition = 1; +#endif /* for slow cpus */ ffmpegdec->context->lowres = ffmpegdec->lowres; @@ -2423,7 +2427,7 @@ gst_ffmpegdec_register (GstPlugin * plug AVCodec *in_plugin; gint rank; - in_plugin = first_avcodec; + in_plugin = av_codec_next(NULL); GST_LOG ("Registering decoders"); @@ -2545,7 +2549,7 @@ gst_ffmpegdec_register (GstPlugin * plug gst_caps_unref (sinkcaps); if (srccaps) gst_caps_unref (srccaps); - in_plugin = in_plugin->next; + in_plugin = av_codec_next(in_plugin); } GST_LOG ("Finished Registering decoders"); Index: gst-ffmpeg-0.10.4/ext/ffmpeg/gstffmpegenc.c =================================================================== --- gst-ffmpeg-0.10.4.orig/ext/ffmpeg/gstffmpegenc.c +++ gst-ffmpeg-0.10.4/ext/ffmpeg/gstffmpegenc.c @@ -306,8 +306,8 @@ gst_ffmpegenc_getcaps (GstPad * pad) /* set some default properties */ ctx->width = DEFAULT_WIDTH; ctx->height = DEFAULT_HEIGHT; - ctx->time_base.num = DEFAULT_FRAME_RATE_BASE; - ctx->time_base.den = 25 * DEFAULT_FRAME_RATE_BASE; + ctx->time_base.num = 1; + ctx->time_base.den = 25; ctx->bit_rate = DEFAULT_VIDEO_BITRATE; /* makes it silent */ ctx->strict_std_compliance = -1; @@ -391,7 +391,9 @@ gst_ffmpegenc_setcaps (GstPad * pad, Gst /* RTP payload used for GOB production (for Asterisk) */ if (ffmpegenc->rtp_payload_size) { +#if LIBAVCODEC_VERSION_INT < ((52<<16)+(0<<8)+0) ffmpegenc->context->rtp_mode = 1; +#endif ffmpegenc->context->rtp_payload_size = ffmpegenc->rtp_payload_size; } @@ -944,13 +946,13 @@ gst_ffmpegenc_register (GstPlugin * plug GType type; AVCodec *in_plugin; - in_plugin = first_avcodec; GST_LOG ("Registering encoders"); /* build global ffmpeg param/property info */ gst_ffmpeg_cfg_init (); + in_plugin = av_codec_next(NULL); while (in_plugin) { gchar *type_name; GstCaps *srccaps = NULL, *sinkcaps = NULL; @@ -1027,7 +1029,7 @@ gst_ffmpegenc_register (GstPlugin * plug gst_caps_unref (sinkcaps); if (srccaps) gst_caps_unref (srccaps); - in_plugin = in_plugin->next; + in_plugin = av_codec_next(in_plugin); } GST_LOG ("Finished registering encoders");