After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 315126 - filesrc + forced caps should be possible
filesrc + forced caps should be possible
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.9.4
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-09-02 15:06 UTC by Tim-Philipp Müller
Modified: 2005-10-20 17:05 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Tim-Philipp Müller 2005-09-02 15:06:09 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
Comment 1 Stefan Sauer (gstreamer, gtkdoc dev) 2005-09-06 12:36:15 UTC
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
Comment 2 Benjamin Otte (Company) 2005-09-19 14:43:59 UTC
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
Comment 3 Tim-Philipp Müller 2005-10-20 17:05:24 UTC
'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