rtspserver how to dispose correctly
Lad, Prabhakar
prabhakar.csengg at gmail.com
Thu Mar 10 13:08:51 UTC 2016
Hi,
On Thu, Mar 10, 2016 at 10:02 AM, Serj TorresSoldado
<torres.soldado at gmail.com> wrote:
> Hi,
>
> I am using a rtspserver with an appsink element.
>
> I am currently having issues when trying to dispose and recreate a
> rtspserver. To delete the server I am doing to following operations:
>
> g_main_loop_quit()
> g_source_remove() to remove the source from attaching the server.
> g_main_loop_unref()
> g_object_unref(server)
>
> I can create a new server on the same port but I cant connect to it with a
> client.
>
> Also I had an issue when trying to delete the server while a client is
> connected, it would crash because a udpsrc element was stuck in the play
> state. As a workaround I am stopping the appsink "need-data" callback before
> destroying the server.
>
> I can't find any example of how to properly dispose of a server because the
> existing examples seem to depend on the main process exit.
>
Make sure you send a EOS first (if you have a queue in a pipeline have
flush-on-eos=true),
catch it on the bus handler then later do a mail_loop quit unref that object,
remove the factory (gst_rtsp_mount_points_remove_factory ()), unref
the mounts object,
unref the factory object and lastly unref the server object.
Cheers,
--Prabhakar Lad
More information about the gstreamer-devel
mailing list