how to use appsrc in pipeline to rtsp-server

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

how to use appsrc in pipeline to rtsp-server

os_developer
What is the proper way to pass a GstBin or GstElement as the pipeline instead of using a launch string?

I'm trying to use a pipeline as:

appsrc ! ffmpegcolorspace ! x264enc ! rtph264pay

But it isn't clear to me exactly what is required for implementing my own version of GstRTSPMediaFactoryClass  create_pipeline and get_element.  

I create my own pipeline element (m_pipeline), then add and link the plugins, and return the m_pipeline pointer in create_pipeline and get_element.  However, it seems however I tweak things, I always end up with errors relating to either not having a top-level bin, or not being able to pre-roll, etc.  When I try to hook up the appsrc callbacks using gst_app_src_set_callbacks(), my callbacks are never called. Without the callbacks, I am using a loop where I pass frames of data to appsrc, but only the first 3 seem to go through before it errors saying it is full, but nothing ever appears on the client end of the stream.

I know my pipeline is valid because I can use it in a stand-alone app that doesn't use the rtsp-server.  I am assuming I'm missing some configuration somewhere but can't seem to figure out what it is.  If I just a multifilesrc in place of appsrc and pass a launch string using the ...set_launch() function, it works great.

Any ideas on where I could look for examples of overriding create_pipeline and the other methods in the factory?

Thanks,
Andrea