From 8ffeb3eb7c7e5738883f6c247330316753bf173e Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Mon, 26 Mar 2012 15:22:20 +0200 Subject: [PATCH] Expose ms2 MS_VIDEO_DECODER_FIRST_IMAGE_DECODED event to application --- coreapi/linphonecall.c | 8 +++++++- coreapi/linphonecore.h | 5 ++++- mediastreamer2 | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 4872a4cdc..bf96a0400 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -842,12 +842,18 @@ static void rendercb(void *data, const MSPicture *local, const MSPicture *remote #ifdef VIDEO_ENABLED static void video_stream_event_cb(void *user_pointer, const MSFilter *f, const unsigned int event_id, const void *args){ + LinphoneCall* call = (LinphoneCall*) user_pointer; ms_warning("In linphonecall.c: video_stream_event_cb"); switch (event_id) { case MS_VIDEO_DECODER_DECODING_ERRORS: ms_warning("Case is MS_VIDEO_DECODER_DECODING_ERRORS"); - linphone_call_send_vfu_request((LinphoneCall*) user_pointer); + linphone_call_send_vfu_request(call); break; + case MS_VIDEO_DECODER_FIRST_IMAGE_DECODED: + ms_message("First video frame decoded successfully"); + if (call->core->vtable.call_first_video_frame != NULL) + call->core->vtable.call_first_video_frame(call->core, call); + break; default: ms_warning("Unhandled event %i", event_id); break; diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 35fa25ad3..ea14d1596 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -613,7 +613,9 @@ typedef void (*DtmfReceived)(struct _LinphoneCore* lc, LinphoneCall *call, int d typedef void (*ReferReceived)(struct _LinphoneCore *lc, const char *refer_to); /** Callback prototype */ typedef void (*BuddyInfoUpdated)(struct _LinphoneCore *lc, LinphoneFriend *lf); - +/** Callback prototype */ +typedef void (*CallFirstVideoFrameCb)(struct _LinphoneCore *lc, LinphoneCall *call); + /** * This structure holds all callbacks that the application should implement. * None is mandatory. @@ -637,6 +639,7 @@ typedef struct _LinphoneVTable{ DisplayUrlCb display_url; ShowInterfaceCb show; /**< Notifies the application that it should show up*/ CallEncryptionChangedCb call_encryption_changed; /**