[Bug 729760] appsrc: Changing caps and pushing buffers is not serialized
GStreamer (bugzilla.gnome.org)
bugzilla at gnome.org
Fri Aug 1 08:37:54 PDT 2014
https://bugzilla.gnome.org/show_bug.cgi?id=729760
GStreamer | gst-plugins-base | git
--- Comment #18 from comicfans44 <comicfans44 at gmail.com> 2014-08-01 15:37:48 UTC ---
(In reply to comment #17)
> Review of attachment 282124 [details]:
>
> ::: gst-libs/gst/app/gstappsrc.c
> @@ +537,3 @@
> + while ((caps_or_buffer = g_queue_pop_head (priv->queue))) {
> + if (caps_or_buffer) {
> + gst_mini_object_unref (caps_or_buffer);
>
> Can it ever be NULL?
the original implementation allows set NULL as new caps ,so the queued caps can
also be NULL . that's also the reason I'm trying to use any caps instead of
NULL caps:)
>
> @@ +1088,2 @@
> /* Contiue checks caps and queue */
> continue;
>
> Here I was more thinking about a symmetric loop instead of this
>
> while (!g_queue_is_empty (priv->queue)) {
> obj = g_queue_pop_head (priv->queue);
>
> if (GST_IS_CAPS (obj)) {
> caps = GST_CAPS (obj);
> negotiate and stuff
> } else if (GST_IS_BUFFER (obj)) {
> buffer = GST_BUFFER (obj);
> push buffer downstream and everything
> }
> gst_mini_object_unref (obj);
> }
seems more clear. BTW,it may be a "NULL" as caps in queue, this should be
considered
>
> @@ +1190,3 @@
> GST_DEBUG_OBJECT (appsrc, "setting caps to %" GST_PTR_FORMAT, caps);
> +
> + caps_or_buffer = g_queue_peek_tail (priv->queue);
>
> Why this complicated code? Just push the caps on the queue and handle them
> above :)
caller may set new caps multi times but didn't push any buffers between them,
my patch tried to skip these unnecessary re-negotitate . if every new caps
(even without buffer of this caps) event should be pushed downstream , I should
correct my patch.
>
> @@ +1251,3 @@
> + if ((caps = appsrc->priv->last_caps))
> + gst_caps_ref (caps);
> + GST_OBJECT_UNLOCK (appsrc);
>
> Is the caps query now returning current_caps, while the caps property returns
> the last caps?
yes, basesrc_class->get_caps points to gst_app_src_internal_get_caps and return
current_caps. caps property use app_src_get_caps ,return last caps
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
More information about the gstreamer-bugs
mailing list