Handling GStreamer used by another application

jmz jmzheng at gmail.com
Thu Jul 6 12:18:52 UTC 2017


Hi

I am developing a streamer application (as a library) based on GStreamer to
provide some multimedia services such as playback and recording. A user
application (app) can use the library to start, pause, and stop the
services.

To start services, user app asks the library to create a streamer object.
The object's construction process creates a context and main loop. Then a
thread is created and it runs the main loop. Finally, a pointer to the
object is returned to the app.

To stop services, user app calls g_object_unref() to destroy the streamer
object. The object's destruction process calls g_main_loop_quit(), the
thread frees the pipeline, and then the main loop (as well as the thread) is
stopped. The context is also freed.

When an error occurs in the pipeline (for example, output window was
closed), on_error callback in the streamer application is invoked to handle
it without notifying the user app of the error (this may not be
recommended). Shall I do any of the following in the on_error callback?

(a) do nothing
(b) change the pipeline state to NULL (or others?)
(c) invoke g_main_loop_quit()

If (a) or (b), a gst_element_get_state() called after
gst_element_set_state(pipeline, GST_STATE_PAUSED) will block. Why?
If (c), further changes made on the pipeline (requested by user app) may
fail because the streamer object has been destroyed.

Is it proper to use (c)?

Thanks for any suggestions or help.



--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Handling-GStreamer-used-by-another-application-tp4683710.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list