Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
mediastreamer2
Commits
e24d78e2
Commit
e24d78e2
authored
Mar 06, 2013
by
Ghislain MARY
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add get_nchannels method to the alsa filter.
parent
f13be1e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
src/audiofilters/alsa.c
src/audiofilters/alsa.c
+14
-0
No files found.
src/audiofilters/alsa.c
View file @
e24d78e2
...
...
@@ -979,6 +979,12 @@ static int alsa_read_set_sample_rate(MSFilter *obj, void *param){
return
0
;
}
static
int
alsa_read_get_nchannels
(
MSFilter
*
obj
,
void
*
param
)
{
AlsaReadData
*
ad
=
(
AlsaReadData
*
)
obj
->
data
;
*
((
int
*
)
param
)
=
ad
->
nchannels
;
return
0
;
}
static
int
alsa_read_set_nchannels
(
MSFilter
*
obj
,
void
*
param
){
AlsaReadData
*
ad
=
(
AlsaReadData
*
)
obj
->
data
;
ad
->
nchannels
=*
((
int
*
)
param
);
...
...
@@ -988,6 +994,7 @@ static int alsa_read_set_nchannels(MSFilter *obj, void *param){
MSFilterMethod
alsa_read_methods
[]
=
{
{
MS_FILTER_GET_SAMPLE_RATE
,
alsa_read_get_sample_rate
},
{
MS_FILTER_SET_SAMPLE_RATE
,
alsa_read_set_sample_rate
},
{
MS_FILTER_GET_NCHANNELS
,
alsa_read_get_nchannels
},
{
MS_FILTER_SET_NCHANNELS
,
alsa_read_set_nchannels
},
{
0
,
NULL
}
};
...
...
@@ -1052,6 +1059,12 @@ int alsa_write_set_sample_rate(MSFilter *obj, void *data){
return
0
;
}
int
alsa_write_get_nchannels
(
MSFilter
*
obj
,
void
*
data
)
{
AlsaWriteData
*
ad
=
(
AlsaWriteData
*
)
obj
->
data
;
*
((
int
*
)
data
)
=
ad
->
nchannels
;
return
0
;
}
int
alsa_write_set_nchannels
(
MSFilter
*
obj
,
void
*
data
){
int
*
n
=
(
int
*
)
data
;
AlsaWriteData
*
ad
=
(
AlsaWriteData
*
)
obj
->
data
;
...
...
@@ -1091,6 +1104,7 @@ void alsa_write_process(MSFilter *obj){
MSFilterMethod
alsa_write_methods
[]
=
{
{
MS_FILTER_GET_SAMPLE_RATE
,
alsa_write_get_sample_rate
},
{
MS_FILTER_SET_SAMPLE_RATE
,
alsa_write_set_sample_rate
},
{
MS_FILTER_GET_NCHANNELS
,
alsa_write_get_nchannels
},
{
MS_FILTER_SET_NCHANNELS
,
alsa_write_set_nchannels
},
{
0
,
NULL
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment