Merge branch 'master' into 0.11
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 4 Oct 2011 15:58:49 +0000 (17:58 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 4 Oct 2011 15:58:49 +0000 (17:58 +0200)
1  2 
docs/libs/gst-plugins-base-libs-sections.txt
ext/alsa/gstalsasrc.c
ext/alsa/gstalsasrc.h
gst-libs/gst/pbutils/encoding-profile.c
gst-libs/gst/pbutils/encoding-profile.h
gst/playback/gstdecodebin2.c
gst/playback/gstplaybin2.c
gst/playback/gstplaysink.c

Simple merge
@@@ -63,8 -63,9 +63,9 @@@ struct _GstAlsaSrc 
    snd_pcm_format_t      format;
    guint                 rate;
    guint                 channels;
 -  gint                  bytes_per_sample;
 +  gint                  bpf;
    gboolean              driver_timestamps;
+   GstClockTime          first_alsa_ts;
  
    guint                 buffer_time;
    guint                 period_time;
Simple merge
@@@ -3227,12 -3218,53 +3227,52 @@@ autoplug_select_cb (GstElement * decode
    GST_DEBUG_OBJECT (playbin, "select group %p for %s:%s, %" GST_PTR_FORMAT,
        group, GST_DEBUG_PAD_NAME (pad), caps);
  
 -  GST_DEBUG_OBJECT (playbin, "checking factory %s",
 -      GST_PLUGIN_FEATURE_NAME (factory));
 +  GST_DEBUG_OBJECT (playbin, "checking factory %s", GST_OBJECT_NAME (factory));
  
-   /* if it's not a sink, we just make decodebin try it */
+   /* if it's not a sink, we make sure the element is compatible with
+    * the fixed sink */
    if (!gst_element_factory_list_is_type (factory,
-           GST_ELEMENT_FACTORY_TYPE_SINK))
-     return GST_AUTOPLUG_SELECT_TRY;
+           GST_ELEMENT_FACTORY_TYPE_SINK)) {
+     gboolean isvideodec = gst_element_factory_list_is_type (factory,
+         GST_ELEMENT_FACTORY_TYPE_DECODER |
+         GST_ELEMENT_FACTORY_TYPE_MEDIA_VIDEO |
+         GST_ELEMENT_FACTORY_TYPE_MEDIA_IMAGE);
+     gboolean isaudiodec = gst_element_factory_list_is_type (factory,
+         GST_ELEMENT_FACTORY_TYPE_DECODER |
+         GST_ELEMENT_FACTORY_TYPE_MEDIA_AUDIO);
+     /* If it is a decoder and we have a fixed sink for the media
+      * type it outputs, check that the decoder is compatible with this sink */
+     if ((isvideodec && group->video_sink) || (isaudiodec && group->audio_sink)) {
+       gboolean compatible = TRUE;
+       GstPad *sinkpad;
+       GstCaps *caps;
+       GstElement *sink;
+       if (isaudiodec)
+         sink = group->audio_sink;
+       else
+         sink = group->video_sink;
+       if ((sinkpad = gst_element_get_static_pad (sink, "sink"))) {
+         caps = gst_pad_get_caps_reffed (sinkpad);
+         compatible = gst_element_factory_can_src_any_caps (factory, caps);
+         gst_object_unref (sinkpad);
+         gst_caps_unref (caps);
+       }
+       if (compatible)
+         return GST_AUTOPLUG_SELECT_TRY;
+       GST_DEBUG_OBJECT (playbin, "%s not compatible with the fixed sink",
+           GST_PLUGIN_FEATURE_NAME (factory));
+       return GST_AUTOPLUG_SELECT_SKIP;
+     } else
+       return GST_AUTOPLUG_SELECT_TRY;
+   }
  
    /* it's a sink, see if an instance of it actually works */
    GST_DEBUG_OBJECT (playbin, "we found a sink");
Simple merge