Adder element and pipeline rebuilding

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

Adder element and pipeline rebuilding

marco@teknusi.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

i am trying to have this setup working:
i have a pipeline with an adder element  placed just after a decodebin  
element.
what i want to do is adding a pad to the adder element while the  
pipeline is in GST_STATE_PLAYING.
so i create a new bin for the new source, i add it to the pipeline,  
then i should link it to the adder.
which is the right sequence to do this?
i have problems and crash when i try to do the linking, the pipeline  
stalls and never restart.

(it seems there is a lack of documentation about this family of  
problems)

thanks in advance,

marco
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkld3kMACgkQ5A1A6ak/SoVibACeNYAy3iX8ifir2D2nUZmhjPm2
G9YAn1XTwzfyuvsWUlGkdAyvU0vUQsJ2
=0aGb
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Adder element and pipeline rebuilding

Sudarshan Bisht
HI ,
        First set your pipeline to GST_STATE_PAUSED state then add the new element and then again set pipeline to GST_STATE_PLAYING state.

On Fri, Jan 2, 2009 at 2:58 PM, marco <[hidden email]> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

i am trying to have this setup working:
i have a pipeline with an adder element  placed just after a decodebin
element.
what i want to do is adding a pad to the adder element while the
pipeline is in GST_STATE_PLAYING.
so i create a new bin for the new source, i add it to the pipeline,
then i should link it to the adder.
which is the right sequence to do this?
i have problems and crash when i try to do the linking, the pipeline
stalls and never restart.

(it seems there is a lack of documentation about this family of
problems)

thanks in advance,

marco
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkld3kMACgkQ5A1A6ak/SoVibACeNYAy3iX8ifir2D2nUZmhjPm2
G9YAn1XTwzfyuvsWUlGkdAyvU0vUQsJ2
=0aGb
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



--
Regards,

Sudarshan Bisht

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

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Adder element and pipeline rebuilding

marco@teknusi.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Il giorno 02/gen/09, alle ore 10:33, sudarshan bisht ha scritto:

> HI ,
>         First set your pipeline to GST_STATE_PAUSED state then add  
> the new element and then again set pipeline to GST_STATE_PLAYING  
> state.

thanks for your fast answer.
it seems it does not work, it stalls or it gives errors in the flow.
the following is the code i am executing:

void add_sine(){
         GstElement *tsine;

         tsine = get_silence_bin();
         gst_element_set_state(pipeline, GST_STATE_PAUSED);

         gst_bin_add(GST_BIN(pipeline), tsine);


         gst_pad_link(gst_element_get_static_pad(tsine, "src"),
                 gst_element_get_request_pad(adder, "sink1"));

         gst_element_set_state(pipeline, GST_STATE_PLAYING);
}

this brings to a flow error. if i add a :
gst_element_set_state(tsine, GST_STATE_PAUSED);
before adding it to the pipeline, it simply stalls (i never get an  
async-done from the pipeline, that should be the message posted to the  
bus when the pipeline is in playing state again.
just for your information: this pipeline has a tee element outputting  
to two different sink elements (alsasink and shout2send);
any hint on how to get this working?

marco
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkld4nEACgkQ5A1A6ak/SoXO2QCgolmRiZRm8GSEeRnQalLBOrFT
lDgAnRL5iT7LTYkYFfAl7IBOGe2uji3G
=mkNJ
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Adder element and pipeline rebuilding

Sudarshan Bisht
Hi ,,
        Add the tsine element before  ,  link it in later in  GST_STATE_PAUSED  state.

On Fri, Jan 2, 2009 at 3:16 PM, marco <[hidden email]> wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Il giorno 02/gen/09, alle ore 10:33, sudarshan bisht ha scritto:

> HI ,
>         First set your pipeline to GST_STATE_PAUSED state then add
> the new element and then again set pipeline to GST_STATE_PLAYING
> state.

thanks for your fast answer.
it seems it does not work, it stalls or it gives errors in the flow.
the following is the code i am executing:

void add_sine(){
        GstElement *tsine;

        tsine = get_silence_bin();
        gst_element_set_state(pipeline, GST_STATE_PAUSED);

        gst_bin_add(GST_BIN(pipeline), tsine);


        gst_pad_link(gst_element_get_static_pad(tsine, "src"),
                gst_element_get_request_pad(adder, "sink1"));

        gst_element_set_state(pipeline, GST_STATE_PLAYING);
}

this brings to a flow error. if i add a :
gst_element_set_state(tsine, GST_STATE_PAUSED);
before adding it to the pipeline, it simply stalls (i never get an
async-done from the pipeline, that should be the message posted to the
bus when the pipeline is in playing state again.
just for your information: this pipeline has a tee element outputting
to two different sink elements (alsasink and shout2send);
any hint on how to get this working?

marco
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkld4nEACgkQ5A1A6ak/SoXO2QCgolmRiZRm8GSEeRnQalLBOrFT
lDgAnRL5iT7LTYkYFfAl7IBOGe2uji3G
=mkNJ
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



--
Regards,

Sudarshan Bisht

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

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Adder element and pipeline rebuilding

marco@teknusi.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Il giorno 02/gen/09, alle ore 10:52, sudarshan bisht ha scritto:

> Hi ,,
>         Add the tsine element before  ,  link it in later in  
> GST_STATE_PAUSED  state.

in this way i have no errors but the pipeline stalls and the alsa  
output sink does not play nothing.
i suspect it could be the shout2send sink not restarting...
i have no idea of what happens : (

marco
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkld6GwACgkQ5A1A6ak/SoXcXQCgoicsOlVVyObHatS5xTvoQzlX
IcgAn14ZCDynRAnENrTB38JmnmO6u+OW
=wrQE
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Adder element and pipeline rebuilding

Stefan Sauer
In reply to this post by marco@teknusi.org
marco schrieb:

> Hi,
>
> i am trying to have this setup working:
> i have a pipeline with an adder element  placed just after a decodebin  
> element.
> what i want to do is adding a pad to the adder element while the  
> pipeline is in GST_STATE_PLAYING.
> so i create a new bin for the new source, i add it to the pipeline,  
> then i should link it to the adder.
> which is the right sequence to do this?
> i have problems and crash when i try to do the linking, the pipeline  
> stalls and never restart.
>
> (it seems there is a lack of documentation about this family of  
> problems)

Have a look at gstreamer/docs/design/part-block.txt

Stefan

>
> thanks in advance,
>
> marco

------------------------------------------------------------------------------
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Adder element and pipeline rebuilding

marco@teknusi.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Il giorno 02/gen/09, alle ore 12:02, Stefan Kost ha scritto:
> Have a look at gstreamer/docs/design/part-block.txt

had a look and implemented some code, i can get to block a pad only  
when an EOS is reached, that seems strange to me...or this is the  
normal behaviour?

marco
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkld/RsACgkQ5A1A6ak/SoVoXgCgiwnQnHH44nQcKbKRoa5nmRTb
3fEAnRbs6bgIYCrPZZAmRvgg/u/u6zG7
=46u4
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Adder element and pipeline rebuilding

marco@teknusi.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Il giorno 02/gen/09, alle ore 12:40, marco ha scritto:
> had a look and implemented some code, i can get to block a pad only
> when an EOS is reached, that seems strange to me...or this is the
> normal behaviour?


it seems that bloking an adder element sinkpad only succeeds when an  
EOS is reached by the source. i cannot understand if this is a bug or  
what.

marco

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkleCtgACgkQ5A1A6ak/SoXWlQCfZFRc4ZNdxRvIk+ixaIbVHYV+
crsAniuJsGxpDc5NsL3QmTzw2CePrDGL
=gD2t
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Adder element and pipeline rebuilding

Wim Taymans
In reply to this post by marco@teknusi.org
On Fri, 2009-01-02 at 10:28 +0100, marco wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi,
>
> i am trying to have this setup working:
> i have a pipeline with an adder element  placed just after a decodebin  
> element.
> what i want to do is adding a pad to the adder element while the  
> pipeline is in GST_STATE_PLAYING.
> so i create a new bin for the new source, i add it to the pipeline,  
> then i should link it to the adder.
> which is the right sequence to do this?

The sequence is:

1) leave the bin to READY
2) request a new pad from adder
3) link the requested pad to the bin
4) set the bin to PLAYING

> i have problems and crash when i try to do the linking, the pipeline  
> stalls and never restart.

Did you do gobject.threads_init() first?

Wim

>
> (it seems there is a lack of documentation about this family of  
> problems)
>
> thanks in advance,
>
> marco
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (Darwin)
>
> iEYEARECAAYFAkld3kMACgkQ5A1A6ak/SoVibACeNYAy3iX8ifir2D2nUZmhjPm2
> G9YAn1XTwzfyuvsWUlGkdAyvU0vUQsJ2
> =0aGb
> -----END PGP SIGNATURE-----
>
> ------------------------------------------------------------------------------
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel


------------------------------------------------------------------------------
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Adder element and pipeline rebuilding

marco@teknusi.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Il giorno 02/gen/09, alle ore 16:09, Wim Taymans ha scritto:
> The sequence is:
>
> 1) leave the bin to READY
> 2) request a new pad from adder
> 3) link the requested pad to the bin
> 4) set the bin to PLAYING

ok, tried this too and i did not succeed into having it to work.
the code is:


void add_sine(){
         GstElement *tsine;
         int pstate;
         GstPad *newpad;
         GstPad *toblock;

         tsine = get_silence_bin();
         gst_bin_add(GST_BIN(pipeline), tsine);


         //toblock = gst_ghost_pad_get_target(
         //      gst_element_get_static_pad(adderbin, "sink0"));
         //gst_pad_set_blocked(toblock, TRUE);

         newpad = gst_ghost_pad_new("sink1",
                 gst_element_get_request_pad(adder, "sink%d"));

         gst_element_add_pad(adderbin, newpad);

         gst_pad_link(gst_element_get_static_pad(tsine, "src"),
                 gst_element_get_static_pad(adderbin, "sink1"));

         gst_element_set_state(tsine, GST_STATE_PLAYING);
         //gst_pad_set_blocked(toblock, FALSE);
}



>> i have problems and crash when i try to do the linking, the pipeline
>> stalls and never restart.
>
> Did you do gobject.threads_init() first?

yes, i have g_thread_init(NULL) call and gst_init() for first in the  
main (and i think that gst_init() does a conditional call to  
g_thread_init() when !g_thread_supported(), or am i wrong?

anyway, thanks for your help, i am sorry to bother the list with so  
many mails.

marco
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Darwin)

iEYEARECAAYFAkleWj8ACgkQ5A1A6ak/SoWoqACfVPL0A0kGakN93oI0eajQD6+K
fu4AnRMCIXTVtjibqXey7N2SIYdmXt4t
=eXZi
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel