<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<meta content="text/html; charset=UTF-8">
<style type="text/css" style="">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div dir="ltr">
<div id="x_divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p><font size="2"><span style="font-size:10pt">>Since 1.4, we added the method gst_buffer_pool_set_flushing(). Setting<br>
>the flusing state to TRUE will unblock all calls to acquire, and will<br>
>make future acquire() call to return GST_FLOW_FLUSHING. This was added<br>
>since previously the only way to unblock a pool was<br>
>gst_buffer_set_active(), which has the side effect of freeing all the<br>
>buffers. You have to be own of the pool (that element that activated<br>
>that pool) to do so. In general, you will combined this with<br>
>implementation of unclock/unclock_stop method in various base classes.</span></font></p>
<p><font size="2"><span style="font-size:10pt"><br>
</span></font></p>
<p><font size="2"><span style="font-size:10pt"><br>
</span></font></p>
<p><font size="2"><span style="font-size:10pt"></span></font>Two questions:</p>
<p><br>
</p>
<p>1) I'm not implementing any gstreamer component, the last sentence about</p>
<p>unclock/unclock_stop don't apply, right?</p>
<p><br>
</p>
<p>2) How can I access the bufferpool?? My pipeline is something like:</p>
<p><br>
</p>
<p></p>
<div>gst-launch-1.0 filesrc location=$1 typefind=true ! video/quicktime ! qtdemux ! vpudec ! appsink<br>
<br>
In gdb the backtrace for the locked thread I see this call chain:<br>
<br>
<div>gst_poll_wait at gstpoll.c:1248<br>
default_acquire_buffer at gstbufferpool.c:1120<br>
gst_buffer_pool_acquire_buffer at gstbufferpool.c:1209<br>
gst_video_decoder_allocate_output_buffer at gstvideodecoder.c:3520<br>
gst_vpu_dec_object_get_gst_buffer at gstvpudecobject.c:1006<br>
gst_vpu_dec_object_decode at gstvpudecobject.c:1231<br>
gst_video_decoder_decode_frame at gstvideodecoder.c:3015<br>
gst_video_decoder_chain_forward at gstvideodecoder.c:1882<br>
gst_video_decoder_chain at gstvideodecoder.c:2183<br>
gst_pad_push_data at gstpad.c:3830<br>
gst_pad_push_data at gstpad.c:4063<br>
gst_pad_push at gstpad.c:4174<br>
gst_qtdemux_decorate_and_push_buffer at qtdemux.c:4139<br>
gst_qtdemux_loop at qtdemux.c:4286<br>
gst_qtdemux_loop at qtdemux.c:4363<br>
gst_task_func at gsttask.c:316<br>
g_thread_pool_thread_proxy at gthreadpool.c:307<br>
g_thread_proxy at gthread.c:764<br>
start_thread at pthread_create.c:338<br>
</div>
<br>
The qtdemux object is waiting for a buffer from the buffer pool.<br>
<br>
The complete gdb backtrace is:<br>
<br>
<div>[Switching to thread 2 (Thread 0x39300410 (LWP 989))]<br>
#0  0x75cc0394 in __GI_ppoll (fds=0x51038820, nfds=1, timeout=<optimized out>, sigmask=sigmask@entry=0x0) at ../sysdeps/unix/sysv/linux/ppoll.c:56<br>
56    ../sysdeps/unix/sysv/linux/ppoll.c: No such file or directory.<br>
(gdb) bt<br>
#0  0x75cc0394 in __GI_ppoll (fds=0x51038820, nfds=1, timeout=<optimized out>, sigmask=sigmask@entry=0x0) at ../sysdeps/unix/sysv/linux/ppoll.c:56<br>
#1  0x761bac48 in gst_poll_wait (set=0x51084008, timeout=<optimized out>)<br>
    at /mnt/develop/imx6unidesa/yocto-unidesa-3.14.52-1.1.1/build-imx6unidesa-fb/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0/1.4.5-r0/gstreamer-1.4.5/gst/gstpoll.c:1248<br>
#2  0x7616f318 in default_acquire_buffer (pool=0x510ae360 [GstVideoBufferPool], buffer=0x392ff794, params=0x76360de4 <allocator>)<br>
    at /mnt/develop/imx6unidesa/yocto-unidesa-3.14.52-1.1.1/build-imx6unidesa-fb/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0/1.4.5-r0/gstreamer-1.4.5/gst/gstbufferpool.c:1120<br>
#3  0x76170c04 in gst_buffer_pool_acquire_buffer (pool=0x510ae360 [GstVideoBufferPool], buffer=0x392ff794, buffer@entry=0x392ff78c, params=params@entry=0x0)<br>
    at /mnt/develop/imx6unidesa/yocto-unidesa-3.14.52-1.1.1/build-imx6unidesa-fb/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0/1.4.5-r0/gstreamer-1.4.5/gst/gstbufferpool.c:1209<br>
