libav: Switch to non-deprecated symbols
authorEdward Hervey <edward.hervey@collabora.co.uk>
Wed, 12 Sep 2012 13:30:05 +0000 (15:30 +0200)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Thu, 13 Sep 2012 13:23:26 +0000 (15:23 +0200)
This symbols/enums will all be deprecated in the next releases

ext/libav/gstavcodecmap.c
ext/libav/gstavutils.c
ext/libav/gstavutils.h
ext/libav/gstavviddec.c
ext/libav/gstavvidenc.c

index bc538ec..2dd123a 100644 (file)
@@ -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;
index 687f01d..8555d8d 100644 (file)
@@ -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:
index 0efa730..ebe49fb 100644 (file)
@@ -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);
index d14e065..68f3c91 100644 (file)
@@ -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);
 
index 5f81464..2ef4acb 100644 (file)
@@ -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");