+2006-03-15 Jan Schmidt <thaytan@mad.scientist.com>
+
+ * ext/alsa/gstalsasink.c: (gst_alsasink_finalise):
+ Chain up to the parent finalize method.
+ Add 32-bit sample size to the template caps.
+
+ * gst-libs/gst/riff/riff-media.c: (gst_riff_create_video_caps),
+ (gst_riff_create_video_template_caps):
+ Add the fourcc that the VMWare codec uses.
+
+ * gst/playback/gststreamselector.c:
+ (gst_stream_selector_set_property),
+ (gst_stream_selector_bufferalloc),
+ (gst_stream_selector_request_new_pad):
+ For the active pad, forward buffer-alloc requests, otherwise
+ return GST_FLOW_NOT_LINKED. This also prevents xvimagesink
+ having to memcpy every frame when used by playbin.
+
+ * gst/tcp/gstmultifdsink.c:
+ (gst_multi_fd_sink_handle_client_write):
+ Get negotiated caps from the sink pad, rather than the sink
+ pad's peer.
+
2006-03-15 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Tommi Myöhänen <ext-tommi dot myohanen at nokia dot com>
GST_STATIC_CAPS ("audio/x-raw-int, "
"endianness = (int) { " ALSA_SINK_FACTORY_ENDIANNESS " }, "
"signed = (boolean) { TRUE, FALSE }, "
+ "width = (int) 32, "
+ "depth = (int) 32, "
+ "rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 8 ]; "
+ "audio/x-raw-int, "
+ "endianness = (int) { " ALSA_SINK_FACTORY_ENDIANNESS " }, "
+ "signed = (boolean) { TRUE, FALSE }, "
"width = (int) 16, "
"depth = (int) 16, "
"rate = (int) [ 1, MAX ], " "channels = (int) [ 1, 8 ]; "
g_free (sink->device);
g_mutex_free (sink->alsa_lock);
+
+ G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
*codec_name = g_strdup ("Flash Video 1");
break;
+ case GST_MAKE_FOURCC ('V', 'M', 'n', 'c'):
+ caps = gst_caps_new_simple ("video/x-vmnc",
+ "version", G_TYPE_INT, 1, NULL);
+ if (codec_name)
+ *codec_name = g_strdup ("VMWare NC Video");
+ break;
+
default:
GST_WARNING ("Unknown video fourcc %" GST_FOURCC_FORMAT,
GST_FOURCC_ARGS (codec_fcc));
GST_MAKE_FOURCC ('P', 'N', 'G', ' '),
GST_MAKE_FOURCC ('C', 'Y', 'U', 'V'),
GST_MAKE_FOURCC ('F', 'L', 'V', '1'),
+ GST_MAKE_FOURCC ('V', 'M', 'n', 'c'),
/* FILL ME */
0
};
const GValue * value, GParamSpec * pspec);
static void gst_stream_selector_get_property (GObject * object, guint prop_id,
GValue * value, GParamSpec * pspec);
+static GstFlowReturn gst_stream_selector_bufferalloc (GstPad * pad,
+ guint64 offset, guint size, GstCaps * caps, GstBuffer ** buf);
static GstElementClass *parent_class = NULL;
return gst_pad_peer_get_caps (otherpad);
}
+static GstFlowReturn
+gst_stream_selector_bufferalloc (GstPad * pad, guint64 offset,
+ guint size, GstCaps * caps, GstBuffer ** buf)
+{
+ GstStreamSelector *sel = GST_STREAM_SELECTOR (gst_pad_get_parent (pad));
+ GstFlowReturn result;
+ GstPad *active_sinkpad;
+
+ GST_OBJECT_LOCK (sel);
+ active_sinkpad = sel->active_sinkpad;
+ GST_OBJECT_UNLOCK (sel);
+
+ /* Ignore buffers from pads except the selected one */
+ if (pad != active_sinkpad) {
+ GST_DEBUG_OBJECT (sel,
+ "Returning not-linked for buffer alloc from pad %s:%s",
+ GST_DEBUG_PAD_NAME (pad));
+
+ result = GST_FLOW_NOT_LINKED;
+ } else {
+ result = gst_pad_alloc_buffer_and_set_caps (sel->srcpad, offset,
+ size, caps, buf);
+ }
+
+ gst_object_unref (sel);
+
+ return result;
+}
+
static GList *
gst_stream_selector_get_linked_pads (GstPad * pad)
{
GST_DEBUG_FUNCPTR (gst_stream_selector_chain));
gst_pad_set_internal_link_function (sinkpad,
GST_DEBUG_FUNCPTR (gst_stream_selector_get_linked_pads));
+ gst_pad_set_bufferalloc_function (sinkpad,
+ GST_DEBUG_FUNCPTR (gst_stream_selector_bufferalloc));
+
gst_element_add_pad (GST_ELEMENT (sel), sinkpad);
return sinkpad;
GST_WARNING_OBJECT (sink, "pad has no peer");
return FALSE;
}
-
- caps = gst_pad_get_negotiated_caps (peer);
gst_object_unref (peer);
+ caps = gst_pad_get_negotiated_caps (GST_BASE_SINK_PAD (sink));
+ if (!caps) {
+ GST_WARNING_OBJECT (sink, "pad caps not yet negotiated");
+ return FALSE;
+ }
+
/* queue caps for sending */
res = gst_multi_fd_sink_client_queue_caps (sink, client, caps);