GNOME Bugzilla – Bug 315126
filesrc + forced caps should be possible
Last modified: 2005-10-20 17:05:24 UTC
This should work: gst-launch-0.9 filesrc foo.raw ! audio/x-raw-int,channels=2,rate=44100,depth=16,width=16 ! alsasink <__tim> and capsfilter should set caps on outgoing buffers after all, otherwise filesrc ! audio/x-raw-int,... ! alsasink or similar won't work <BBB> __tim, I've discussed it with wim once, and I see this as a design issue... it's not fixeable <BBB> filtercaps setting caps on buffers is not the right solution <__tim> okay <thaytan> BBB: we decided that gst_pad_push should set the caps from the pad if the buffer doesn't have any yet Cheers -Tim
same problem: fakesrc ! audio/x-raw-int,width=16,depth=16,rate=22050,channels=1 ! audioconvert ! audio/x-raw-int,width=16,depth=16,rate=22050,channels=1 ! fakesink there is now a test for it under gst-plugins-base/check/pipelines/simple_lauch_lines.c
Please make sure that fakesrc or filesrc work without requiring extra code in autopluggers. In 0.8 it was necessary to always check for ANY caps and treat them like unknown caps. My idea was to use a special caps-overwrite element like filtercaps but ignoring peercaps
's fixed, Sir! And it wasn't even me ... From capsfilter.c: /* Output buffer preparation... if the buffer has no caps, and * our allowed output caps is fixed, then give the caps to the * buffer. * This ensures that outgoing buffers have caps if we can, so * that pipelines like: * gst-launch filesrc location=rawsamples.raw ! * audio/x-raw-int,width=16,depth=16,rate=48000,channels=2, * endianness=4321,signed='(boolean)'true ! alsasink * will work. */ static GstFlowReturn gst_capsfilter_prepare_buf (GstBaseTransform * trans, GstBuffer * input, gint size, GstCaps * caps, GstBuffer ** buf) { if (GST_BUFFER_CAPS (input) != NULL) { /* Output buffer already has caps */ GST_DEBUG_OBJECT (trans, "Input buffer already has caps"); gst_buffer_ref (input); *buf = input; } else { /* Buffer has no caps. See if the output pad only supports fixed caps */ GstCaps *out_caps; ...... } Cheers -Tim