Commit b2b4abda authored by Ghislain MARY's avatar Ghislain MARY

Implement get_channels and get_sample_rate methods for voidsource and dtmfgen filters.

parent bf0dc6eb
......@@ -215,12 +215,24 @@ static int dtmfgen_set_rate(MSFilter *f, void *arg){
return 0;
}
static int dtmfgen_get_rate(MSFilter *f, void *arg) {
DtmfGenState *s = (DtmfGenState *)f->data;
*((int *)arg) = s->rate;
return 0;
}
static int dtmfgen_set_nchannels(MSFilter *f, void *arg) {
DtmfGenState *s = (DtmfGenState *)f->data;
s->nchannels = *(int *)arg;
return 0;
}
static int dtmfgen_get_nchannels(MSFilter *f, void *arg) {
DtmfGenState *s = (DtmfGenState *)f->data;
*((int *)arg) = s->nchannels;
return 0;
}
static int dtmfgen_set_amp(MSFilter *f, void *arg){
DtmfGenState *s=(DtmfGenState*)f->data;
s->default_amplitude=*(float*)arg;
......@@ -303,7 +315,9 @@ static void dtmfgen_process(MSFilter *f){
MSFilterMethod dtmfgen_methods[]={
{ MS_FILTER_SET_SAMPLE_RATE , dtmfgen_set_rate },
{ MS_FILTER_GET_SAMPLE_RATE , dtmfgen_get_rate },
{ MS_FILTER_SET_NCHANNELS , dtmfgen_set_nchannels },
{ MS_FILTER_GET_NCHANNELS , dtmfgen_get_nchannels },
{ MS_DTMF_GEN_PLAY , dtmfgen_put },
{ MS_DTMF_GEN_START , dtmfgen_start },
{ MS_DTMF_GEN_STOP , dtmfgen_stop },
......
......@@ -58,15 +58,29 @@ static int void_source_set_rate(MSFilter *f, void *arg) {
return 0;
}
static int void_source_get_rate(MSFilter *f, void *arg) {
VoidSourceState *s = (VoidSourceState *)f->data;
*((int *)arg) = s->rate;
return 0;
}
static int void_source_set_nchannels(MSFilter *f, void *arg) {
VoidSourceState *s = (VoidSourceState *)f->data;
s->nchannels = *(int *)arg;
return 0;
}
static int void_source_get_nchannels(MSFilter *f, void *arg) {
VoidSourceState *s = (VoidSourceState *)f->data;
*((int *)arg) = s->nchannels;
return 0;
}
MSFilterMethod void_source_methods[] = {
{ MS_FILTER_SET_SAMPLE_RATE, void_source_set_rate },
{ MS_FILTER_GET_SAMPLE_RATE, void_source_get_rate },
{ MS_FILTER_SET_NCHANNELS, void_source_set_nchannels },
{ MS_FILTER_GET_NCHANNELS, void_source_get_nchannels },
{ 0, NULL }
};
......
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