Commit acade627 authored by Simon Morlat's avatar Simon Morlat

Add new method...

Add new method 'linphone_call_request_notify_next_video_frame_decoded(LinphoneCall *call)' that is missing to compensate the deprecation of linphone_call_set_next_video_frame_decoded_callback().
Due to this lack, some tests were failed.
parent 794bd7b5
......@@ -258,7 +258,13 @@ LINPHONE_PUBLIC void linphone_call_set_authentication_token_verified (LinphoneCa
**/
LINPHONE_PUBLIC void linphone_call_send_vfu_request (LinphoneCall *call);
LINPHONE_PUBLIC void linphone_call_set_next_video_frame_decoded_callback (LinphoneCall *call, LinphoneCallCbFunc cb, void *ud);
/**
* Request the callback passed to linphone_call_cbs_set_next_video_frame_decoded() to be called the next time the video decoder properly decodes a video frame.
* @param call the #LinphoneCall
**/
LINPHONE_PUBLIC void linphone_call_request_notify_next_video_frame_decoded(LinphoneCall *call);
LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_call_set_next_video_frame_decoded_callback (LinphoneCall *call, LinphoneCallCbFunc cb, void *ud);
/**
* Returns the current transfer state, if a transfer has been initiated from this call.
......
......@@ -364,6 +364,10 @@ void linphone_call_set_next_video_frame_decoded_callback (LinphoneCall *call, Li
L_GET_CPP_PTR_FROM_C_OBJECT(call)->setNextVideoFrameDecodedCallback(cb, ud);
}
void linphone_call_request_notify_next_video_frame_decoded(LinphoneCall *call){
L_GET_CPP_PTR_FROM_C_OBJECT(call)->requestNotifyNextVideoFrameDecoded();
}
LinphoneCallState linphone_call_get_transfer_state (LinphoneCall *call) {
return static_cast<LinphoneCallState>(L_GET_CPP_PTR_FROM_C_OBJECT(call)->getTransferState());
}
......
......@@ -67,7 +67,7 @@ public:
void stopMediaStreams ();
private:
void resetFirstVideoFrameDecoded ();
void requestNotifyNextVideoFrameDecoded ();
void startRemoteRing ();
void terminateBecauseOfLostMedia ();
......
......@@ -148,12 +148,6 @@ void CallPrivate::stopMediaStreams () {
// -----------------------------------------------------------------------------
void CallPrivate::resetFirstVideoFrameDecoded () {
#ifdef VIDEO_ENABLED
if (nextVideoFrameDecoded._func)
static_pointer_cast<MediaSession>(getActiveSession())->resetFirstVideoFrameDecoded();
#endif // ifdef VIDEO_ENABLED
}
void CallPrivate::startRemoteRing () {
L_Q();
......@@ -419,7 +413,16 @@ void CallPrivate::onFirstVideoFrameDecoded (const shared_ptr<CallSession> &sessi
}
void CallPrivate::onResetFirstVideoFrameDecoded (const shared_ptr<CallSession> &session) {
resetFirstVideoFrameDecoded();
/*we are called here by the MediaSession when the stream start to know whether there is the deprecated nextVideoFrameDecoded callback set,
* so that we can request the notification of the next frame decoded.*/
#ifdef VIDEO_ENABLED
if (nextVideoFrameDecoded._func)
requestNotifyNextVideoFrameDecoded();
#endif // ifdef VIDEO_ENABLED
}
void CallPrivate::requestNotifyNextVideoFrameDecoded(){
static_pointer_cast<MediaSession>(getActiveSession())->requestNotifyNextVideoFrameDecoded();
}
void CallPrivate::onPlayErrorTone (const shared_ptr<CallSession> &session, LinphoneReason reason) {
......@@ -924,7 +927,12 @@ void Call::setNextVideoFrameDecodedCallback (LinphoneCallCbFunc cb, void *user_d
L_D();
d->nextVideoFrameDecoded._func = cb;
d->nextVideoFrameDecoded._user_data = user_data;
d->resetFirstVideoFrameDecoded();
d->requestNotifyNextVideoFrameDecoded();
}
void Call::requestNotifyNextVideoFrameDecoded (){
L_D();
d->requestNotifyNextVideoFrameDecoded();
}
void Call::setParams (const MediaSessionParams *msp) {
......
......@@ -123,6 +123,7 @@ public:
void setMicrophoneVolumeGain (float value);
void setNativeVideoWindowId (void *id);
void setNextVideoFrameDecodedCallback (LinphoneCallCbFunc cb, void *user_data);
void requestNotifyNextVideoFrameDecoded();
void setParams (const MediaSessionParams *msp);
void setSpeakerVolumeGain (float value);
......
......@@ -4234,10 +4234,6 @@ void MediaSession::sendVfuRequest () {
L_D();
MediaSessionParams *curParams = getCurrentParams();
if (d->videoStream && d->videoStream->ms.decoder) {
ms_filter_call_method_noarg(d->videoStream->ms.decoder, MS_VIDEO_DECODER_RESET_FIRST_IMAGE_NOTIFICATION);
}
if ((curParams->avpfEnabled() || curParams->getPrivate()->implicitRtcpFbEnabled())
&& d->videoStream && media_stream_get_state(&d->videoStream->ms) == MSStreamStarted) { // || sal_media_description_has_implicit_avpf((const SalMediaDescription *)call->resultdesc)
lInfo() << "Request Full Intra Request on CallSession [" << this << "]";
......@@ -4369,7 +4365,7 @@ LinphoneStatus MediaSession::update (const MediaSessionParams *msp, const string
// -----------------------------------------------------------------------------
void MediaSession::resetFirstVideoFrameDecoded () {
void MediaSession::requestNotifyNextVideoFrameDecoded () {
L_D();
if (d->videoStream && d->videoStream->ms.decoder)
ms_filter_call_method_noarg(d->videoStream->ms.decoder, MS_VIDEO_DECODER_RESET_FIRST_IMAGE_NOTIFICATION);
......
......@@ -63,7 +63,7 @@ public:
void terminateBecauseOfLostMedia ();
LinphoneStatus update (const MediaSessionParams *msp, const std::string &subject = "");
void resetFirstVideoFrameDecoded ();
void requestNotifyNextVideoFrameDecoded ();
LinphoneStatus takePreviewSnapshot (const std::string& file);
LinphoneStatus takeVideoSnapshot (const std::string& file);
void zoomVideo (float zoomFactor, float *cx, float *cy);
......
......@@ -55,7 +55,7 @@ static void call_multicast_base(bool_t video) {
BC_ASSERT_GREATER(linphone_core_manager_get_max_audio_down_bw(marie),70,int,"%d");
if (video) {
/*check video path*/
linphone_call_set_first_video_frame_decoded_cb(linphone_core_get_current_call(marie->lc));
liblinphone_tester_set_next_video_frame_decoded_cb(linphone_core_get_current_call(marie->lc));
linphone_call_send_vfu_request(linphone_core_get_current_call(marie->lc));
BC_ASSERT_TRUE( wait_for(marie->lc,pauline->lc,&marie->stat.number_of_IframeDecoded,1));
}
......@@ -149,7 +149,7 @@ static void early_media_with_multicast_base(bool_t video) {
/* send a 183 to initiate the early media */
if (video) {
/*check video path*/
linphone_call_set_first_video_frame_decoded_cb(linphone_core_get_current_call(pauline->lc));
liblinphone_tester_set_next_video_frame_decoded_cb(linphone_core_get_current_call(pauline->lc));
}
linphone_call_accept_early_media(linphone_core_get_current_call(pauline->lc));
......@@ -160,7 +160,7 @@ static void early_media_with_multicast_base(bool_t video) {
/* send a 183 to initiate the early media */
if (video) {
/*check video path*/
linphone_call_set_first_video_frame_decoded_cb(linphone_core_get_current_call(pauline2->lc));
liblinphone_tester_set_next_video_frame_decoded_cb(linphone_core_get_current_call(pauline2->lc));
}
linphone_call_accept_early_media(linphone_core_get_current_call(pauline2->lc));
......
......@@ -186,11 +186,15 @@ static void linphone_call_next_video_frame_decoded_cb(LinphoneCall *call) {
counters->number_of_IframeDecoded++;
}
void linphone_call_set_first_video_frame_decoded_cb(LinphoneCall *call) {
LinphoneCallCbs *call_cbs = linphone_factory_create_call_cbs(linphone_factory_get());
linphone_call_cbs_set_next_video_frame_decoded(call_cbs, linphone_call_next_video_frame_decoded_cb);
linphone_call_add_callbacks(call, call_cbs);
linphone_call_cbs_unref(call_cbs);
void liblinphone_tester_set_next_video_frame_decoded_cb(LinphoneCall *call) {
if (belle_sip_object_data_get(BELLE_SIP_OBJECT(call), "next_video_frame_decoded_set") == NULL){
LinphoneCallCbs *call_cbs = linphone_factory_create_call_cbs(linphone_factory_get());
linphone_call_cbs_set_next_video_frame_decoded(call_cbs, linphone_call_next_video_frame_decoded_cb);
linphone_call_add_callbacks(call, call_cbs);
linphone_call_cbs_unref(call_cbs);
belle_sip_object_data_set(BELLE_SIP_OBJECT(call), "next_video_frame_decoded_set", (void*)1, NULL);
}
linphone_call_request_notify_next_video_frame_decoded(call);
}
#define reset_call_stats(var, value) \
......
......@@ -276,7 +276,7 @@ bool_t request_video(LinphoneCoreManager* caller,LinphoneCoreManager* callee, bo
}
if (video_added) {
linphone_call_set_first_video_frame_decoded_cb(call_obj);
liblinphone_tester_set_next_video_frame_decoded_cb(call_obj);
/*send vfu*/
linphone_call_send_vfu_request(call_obj);
BC_ASSERT_TRUE(wait_for(caller->lc,callee->lc,&callee->stat.number_of_IframeDecoded,initial_callee_stat.number_of_IframeDecoded+1));
......@@ -600,7 +600,7 @@ void video_call_base_2(LinphoneCoreManager* caller,LinphoneCoreManager* callee,
BC_ASSERT_TRUE(linphone_call_log_video_enabled(linphone_call_get_call_log(caller_call)));
/*check video path*/
linphone_call_set_first_video_frame_decoded_cb(callee_call);
liblinphone_tester_set_next_video_frame_decoded_cb(callee_call);
linphone_call_send_vfu_request(callee_call);
BC_ASSERT_TRUE( wait_for(callee->lc,caller->lc,&callee->stat.number_of_IframeDecoded,1));
} else {
......@@ -623,8 +623,8 @@ static void check_fir(LinphoneCoreManager* caller,LinphoneCoreManager* callee ){
/*check video path is established in both directions.
Indeed, FIR are ignored until the first RTP packet is received, because SSRC is not known.*/
linphone_call_set_first_video_frame_decoded_cb(callee_call);
linphone_call_set_first_video_frame_decoded_cb(caller_call);
liblinphone_tester_set_next_video_frame_decoded_cb(callee_call);
liblinphone_tester_set_next_video_frame_decoded_cb(caller_call);
BC_ASSERT_TRUE( wait_for(callee->lc,caller->lc,&callee->stat.number_of_IframeDecoded,1));
BC_ASSERT_TRUE( wait_for(callee->lc,caller->lc,&caller->stat.number_of_IframeDecoded,1));
......@@ -640,7 +640,7 @@ static void check_fir(LinphoneCoreManager* caller,LinphoneCoreManager* callee ){
ms_message("check_fir: [%p] received %d FIR ",&caller_call ,caller_vstream->ms_video_stat.counter_rcvd_fir);
ms_message("check_fir: [%p] stat number of iframe decoded %d ",&callee_call, callee->stat.number_of_IframeDecoded);
linphone_call_set_first_video_frame_decoded_cb(caller_call);
liblinphone_tester_set_next_video_frame_decoded_cb(caller_call);
linphone_call_send_vfu_request(caller_call);
BC_ASSERT_TRUE( wait_for(callee->lc,caller->lc,&caller->stat.number_of_IframeDecoded,1));
......@@ -669,6 +669,12 @@ void video_call_base_3(LinphoneCoreManager* caller,LinphoneCoreManager* callee,
linphone_core_set_video_policy(callee->lc,&callee_policy);
linphone_core_set_video_policy(caller->lc,&caller_policy);
}
linphone_core_set_preferred_video_size_by_name(caller->lc, "QVGA");
linphone_core_set_preferred_video_size_by_name(callee->lc, "QVGA");
linphone_core_set_video_device(caller->lc, "Mire: Mire (synthetic moving picture)");
linphone_core_set_video_device(callee->lc, "Mire: Mire (synthetic moving picture)");
linphone_core_enable_video_display(callee->lc, callee_video_enabled);
linphone_core_enable_video_capture(callee->lc, callee_video_enabled);
......@@ -879,8 +885,8 @@ static void video_call_established_by_reinvite_with_implicit_avpf(void) {
BC_ASSERT_TRUE(linphone_call_params_video_enabled(linphone_call_get_current_params(callee_call)));
BC_ASSERT_TRUE(linphone_call_params_video_enabled(linphone_call_get_current_params(caller_call)));
linphone_call_set_first_video_frame_decoded_cb(caller_call);
linphone_call_set_first_video_frame_decoded_cb(callee_call);
liblinphone_tester_set_next_video_frame_decoded_cb(caller_call);
liblinphone_tester_set_next_video_frame_decoded_cb(callee_call);
BC_ASSERT_TRUE( wait_for(callee->lc,caller->lc,&callee->stat.number_of_IframeDecoded,1));
BC_ASSERT_TRUE( wait_for(callee->lc,caller->lc,&caller->stat.number_of_IframeDecoded,1));
......@@ -1329,7 +1335,7 @@ static void accept_call_in_send_only_base(LinphoneCoreManager* pauline, Linphone
/*The send-only client shall set rtp symmetric in absence of media relay for this test.*/
lp_config_set_int(linphone_core_get_config(marie->lc),"rtp","symmetric",1);
linphone_call_set_first_video_frame_decoded_cb(linphone_core_invite_address(pauline->lc,marie->identity));
liblinphone_tester_set_next_video_frame_decoded_cb(linphone_core_invite_address(pauline->lc,marie->identity));
BC_ASSERT_TRUE(wait_for_list(lcs, &marie->stat.number_of_LinphoneCallIncomingReceived,1,DEFAULT_WAIT_FOR));
......@@ -1420,8 +1426,6 @@ static void video_early_media_call(void) {
LinphoneCoreManager *pauline = linphone_core_manager_new("pauline_rc");
LinphoneCall *pauline_to_marie;
linphone_core_set_video_device(pauline->lc, "Mire: Mire (synthetic moving picture)");
video_call_base_3(pauline, marie, TRUE, LinphoneMediaEncryptionNone, TRUE, TRUE);
BC_ASSERT_PTR_NOT_NULL(pauline_to_marie = linphone_core_get_current_call(pauline->lc));
......
......@@ -410,7 +410,7 @@ void account_manager_destroy(void);
LinphoneAddress *account_manager_get_identity_with_modified_identity(const LinphoneAddress *modified_identity);
LinphoneCore *configure_lc_from(LinphoneCoreCbs *cbs, const char *path, const char *file, void *user_data);
void linphone_call_set_first_video_frame_decoded_cb(LinphoneCall *call);
void liblinphone_tester_set_next_video_frame_decoded_cb(LinphoneCall *call);
void call_paused_resumed_base(bool_t multicast,bool_t with_losses);
void simple_call_base(bool_t enable_multicast_recv_side);
void call_base_with_configfile(LinphoneMediaEncryption mode, bool_t enable_video,bool_t enable_relay,LinphoneFirewallPolicy policy,bool_t enable_tunnel, const char *marie_rc, const char *pauline_rc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment