Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
8958c8ac
Commit
8958c8ac
authored
Apr 30, 2018
by
Sylvain Berfini
🐮
Browse files
Applied from master callback for next video frame decoded
parent
ab06d514
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
68 additions
and
21 deletions
+68
-21
coreapi/private_functions.h
coreapi/private_functions.h
+1
-0
include/linphone/api/c-call-cbs.h
include/linphone/api/c-call-cbs.h
+14
-0
include/linphone/api/c-callbacks.h
include/linphone/api/c-callbacks.h
+6
-0
src/c-wrapper/api/c-call-cbs.cpp
src/c-wrapper/api/c-call-cbs.cpp
+9
-0
src/c-wrapper/api/c-call.cpp
src/c-wrapper/api/c-call.cpp
+4
-0
src/call/call.cpp
src/call/call.cpp
+1
-0
src/conference/session/media-session.cpp
src/conference/session/media-session.cpp
+5
-0
tester/call_multicast_tester.c
tester/call_multicast_tester.c
+3
-3
tester/call_single_tester.c
tester/call_single_tester.c
+16
-6
tester/call_video_tester.c
tester/call_video_tester.c
+8
-11
tester/liblinphone_tester.h
tester/liblinphone_tester.h
+1
-1
No files found.
coreapi/private_functions.h
View file @
8958c8ac
...
...
@@ -50,6 +50,7 @@ void linphone_call_notify_info_message_received(LinphoneCall *call, const Linpho
void
linphone_call_notify_ack_processing
(
LinphoneCall
*
call
,
LinphoneHeaders
*
msg
,
bool_t
is_received
);
void
linphone_call_notify_tmmbr_received
(
LinphoneCall
*
call
,
int
stream_index
,
int
tmmbr
);
void
linphone_call_notify_snapshot_taken
(
LinphoneCall
*
call
,
const
char
*
file_path
);
void
linphone_call_notify_next_video_frame_decoded
(
LinphoneCall
*
call
);
LinphoneCall
*
linphone_call_new_outgoing
(
struct
_LinphoneCore
*
lc
,
const
LinphoneAddress
*
from
,
const
LinphoneAddress
*
to
,
const
LinphoneCallParams
*
params
,
LinphoneProxyConfig
*
cfg
);
LinphoneCall
*
linphone_call_new_incoming
(
struct
_LinphoneCore
*
lc
,
const
LinphoneAddress
*
from
,
const
LinphoneAddress
*
to
,
LinphonePrivate
::
SalCallOp
*
op
);
...
...
include/linphone/api/c-call-cbs.h
View file @
8958c8ac
...
...
@@ -187,6 +187,20 @@ LINPHONE_PUBLIC LinphoneCallCbsSnapshotTakenCb linphone_call_cbs_get_snapshot_ta
*/
LINPHONE_PUBLIC
void
linphone_call_cbs_set_snapshot_taken
(
LinphoneCallCbs
*
cbs
,
LinphoneCallCbsSnapshotTakenCb
cb
);
/**
* Get the next video frame decoded callback.
* @param[in] cbs LinphoneCallCbs object.
* @return The current next video frame decoded callback.
*/
LINPHONE_PUBLIC
LinphoneCallCbsNextVideoFrameDecodedCb
linphone_call_cbs_get_next_video_frame_decoded
(
LinphoneCallCbs
*
cbs
);
/**
* Set the next video frame decoded callback.
* @param[in] cbs LinphoneCallCbs object.
* @param[in] cb The next video frame decoded callback to be used.
*/
LINPHONE_PUBLIC
void
linphone_call_cbs_set_next_video_frame_decoded
(
LinphoneCallCbs
*
cbs
,
LinphoneCallCbsNextVideoFrameDecodedCb
cb
);
/**
* @}
*/
...
...
include/linphone/api/c-callbacks.h
View file @
8958c8ac
...
...
@@ -102,6 +102,12 @@ typedef void (*LinphoneCallCbsTmmbrReceivedCb)(LinphoneCall *call, int stream_in
*/
typedef
void
(
*
LinphoneCallCbsSnapshotTakenCb
)(
LinphoneCall
*
call
,
const
char
*
filepath
);
/**
* Callback to notify a next video frame has been decoded
* @param call LinphoneCall for which the next video frame has been decoded
*/
typedef
void
(
*
LinphoneCallCbsNextVideoFrameDecodedCb
)(
LinphoneCall
*
call
);
/**
* @}
**/
...
...
src/c-wrapper/api/c-call-cbs.cpp
View file @
8958c8ac
...
...
@@ -35,6 +35,7 @@ struct _LinphoneCallCbs {
LinphoneCallCbsAckProcessingCb
ackProcessing
;
LinphoneCallCbsTmmbrReceivedCb
tmmbrReceivedCb
;
LinphoneCallCbsSnapshotTakenCb
snapshotTakenCb
;
LinphoneCallCbsNextVideoFrameDecodedCb
nextVideoFrameDecodedCb
;
};
BELLE_SIP_DECLARE_VPTR_NO_EXPORT
(
LinphoneCallCbs
);
...
...
@@ -142,3 +143,11 @@ LinphoneCallCbsSnapshotTakenCb linphone_call_cbs_get_snapshot_taken(LinphoneCall
void
linphone_call_cbs_set_snapshot_taken
(
LinphoneCallCbs
*
cbs
,
LinphoneCallCbsSnapshotTakenCb
cb
)
{
cbs
->
snapshotTakenCb
=
cb
;
}
LinphoneCallCbsNextVideoFrameDecodedCb
linphone_call_cbs_get_next_video_frame_decoded
(
LinphoneCallCbs
*
cbs
)
{
return
cbs
->
nextVideoFrameDecodedCb
;
}
void
linphone_call_cbs_set_next_video_frame_decoded
(
LinphoneCallCbs
*
cbs
,
LinphoneCallCbsNextVideoFrameDecodedCb
cb
)
{
cbs
->
nextVideoFrameDecodedCb
=
cb
;
}
src/c-wrapper/api/c-call.cpp
View file @
8958c8ac
...
...
@@ -188,6 +188,10 @@ void linphone_call_notify_snapshot_taken(LinphoneCall *call, const char *file_pa
NOTIFY_IF_EXIST
(
SnapshotTaken
,
snapshot_taken
,
call
,
file_path
)
}
void
linphone_call_notify_next_video_frame_decoded
(
LinphoneCall
*
call
)
{
NOTIFY_IF_EXIST
(
NextVideoFrameDecoded
,
next_video_frame_decoded
,
call
)
}
// =============================================================================
// Public functions.
// =============================================================================
...
...
src/call/call.cpp
View file @
8958c8ac
...
...
@@ -418,6 +418,7 @@ void CallPrivate::onFirstVideoFrameDecoded (const shared_ptr<CallSession> &sessi
nextVideoFrameDecoded
.
_func
=
nullptr
;
nextVideoFrameDecoded
.
_user_data
=
nullptr
;
}
linphone_call_notify_next_video_frame_decoded
(
L_GET_C_BACK_PTR
(
q
));
}
void
CallPrivate
::
onResetFirstVideoFrameDecoded
(
const
shared_ptr
<
CallSession
>
&
session
)
{
...
...
src/conference/session/media-session.cpp
View file @
8958c8ac
...
...
@@ -4227,6 +4227,11 @@ void MediaSession::sendVfuRequest () {
#ifdef VIDEO_ENABLED
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
<<
"]"
;
...
...
tester/call_multicast_tester.c
View file @
8958c8ac
...
...
@@ -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_
nex
t_video_frame_decoded_c
allback
(
linphone_core_get_current_call
(
marie
->
lc
)
,
linphone_call_iframe_decoded_cb
,
marie
->
lc
);
linphone_call_set_
firs
t_video_frame_decoded_c
b
(
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_
nex
t_video_frame_decoded_c
allback
(
linphone_core_get_current_call
(
pauline
->
lc
)
,
linphone_call_iframe_decoded_cb
,
pauline
->
lc
);
linphone_call_set_
firs
t_video_frame_decoded_c
b
(
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_
nex
t_video_frame_decoded_c
allback
(
linphone_core_get_current_call
(
pauline2
->
lc
)
,
linphone_call_iframe_decoded_cb
,
pauline2
->
lc
);
linphone_call_set_
firs
t_video_frame_decoded_c
b
(
linphone_core_get_current_call
(
pauline2
->
lc
));
}
linphone_call_accept_early_media
(
linphone_core_get_current_call
(
pauline2
->
lc
));
...
...
tester/call_single_tester.c
View file @
8958c8ac
...
...
@@ -173,12 +173,12 @@ void linphone_transfer_state_changed(LinphoneCore *lc, LinphoneCall *transfered,
}
void
linphone_call_
i
frame_decoded_cb
(
LinphoneCall
*
call
,
void
*
user_data
)
{
LinphoneCallLog
*
c
all
log
=
linphone_call_get_call_log
(
call
);
char
*
to
=
linphone_address_as_string
(
linphone_call_log_get_to
(
c
all
log
));
char
*
from
=
linphone_address_as_string
(
linphone_call_log_get_
from
(
call
log
));
static
void
linphone_call_
next_video_
frame_decoded_cb
(
LinphoneCall
*
call
)
{
LinphoneCallLog
*
clog
=
linphone_call_get_call_log
(
call
);
char
*
to
=
linphone_address_as_string
(
linphone_call_log_get_to
(
clog
));
char
*
from
=
linphone_address_as_string
(
linphone_call_log_get_
to
(
c
log
));
stats
*
counters
;
LinphoneCore
*
lc
=
(
L
inphone
Core
*
)
user_data
;
LinphoneCore
*
lc
=
l
inphone
_call_get_core
(
call
)
;
ms_message
(
"call from [%s] to [%s] receive iFrame"
,
from
,
to
);
ms_free
(
to
);
ms_free
(
from
);
...
...
@@ -186,6 +186,13 @@ void linphone_call_iframe_decoded_cb(LinphoneCall *call,void * user_data) {
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
);
}
#define reset_call_stats(var, value) \
if (var) linphone_call_stats_unref(var); \
var = value
...
...
@@ -3655,9 +3662,12 @@ void check_media_direction(LinphoneCoreManager* mgr, LinphoneCall *call, bctbx_l
LinphoneCallStats
*
stats
=
linphone_call_get_video_stats
(
call
);
if
(
video_dir
!=
LinphoneMediaDirectionInactive
){
LinphoneCallCbs
*
call_cbs
=
linphone_factory_create_call_cbs
(
linphone_factory_get
());
BC_ASSERT_TRUE
(
linphone_call_params_video_enabled
(
params
));
BC_ASSERT_EQUAL
(
linphone_call_params_get_video_direction
(
params
),
video_dir
,
int
,
"%d"
);
linphone_call_set_next_video_frame_decoded_callback
(
call
,
linphone_call_iframe_decoded_cb
,
mgr
->
lc
);
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
);
linphone_call_send_vfu_request
(
call
);
}
switch
(
video_dir
)
{
...
...
tester/call_video_tester.c
View file @
8958c8ac
...
...
@@ -275,7 +275,7 @@ bool_t request_video(LinphoneCoreManager* caller,LinphoneCoreManager* callee, bo
}
if
(
video_added
)
{
linphone_call_set_
nex
t_video_frame_decoded_c
allback
(
call_obj
,
linphone_call_iframe_decoded_cb
,
callee
->
lc
);
linphone_call_set_
firs
t_video_frame_decoded_c
b
(
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
));
...
...
@@ -599,7 +599,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_
nex
t_video_frame_decoded_c
allback
(
callee_call
,
linphone_call_iframe_decoded_cb
,
callee
->
lc
);
linphone_call_set_
firs
t_video_frame_decoded_c
b
(
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
{
...
...
@@ -622,8 +622,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_
nex
t_video_frame_decoded_c
allback
(
callee_call
,
linphone_call_iframe_decoded_cb
,
callee
->
lc
);
linphone_call_set_
nex
t_video_frame_decoded_c
allback
(
caller_call
,
linphone_call_iframe_decoded_cb
,
caller
->
lc
);
linphone_call_set_
firs
t_video_frame_decoded_c
b
(
callee_call
);
linphone_call_set_
firs
t_video_frame_decoded_c
b
(
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
));
...
...
@@ -639,7 +639,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_
nex
t_video_frame_decoded_c
allback
(
caller_call
,
linphone_call_iframe_decoded_cb
,
caller
->
lc
);
linphone_call_set_
firs
t_video_frame_decoded_c
b
(
caller_call
);
linphone_call_send_vfu_request
(
caller_call
);
BC_ASSERT_TRUE
(
wait_for
(
callee
->
lc
,
caller
->
lc
,
&
caller
->
stat
.
number_of_IframeDecoded
,
1
));
...
...
@@ -878,8 +878,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_
nex
t_video_frame_decoded_c
allback
(
caller_call
,
linphone_call_iframe_decoded_cb
,
caller
->
lc
);
linphone_call_set_
nex
t_video_frame_decoded_c
allback
(
callee_call
,
linphone_call_iframe_decoded_cb
,
callee
->
lc
);
linphone_call_set_
firs
t_video_frame_decoded_c
b
(
caller_call
);
linphone_call_set_
firs
t_video_frame_decoded_c
b
(
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
));
...
...
@@ -1328,10 +1328,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_next_video_frame_decoded_callback
(
linphone_core_invite_address
(
pauline
->
lc
,
marie
->
identity
)
,
linphone_call_iframe_decoded_cb
,
pauline
->
lc
);
linphone_call_set_first_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
));
...
...
tester/liblinphone_tester.h
View file @
8958c8ac
...
...
@@ -406,7 +406,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_
i
frame_decoded_cb
(
LinphoneCall
*
call
,
void
*
user_data
);
void
linphone_call_
set_first_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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment