[gst-devel] Re : CollectPads synchronization with request pads

Albert Costa costa_albert at yahoo.fr
Thu Oct 16 16:05:11 CEST 2008


Hi,
you can also have a look at plugin videomixer (in Good package). It is also based on N-1mixing, and does include some sort of synchronization on its pads (to make sure video frames with same timestamp will get mixed together). I used it to create my own plugin for other purpose, and it works quite fine.
Regards,
Al



----- Message d'origine ----
De : Rob Gil <rob.gil at live.com>
À : gstreamer-devel at lists.sourceforge.net
Envoyé le : Mercredi, 15 Octobre 2008, 17h09mn 28s
Objet : [gst-devel] CollectPads synchronization with request pads


Hi,

I'm writing a mixer-type (N-to-1) plugin for GStreamer and using "adder" element as my example how to make one. The problem I am having currently is synchronization of input streams - adder is not even trying to synchronize anything, so if I feed it for example 5 perfectly time-synchronized streams from files it starts processing data before all the pads are negotiated. Below is a debug output of what is happening, sink2 gets negotiated just in time to make it to the mix, but sinks 3 and 4 get their requests only after _collected is already ran and first buffer pushed out. Any suggestions for an easy way to do synchronization?

Thanks,

Rob

$ gst-launch-0..10  -v filesrc location=input1.wav ! wavparse ! adder name=add ! wavenc ! filesink location=out.wav \
filesrc location=input2.wav ! wavparse ! add. \
filesrc location=input3.wav ! wavparse ! add. \
filesrc location=input4.wav ! wavparse ! add. \
filesrc location=input5.wav ! wavparse ! add.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Setting pipeline to PAUSED ...
0:00:00.040771611 16675  0x8051410 DEBUG                adder gstadder.c:789:gst_adder_request_new_pad:<add> request new pad sink0
0:00:00.040813029 16675 0xb6f005c8 DEBUG                adder gstadder.c:789:gst_adder_request_new_pad:<add> request new pad sink1
0:00:00.040887694 16675 0xb6f005c8 DEBUG                adder gstadder.c:209:gst_adder_sink_getcaps:<add> intersecting peer and template caps
0:00:00.040984569 16675  0x8051410 DEBUG                adder gstadder.c:209:gst_adder_sink_getcaps:<add> intersecting peer and template caps
0:00:00.041024661 16675 0xb6f005c8 DEBUG                adder gstadder.c:677:gst_adder_sink_event: Got newsegment event on pad add:sink1
0:00:00.041060282 16675 0xb6f005c8 DEBUG                adder gstadder.c:677:gst_adder_sink_event: Got tag event on pad add:sink1
0:00:00.041114063 16675 0xb6f005c8 DEBUG                adder gstadder.c:209:gst_adder_sink_getcaps:<add> intersecting peer and template caps
0:00:00.041119231 16675  0x8051410 DEBUG                adder gstadder.c:677:gst_adder_sink_event: Got newsegment event on pad add:sink0
0:00:00.041146960 16675  0x8051410 DEBUG                adder gstadder.c:677:gst_adder_sink_event: Got tag event on pad add:sink0
0:00:00.041225256 16675  0x8051410 DEBUG                adder gstadder.c:209:gst_adder_sink_getcaps:<add> intersecting peer and template caps
0:00:00.041241181 16675 0xb6f005c8 LOG                  adder gstadder.c:241:gst_adder_setcaps:<add> setting caps on pad 0x813f3f8,sink1 to audio/x-raw-int, endianness=(int)1234, channels=(int)1, width=(int)16, depth=(int)16, signed=(boolean)true, rate=(int)48000
0:00:00.041356635 16675  0x8051410 LOG                  adder gstadder.c:241:gst_adder_setcaps:<add> setting caps on pad 0x8136d80,sink0 to audio/x-raw-int, endianness=(int)1234, channels=(int)1, width=(int)16, depth=(int)16, signed=(boolean)true, rate=(int)48000
0:00:00.041392117 16675  0x8051410 DEBUG                adder gstadder.c:261:gst_adder_setcaps:<add> parse_caps sets adder to format int
/pipeline0/add.sink0: caps = audio/x-raw-int, endianness=(int)1234, channels=(int)1, width=(int)16, depth=(int)16, signed=(boolean)true, rate=(int)48000
0:00:00.041513368 16675 0xb6f00830 DEBUG                adder gstadder.c:789:gst_adder_request_new_pad:<add> request new pad sink2
0:00:00.041574133 16675 0xb6f00830 DEBUG                adder gstadder.c:209:gst_adder_sink_getcaps:<add> intersecting peer and template caps
0:00:00.041699994 16675 0xb6f00830 DEBUG                adder gstadder.c:677:gst_adder_sink_event: Got newsegment event on pad add:sink2
0:00:00.041725069 16675 0xb6f00830 DEBUG                adder gstadder.c:677:gst_adder_sink_event: Got tag event on pad add:sink2
0:00:00.041740155 16675 0xb6f005c8 DEBUG                adder gstadder..c:261:gst_adder_setcaps:<add> parse_caps sets adder to format int
/pipeline0/add.sink1: caps = audio/x-raw-int, endianness=(int)1234, channels=(int)1, width=(int)16, depth=(int)16, signed=(boolean)true, rate=(int)48000
0:00:00.041858054 16675 0xb6f005c8 LOG                  adder gstadder.c:877:gst_adder_collected:<add> starting to cycle through channels, 4096 bytes available (bps = 2)
0:00:00.041884875 16675 0xb6f005c8 LOG                  adder gstadder.c:907:gst_adder_collected:<add> channel 0x811e530: making output buffer of 4096 bytes
0:00:00.041904222 16675 0xb6f005c8 LOG                  adder gstadder.c:921:gst_adder_collected:<add> channel 0x811e530: copying 4096 bytes from data 0x8145a00
0:00:00.041921264 16675 0xb6f005c8 LOG                  adder gstadder.c:934:gst_adder_collected:<add> channel 0x813d308: mixing 4096 bytes from data 0x8140c00
0:00:00.041946478 16675 0xb6f005c8 LOG                  adder gstadder.c:934:gst_adder_collected:<add> channel 0xb6f00b88: mixing 4096 bytes from data 0x813d800
0:00:00.041982518 16675 0xb6f005c8 LOG                  adder gstadder..c:999:gst_adder_collected:<add> pushing outbuf, timestamp 0:00:00.000000000
/pipeline0/wavenc0.sink: caps = audio/x-raw-int, endianness=(int)1234, channels=(int)1, width=(int)16, depth=(int)16, signed=(boolean)true, rate=(int)48000
/pipeline0/filesink0.sink: caps = audio/x-wav
0:00:00.042310372 16675 0xb6f00930 DEBUG                adder gstadder..c:789:gst_adder_request_new_pad:<add> request new pad sink3
0:00:00.042369391 16675 0xb6f00930 DEBUG                adder gstadder.c:209:gst_adder_sink_getcaps:<add> intersecting peer and template caps
0:00:00.042495043 16675 0xb6f00930 DEBUG                adder gstadder.c:677:gst_adder_sink_event: Got newsegment event on pad add:sink3
0:00:00.042518790 16675 0xb6f00930 DEBUG                adder gstadder.c:677:gst_adder_sink_event: Got tag event on pad add:sink3
Pipeline is PREROLLING ...
0:00:00.042897491 16675 0xb6f03200 DEBUG                adder gstadder.c:789:gst_adder_request_new_pad:<add> request new pad sink4
0:00:00.042961609 16675 0xb6f03200 DEBUG                adder gstadder.c:209:gst_adder_sink_getcaps:<add> intersecting peer and template caps
0:00:00.043095084 16675 0xb6f03200 DEBUG                adder gstadder.c:677:gst_adder_sink_event: Got newsegment event on pad add:sink4
0:00:00.043120926 16675 0xb6f03200 DEBUG                adder gstadder.c:677:gst_adder_sink_event: Got tag event on pad add:sink4


________________________________
Stay up to date on your PC, the Web, and your mobile phone with Windows Live. See Now 


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20081016/3d8a8585/attachment.htm>


More information about the gstreamer-devel mailing list