[gstreamer-bugs] [Bug 325984] New: [playbin] cannot handle sources that produce raw audio/video

GStreamer (bugzilla.gnome.org) bugzilla-daemon at bugzilla.gnome.org
Fri Jan 6 06:12:09 PST 2006


Do not reply to this via email (we are currently unable to handle email
responses and they get discarded).  You can add comments to this bug at
http://bugzilla.gnome.org/show_bug.cgi?id=325984
 GStreamer | gst-plugins-base | Ver: HEAD CVS

           Summary: [playbin] cannot handle sources that produce raw
                    audio/video
           Product: GStreamer
           Version: HEAD CVS
          Platform: Other
        OS/Version: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: Normal
         Component: gst-plugins-base
        AssignedTo: gstreamer-bugs at lists.sourceforge.net
        ReportedBy: t.i.m at zen.co.uk
         QAContact: gstreamer-bugs at lists.sourceforge.net
     GNOME version: Unspecified
   GNOME milestone: Unspecified


Playbin currently doesn't handle sources that produce raw audio/video correctly
at the moment.

This is required e.g. for Audio CD playback using cdparanoiasrc.


My local patch currently looks like this, but needs cleaning up/review:

Index: gstplaybasebin.c
===================================================================
RCS file: /cvs/gstreamer/gst-plugins-base/gst/playback/gstplaybasebin.c,v
retrieving revision 1.94
diff -u -p -r1.94 gstplaybasebin.c
--- gstplaybasebin.c    15 Dec 2005 09:48:19 -0000      1.94
+++ gstplaybasebin.c    6 Jan 2006 14:08:31 -0000
@@ -1255,12 +1266,71 @@ setup_source (GstPlayBaseBin * play_base
 #endif
   }

+#if 1
   /* now see if the source element emits raw audio/video all by itself,
    * if so, we can create streams for the pads and be done with it.
    * Also check that is has source pads, if not, we assume it will
    * do everything itself.
    */
   {
+    GstIterator *pads_iter;
+    gboolean done = FALSE;
+    gboolean no_out, is_raw = FALSE;
+
+    pads_iter = gst_element_iterate_pads (play_base_bin->source);
+    while (!done) {
+      gpointer data;
+
+      switch (gst_iterator_next (pads_iter, &data)) {
+        case GST_ITERATOR_DONE:
+          done = TRUE;
+        case GST_ITERATOR_ERROR:
+        case GST_ITERATOR_RESYNC:
+          break;
+        case GST_ITERATOR_OK:
+        {
+          GstCaps *caps;
+          GstPad *pad = GST_PAD (data);
+          guint i, num_raw = 0;
+
+          if (GST_PAD_IS_SINK (pad))
+            break;
+
+          no_out = FALSE;
+
+          caps = gst_pad_get_caps (pad);
+          if (caps == NULL || gst_caps_is_empty (caps) ||
+              gst_caps_get_size (caps) == 0) {
+            if (caps)
+              gst_caps_unref (caps);
+            break;
+          }
+
+          for (i = 0; i < gst_caps_get_size (caps); ++i) {
+            GstStructure *s;
+            const gchar *mime_type;
+
+            s = gst_caps_get_structure (caps, i);
+            mime_type = gst_structure_get_name (s);
+
+            if (g_str_has_prefix (mime_type, "audio/x-raw") ||
+                g_str_has_prefix (mime_type, "video/x-raw")) {
+              ++num_raw;
+            }
+          }
+
+          if (num_raw == gst_caps_get_size (caps)) {
+            new_decoded_pad (play_base_bin->source, pad, FALSE /*g_list_next
(pads) == NULL*/,
+              play_base_bin);
+            is_raw = TRUE;
+            return TRUE; /////// fixme: added shortcut, remove again / ///
+          }
+
+          break;
+        }
+      }
+    }
+
 #if 0
     const GList *pads;
     gboolean is_raw = FALSE, no_out = TRUE;
@@ -1312,6 +1382,7 @@ setup_source (GstPlayBaseBin * play_base
     }
 #endif
   }
+#endif

   /* now create the decoder element */
   if (!(play_base_bin->decoder =


-- 
Configure bugmail: http://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.




More information about the Gstreamer-bugs mailing list