[Bug 759389] fakesrc ! wasapisink and any other combination raises The stream is in the wrong format

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Fri Apr 8 10:49:46 UTC 2016


https://bugzilla.gnome.org/show_bug.cgi?id=759389

--- Comment #13 from Thomas Roos <thomas at roosesweb.de> ---
> Created attachment 325478 [details] [review] [review]
> fix basic stuff - 2nd try
> 
> +  gst_element_class_add_pad_template (gstelement_class,
> +      gst_static_pad_template_get (&sink_template));
> 
> Why this change? It was intentionally changed just a while ago
> -> otherwise I will get an warning
> "C:/mingw-w64/i686-4.8.1-posix-sjlj-rt_v3-rev2/mingw32/i686-w64-mingw32/
> include/gstreamer-1.0/gst/gstelement.h:660:25: note: expected 'struct
> GstPadTemplate *' but argument is of type 'struct GstStaticPadTemplat
> e *'
>  void                    gst_element_class_add_pad_template     
> (GstElementClass *klass, GstPadTemplate *templ);"

It was gst_element_class_add_*static*_pad_template(), which was added with
1.8.0. That gives you a warning?
-> you're probably right - Im currently using 1.4.5. will remove my change from
patch


> @@ +111,3 @@
> +  if (FAILED(hr)) {
> +        GST_ELEMENT_ERROR(self, RESOURCE, OPEN_READ,
> +                ("CoInitializeEx: %ld", hr), (NULL));
> 
> GST_ELEMENT_ERROR() does not work during init()
> 
> -> dont know the correct gst way of printing err msg then

You could remember in an instance variable that things failed, and then during
the state change from NULL->READY fail like that. Also it makes probably more
sense to do the COM initialization in class_init() (i.e. once per class, not
once per instance).
-> ok

> @@ +144,3 @@
> +
> +  GST_DEBUG ("gst_wasapi_sink_get_caps filter: %s", gst_caps_to_string
> (filter));
> +  GST_DEBUG ("gst_wasapi_sink_get_caps: %s", gst_caps_to_string (caps));
> 
> You need to filter it against the filter caps if filter!=NULL
> -> added comment TODO

It's not a TODO, it's a bug that will cause assertions. Alternatively you can
just continue returning NULL here, then the base class should do the right
thing.
-> returning the actual caps is not an good idea? The way I've implemented it
is a 100% copy of directsound src and sink!?

> ::: sys/wasapi/gstwasapisrc.c
> @@ +205,3 @@
> 
> +  hr = IAudioClient_Initialize (self->client, AUDCLNT_SHAREMODE_SHARED,
> AUDCLNT_STREAMFLAGS_EVENTCALLBACK,
> +         spec->buffer_time / 100, 0, (WAVEFORMATEX *) &format, NULL);
> 
> In the sink you do * 10, here you do / 100. What is correct now?
> 
> -> you're right - microsoft use hns (100ns) as unit

Ok :) Should you also check here afterwards if you got the requested buffer
time, and update with the actual value returned?

-> I did that already in the recent patch version (second try)

-- 
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