diff options
author | Autobuilder at buildslave-ubuntu-12-32 <magnus@alkit.se> | 2013-11-07 10:20:59 (GMT) |
---|---|---|
committer | Autobuilder at buildslave-ubuntu-12-32 <magnus@alkit.se> | 2013-11-07 10:20:59 (GMT) |
commit | 1dca74be3a40cb878cd284d3572fca020173113a (patch) | |
tree | 420716ac88856cc22e3f8df9e1c2c3240f8403c3 | |
parent | fb91e9aa1cfa84f471024ac8de63b2ffebf934cb (diff) | |
download | uscxml-1dca74be3a40cb878cd284d3572fca020173113a.zip uscxml-1dca74be3a40cb878cd284d3572fca020173113a.tar.gz uscxml-1dca74be3a40cb878cd284d3572fca020173113a.tar.bz2 |
multiple video streams
-rw-r--r-- | apps/samples/miles/miles.html | 6 | ||||
-rw-r--r-- | apps/samples/miles/miles.js | 1 | ||||
-rw-r--r-- | apps/samples/miles/miles.scxml | 6 | ||||
-rw-r--r-- | src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp | 41 | ||||
-rw-r--r-- | src/uscxml/plugins/invoker/miles/MilesSessionInvoker.h | 1 |
5 files changed, 29 insertions, 26 deletions
diff --git a/apps/samples/miles/miles.html b/apps/samples/miles/miles.html index 08cfeca..5028621 100644 --- a/apps/samples/miles/miles.html +++ b/apps/samples/miles/miles.html @@ -16,9 +16,9 @@ <script type="text/javascript"> require(["dojo/domReady!"], function(dom) { var milesSession1 = new Miles("miles1"); - var milesSession2 = new Miles("miles2"); - var milesSession3 = new Miles("miles3"); - var milesSession4 = new Miles("miles4"); + var milesSession2 = new Miles("miles2", {"scxmlURL": "localhost:8080", "reflectorIp": "88.131.107.12", "email": "user@smartvortex.eu", "problemName": "webconfero", "remoteEmail": "yetanother@smartvortex.eu"}); + var milesSession3 = new Miles("miles3", {"scxmlURL": "localhost:8080", "reflectorIp": "88.131.107.12", "email": "user@smartvortex.eu", "problemName": "webconfero", "remoteEmail": "stillanother@smartvortex.eu"}); + var milesSession4 = new Miles("miles4", {"scxmlURL": "localhost:8080", "reflectorIp": "88.131.107.12", "email": "user@smartvortex.eu", "problemName": "webconfero", "remoteEmail": "last@smartvortex.eu"}); }); </script> </head> diff --git a/apps/samples/miles/miles.js b/apps/samples/miles/miles.js index 4f31d68..9419a8e 100644 --- a/apps/samples/miles/miles.js +++ b/apps/samples/miles/miles.js @@ -60,6 +60,7 @@ function Miles(element, params) { if (params && params.reflectorIp) reflectorIp = params.reflectorIp; if (params && params.email) email = params.email; if (params && params.problemName) problemName = params.problemName; + if (params && params.remoteEmail) remoteEmail = params.remoteEmail; // called when dojo loaded all requirements below this.connect = function() { diff --git a/apps/samples/miles/miles.scxml b/apps/samples/miles/miles.scxml index 22ebdda..154e4d6 100644 --- a/apps/samples/miles/miles.scxml +++ b/apps/samples/miles/miles.scxml @@ -49,7 +49,7 @@ <send target="#_miles" event="start"> <param name="origin" expr="_event.origin" /> <param name="reflector" expr="_event.data.query.reflector" /> - <param name="userId" expr="_event.data.query.userid" /> + <param name="userid" expr="_event.data.query.userid" /> <param name="session" expr="_event.data.query.session" /> </send> @@ -58,7 +58,7 @@ <send target="#_miles" event="stop"> <param name="origin" expr="_event.origin" /> <param name="reflector" expr="_event.data.query.reflector" /> - <param name="userId" expr="_event.data.query.userid" /> + <param name="userid" expr="_event.data.query.userid" /> <param name="session" expr="_event.data.query.session" /> </send> @@ -72,7 +72,7 @@ <elseif cond="_event.data.pathComponent[1] === 'thumbnail'" /> <send target="#_miles" event="thumbnail"> <param name="origin" expr="_event.origin" /> - <param name="userId" expr="_event.data.query.userid" /> + <param name="userid" expr="_event.data.query.userid" /> </send> <!-- VIDEO ON ############### --> diff --git a/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp b/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp index dcefc0f..b36935c 100644 --- a/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp +++ b/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp @@ -437,31 +437,31 @@ void MilesSessionInvoker::processEventThumbnail(const std::string& origin, const ev.name = "thumbnail.reply"; - int has_thumb = 0; + struct thumb_entry *use_thumb = NULL; struct miles_rtp_in_stream *rtps; struct miles_list *p; struct thumb_entry *te; _mutex.lock(); - if(video_session->instreams) { - rtps = video_session->instreams->stream; - if(rtps) { - p = thumb_list; - while(p) { - te = (struct thumb_entry *)p->item; - if(te->ssrc == rtps->ssrc) { - break; - } - p = p->next; - } - if(p) { - has_thumb = 1; - ev.data.compound["image"] = Data(te->img_buf, te->img_size, "image/jpeg"); - } + // Find thumbnail of user + p = thumb_list; + while(p) { + te = (struct thumb_entry *)p->item; + if(te->userid && strcmp(te->userid, userid.c_str()) == 0) { + use_thumb = te; + break; } - } - if(!has_thumb) { - // Return empty face image - ev.data.compound["image"] = Data(imageContent.data(), imageContent.size(), "image/jpeg"); + if(te->userid==NULL && use_thumb == NULL) { + use_thumb = te; + } + p = p->next; + } + if(!p && use_thumb) + use_thumb->userid = strdup(userid.c_str()); + if(use_thumb) { + ev.data.compound["image"] = Data(use_thumb->img_buf, use_thumb->img_size, "image/jpeg"); + } else { + // Return empty face image + ev.data.compound["image"] = Data(imageContent.data(), imageContent.size(), "image/jpeg"); } _mutex.unlock(); @@ -845,6 +845,7 @@ int MilesSessionInvoker::video_receiver(struct miles_rtp_in_stream *rtp_stream, p = miles_list_append(thumb_list, te); te->ssrc = rtp_stream->ssrc; te->window_ctx = NULL; + te->userid = NULL; te->img_buf = (char *)malloc(bytes_read); te->buf_size = bytes_read; te->img_size = 0; diff --git a/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.h b/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.h index 552297c..fec2243 100644 --- a/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.h +++ b/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.h @@ -51,6 +51,7 @@ struct thumb_entry { int img_format; // JPEG or PNG image char *decode_buf; u_int32_t ssrc; + char *userid; // The user id assigned to the video stream void *window_ctx; // The context of the window popped up when the thumbnail is clicked. }; |