Web lists-archives.com

[MPlayer-dev-eng] [PATCH v2 3/5] stream_pvr: add AAC and AC-3 audio encoding control options




Use alayer=4 for AAC or alayer=5 for AC-3.

These are in fact the only two values supported by hdpvr.

Signed-off-by: Reza Arbab <arbab@xxxxxxxxx>
---
 DOCS/man/cs/mplayer.1    |  2 +-
 DOCS/man/de/mplayer.1    |  2 +-
 DOCS/man/en/mplayer.1    |  2 +-
 DOCS/man/es/mplayer.1    |  2 +-
 DOCS/man/fr/mplayer.1    |  2 +-
 DOCS/man/hu/mplayer.1    |  2 +-
 DOCS/man/it/mplayer.1    |  2 +-
 DOCS/man/ru/mplayer.1    |  2 +-
 DOCS/man/zh_CN/mplayer.1 |  2 +-
 cfg-common.h             |  2 +-
 stream/stream_pvr.c      | 73 ++++++++++++++++++++++++++++++++++++++++++++++++
 11 files changed, 83 insertions(+), 10 deletions(-)

diff --git a/DOCS/man/cs/mplayer.1 b/DOCS/man/cs/mplayer.1
index a7d75e6..825d8f2 100644
--- a/DOCS/man/cs/mplayer.1
+++ b/DOCS/man/cs/mplayer.1
@@ -1487,7 +1487,7 @@ Nastavuje poměr stran vstupu:
 .IPs arate=<32000\-48000>
 Nastavuje vzorkovací kmitočet enkódovaného zvuku (výchozí: 48000 Hz, dostupné: 32000, 44100
 a 48000 Hz).
-.IPs alayer=<1\-3>
+.IPs alayer=<1\-5>
 Nastavuje kódování zvuku (MPEG audio layer)(výchozí: 2).
 .IPs abitrate=<32\-448>
 Nastavuje datový tok zvuku v kbps (výchozí: 384 kbps).
diff --git a/DOCS/man/de/mplayer.1 b/DOCS/man/de/mplayer.1
index f2c66bf..ca9cf32 100644
--- a/DOCS/man/de/mplayer.1
+++ b/DOCS/man/de/mplayer.1
@@ -1821,7 +1821,7 @@ Gib den Aspekt der Eingabe an:
 .IPs arate=<32000\-48000>
 Gib die Audio-Rate für die Encodierung an (Standard: 48000 Hz, verfügbar:
 32000, 44100 und 48000 Hz).
-.IPs alayer=<1\-3>
+.IPs alayer=<1\-5>
 Gib die Encodierung des MPEG-Audio-Layers an (Standard: 2).
 .IPs abitrate=<32\-448>
 Gib die Bitrate für die Audioencodierung in kbps an (Standard: 384).
diff --git a/DOCS/man/en/mplayer.1 b/DOCS/man/en/mplayer.1
index 25c701b..36d82ca 100644
--- a/DOCS/man/en/mplayer.1
+++ b/DOCS/man/en/mplayer.1
@@ -1912,7 +1912,7 @@ Specify input aspect ratio:
 .IPs arate=<32000\-48000>
 Specify encoding audio rate (default: 48000 Hz, available: 32000, 44100
 and 48000 Hz).
-.IPs alayer=<1\-3>
+.IPs alayer=<1\-5>
 Specify MPEG audio layer encoding (default: 2).
 .IPs abitrate=<32\-448>
 Specify audio encoding bitrate in kbps (default: 384).
diff --git a/DOCS/man/es/mplayer.1 b/DOCS/man/es/mplayer.1
index cb01588..129ed82 100644
--- a/DOCS/man/es/mplayer.1
+++ b/DOCS/man/es/mplayer.1
@@ -1689,7 +1689,7 @@ Especifica el ratio de la entrada:
 .IPs arate=<32000\-48000>
 Especifica el ratio de codificación del audio (por defecto: 48000 Hz,
 disponibles: 32000, 44100 y 48000 Hz).