#4  0x747813b8 in gst_video_decoder_allocate_output_buffer (decoder=decoder@entry=0x50ca2138 [GstVpuDec])<br>
    at /mnt/develop/imx6unidesa/yocto-unidesa-3.14.52-1.1.1/build-imx6unidesa-fb/tmp/work/cortexa9hf-vfp-neon-mx6qdl-poky-linux-gnueabi/gstreamer1.0-plugins-base/1.4.5-r0/gst-plugins-base-1.4.5/gst-libs/gst/video/gstvideodecoder.c:3520<br>
#5  0x7464d348 in gst_vpu_dec_object_get_gst_buffer (bdec=0x50ca2138 [GstVpuDec], bdec@entry=0x7615d0f8, vpu_dec_object=vpu_dec_object@entry=0x50ca7118 [GstVpuDecObject])<br>
    at /mnt/develop/imx6unidesa/yocto-unidesa-3.14.52-1.1.1/build-imx6unidesa-fb/tmp/work/imx6unidesa-poky-linux-gnueabi/gst1.0-fsl-plugin/4.0.8-r0/gst1.0-fsl-plugins-4.0.8/plugins/vpu/gstvpudecobject.c:1006<br>
#6  0x7464fce8 in gst_vpu_dec_object_decode (vpu_dec_object=0x50ca7118 [GstVpuDecObject], bdec=0x7615d0f8, frame=0x74656268 <__FUNCTION__.23893>)<br>
    at /mnt/develop/imx6unidesa/yocto-unidesa-3.14.52-1.1.1/build-imx6unidesa-fb/tmp/work/imx6unidesa-poky-linux-gnueabi/gst1.0-fsl-plugin/4.0.8-r0/gst1.0-fsl-plugins-4.0.8/plugins/vpu/gstvpudecobject.c:1231<br>
#7  0x74778750 in gst_video_decoder_decode_frame (decoder=decoder@entry=0x50ca2138 [GstVpuDec], frame=0x5103dc98)<br>
    at /mnt/develop/imx6unidesa/yocto-unidesa-3.14.52-1.1.1/build-imx6unidesa-fb/tmp/work/cortexa9hf-vfp-neon-mx6qdl-poky-linux-gnueabi/gstreamer1.0-plugins-base/1.4.5-r0/gst-plugins-base-1.4.5/gst-libs/gst/video/gstvideodecoder.c:3015<br>
#8  0x74778a88 in gst_video_decoder_chain_forward (decoder=decoder@entry=0x50ca2138 [GstVpuDec], buf=buf@entry=0x5103e730, at_eos=at_eos@entry=0)<br>
    at /mnt/develop/imx6unidesa/yocto-unidesa-3.14.52-1.1.1/build-imx6unidesa-fb/tmp/work/cortexa9hf-vfp-neon-mx6qdl-poky-linux-gnueabi/gstreamer1.0-plugins-base/1.4.5-r0/gst-plugins-base-1.4.5/gst-libs/gst/video/gstvideodecoder.c:1882<br>
#9  0x7477b298 in gst_video_decoder_chain (pad=<optimized out>, parent=0x50ca2138 [GstVpuDec], buf=0x5103e730)<br>
    at /mnt/develop/imx6unidesa/yocto-unidesa-3.14.52-1.1.1/build-imx6unidesa-fb/tmp/work/cortexa9hf-vfp-neon-mx6qdl-poky-linux-gnueabi/gstreamer1.0-plugins-base/1.4.5-r0/gst-plugins-base-1.4.5/gst-libs/gst/video/gstvideodecoder.c:2183<br>
#10 0x761a40f0 in gst_pad_push_data (data=0x5103e730, type=4112, pad=0x50c8d540 [GstPad])<br>
    at /mnt/develop/imx6unidesa/yocto-unidesa-3.14.52-1.1.1/build-imx6unidesa-fb/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0/1.4.5-r0/gstreamer-1.4.5/gst/gstpad.c:3830<br>
#11 0x761a40f0 in gst_pad_push_data (pad=0x5112a1c0 [GstPad], type=type@entry=4112, data=<optimized out>, data@entry=0x5103e730)<br>
    at /mnt/develop/imx6unidesa/yocto-unidesa-3.14.52-1.1.1/build-imx6unidesa-fb/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0/1.4.5-r0/gstreamer-1.4.5/gst/gstpad.c:4063<br>
#12 0x761aca50 in gst_pad_push (pad=<optimized out>, buffer=buffer@entry=0x5103e730)<br>
    at /mnt/develop/imx6unidesa/yocto-unidesa-3.14.52-1.1.1/build-imx6unidesa-fb/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0/1.4.5-r0/gstreamer-1.4.5/gst/gstpad.c:4174<br>
#13 0x74816550 in gst_qtdemux_decorate_and_push_buffer (qtdemux=0x50c9c070 [GstQTDemux], qtdemux@entry=0x11493, stream=stream@entry=0x51057e00, buf=0x5103e730, dts=400000000,
<br>
    dts@entry=2908, pts=400000000, pts@entry=8513413256590654664, duration=40000000, duration@entry=5821135582436642820, keyframe=0,
<br>
    keyframe@entry=40000000, position=position@entry=400000000, byte_position=<optimized out>)<br>
    at /mnt/develop/imx6unidesa/yocto-unidesa-3.14.52-1.1.1/build-imx6unidesa-fb/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0-plugins-good/1.4.5-r0/gst-plugins-good-1.4.5/gst/isomp4/qtdemux.c:4139<br>
#14 0x7482b988 in gst_qtdemux_loop (qtdemux=0x11493)<br>
    at /mnt/develop/imx6unidesa/yocto-unidesa-3.14.52-1.1.1/build-imx6unidesa-fb/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0-plugins-good/1.4.5-r0/gst-plugins-good-1.4.5/gst/isomp4/qtdemux.c:4286<br>
#15 0x7482b988 in gst_qtdemux_loop (pad=0x76239220)<br>
    at /mnt/develop/imx6unidesa/yocto-unidesa-3.14.52-1.1.1/build-imx6unidesa-fb/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0-plugins-good/1.4.5-r0/gst-plugins-good-1.4.5/gst/isomp4/qtdemux.c:4363<br>
#16 0x761db6ec in gst_task_func (task=0x3bffe568 [GstTask])<br>
    at /mnt/develop/imx6unidesa/yocto-unidesa-3.14.52-1.1.1/build-imx6unidesa-fb/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0/1.4.5-r0/gstreamer-1.4.5/gst/gsttask.c:316<br>
#17 0x762b3230 in g_thread_pool_thread_proxy (data=<optimized out>)<br>
    at /mnt/develop/imx6unidesa/yocto-unidesa-3.14.52-1.1.1/build-imx6unidesa-fb/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/glib-2.0/1_2.42.1-r0/glib-2.42.1/glib/gthreadpool.c:307<br>
#18 0x762b2704 in g_thread_proxy (data=0x50c9ad80)<br>
    at /mnt/develop/imx6unidesa/yocto-unidesa-3.14.52-1.1.1/build-imx6unidesa-fb/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/glib-2.0/1_2.42.1-r0/glib-2.42.1/glib/gthread.c:764<br>
#19 0x76995de0 in start_thread (arg=0x39300410) at pthread_create.c:338<br>
#20 0x75cccfa0 in  () at ../sysdeps/unix/sysv/linux/arm/clone.S:89<br>
</div>
<br>
Thanks!<br>
</div>
<br>
<p></p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>De:</b> gstreamer-devel <gstreamer-devel-bounces@lists.freedesktop.org> en nombre de Nicolas Dufresne <nicolas@ndufresne.ca><br>
<b>Enviado:</b> martes, 25 de abril de 2017 16:35:15<br>
<b>Para:</b> Discussion of the development of and with GStreamer<br>
<b>Asunto:</b> [SENDER UNVERIFIED]Re: How to force a GstBufferPool flush?</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt;">
<div class="PlainText">Le mardi 25 avril 2017 à 10:49 +0000, Jorge Fernandez Monteagudo a<br>
écrit :<br>
> Hi all!<br>
> <br>
> I'm using an old 1.4.5 gstreamer release. I have sometimes a deadlock<br>
> in the 'default_acquire_buffer()' method from gstbufferpool.c when a<br>
> video playing is<br>
> already ended. The code has a comment:<br>
<br>
Since 1.4, we added the method gst_buffer_pool_set_flushing(). Setting<br>
the flusing state to TRUE will unblock all calls to acquire, and will<br>
make future acquire() call to return GST_FLOW_FLUSHING. This was added<br>
since previously the only way to unblock a pool was<br>
gst_buffer_set_active(), which has the side effect of freeing all the<br>
buffers. You have to be own of the pool (that element that activated<br>
that pool) to do so. In general, you will combined this with<br>
implementation of unclock/unclock_stop method in various base classes.<br>
<br>
> <br>
>     /* now we release the control socket, we wait for a buffer<br>
> release or<br>
>      * flushing */<br>
>     gst_poll_read_control (pool->priv->poll);<br>
>     GST_LOG_OBJECT (pool, "waiting for free buffers or flushing");<br>
>     gst_poll_wait (priv->poll, GST_CLOCK_TIME_NONE);<br>
>     gst_poll_write_control (pool->priv->poll);<br>
> <br>
> and I would like to know how to force a flush in order to get the<br>
> control back to my application.<br>
> In the same file is the 'gst_buffer_pool_set_flushing' method. What's<br>
> the way to get a flush done?<br>
> With gst_event_new_flush_start()/stop() methods? With<br>
> 'gst_bus_set_flushing()'?<br>
> <br>
> Thanks!<br>
> Jorge<br>
> _______________________________________________<br>
> gstreamer-devel mailing list<br>
> gstreamer-devel@lists.freedesktop.org<br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></div>
</span></font>
</body>
</html>