GstRTSPServer on two independent threads

watertreader watertreader at
Tue Apr 13 07:40:49 UTC 2021


I have some query about using of threads in GstRTSPServer library. 

My applications is required to perform two tasks:
   1) stream and record (at varied time) my camera 
   2) Play a file recorded (not neccessary the current file that is

They are expected to mount at two different locations.

My initial thought/attempt is to use threads (call it T1 and T2) for each of
the task. 

 I have done some some simple initilal trials using test-launch.c as my
baseline code in the GstRTSPServer examples folder in github (just modifying
the source in each case) and putting them in their own separate threads
(complete with their own GstRTSPMediaFactory. GstRTSPMountPoints,
GstRTSPAddressPool and etc)

My initial result is that only one thread can be fully functioning at any
point of time... ie if T1 works then T2 cannot work and vice versa. The
problem I have is with connecting the server to the context.. most of the
time the connection fails when GstRTSPServer is being attached to the
default context.

My 2nd attempt is to attach the thread GstRTSPServer to the thread created
context (by using g_main_context_new() ). But this time round I could not
get even one thread to be functioning

Is this the right approach to the problem? Should I merge the two threads
together ie having streaming from camera as my baseline pipeline,
attaching/detaching the record bin and the playback bin as needed?

Thanks for the advice

Sent from:

More information about the gstreamer-devel mailing list