[asterisk-dev] Fwd: How about to support multi video tracks of the webrtc sfu?

Xiemin Chen chenxiemin at gmail.com
Tue Dec 4 09:48:56 CST 2018


At last I find the root cause and have a path with it, after my test seems
everything works fine with only a few lines of code change.

 I want to know your ideas about its correctness and how to commit this
patch:

Root Cause:

Different video streams have the same name(ast_stream_get_name() returns
"video" for every video stream) which causes the is_video_dest() function
in bridge_softmix.c fails to distinguish different video streams.

Solution:

To use the "MSID:LABEL" metadata in stream instead of its name. For
example, in append_source_steams() function, change from:

if (ast_asprintf(&stream_clone_name, "%s_%s_%s",
SOFTBRIDGE_VIDEO_DEST_PREFIX,
    channel_name, ast_stream_get_name(stream)) < 0)

TO:

if (ast_asprintf(&stream_clone_name, "%s_%s_%s",
SOFTBRIDGE_VIDEO_DEST_PREFIX,
    channel_name, ast_stream_get_metadata(stream, "MSID:LABEL")) < 0)

Sincerely
Xiemin


Joshua C. Colp <jcolp at digium.com> 于2018年11月27日周二 上午12:05写道:

> On Mon, Nov 26, 2018, at 11:55 AM, Xiemin Chen wrote:
> > ---------- Forwarded message ---------
> > From: Xiemin Chen <chenxiemin at gmail.com>
> > Date: 2018年11月25日周日 下午11:19
> > Subject: Re: [asterisk-dev] How about to support multi video tracks of
> the
> > webrtc sfu?
> > To: <asterisk-dev at lists.digium.com>
> >
> >
> > It just workd with the two user's video-conference which both of them
> have
> > two video track separately. Now each one can see other's video and screen
> > sharing.
> >
> > For the test purpose, I just hard code the to_channel mapping in
> > the bridge_channel_handle_write() then everything seems go fine.
> >
> > Indeed, the code cannot run out-of-the-box and I want to know your ideas
> > about, anything difficult to have the correct mapping of the to_channel
> > vector? Or do I have any extra points missed to know its difficulty?
> >
> >         if (fr->stream_num == 6)
> >             num = 3;
> >         else if (fr->stream_num == 5)
> >             num = 4;
> >         else if (fr->stream_num == 3)
> >             num = 3;
> >         else if (fr->stream_num == 2)
> >             num = 4;
> >
>
> It's not something I've thought about so I don't really know what things
> may occur - I can say, though, that the stream names to actually calculate
> the proper mapping may collide and cause a problem.
>
> --
> Joshua C. Colp
> Digium - A Sangoma Company | Senior Software Developer
> 445 Jan Davis Drive NW - Huntsville, AL 35806 - US
> Check us out at: www.digium.com & www.asterisk.org
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> Astricon is coming up October 9-11!  Signup is available at:
> https://www.asterisk.org/community/astricon-user-conference
>
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20181204/cfe7dafc/attachment.html>


More information about the asterisk-dev mailing list