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

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Wed Apr 6 10:07:12 UTC 2016


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

Sebastian Dröge (slomo) <slomo at coaxion.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #325467|none                        |needs-work
             status|                            |

--- Comment #10 from Sebastian Dröge (slomo) <slomo at coaxion.net> ---
Review of attachment 325467:
 --> (https://bugzilla.gnome.org/review?bug=759389&attachment=325467)

In general please run "gst-indent" over your code first :) There are a few
problems in the patch that have to be solved first. It doesn't help to add new
bugs to the code even if that makes things work for you. Let's try to get any
new changes looking good first

::: sys/wasapi/gstwasapisink.c
@@ +80,3 @@

+  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

@@ +111,3 @@
+  if (FAILED(hr)) {
+        GST_ELEMENT_ERROR(self, RESOURCE, OPEN_READ,
+                ("CoInitializeEx: %ld", hr), (NULL));

GST_ELEMENT_ERROR() does not work during init()

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

@@ +155,3 @@
   IAudioClient *client = NULL;

+  GST_DEBUG ("gst_wasapi_sink_open");

Use GST_DEBUG_OBJECT(sink, ...), also in all the other places

@@ +225,3 @@
+  GST_DEBUG ("gst_wasapi_sink_prepare - buffer time in us: %"G_GUINT64_FORMAT,
spec->buffer_time );
+  GST_DEBUG ("IAudioClient::GetBufferSize (number of audio frames that the
buffer can hold) :%i", NumBufferFrames );
+  newTime =  NumBufferFrames / self->info.channels * self->info.rate / 1000;

You should update spec->buffer_time

@@ +341,2 @@
+  //TODO: unsure if the calculation is correct
+  hr = IAudioClient_GetCurrentPadding ((IAudioClient*)self->client,
&nbOfSamplesInQueue);

Padding sounds wrong. We're interested in how many samples are currently queued
in WASAPI but not played out yet

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

@@ +347,3 @@
+      GST_DEBUG ("gst_wasapi_src_delay");
+
+      hr = IAudioCaptureClient_GetNextPacketSize (self->capture_client,
&nsamples);

Also doesn't seem to be the correct API. Maybe here you could return the
difference between how much data you read and the audio clock position? See old
get_time() function

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