Problems with renegotiation when using queues

Sebastian Dröge sebastian at centricular.com
Fri Jun 6 02:42:33 PDT 2014


On Fr, 2014-06-06 at 10:54 +0200, Jose Antonio Santos Cadenas wrote:
> Hi,
> 
> I've been investigating about reconfiguration of pipelines dynamically and
> I run into negotiation problems while changing the caps of a stream while
> playing.
> 
> I've developed  a program to test the issue, you can download it here:
> 
> https://github.com/jcaden/negotiation_test
> 
> Let me explain the test a little bit (copied from the repo README):
> 
>   This test creates a simple pipeline and forces caps renegotiation once the
>   GST_MESSAGE_STREAM_START is received on bus. It terminates correctly if
> the
>   appsink receives a buffer with the renegotiated format.
> 
>   This program runs a test continuously until it fails or it is executed a
>   number of times selected by the used with -n option (1000000 by default).
> 
>   If option -q is given, the pipeline is this:
> 
>     --------------      -------      ---------
>    | audiotestsrc | -> | queue | -> | appsink |
>     --------------      -------      ---------
> 
>   This test frequently fails  (1 on 15?), because audiotestsrc receive a
>   not negotiated error while pushing a buffer or because no buffer with
>   the new format is received.
> 
>    If -q option is not present the pipeline is this:
> 
>     --------------      ---------
>    | audiotestsrc | -> | appsink |
>     --------------      ---------
> 
>   This second pipeline works properly and renegotiates correctly.
> 
> I'd like to know if I am suppose to do something else to perform the
> renegotiation, currently I am blocking the appsink:sink pad to change the
> appsink caps and send a reconfigure event, then I unblock the pad again.

Renegotiation and the RECONFIGURE event in GStreamer are only "hints",
not something that makes sure you immediately only get buffers in the
new format. And especially if a queue is used it can be possible that
there are still buffers with the old format inside the queue.

Your sink must be able to handle (or at least silently drop) buffers in
the old format after a reconfigure event.

-- 
Sebastian Dröge, Centricular Ltd - http://www.centricular.com
Expertise, Straight from the Source
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 966 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20140606/04c0873a/attachment.sig>


More information about the gstreamer-devel mailing list