Commit d931c935 authored by Simon Morlat's avatar Simon Morlat
Browse files

add missing get_nchannels accessors

parent 8596ed90
...@@ -418,6 +418,12 @@ static int android_snd_read_set_nchannels(MSFilter *obj, void *param){ ...@@ -418,6 +418,12 @@ static int android_snd_read_set_nchannels(MSFilter *obj, void *param){
return 0; return 0;
} }
static int android_snd_read_get_nchannels(MSFilter *obj, void *param){
AndroidSndReadData *ad=(AndroidSndReadData*)obj->data;
*((int*)param)=ad->nchannels;
return 0;
}
static int android_snd_read_hack_speaker_state(MSFilter *f, void *arg) { static int android_snd_read_hack_speaker_state(MSFilter *f, void *arg) {
AndroidSndReadData *ad = (AndroidSndReadData *)f->data; AndroidSndReadData *ad = (AndroidSndReadData *)f->data;
bool speakerOn = *((bool *)arg); bool speakerOn = *((bool *)arg);
...@@ -456,6 +462,7 @@ MSFilterMethod android_snd_read_methods[]={ ...@@ -456,6 +462,7 @@ MSFilterMethod android_snd_read_methods[]={
{MS_FILTER_SET_SAMPLE_RATE, android_snd_read_set_sample_rate}, {MS_FILTER_SET_SAMPLE_RATE, android_snd_read_set_sample_rate},
{MS_FILTER_GET_SAMPLE_RATE, android_snd_read_get_sample_rate}, {MS_FILTER_GET_SAMPLE_RATE, android_snd_read_get_sample_rate},
{MS_FILTER_SET_NCHANNELS, android_snd_read_set_nchannels}, {MS_FILTER_SET_NCHANNELS, android_snd_read_set_nchannels},
{MS_FILTER_GET_NCHANNELS, android_snd_read_get_nchannels},
{MS_AUDIO_CAPTURE_FORCE_SPEAKER_STATE, android_snd_read_hack_speaker_state}, {MS_AUDIO_CAPTURE_FORCE_SPEAKER_STATE, android_snd_read_hack_speaker_state},
{0,NULL} {0,NULL}
}; };
...@@ -516,6 +523,14 @@ static int android_snd_write_set_nchannels(MSFilter *obj, void *data){ ...@@ -516,6 +523,14 @@ static int android_snd_write_set_nchannels(MSFilter *obj, void *data){
return 0; return 0;
} }
static int android_snd_write_get_nchannels(MSFilter *obj, void *data){
int *n=(int*)data;
AndroidSndWriteData *ad=(AndroidSndWriteData*)obj->data;
*n=ad->nchannels;
return 0;
}
static void android_snd_write_cb(int event, void *user, void * p_info){ static void android_snd_write_cb(int event, void *user, void * p_info){
AndroidSndWriteData *ad=(AndroidSndWriteData*)user; AndroidSndWriteData *ad=(AndroidSndWriteData*)user;
...@@ -692,6 +707,7 @@ static MSFilterMethod android_snd_write_methods[]={ ...@@ -692,6 +707,7 @@ static MSFilterMethod android_snd_write_methods[]={
{MS_FILTER_SET_SAMPLE_RATE, android_snd_write_set_sample_rate}, {MS_FILTER_SET_SAMPLE_RATE, android_snd_write_set_sample_rate},
{MS_FILTER_GET_SAMPLE_RATE, android_snd_write_get_sample_rate}, {MS_FILTER_GET_SAMPLE_RATE, android_snd_write_get_sample_rate},
{MS_FILTER_SET_NCHANNELS, android_snd_write_set_nchannels}, {MS_FILTER_SET_NCHANNELS, android_snd_write_set_nchannels},
{MS_FILTER_GET_NCHANNELS, android_snd_write_get_nchannels},
{0,NULL} {0,NULL}
}; };
......
...@@ -689,10 +689,17 @@ static int set_nchannels(MSFilter *f, void *arg){ ...@@ -689,10 +689,17 @@ static int set_nchannels(MSFilter *f, void *arg){
return 0; return 0;
} }
static int get_nchannels(MSFilter *f, void *arg){
AUCommon *d = (AUCommon *) f->data;
*((int*)arg)=d->nchannels;
return 0;
}
static MSFilterMethod au_methods[]={ static MSFilterMethod au_methods[]={
{ MS_FILTER_SET_SAMPLE_RATE , set_rate }, { MS_FILTER_SET_SAMPLE_RATE , set_rate },
{ MS_FILTER_GET_SAMPLE_RATE , get_rate }, { MS_FILTER_GET_SAMPLE_RATE , get_rate },
{ MS_FILTER_SET_NCHANNELS , set_nchannels }, { MS_FILTER_SET_NCHANNELS , set_nchannels },
{ MS_FILTER_GET_NCHANNELS , get_nchannels },
{ 0 , NULL } { 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