Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
liblinphone
Commits
fd75b794
Commit
fd75b794
authored
Oct 15, 2014
by
François Grisez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a destroy function to the Linphone Player Interface
parent
d90dc113
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
13 deletions
+25
-13
coreapi/linphonecore.h
coreapi/linphonecore.h
+1
-6
coreapi/localplayer.c
coreapi/localplayer.c
+7
-5
coreapi/player.c
coreapi/player.c
+13
-1
coreapi/private.h
coreapi/private.h
+3
-0
tester/player_tester.c
tester/player_tester.c
+1
-1
No files found.
coreapi/linphonecore.h
View file @
fd75b794
...
...
@@ -595,6 +595,7 @@ MSPlayerState linphone_player_get_state(LinphonePlayer *obj);
int
linphone_player_get_duration
(
LinphonePlayer
*
obj
);
int
linphone_player_get_current_position
(
LinphonePlayer
*
obj
);
void
linphone_player_close
(
LinphonePlayer
*
obj
);
void
linphone_player_destroy
(
LinphonePlayer
*
obj
);
/**
* @brief Create an independent media file player.
...
...
@@ -607,12 +608,6 @@ void linphone_player_close(LinphonePlayer *obj);
*/
LINPHONE_PUBLIC
LinphonePlayer
*
linphone_core_create_local_player
(
LinphoneCore
*
lc
,
MSSndCard
*
snd_card
,
const
char
*
video_out
,
void
*
window_id
);
/**
* @brief Destroy a local player
* @param obj File player to destroy
*/
LINPHONE_PUBLIC
void
linphone_local_player_destroy
(
LinphonePlayer
*
obj
);
/**
* @brief Check whether Matroksa format is supported by the player
* @return TRUE if it is supported
...
...
coreapi/localplayer.c
View file @
fd75b794
...
...
@@ -29,6 +29,7 @@ static MSPlayerState _local_player_get_state(LinphonePlayer *obj);
static
int
_local_player_get_duration
(
LinphonePlayer
*
obj
);
static
int
_local_player_get_current_position
(
LinphonePlayer
*
obj
);
static
void
_local_player_close
(
LinphonePlayer
*
obj
);
static
void
_local_player_destroy
(
LinphonePlayer
*
obj
);
static
void
_local_player_eof_callback
(
void
*
user_data
);
LinphonePlayer
*
linphone_core_create_local_player
(
LinphoneCore
*
lc
,
MSSndCard
*
snd_card
,
const
char
*
video_out
,
void
*
window_id
)
{
...
...
@@ -44,15 +45,11 @@ LinphonePlayer *linphone_core_create_local_player(LinphoneCore *lc, MSSndCard *s
obj
->
get_duration
=
_local_player_get_duration
;
obj
->
get_position
=
_local_player_get_current_position
;
obj
->
close
=
_local_player_close
;
obj
->
destroy
=
_local_player_destroy
;
ms_media_player_set_eof_callback
((
MSMediaPlayer
*
)
obj
->
impl
,
_local_player_eof_callback
,
obj
);
return
obj
;
}
void
linphone_local_player_destroy
(
LinphonePlayer
*
obj
)
{
ms_media_player_free
((
MSMediaPlayer
*
)
obj
->
impl
);
ms_free
(
obj
);
}
bool_t
linphone_local_player_matroska_supported
(
void
)
{
return
ms_media_player_matroska_supported
();
}
...
...
@@ -86,6 +83,11 @@ static int _local_player_get_current_position(LinphonePlayer *obj) {
return
ms_media_player_get_current_position
((
MSMediaPlayer
*
)
obj
->
impl
);
}
static
void
_local_player_destroy
(
LinphonePlayer
*
obj
)
{
ms_media_player_free
((
MSMediaPlayer
*
)
obj
->
impl
);
_linphone_player_destroy
(
obj
);
}
static
void
_local_player_close
(
LinphonePlayer
*
obj
)
{
ms_media_player_close
((
MSMediaPlayer
*
)
obj
->
impl
);
}
...
...
coreapi/player.c
View file @
fd75b794
...
...
@@ -97,6 +97,18 @@ void linphone_player_close(LinphonePlayer *obj){
return
obj
->
close
(
obj
);
}
/**
* @brief Destroy a player
* @param obj The player
*/
void
linphone_player_destroy
(
LinphonePlayer
*
obj
)
{
if
(
obj
->
destroy
)
obj
->
destroy
(
obj
);
}
void
_linphone_player_destroy
(
LinphonePlayer
*
player
)
{
ms_free
(
player
);
}
/*
* Call player implementation below.
...
...
@@ -169,7 +181,7 @@ static void call_player_close(LinphonePlayer *player){
}
static
void
on_call_destroy
(
void
*
obj
,
belle_sip_object_t
*
call_being_destroyed
){
ms_free
(
obj
);
_linphone_player_destroy
(
obj
);
}
LinphonePlayer
*
linphone_call_build_player
(
LinphoneCall
*
call
){
...
...
coreapi/private.h
View file @
fd75b794
...
...
@@ -923,11 +923,14 @@ struct _LinphonePlayer{
int
(
*
get_duration
)(
struct
_LinphonePlayer
*
player
);
int
(
*
get_position
)(
struct
_LinphonePlayer
*
player
);
void
(
*
close
)(
struct
_LinphonePlayer
*
player
);
void
(
*
destroy
)(
struct
_LinphonePlayer
*
player
);
LinphonePlayerEofCallback
cb
;
void
*
user_data
;
void
*
impl
;
};
void
_linphone_player_destroy
(
LinphonePlayer
*
player
);
/*****************************************************************************
* XML UTILITY FUNCTIONS *
...
...
tester/player_tester.c
View file @
fd75b794
...
...
@@ -79,7 +79,7 @@ static void play_file(const char *filename, bool_t unsupported_format) {
linphone_player_close
(
player
);
fail:
if
(
player
)
linphone_
local_
player_destroy
(
player
);
if
(
player
)
linphone_player_destroy
(
player
);
if
(
lc_manager
)
linphone_core_manager_destroy
(
lc_manager
);
}
...
...
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