<div dir="ltr">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.<div><br></div><div> I want to know your ideas about its correctness and how to commit this patch:<div><br></div><div>Root Cause:</div><div><br></div><div>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.</div><div><br></div><div>Solution:</div><div><br></div><div>To use the "MSID:LABEL" metadata in stream instead of its name. For example, in append_source_steams() function, change from:</div><div><br></div><div><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">if</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre"> (</span><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">ast_asprintf</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">(&stream_clone_name, </span><span class="gmail-pl-s" style="box-sizing:border-box;color:rgb(3,47,98);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre"><span class="gmail-pl-pds" style="box-sizing:border-box">"</span><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">%s</span>_<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">%s</span>_<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">%s</span><span class="gmail-pl-pds" style="box-sizing:border-box">"</span></span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">, SOFTBRIDGE_VIDEO_DEST_PREFIX,</span> </div><div>    <span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">channel_name, </span><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">ast_stream_get_name</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">(stream)) < </span><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">0</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">)</span> </div><div><br></div><div>TO:</div><div><br></div><div><span class="gmail-pl-k" style="box-sizing:border-box;color:rgb(215,58,73);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">if</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre"> (</span><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">ast_asprintf</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">(&stream_clone_name, </span><span class="gmail-pl-s" style="box-sizing:border-box;color:rgb(3,47,98);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre"><span class="gmail-pl-pds" style="box-sizing:border-box">"</span><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">%s</span>_<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">%s</span>_<span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197)">%s</span><span class="gmail-pl-pds" style="box-sizing:border-box">"</span></span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">, SOFTBRIDGE_VIDEO_DEST_PREFIX,</span>   <br></div><div>    <span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">channel_name, </span><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">ast_stream_get_metadata</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">(stream, "MSID:LABEL")) < </span><span class="gmail-pl-c1" style="box-sizing:border-box;color:rgb(0,92,197);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">0</span><span style="color:rgb(36,41,46);font-family:SFMono-Regular,Consolas,"Liberation Mono",Menlo,Courier,monospace;font-size:12px;white-space:pre">)</span> </div><div><br></div></div><div>Sincerely</div><div>Xiemin</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">Joshua C. Colp <<a href="mailto:jcolp@digium.com">jcolp@digium.com</a>> 于2018年11月27日周二 上午12:05写道:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Mon, Nov 26, 2018, at 11:55 AM, Xiemin Chen wrote:<br>
> ---------- Forwarded message ---------<br>
> From: Xiemin Chen <<a href="mailto:chenxiemin@gmail.com" target="_blank">chenxiemin@gmail.com</a>><br>
> Date: 2018年11月25日周日 下午11:19<br>
> Subject: Re: [asterisk-dev] How about to support multi video tracks of the<br>
> webrtc sfu?<br>
> To: <<a href="mailto:asterisk-dev@lists.digium.com" target="_blank">asterisk-dev@lists.digium.com</a>><br>
> <br>
> <br>
> It just workd with the two user's video-conference which both of them have<br>
> two video track separately. Now each one can see other's video and screen<br>
> sharing.<br>
> <br>
> For the test purpose, I just hard code the to_channel mapping in<br>
> the bridge_channel_handle_write() then everything seems go fine.<br>
> <br>
> Indeed, the code cannot run out-of-the-box and I want to know your ideas<br>
> about, anything difficult to have the correct mapping of the to_channel<br>
> vector? Or do I have any extra points missed to know its difficulty?<br>
> <br>
>         if (fr->stream_num == 6)<br>
>             num = 3;<br>
>         else if (fr->stream_num == 5)<br>
>             num = 4;<br>
>         else if (fr->stream_num == 3)<br>
>             num = 3;<br>
>         else if (fr->stream_num == 2)<br>
>             num = 4;<br>
> <br>
<br>
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.<br>
<br>
-- <br>
Joshua C. Colp<br>
Digium - A Sangoma Company | Senior Software Developer<br>
445 Jan Davis Drive NW - Huntsville, AL 35806 - US<br>
Check us out at: <a href="http://www.digium.com" rel="noreferrer" target="_blank">www.digium.com</a> & <a href="http://www.asterisk.org" rel="noreferrer" target="_blank">www.asterisk.org</a><br>
<br>
-- <br>
_____________________________________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" rel="noreferrer" target="_blank">http://www.api-digital.com</a> --<br>
<br>
Astricon is coming up October 9-11!  Signup is available at: <a href="https://www.asterisk.org/community/astricon-user-conference" rel="noreferrer" target="_blank">https://www.asterisk.org/community/astricon-user-conference</a><br>
<br>
asterisk-dev mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
   <a href="http://lists.digium.com/mailman/listinfo/asterisk-dev" rel="noreferrer" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-dev</a></blockquote></div>