ext/ffmpeg/gstffmpegcodecmap.c: Add AMR mimetypes (since those are recognized in...
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>
Fri, 28 Jan 2005 10:45:37 +0000 (10:45 +0000)
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>
Fri, 28 Jan 2005 10:45:37 +0000 (10:45 +0000)
Original commit message from CVS:
* ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),
(gst_ffmpeg_caps_to_codecid):
Add AMR mimetypes (since those are recognized in ffmpeg).
* ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_frame),
(gst_ffmpegdec_register):
* ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
* ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_register):
Register law codecs too, add time debug. Use ANY for template caps
since we don't necessarily have available decoders for recognized
formats.

ChangeLog
ext/ffmpeg/gstffmpegcodecmap.c
ext/ffmpeg/gstffmpegdec.c
ext/ffmpeg/gstffmpegdemux.c
ext/ffmpeg/gstffmpegenc.c

index 2161f59..74b0566 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2005-01-28  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
+
+       * ext/ffmpeg/gstffmpegcodecmap.c: (gst_ffmpeg_codecid_to_caps),
+       (gst_ffmpeg_caps_to_codecid):
+         Add AMR mimetypes (since those are recognized in ffmpeg).
+       * ext/ffmpeg/gstffmpegdec.c: (gst_ffmpegdec_frame),
+       (gst_ffmpegdec_register):
+       * ext/ffmpeg/gstffmpegdemux.c: (gst_ffmpegdemux_register):
+       * ext/ffmpeg/gstffmpegenc.c: (gst_ffmpegenc_register):
+         Register law codecs too, add time debug. Use ANY for template caps
+         since we don't necessarily have available decoders for recognized
+         formats.
+
 2005-01-27  Ronald S. Bultje  <rbultje@ronald.bitfreak.net>
 
        * ext/ffmpeg/gstffmpeg.c: (plugin_init):
index c3c293e..6c9fa32 100644 (file)
@@ -631,10 +631,11 @@ gst_ffmpeg_codecid_to_caps (enum CodecID codec_id,
       break;
 
     case CODEC_ID_AMR_NB:
+      caps = GST_FF_AUD_CAPS_NEW ("audio/x-amr-nb", NULL);
+      break;
+
     case CODEC_ID_AMR_WB:
-      /* what's this? ffmpeg uses external libs here that we don't include
-       * so there's no point in defining those. Still, I want to know what
-       * it actually is... */
+      caps = GST_FF_AUD_CAPS_NEW ("audio/x-amr-wb", NULL);
       break;
 
     case CODEC_ID_RA_144:
@@ -1710,6 +1711,12 @@ gst_ffmpeg_caps_to_codecid (const GstCaps * caps, AVCodecContext * context)
           break;
       }
     }
+  } else if (!strcmp (mimetype, "audio/x-amrnb")) {
+    audio = TRUE;
+    id = CODEC_ID_AMR_NB;
+  } else if (!strcmp (mimetype, "audio/x-amrwb")) {
+    id = CODEC_ID_AMR_WB;
+    audio = TRUE;
   } else if (!strncmp (mimetype, "audio/x-gst_ff-", 15) ||
       !strncmp (mimetype, "video/x-gst_ff-", 15)) {
     gchar ext[16];
index 86db135..291866b 100644 (file)
@@ -660,7 +660,8 @@ gst_ffmpegdec_frame (GstFFMpegDec * ffmpegdec,
   }
 
   if (have_data) {
-    GST_DEBUG_OBJECT (ffmpegdec, "Decoded data, now pushing");
+    GST_DEBUG_OBJECT (ffmpegdec, "Decoded data, now pushing (%"
+        GST_TIME_FORMAT ")", GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (outbuf)));
 
     if (!gst_ffmpegdec_negotiate (ffmpegdec)) {
       gst_buffer_unref (outbuf);
@@ -881,7 +882,7 @@ gst_ffmpegdec_register (GstPlugin * plugin)
     /* no quasi-codecs, please */
     if (in_plugin->id == CODEC_ID_RAWVIDEO ||
         (in_plugin->id >= CODEC_ID_PCM_S16LE &&
-            in_plugin->id <= CODEC_ID_PCM_ALAW)) {
+            in_plugin->id <= CODEC_ID_PCM_U8)) {
       goto next;
     }
 
@@ -896,7 +897,7 @@ gst_ffmpegdec_register (GstPlugin * plugin)
 
     /* first make sure we've got a supported type */
     sinkcaps = gst_ffmpeg_codecid_to_caps (in_plugin->id, NULL, FALSE);
-    srccaps = gst_ffmpeg_codectype_to_caps (in_plugin->type, NULL);
+    srccaps = gst_caps_from_string ("video/x-raw-rgb; video/x-raw-yuv");
     if (!sinkcaps || !srccaps) {
       if (sinkcaps) gst_caps_free (sinkcaps);
       if (srccaps) gst_caps_free (srccaps);
index 7786fec..4705b55 100644 (file)
@@ -745,26 +745,8 @@ gst_ffmpegdemux_register (GstPlugin * plugin)
     /* This is a bit ugly, but we just take all formats
      * for the pad template. We'll get an exact match
      * when we open the stream */
-    audiosrccaps = gst_caps_new_empty ();
-    videosrccaps = gst_caps_new_empty ();
-    for (in_codec = first_avcodec; in_codec != NULL; in_codec = in_codec->next) {
-      GstCaps *temp = gst_ffmpeg_codecid_to_caps (in_codec->id, NULL, TRUE);
-
-      if (!temp) {
-        continue;
-      }
-      switch (in_codec->type) {
-        case CODEC_TYPE_VIDEO:
-          gst_caps_append (videosrccaps, temp);
-          break;
-        case CODEC_TYPE_AUDIO:
-          gst_caps_append (audiosrccaps, temp);
-          break;
-        default:
-          gst_caps_free (temp);
-          break;
-      }
-    }
+    audiosrccaps = gst_caps_new_any ();
+    videosrccaps = gst_caps_new_any ();
 
     /* construct the type */
     type_name = g_strdup_printf ("ffdemux_%s", name);
index 39f1298..a528f49 100644 (file)
@@ -708,7 +708,7 @@ gst_ffmpegenc_register (GstPlugin * plugin)
 
     /* first make sure we've got a supported type */
     srccaps = gst_ffmpeg_codecid_to_caps (in_plugin->id, NULL, TRUE);
-    sinkcaps = gst_ffmpeg_codectype_to_caps (in_plugin->type, NULL);
+    sinkcaps = gst_caps_from_string ("video/x-raw-rgb; video/x-raw-yuv");
     if (!sinkcaps || !srccaps)
       goto next;