[vlc-commits] vlc_fourcc: add a define for "araw" (Raw PCM)
Steve Lhomme
git at videolan.org
Wed Jul 12 12:23:52 CEST 2017
vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Thu Jul 6 16:52:44 2017 +0200| [a129a5419c04f379611ef4e62021ed0f5bfab573] | committer: Jean-Baptiste Kempf
vlc_fourcc: add a define for "araw" (Raw PCM)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a129a5419c04f379611ef4e62021ed0f5bfab573
---
include/vlc_codecs.h | 4 ++--
include/vlc_fourcc.h | 1 +
modules/access/dshow/dshow.cpp | 2 +-
modules/access/dshow/filter.cpp | 2 +-
modules/codec/araw.c | 2 +-
modules/demux/mkv/matroska_segment_parse.cpp | 2 +-
modules/demux/mod.c | 2 +-
modules/demux/nsv.c | 4 ++--
modules/demux/wav.c | 4 ++--
src/misc/fourcc.c | 2 +-
src/misc/fourcc_list.h | 3 +++
11 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/include/vlc_codecs.h b/include/vlc_codecs.h
index 950c09fd14..7a79eec043 100644
--- a/include/vlc_codecs.h
+++ b/include/vlc_codecs.h
@@ -313,7 +313,7 @@ static const struct
}
wave_format_tag_to_fourcc[] =
{
- { WAVE_FORMAT_PCM, VLC_FOURCC( 'a', 'r', 'a', 'w' ), "Raw audio" },
+ { WAVE_FORMAT_PCM, VLC_CODEC_RAW_PCM, "Raw audio" },
{ WAVE_FORMAT_PCM, VLC_CODEC_S8, "PCM S8 audio" },
{ WAVE_FORMAT_PCM, VLC_CODEC_S16L, "PCM S16L audio" },
{ WAVE_FORMAT_PCM, VLC_CODEC_S24L, "PCM S24L audio" },
@@ -418,7 +418,7 @@ static const struct
}
sub_format_tag_to_fourcc[] =
{
- { VLC_AMBISONIC_SUBTYPE_PCM, VLC_FOURCC( 'a', 'r', 'a', 'w' ), "Ambisonic B format (PCM)" },
+ { VLC_AMBISONIC_SUBTYPE_PCM, VLC_CODEC_RAW_PCM, "Ambisonic B format (PCM)" },
{ VLC_AMBISONIC_SUBTYPE_IEEE_FLOAT, VLC_FOURCC( 'a', 'f', 'l', 't' ), "Ambisonic B format (IEEE float)" },
{ VLC_KSDATAFORMAT_SUBTYPE_ATRAC3P, VLC_CODEC_ATRAC3P, "Sony Atrac3+" },
{ VLC_KSDATAFORMAT_SUBTYPE_UNKNOWN, VLC_FOURCC( 'u', 'n', 'd', 'f' ), "Unknown" }
diff --git a/include/vlc_fourcc.h b/include/vlc_fourcc.h
index b4c4d26bc7..fc073db5a8 100644
--- a/include/vlc_fourcc.h
+++ b/include/vlc_fourcc.h
@@ -473,6 +473,7 @@
#define VLC_CODEC_MIDI VLC_FOURCC('M','I','D','I')
#define VLC_CODEC_RALF VLC_FOURCC('R','A','L','F')
+#define VLC_CODEC_RAW_PCM VLC_FOURCC('a','r','a','w')
#define VLC_CODEC_S8 VLC_FOURCC('s','8',' ',' ')
#define VLC_CODEC_U8 VLC_FOURCC('u','8',' ',' ')
#define VLC_CODEC_S16L VLC_FOURCC('s','1','6','l')
diff --git a/modules/access/dshow/dshow.cpp b/modules/access/dshow/dshow.cpp
index d3dd1a4224..274ff9061b 100644
--- a/modules/access/dshow/dshow.cpp
+++ b/modules/access/dshow/dshow.cpp
@@ -966,7 +966,7 @@ static int GetFourCCPriority( int i_fourcc )
case VLC_CODEC_FL32:
return 9;
case VLC_CODEC_YV12:
- case VLC_FOURCC('a','r','a','w'):
+ case VLC_CODEC_RAW_PCM:
return 8;
case VLC_CODEC_RGB24:
return 7;
diff --git a/modules/access/dshow/filter.cpp b/modules/access/dshow/filter.cpp
index 40620b9c64..33642298c5 100644
--- a/modules/access/dshow/filter.cpp
+++ b/modules/access/dshow/filter.cpp
@@ -185,7 +185,7 @@ int GetFourCCFromMediaType( const AM_MEDIA_TYPE &media_type )
if( media_type.formattype == FORMAT_WaveFormatEx )
{
if( media_type.subtype == MEDIASUBTYPE_PCM )
- i_fourcc = VLC_FOURCC( 'a', 'r', 'a', 'w' );
+ i_fourcc = VLC_CODEC_RAW_PCM;
else if( media_type.subtype == MEDIASUBTYPE_IEEE_FLOAT )
i_fourcc = VLC_CODEC_FL32;
}
diff --git a/modules/codec/araw.c b/modules/codec/araw.c
index ffa585bf9e..9fb45f1bec 100644
--- a/modules/codec/araw.c
+++ b/modules/codec/araw.c
@@ -116,7 +116,7 @@ static int DecoderOpen( vlc_object_t *p_this )
switch( p_dec->fmt_in.i_codec )
{
- case VLC_FOURCC('a','r','a','w'):
+ case VLC_CODEC_RAW_PCM:
case VLC_FOURCC('a','f','l','t'):
/* _signed_ big endian samples (mov) */
case VLC_FOURCC('t','w','o','s'):
diff --git a/modules/demux/mkv/matroska_segment_parse.cpp b/modules/demux/mkv/matroska_segment_parse.cpp
index d640bc4b29..4452bbf1a6 100644
--- a/modules/demux/mkv/matroska_segment_parse.cpp
+++ b/modules/demux/mkv/matroska_segment_parse.cpp
@@ -1727,7 +1727,7 @@ int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
}
S_CASE("A_PCM/INT/BIG") { A_PCM__helper ( vars, VLC_FOURCC( 't','w','o','s' ) ); }
- S_CASE("A_PCM/INT/LIT") { A_PCM__helper ( vars, VLC_FOURCC( 'a','r','a','w' ) ); }
+ S_CASE("A_PCM/INT/LIT") { A_PCM__helper ( vars, VLC_CODEC_RAW_PCM ); }
S_CASE("A_PCM/FLOAT/IEEE") { A_PCM__helper ( vars, VLC_FOURCC( 'a','f','l','t' ) ) ;}
S_CASE("A_REAL/14_4") {
vars.p_fmt->i_codec = VLC_CODEC_RA_144;
diff --git a/modules/demux/mod.c b/modules/demux/mod.c
index c5068f6b24..407052c12b 100644
--- a/modules/demux/mod.c
+++ b/modules/demux/mod.c
@@ -234,7 +234,7 @@ static int Open( vlc_object_t *p_this )
#ifdef WORDS_BIGENDIAN
es_format_Init( &p_sys->fmt, AUDIO_ES, VLC_FOURCC( 't', 'w', 'o', 's' ) );
#else
- es_format_Init( &p_sys->fmt, AUDIO_ES, VLC_FOURCC( 'a', 'r', 'a', 'w' ) );
+ es_format_Init( &p_sys->fmt, AUDIO_ES, VLC_CODEC_RAW_PCM );
#endif
p_sys->fmt.audio.i_rate = settings.mFrequency;
p_sys->fmt.audio.i_channels = settings.mChannels;
diff --git a/modules/demux/nsv.c b/modules/demux/nsv.c
index a30667da65..96e4e1a158 100644
--- a/modules/demux/nsv.c
+++ b/modules/demux/nsv.c
@@ -295,7 +295,7 @@ static int Demux( demux_t *p_demux )
if( i_size > 0 )
{
/* msg_Dbg( p_demux, "frame audio size=%d", i_size ); */
- if( p_sys->fmt_audio.i_codec == VLC_FOURCC( 'a', 'r', 'a', 'w' ) )
+ if( p_sys->fmt_audio.i_codec == VLC_CODEC_RAW_PCM )
{
uint8_t h[4];
if( vlc_stream_Read( p_demux->s, h, 4 ) < 4 )
@@ -548,7 +548,7 @@ static int ReadNSVs( demux_t *p_demux )
fcc = VLC_FOURCC( 'm', 'p', 'g', 'a' );
break;
case VLC_FOURCC( 'P', 'C', 'M', ' ' ):
- fcc = VLC_FOURCC( 'a', 'r', 'a', 'w' );
+ fcc = VLC_CODEC_RAW_PCM;
break;
case VLC_FOURCC( 'A', 'A', 'C', ' ' ):
case VLC_FOURCC( 'A', 'A', 'C', 'P' ):
diff --git a/modules/demux/wav.c b/modules/demux/wav.c
index d48ca384a4..31cefd24be 100644
--- a/modules/demux/wav.c
+++ b/modules/demux/wav.c
@@ -299,7 +299,7 @@ static int Open( vlc_object_t * p_this )
if( p_sys->i_channel_mask )
{
- if( p_sys->fmt.i_codec == VLC_FOURCC('a','r','a','w') ||
+ if( p_sys->fmt.i_codec == VLC_CODEC_RAW_PCM ||
p_sys->fmt.i_codec == VLC_FOURCC('a','f','l','t') )
p_sys->i_chans_to_reorder =
aout_CheckChannelReorder( pi_channels_aout, NULL,
@@ -338,7 +338,7 @@ static int Open( vlc_object_t * p_this )
switch( p_sys->fmt.i_codec )
{
- case VLC_FOURCC( 'a', 'r', 'a', 'w' ):
+ case VLC_CODEC_RAW_PCM:
case VLC_FOURCC( 'a', 'f', 'l', 't' ):
case VLC_FOURCC( 'u', 'l', 'a', 'w' ):
case VLC_CODEC_ALAW:
diff --git a/src/misc/fourcc.c b/src/misc/fourcc.c
index 59ed71469b..41a255979f 100644
--- a/src/misc/fourcc.c
+++ b/src/misc/fourcc.c
@@ -143,7 +143,7 @@ vlc_fourcc_t vlc_fourcc_GetCodecAudio( vlc_fourcc_t i_fourcc, int i_bits )
return 0;
}
}
- else if( i_fourcc == VLC_FOURCC( 'a', 'r', 'a', 'w' ) )
+ else if( i_fourcc == VLC_CODEC_RAW_PCM )
{
switch( i_bytes )
{
diff --git a/src/misc/fourcc_list.h b/src/misc/fourcc_list.h
index 21f849aea2..400aaf67b5 100644
--- a/src/misc/fourcc_list.h
+++ b/src/misc/fourcc_list.h
@@ -1430,6 +1430,9 @@ static const staticentry_t p_list_audio[] = {
A("g72\x31"),
/* PCM */
+ B(VLC_CODEC_RAW_PCM, "Raw PCM"),
+ A("araw"),
+
B(VLC_CODEC_S8, "PCM S8"),
A("s8 "),
More information about the vlc-commits
mailing list