mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-18 03:28:07 +00:00
Add two getter the the LinphonePlayer interface
This commit is contained in:
parent
e91b1c83ed
commit
f89751515f
5 changed files with 35 additions and 1 deletions
|
|
@ -7,6 +7,8 @@ static int file_player_start(LinphonePlayer *obj);
|
|||
static int file_player_pause(LinphonePlayer *obj);
|
||||
static int file_player_seek(LinphonePlayer *obj, int time_ms);
|
||||
static MSPlayerState file_player_get_state(LinphonePlayer *obj);
|
||||
static int file_player_get_duration(LinphonePlayer *obj);
|
||||
static int file_player_get_current_position(LinphonePlayer *obj);
|
||||
static void file_player_close(LinphonePlayer *obj);
|
||||
static void file_player_eof_callback(void *user_data);
|
||||
|
||||
|
|
@ -20,6 +22,8 @@ LinphonePlayer *linphone_core_create_file_player(LinphoneCore *lc, MSSndCard *sn
|
|||
obj->pause = file_player_pause;
|
||||
obj->seek = file_player_seek;
|
||||
obj->get_state = file_player_get_state;
|
||||
obj->get_duration = file_player_get_duration;
|
||||
obj->get_position = file_player_get_current_position;
|
||||
obj->close = file_player_close;
|
||||
ms_file_player_set_eof_callback((MSFilePlayer *)obj->impl, file_player_eof_callback, obj);
|
||||
return obj;
|
||||
|
|
@ -55,6 +59,14 @@ static MSPlayerState file_player_get_state(LinphonePlayer *obj) {
|
|||
return ms_file_player_get_state((MSFilePlayer *)obj->impl);
|
||||
}
|
||||
|
||||
static int file_player_get_duration(LinphonePlayer *obj) {
|
||||
return ms_file_player_get_duration((MSFilePlayer *)obj->impl);
|
||||
}
|
||||
|
||||
static int file_player_get_current_position(LinphonePlayer *obj) {
|
||||
return ms_file_player_get_current_position((MSFilePlayer *)obj->impl);
|
||||
}
|
||||
|
||||
static void file_player_close(LinphonePlayer *obj) {
|
||||
ms_file_player_close((MSFilePlayer *)obj->impl);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -592,6 +592,8 @@ int linphone_player_start(LinphonePlayer *obj);
|
|||
int linphone_player_pause(LinphonePlayer *obj);
|
||||
int linphone_player_seek(LinphonePlayer *obj, int time_ms);
|
||||
MSPlayerState linphone_player_get_state(LinphonePlayer *obj);
|
||||
int linphone_player_get_duration(LinphonePlayer *obj);
|
||||
int linphone_player_get_position(LinphonePlayer *obj);
|
||||
void linphone_player_close(LinphonePlayer *obj);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -71,6 +71,24 @@ MSPlayerState linphone_player_get_state(LinphonePlayer *obj){
|
|||
return obj->get_state(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the duration of the media
|
||||
* @param obj the player
|
||||
* @return The duration in milliseconds
|
||||
*/
|
||||
int linphone_player_get_duration(LinphonePlayer *obj) {
|
||||
return obj->get_duration(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the position of the playback
|
||||
* @param obj the player
|
||||
* @return Position of the playback in milliseconds
|
||||
*/
|
||||
int linphone_player_get_position(LinphonePlayer *obj) {
|
||||
return obj->get_position(obj);
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the player.
|
||||
* @param obj the player.
|
||||
|
|
|
|||
|
|
@ -920,6 +920,8 @@ struct _LinphonePlayer{
|
|||
int (*pause)(struct _LinphonePlayer* player);
|
||||
int (*seek)(struct _LinphonePlayer* player, int time_ms);
|
||||
MSPlayerState (*get_state)(struct _LinphonePlayer* player);
|
||||
int (*get_duration)(struct _LinphonePlayer *player);
|
||||
int (*get_position)(struct _LinphonePlayer *player);
|
||||
void (*close)(struct _LinphonePlayer* player);
|
||||
LinphonePlayerEofCallback cb;
|
||||
void *user_data;
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit 548ccf41fa0d3cd3ab48d0eff44d3bed45083312
|
||||
Subproject commit 636c6b928d696cf8943653548351a5b8524491e9
|
||||
Loading…
Add table
Reference in a new issue