[vlc-commits] [Git][videolan/vlc][master] 2 commits: transcode: use AOUT_CHANS_ for channel mapping

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Apr 9 06:16:28 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
94313f36 by Ilkka Ollakka at 2024-04-09T05:50:56+00:00
transcode: use AOUT_CHANS_ for channel mapping

- - - - -
29dfd85d by Ilkka Ollakka at 2024-04-09T05:50:56+00:00
transcode: show textual names for different channel-amounts

- - - - -


2 changed files:

- modules/stream_out/transcode/encoder/audio.c
- modules/stream_out/transcode/transcode.c


Changes:

=====================================
modules/stream_out/transcode/encoder/audio.c
=====================================
@@ -36,26 +36,21 @@
 #include "encoder.h"
 #include "encoder_priv.h"
 
-static const int pi_channels_maps[9] =
+static const int pi_channels_maps[] =
 {
     0,
     AOUT_CHAN_CENTER,
-    AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT,
-    AOUT_CHAN_LFE  | AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT,
-    AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_REARLEFT
-     | AOUT_CHAN_REARRIGHT,
-    AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
-     | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT,
-    AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
-     | AOUT_CHAN_REARLEFT | AOUT_CHAN_REARRIGHT | AOUT_CHAN_LFE,
-    AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER
-     | AOUT_CHAN_REARCENTER | AOUT_CHAN_MIDDLELEFT
-     | AOUT_CHAN_MIDDLERIGHT | AOUT_CHAN_LFE,
-    AOUT_CHAN_LEFT | AOUT_CHAN_RIGHT | AOUT_CHAN_CENTER | AOUT_CHAN_REARLEFT
-     | AOUT_CHAN_REARRIGHT | AOUT_CHAN_MIDDLELEFT | AOUT_CHAN_MIDDLERIGHT
-     | AOUT_CHAN_LFE,
+    AOUT_CHANS_2_0,
+    AOUT_CHANS_2_1,
+    AOUT_CHANS_4_0,
+    AOUT_CHANS_5_0,
+    AOUT_CHANS_5_1,
+    AOUT_CHANS_7_0,
+    AOUT_CHANS_7_1,
+    AOUT_CHANS_8_1,
 };
 
+
 int transcode_encoder_audio_open( transcode_encoder_t *p_enc,
                                   const transcode_encoder_config_t *p_cfg )
 {


=====================================
modules/stream_out/transcode/transcode.c
=====================================
@@ -142,6 +142,11 @@ static const char *const ppsz_deinterlace_type[] =
 {
     "deinterlace", "ffmpeg-deinterlace"
 };
+static const int channel_layout_values[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, };
+
+static const char *const channel_layout_texts[] = {
+  "default", "mono", "stereo", "2.1", "4.0", "5.0", "5.1", "7.0", "7.1", "8.1",
+};
 
 static int  Open ( vlc_object_t * );
 static void Close( sout_stream_t * );
@@ -193,7 +198,7 @@ vlc_module_begin ()
                 ALANG_LONGTEXT )
     add_integer( SOUT_CFG_PREFIX "channels", 0, ACHANS_TEXT,
                  ACHANS_LONGTEXT )
-        change_integer_range( 0, 9 )
+        change_integer_list( channel_layout_values, channel_layout_texts)
     add_integer( SOUT_CFG_PREFIX "samplerate", 0, ARATE_TEXT,
                  ARATE_LONGTEXT )
         change_integer_range( 0, 48000 )



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/993528cc4a50d8ca246f32eeb17eeb38e950186e...29dfd85dcffc08ba885be2b61d04bcbf94813097

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/993528cc4a50d8ca246f32eeb17eeb38e950186e...29dfd85dcffc08ba885be2b61d04bcbf94813097
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list