From: Edward Hervey Date: Wed, 12 Sep 2012 13:30:05 +0000 (+0200) Subject: libav: Switch to non-deprecated symbols X-Git-Tag: RELEASE-0.11.94~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0f9cc8dac63be84c20a8bc283e84089bd0fcd1cd;p=platform%2Fupstream%2Fgst-libav.git libav: Switch to non-deprecated symbols This symbols/enums will all be deprecated in the next releases --- diff --git a/ext/libav/gstavcodecmap.c b/ext/libav/gstavcodecmap.c index bc538ec..2dd123a 100644 --- a/ext/libav/gstavcodecmap.c +++ b/ext/libav/gstavcodecmap.c @@ -1865,23 +1865,23 @@ gst_ffmpeg_pixfmt_to_caps (enum PixelFormat pix_fmt, AVCodecContext * context, */ static GstCaps * -gst_ffmpeg_smpfmt_to_caps (enum SampleFormat sample_fmt, +gst_ffmpeg_smpfmt_to_caps (enum AVSampleFormat sample_fmt, AVCodecContext * context, enum CodecID codec_id) { GstCaps *caps = NULL; GstAudioFormat format; switch (sample_fmt) { - case SAMPLE_FMT_S16: + case AV_SAMPLE_FMT_S16: format = GST_AUDIO_FORMAT_S16; break; - case SAMPLE_FMT_S32: + case AV_SAMPLE_FMT_S32: format = GST_AUDIO_FORMAT_S32; break; - case SAMPLE_FMT_FLT: + case AV_SAMPLE_FMT_FLT: format = GST_AUDIO_FORMAT_F32; break; - case SAMPLE_FMT_DBL: + case AV_SAMPLE_FMT_DBL: format = GST_AUDIO_FORMAT_F64; break; default: @@ -1930,12 +1930,12 @@ gst_ffmpeg_codectype_to_audio_caps (AVCodecContext * context, } } else { GstCaps *temp; - enum SampleFormat i; + enum AVSampleFormat i; AVCodecContext ctx = { 0, }; ctx.channels = -1; caps = gst_caps_new_empty (); - for (i = 0; i <= SAMPLE_FMT_DBL; i++) { + for (i = 0; i <= AV_SAMPLE_FMT_DBL; i++) { temp = gst_ffmpeg_smpfmt_to_caps (i, encode ? &ctx : NULL, codec_id); if (temp != NULL) { gst_caps_append (caps, temp); @@ -2038,16 +2038,16 @@ gst_ffmpeg_caps_to_smpfmt (const GstCaps * caps, switch (format) { case GST_AUDIO_FORMAT_F32: - context->sample_fmt = SAMPLE_FMT_FLT; + context->sample_fmt = AV_SAMPLE_FMT_FLT; break; case GST_AUDIO_FORMAT_F64: - context->sample_fmt = SAMPLE_FMT_DBL; + context->sample_fmt = AV_SAMPLE_FMT_DBL; break; case GST_AUDIO_FORMAT_S32: - context->sample_fmt = SAMPLE_FMT_S32; + context->sample_fmt = AV_SAMPLE_FMT_S32; break; case GST_AUDIO_FORMAT_S16: - context->sample_fmt = SAMPLE_FMT_S16; + context->sample_fmt = AV_SAMPLE_FMT_S16; break; default: break; diff --git a/ext/libav/gstavutils.c b/ext/libav/gstavutils.c index 687f01d..8555d8d 100644 --- a/ext/libav/gstavutils.c +++ b/ext/libav/gstavutils.c @@ -39,21 +39,21 @@ gst_ffmpeg_get_codecid_longname (enum CodecID codec_id) } gint -av_smp_format_depth (enum SampleFormat smp_fmt) +av_smp_format_depth (enum AVSampleFormat smp_fmt) { gint depth = -1; switch (smp_fmt) { - case SAMPLE_FMT_U8: + case AV_SAMPLE_FMT_U8: depth = 1; break; - case SAMPLE_FMT_S16: + case AV_SAMPLE_FMT_S16: depth = 2; break; - case SAMPLE_FMT_S32: - case SAMPLE_FMT_FLT: + case AV_SAMPLE_FMT_S32: + case AV_SAMPLE_FMT_FLT: depth = 4; break; - case SAMPLE_FMT_DBL: + case AV_SAMPLE_FMT_DBL: depth = 8; break; default: diff --git a/ext/libav/gstavutils.h b/ext/libav/gstavutils.h index 0efa730..ebe49fb 100644 --- a/ext/libav/gstavutils.h +++ b/ext/libav/gstavutils.h @@ -89,7 +89,7 @@ G_CONST_RETURN gchar * gst_ffmpeg_get_codecid_longname (enum CodecID codec_id); gint -av_smp_format_depth(enum SampleFormat smp_fmt); +av_smp_format_depth(enum AVSampleFormat smp_fmt); GstBuffer * new_aligned_buffer (gint size); diff --git a/ext/libav/gstavviddec.c b/ext/libav/gstavviddec.c index d14e065..68f3c91 100644 --- a/ext/libav/gstavviddec.c +++ b/ext/libav/gstavviddec.c @@ -606,7 +606,6 @@ gst_ffmpegviddec_get_buffer (AVCodecContext * context, AVFrame * picture) /* tell ffmpeg we own this buffer, tranfer the ref we have on the buffer to * the opaque data. */ picture->type = FF_BUFFER_TYPE_USER; - picture->age = 256 * 256 * 256 * 64; GST_LOG_OBJECT (ffmpegdec, "returned frame %p", frame->output_buffer); diff --git a/ext/libav/gstavvidenc.c b/ext/libav/gstavvidenc.c index 5f81464..2ef4acb 100644 --- a/ext/libav/gstavvidenc.c +++ b/ext/libav/gstavvidenc.c @@ -662,7 +662,7 @@ gst_ffmpegvidenc_handle_frame (GstVideoEncoder * encoder, GstVideoFrame vframe; if (GST_VIDEO_CODEC_FRAME_IS_FORCE_KEYFRAME (frame)) - ffmpegenc->picture->pict_type = FF_I_TYPE; + ffmpegenc->picture->pict_type = AV_PICTURE_TYPE_I; if (!gst_video_frame_map (&vframe, info, frame->input_buffer, GST_MAP_READ)) { GST_ERROR_OBJECT (encoder, "Failed to map input buffer");