A question about multiple players

Ben Rush ben at ben-rush.net
Fri Sep 6 21:21:30 UTC 2019


I have. Things look similar. I'll keep looking.

Question: is there a reason you're not using the main loop? Have you seen
it improve stability?

On Fri, Sep 6, 2019, 4:19 PM David Ing <ding at panopto.com> wrote:

> I do not use `gst_parse_launch`, `gst_bus_add_watch`, or anything related
> to GMainLoop.  I am not familiar enough to give you stronger advice.
>
> You might want to look through the samples and tutorials (many of which
> use a GMailLoop) if you haven't done that already.
>
>
>
> On Fri, Sep 6, 2019 at 2:08 PM Ben Rush <ben at ben-rush.net> wrote:
>
>> Do I need a different context for each main loop? Do the steps leading up
>> to 8 look okay?
>>
>> Your advice about the PDBs was invaluable today, by the way. When I track
>> all bits of this down I'll send out an update.
>>
>>
>> On Fri, Sep 6, 2019, 3:51 PM David Ing <ding at panopto.com> wrote:
>>
>>> Steps 8-10 are in the correct order (my code does it that way).
>>>
>>> But I don't have a step 11 because I don't use a GMainLoop.  I would
>>> guess that the main loop should stop before step 8 but I am only guessing.
>>>
>>> On Fri, Sep 6, 2019 at 1:32 PM Ben Rush <ben at ben-rush.net> wrote:
>>>
>>>> I have a need to put multiple video windows in a single application.
>>>> This means multiple pipelines. For example, the RTSP URL is different for
>>>> each player, and so I get a new pipeline for each invocation
>>>> of gst_parse_launch.
>>>>
>>>> I can share code, but in general: what is the best way to do this? The
>>>> way I'm doing this now (for EACH player I've instantiated in the SAME app):
>>>>
>>>> 1) gst_parse_launch, get back the pipeline,
>>>> 2) gst_pipeline_get_bus, to create a bus on this pipeline.
>>>> 3) g_main_loop_new(NULL, FALSE) to create a new loop (this is where my
>>>> main question is at)
>>>> 4) gst_bus_add_watch to create an add watch on this pipeline,
>>>> 5) gst_element_set_state to set my pipeline state to GST_STATE_PLAYING
>>>> 6) g_main_loop_run on the loop returned from #3
>>>> 7) Then I play until a stop is issued....
>>>> 8) gst_element_set_state(pipeline, GST_STATE_NULL)
>>>> 9) unref the bus,
>>>> 10) unref the pipeline
>>>> 11) unref the loop
>>>>
>>>> I ask about this order, and the fact I'm creating a new loop without an
>>>> independent context because I'm getting some random crashes in my app
>>>> hosting multiple players, and it appears to be during tear down. In
>>>> general, is this pattern acceptable, or have I committed a sin somewhere?
>>>> _______________________________________________
>>>> gstreamer-devel mailing list
>>>> gstreamer-devel at lists.freedesktop.org
>>>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>>
>>> _______________________________________________
>>> gstreamer-devel mailing list
>>> gstreamer-devel at lists.freedesktop.org
>>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20190906/f7a8e4ff/attachment.html>


More information about the gstreamer-devel mailing list