mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-05-03 20:46:28 +00:00
implement MS_FILTER_GET_SAMPLE_RATE
git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@775 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
This commit is contained in:
parent
2c73365730
commit
c3eb04900b
1 changed files with 21 additions and 2 deletions
|
|
@ -303,6 +303,24 @@ static int receiver_set_session(MSFilter * f, void *arg)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int receiver_get_sr(MSFilter *f, void *arg){
|
||||
ReceiverData *d = (ReceiverData *) f->data;
|
||||
PayloadType *pt;
|
||||
if (d->session==NULL) {
|
||||
ms_warning("Could not obtain sample rate, session is not set.");
|
||||
return -1;
|
||||
}
|
||||
pt=rtp_profile_get_payload(rtp_session_get_profile(d->session),
|
||||
rtp_session_get_recv_payload_type(d->session));
|
||||
if (pt != NULL) {
|
||||
*(int*)arg=pt->clock_rate;
|
||||
}else{
|
||||
ms_warning("Could not obtain sample rate, payload type is unknown.");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void receiver_preprocess(MSFilter * f){
|
||||
ReceiverData *d = (ReceiverData *) f->data;
|
||||
if (d->session){
|
||||
|
|
@ -336,8 +354,9 @@ static void receiver_process(MSFilter * f)
|
|||
}
|
||||
|
||||
static MSFilterMethod receiver_methods[] = {
|
||||
{MS_RTP_RECV_SET_SESSION, receiver_set_session},
|
||||
{0, NULL}
|
||||
{ MS_RTP_RECV_SET_SESSION , receiver_set_session },
|
||||
{ MS_FILTER_GET_SAMPLE_RATE , receiver_get_sr },
|
||||
{ 0, NULL}
|
||||
};
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue