Commit c3eb0490 authored by smorlat's avatar smorlat
Browse files

implement MS_FILTER_GET_SAMPLE_RATE

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@775 3f6dc0c8-ddfe-455d-9043-3cd528dc4637
parent 2c733657
......@@ -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
......
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