Browse code

lswr/swresample: convert ocl and icl options to AV_OPT_TYPE_CHANNEL_LAYOUT

Improve interface flexibility. In particular makes it possible to set
channel layout through symbolic names using the av_opt_set() interface.

Stefano Sabatini authored on 2013/10/15 08:20:35
Showing 3 changed files
... ...
@@ -57,10 +57,10 @@ static const AVOption options[]={
57 57
 {"out_sample_fmt"       , "set output sample format"    , OFFSET(out_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1   , AV_SAMPLE_FMT_NB-1, PARAM},
58 58
 {"tsf"                  , "set internal sample format"  , OFFSET(int_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1   , AV_SAMPLE_FMT_NB-1, PARAM},
59 59
 {"internal_sample_fmt"  , "set internal sample format"  , OFFSET(int_sample_fmt ), AV_OPT_TYPE_SAMPLE_FMT , {.i64=AV_SAMPLE_FMT_NONE}, -1   , AV_SAMPLE_FMT_NB-1, PARAM},
60
-{"icl"                  , "set input channel layout"    , OFFSET( in_ch_layout  ), AV_OPT_TYPE_INT64, {.i64=0                     }, 0      , INT64_MAX , PARAM, "channel_layout"},
61
-{"in_channel_layout"    , "set input channel layout"    , OFFSET( in_ch_layout  ), AV_OPT_TYPE_INT64, {.i64=0                     }, 0      , INT64_MAX , PARAM, "channel_layout"},
62
-{"ocl"                  , "set output channel layout"   , OFFSET(out_ch_layout  ), AV_OPT_TYPE_INT64, {.i64=0                     }, 0      , INT64_MAX , PARAM, "channel_layout"},
63
-{"out_channel_layout"   , "set output channel layout"   , OFFSET(out_ch_layout  ), AV_OPT_TYPE_INT64, {.i64=0                     }, 0      , INT64_MAX , PARAM, "channel_layout"},
60
+{"icl"                  , "set input channel layout"    , OFFSET( in_ch_layout  ), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0                     }, 0      , INT64_MAX , PARAM, "channel_layout"},
61
+{"in_channel_layout"    , "set input channel layout"    , OFFSET( in_ch_layout  ), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0                     }, 0      , INT64_MAX , PARAM, "channel_layout"},
62
+{"ocl"                  , "set output channel layout"   , OFFSET(out_ch_layout  ), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0                     }, 0      , INT64_MAX , PARAM, "channel_layout"},
63
+{"out_channel_layout"   , "set output channel layout"   , OFFSET(out_ch_layout  ), AV_OPT_TYPE_CHANNEL_LAYOUT, {.i64=0                     }, 0      , INT64_MAX , PARAM, "channel_layout"},
64 64
 {"clev"                 , "set center mix level"        , OFFSET(clev           ), AV_OPT_TYPE_FLOAT, {.dbl=C_30DB                }, -32    , 32        , PARAM},
65 65
 {"center_mix_level"     , "set center mix level"        , OFFSET(clev           ), AV_OPT_TYPE_FLOAT, {.dbl=C_30DB                }, -32    , 32        , PARAM},
66 66
 {"slev"                 , "set surround mix level"      , OFFSET(slev           ), AV_OPT_TYPE_FLOAT, {.dbl=C_30DB                }, -32    , 32        , PARAM},
... ...
@@ -44,8 +44,8 @@
44 44
  * matrix):
45 45
  * @code
46 46
  * SwrContext *swr = swr_alloc();
47
- * av_opt_set_int(swr, "in_channel_layout",  AV_CH_LAYOUT_5POINT1, 0);
48
- * av_opt_set_int(swr, "out_channel_layout", AV_CH_LAYOUT_STEREO,  0);
47
+ * av_opt_set_channel_layout(swr, "in_channel_layout",  AV_CH_LAYOUT_5POINT1, 0);
48
+ * av_opt_set_channel_layout(swr, "out_channel_layout", AV_CH_LAYOUT_STEREO,  0);
49 49
  * av_opt_set_int(swr, "in_sample_rate",     48000,                0);
50 50
  * av_opt_set_int(swr, "out_sample_rate",    44100,                0);
51 51
  * av_opt_set_sample_fmt(swr, "in_sample_fmt",  AV_SAMPLE_FMT_FLTP, 0);
... ...
@@ -30,7 +30,7 @@
30 30
 
31 31
 #define LIBSWRESAMPLE_VERSION_MAJOR 0
32 32
 #define LIBSWRESAMPLE_VERSION_MINOR 17
33
-#define LIBSWRESAMPLE_VERSION_MICRO 103
33
+#define LIBSWRESAMPLE_VERSION_MICRO 104
34 34
 
35 35
 #define LIBSWRESAMPLE_VERSION_INT  AV_VERSION_INT(LIBSWRESAMPLE_VERSION_MAJOR, \
36 36
                                                   LIBSWRESAMPLE_VERSION_MINOR, \