Callback from gstreamer to application

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Callback from gstreamer to application

deepthips
I have a gstreamer code (say playback.c) with basic functions such as load, play, stop, seek etc.
I have a testapp which will link the playback.c library and call those functions.
I need to post current position from playback.c to my testapp (to update the progress bar). Like a callback function. How is it done in gstreamer. Saw posting to gst bus and all. But my testapp should not be using gstreamer directly. It is like an independent application.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Callback from gstreamer to application

Nicolas Dufresne-5
Le mardi 31 janvier 2017 à 04:31 -0800, deepthips a écrit :
> I have a gstreamer code (say playback.c) with basic functions such as load,
> play, stop, seek etc.
> I have a testapp which will link the playback.c library and call those
> functions.
> I need to post current position from playback.c to my testapp (to update the
> progress bar). Like a callback function. How is it done in gstreamer. Saw
> posting to gst bus and all. But my testapp should not be using gstreamer
> directly. It is like an independent application.

In general, the position is simply being polled using a timer (checked
regularly).

Nicolas
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

signature.asc (188 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Callback from gstreamer to application

Dimitrios Katsaros
you can also use gst_bus_async_signal_func to convert messages on the bus to signals which you can mask as callbacks within your interface. What you are trying to do is similar if not the same as what gstplayer does. I would suggest you check gstplayer under gst-libs/gst/player in gst-plugins-bad.

Dimitrios

On Wed, Feb 1, 2017 at 1:48 AM, Nicolas Dufresne <[hidden email]> wrote:
Le mardi 31 janvier 2017 à 04:31 -0800, deepthips a écrit :
> I have a gstreamer code (say playback.c) with basic functions such as load,
> play, stop, seek etc.
> I have a testapp which will link the playback.c library and call those
> functions.
> I need to post current position from playback.c to my testapp (to update the
> progress bar). Like a callback function. How is it done in gstreamer. Saw
> posting to gst bus and all. But my testapp should not be using gstreamer
> directly. It is like an independent application.

In general, the position is simply being polled using a timer (checked
regularly).

Nicolas

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
jmz
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Callback from gstreamer to application

jmz
In reply to this post by deepthips
Hi,

I also want to develop a testplayer application linking with a playback.c library (GStreamer-based codes) to use functions such as play, stop, etc.
 
My testplayer calls playback_create function to create a new thread which invokes playback_main function. Then, the playback_main sets up pipeline and finally calls g_main_loop_run(). The testplayer will receive user commands in a while loop to manipulate several playback pipelines.

My first question is: is my design (creating a new thread which runs event loop) appropriate for this scenario?

My second question is: how does the testplayer control the pipeline? For example, how to design a playback_stop function to be used by testplayer for stopping a pipeline?

ps. I need to develop playback.c although gstplayer may be useful.

Thanks

Le mardi 31 janvier 2017 à 04:31 -0800, deepthips a écrit :
> I have a gstreamer code (say playback.c) with basic functions such as load,
> play, stop, seek etc.
> I have a testapp which will link the playback.c library and call those
> functions.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Callback from gstreamer to application

Nitin Mahajan
You may prefer to read open source player implementation, such as totem media player to start with (simple player).
That may answer many questions on user operations with multimedia playback.

Regards,
Nitin

On Wed, Jun 14, 2017 at 3:54 PM, jmz <[hidden email]> wrote:
Hi,

I also want to develop a testplayer application linking with a playback.c
library (GStreamer-based codes) to use functions such as play, stop, etc.

My testplayer calls playback_create function to create a new thread which
invokes playback_main function. Then, the playback_main sets up pipeline and
finally calls g_main_loop_run(). The testplayer will receive user commands
in a while loop to manipulate several playback pipelines.

My first question is: is my design (creating a new thread which runs event
loop) appropriate for this scenario?

My second question is: how does the testplayer control the pipeline? For
example, how to design a playback_stop function to be used by testplayer for
stopping a pipeline?

ps. I need to develop playback.c although gstplayer may be useful.

Thanks

Le mardi 31 janvier 2017 à 04:31 -0800, deepthips a écrit :
> I have a gstreamer code (say playback.c) with basic functions such as
> load,
> play, stop, seek etc.
> I have a testapp which will link the playback.c library and call those
> functions.



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Callback-from-gstreamer-to-application-tp4681667p4683376.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Thanks & Regards
--Nitin
Loading...