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 /src/uscxml/plugins | |
parent | fb91e9aa1cfa84f471024ac8de63b2ffebf934cb (diff) | |
download | uscxml-1dca74be3a40cb878cd284d3572fca020173113a.zip uscxml-1dca74be3a40cb878cd284d3572fca020173113a.tar.gz uscxml-1dca74be3a40cb878cd284d3572fca020173113a.tar.bz2 |
multiple video streams
Diffstat (limited to 'src/uscxml/plugins')
-rw-r--r-- | src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp | 41 | ||||
-rw-r--r-- | src/uscxml/plugins/invoker/miles/MilesSessionInvoker.h | 1 |
2 files changed, 22 insertions, 20 deletions
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. }; |