-.IPs alayer=<1\-3>
+.IPs alayer=<1\-5>
 Especifica la capa de codificación MPEG para el audio (por defecto: 2).
 .IPs abitrate=<32\-448>
 Especifica el bitrate de codificación del audio (por defecto: 384).
diff --git a/DOCS/man/fr/mplayer.1 b/DOCS/man/fr/mplayer.1
index d33966b..1da12b5 100644
--- a/DOCS/man/fr/mplayer.1
+++ b/DOCS/man/fr/mplayer.1
@@ -1673,7 +1673,7 @@ Spécifie un format visuel pour l'entrée vidéo\ :
 .IPs arate=<32000\-48000>
 Spécifie le taux d'échantillonnage de l'encodeur audio (la valeur par défaut
 est de 48000 Hz, et sont disponibles 32000, 44100 et 48000 Hz).
-.IPs alayer=<1\-3>
+.IPs alayer=<1\-5>
 Spécifie le niveau d'encodage MPEG audio (par défaut\ : 2).
 .IPs abitrate=<32\-448>
 Spécifie le taux binaire d'encodage audio en kbps (par défaut\ : 384).
diff --git a/DOCS/man/hu/mplayer.1 b/DOCS/man/hu/mplayer.1
index 58222e5..9b8e0bd 100644
--- a/DOCS/man/hu/mplayer.1
+++ b/DOCS/man/hu/mplayer.1
@@ -1693,7 +1693,7 @@ Megadja a bemenet képarányát:
 .IPs arate=<32000\-48000>
 Megadja az audió kódolási rátáját (alapértelmezett: 48000 Hz, használható: 32000, 44100
 és 48000 Hz).
-.IPs alayer=<1\-3>
+.IPs alayer=<1\-5>
 Megadja az MPEG audió réteg kódolását (alapértelmezett: 2).
 .IPs abitrate=<32\-448>
 Megadja az audió kódolási bitrátáját kbps-ben (alapértelmezett: 384).
diff --git a/DOCS/man/it/mplayer.1 b/DOCS/man/it/mplayer.1
index ce3ec0b..3e13651 100644
--- a/DOCS/man/it/mplayer.1
+++ b/DOCS/man/it/mplayer.1
@@ -1943,7 +1943,7 @@ Specifica il rapporto di aspetto:
 .IPs arate=<32000\-48000>
 Specifica la frequenza audio di codifica (default: 48000 Hz, disponibili:
 32000, 44100 e 48000 Hz).
-.IPs alayer=<1\-3>
+.IPs alayer=<1\-5>
 Specifica lo strato (layer) di codifica audio (default: 2).
 .IPs abitrate=<32\-448>
 Specifica la frequenza di codifica audio in kpbs (default: 384).
diff --git a/DOCS/man/ru/mplayer.1 b/DOCS/man/ru/mplayer.1
index 5699305..3fcb41c 100644
--- a/DOCS/man/ru/mplayer.1
+++ b/DOCS/man/ru/mplayer.1
@@ -1554,7 +1554,7 @@ Hauppauge WinTV PVR\-150/250/350/500 и все карты, основанные
 .IPs arate=<32000\-48000>
 Указывает частоту дискретизации звука (по умолчанию: 48000 Гц, доступны: 32000, 44100
 и 48000 Гц).
-.IPs alayer=<1\-3>
+.IPs alayer=<1\-5>
 Указывает слой кодирования MPEG[MPEG layer](по умолчанию: 2).
 .IPs abitrate=<32\-448>
 Указывает битпоток кодируемого звука в кбит/с (по умолчанию: 384).
diff --git a/DOCS/man/zh_CN/mplayer.1 b/DOCS/man/zh_CN/mplayer.1
index d7e4d6d..6597c87 100644
--- a/DOCS/man/zh_CN/mplayer.1
+++ b/DOCS/man/zh_CN/mplayer.1
@@ -1912,7 +1912,7 @@ Hauppauge WinTV PVR\-150/250/350/500 和所有基于 IVTV 的卡\
 .IPs arate=<32000\-48000>
 指定编码音频的码率(默认值:48000 Hz,可用值:32000、\
 44100 和 48000 Hz)。
-.IPs alayer=<1\-3>
+.IPs alayer=<1\-5>
 指定 MPEG 音频编码层级(默认值:2)。
 .IPs abitrate=<32\-448>
 指定音频编码比特率(以 kbps 为单位)(默认值:384)。
diff --git a/cfg-common.h b/cfg-common.h
index 58748ff..3a422cf 100644
--- a/cfg-common.h
+++ b/cfg-common.h
@@ -141,7 +141,7 @@ const m_option_t tvopts_conf[]={
 const m_option_t pvropts_conf[]={
     {"aspect", &pvr_param_aspect_ratio, CONF_TYPE_INT, 0, 1, 4, NULL},
     {"arate", &pvr_param_sample_rate, CONF_TYPE_INT, 0, 32000, 48000, NULL},
-    {"alayer", &pvr_param_audio_layer, CONF_TYPE_INT, 0, 1, 2, NULL},
+    {"alayer", &pvr_param_audio_layer, CONF_TYPE_INT, 0, 1, 5, NULL},
     {"abitrate", &pvr_param_audio_bitrate, CONF_TYPE_INT, 0, 32, 448, NULL},
     {"amode", &pvr_param_audio_mode, CONF_TYPE_STRING, 0, 0, 0, NULL},
     {"vbitrate", &pvr_param_bitrate, CONF_TYPE_INT, 0, 0, 0, NULL},
diff --git a/stream/stream_pvr.c b/stream/stream_pvr.c
index ecce2c5..cbf4f17 100644
--- a/stream/stream_pvr.c
+++ b/stream/stream_pvr.c
@@ -811,6 +811,10 @@ parse_encoder_options (struct pvr_t *pvr)
     pvr->layer = V4L2_MPEG_AUDIO_ENCODING_LAYER_2;
   else if (pvr_param_audio_layer == 3)
     pvr->layer = V4L2_MPEG_AUDIO_ENCODING_LAYER_3;
+  else if (pvr_param_audio_layer == 4)
+    pvr->layer = V4L2_MPEG_AUDIO_ENCODING_AAC;
+  else if (pvr_param_audio_layer == 5)
+    pvr->layer = V4L2_MPEG_AUDIO_ENCODING_AC3;
 
   /* -pvr abitrate=x */
   if (pvr_param_audio_bitrate != 0)
@@ -967,6 +971,75 @@ parse_encoder_options (struct pvr_t *pvr)
         break;
       }
     }
+
+    else if (pvr->layer == V4L2_MPEG_AUDIO_ENCODING_AAC)
+      pvr->audio_rate = pvr_param_audio_bitrate;
+
+    else if (pvr->layer == V4L2_MPEG_AUDIO_ENCODING_AC3)
+    {
+      switch (pvr_param_audio_bitrate)
+      {
+      case 32:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_32K;
+        break;
+      case 40:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_40K;
+        break;
+      case 48:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_48K;
+        break;
+      case 56:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_56K;
+        break;
+      case 64:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_64K;
+        break;
+      case 80:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_80K;
+        break;
+      case 96:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_96K;
+        break;
+      case 112:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_112K;
+        break;
+      case 128:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_128K;
+        break;
+      case 160:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_160K;
+        break;
+      case 192:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_192K;
+        break;
+      case 224:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_224K;
+        break;
+      case 256:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_256K;
+        break;
+      case 320:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_320K;
+        break;
+      case 384:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_384K;
+        break;
+      case 448:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_448K;
+        break;
+      case 512:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_512K;
+        break;
+      case 576:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_576K;
+        break;
+      case 640:
+        pvr->audio_rate = V4L2_MPEG_AUDIO_AC3_BITRATE_640K;
+        break;
+      default:
+        break;
+      }
+    }
   }
 
   /* -pvr amode=x */
-- 
2.5.0

_______________________________________________
MPlayer-dev-eng mailing list
MPlayer-dev-eng@xxxxxxxxxxxx
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng