MPEG4AAC is MPEG-4 audio, not video, and implement a _formatid_to_caps() function...
authorRonald S. Bultje <rbultje@ronald.bitfreak.net>
Sun, 8 Jun 2003 13:30:10 +0000 (13:30 +0000)
committerRonald S. Bultje <rbultje@ronald.bitfreak.net>
Sun, 8 Jun 2003 13:30:10 +0000 (13:30 +0000)
Original commit message from CVS:
MPEG4AAC is MPEG-4 audio, not video, and implement a _formatid_to_caps() function which tracks a GstCaps to a format name (muxing format etc.), useful for setting caps on demuxers

ext/ffmpeg/gstffmpegcodecmap.c
ext/ffmpeg/gstffmpegcodecmap.h

index 4037979..a35d6ef 100644 (file)
@@ -290,7 +290,7 @@ gst_ffmpeg_codecid_to_caps (enum CodecID    codec_id,
 
     case CODEC_ID_MPEG4AAC:
       caps = GST_FF_VID_CAPS_NEW ("ffmpeg_mpeg4aac",
-                                  "video/mpeg",
+                                  "audio/mpeg",
                                     "systemstream", GST_PROPS_BOOLEAN (FALSE),
                                     "mpegversion",  GST_PROPS_INT (4)
                                  );
@@ -691,3 +691,80 @@ gst_ffmpeg_caps_to_codectype (enum CodecType  type,
       break;
   }
 }
+
+/* _formatid_to_caps () is meant for muxers/demuxers, it
+ * transforms a name (ffmpeg way of ID'ing these, why don't
+ * they have unique numerical IDs?) to the corresponding
+ * caps belonging to that mux-format
+ *
+ * Note: we don't need any additional info because the caps
+ * isn't supposed to contain any useful info besides the
+ * media type anyway
+ */
+
+GstCaps *
+gst_ffmpeg_formatid_to_caps (const gchar *format_name)
+{
+  GstCaps *caps = NULL;
+
+  if (!strcmp (format_name, "mpeg")) {
+    caps = GST_CAPS_NEW ("ffmpeg_mpeg",
+                        "video/mpeg",
+                           "systemstream", GST_PROPS_BOOLEAN (TRUE)
+                        );
+  } else if (!strcmp (format_name, "mpegts")) {
+    caps = GST_CAPS_NEW ("ffmpeg_mpegts",
+                        "video/mpegts",
+                           "systemstream", GST_PROPS_BOOLEAN (TRUE)
+                        );
+  } else if (!strcmp (format_name, "rm")) {
+    caps = GST_CAPS_NEW ("ffmpeg_rm",
+                        "audio/x-pn-realaudio",
+                           NULL
+                        );
+  } else if (!strcmp (format_name, "asf")) {
+    caps = GST_CAPS_NEW ("ffmpeg_asf",
+                        "video/x-ms-asf",
+                           NULL
+                        );
+  } else if (!strcmp (format_name, "avi")) {
+    caps = GST_CAPS_NEW ("ffmpeg_avi",
+                        "video/avi",
+                           NULL
+                        );
+  } else if (!strcmp (format_name, "wav")) {
+    caps = GST_CAPS_NEW ("ffmpeg_wav",
+                        "video/x-wav",
+                           NULL
+                        );
+  } else if (!strcmp (format_name, "swf")) {
+    caps = GST_CAPS_NEW ("ffmpeg_swf",
+                        "application/x-shockwave-flash",
+                           NULL
+                        );
+  } else if (!strcmp (format_name, "au")) {
+    caps = GST_CAPS_NEW ("ffmpeg_au",
+                        "audio/basic",
+                           NULL
+                        );
+  } else if (!strcmp (format_name, "mov")) {
+    caps = GST_CAPS_NEW ("ffmpeg_quicktime",
+                        "video/quicktime",
+                           NULL
+                        );
+  } else if (!strcmp (format_name, "dv")) {
+    caps = GST_CAPS_NEW ("ffmpeg_dv",
+                        "video/dv",
+                           "systemstream", GST_PROPS_BOOLEAN (TRUE)
+                        );
+  } else if (!strcmp (format_name, "4xm")) {
+    caps = GST_CAPS_NEW ("ffmpeg_4xm",
+                        "video/x-4xm",
+                           NULL
+                        );
+  } else {
+    /* unknown! */
+  }
+
+  return caps;
+}
index e3d55a3..9b06788 100644 (file)
@@ -52,4 +52,13 @@ gst_ffmpeg_caps_to_codectype (enum CodecType  type,
                               GstCaps        *caps,
                               AVCodecContext *context);
 
+/* _formatid_to_caps () is meant for muxers/demuxers, it
+ * transforms a name (ffmpeg way of ID'ing these, why don't
+ * they have unique numerical IDs?) to the corresponding
+ * caps belonging to that mux-format
+ */
+
+GstCaps *
+gst_ffmpeg_formatid_to_caps (const gchar *format_name);
+
 #endif /* __GST_FFMPEG_CODECMAP_H__ */