Commit f16fcc17 authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

vlc_fourcc: add a define for "undf" (unidentified codec)

Technically it could be set to 0
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 30e0b393
......@@ -381,7 +381,7 @@ wave_format_tag_to_fourcc[] =
{ WAVE_FORMAT_ON2_AVC, VLC_CODEC_ON2AVC, "On2 Audio for Video Codec (VP7)" },
{ WAVE_FORMAT_ON2_AVC_2, VLC_CODEC_ON2AVC, "On2 Audio for Video Codec (VP6)" },
{ WAVE_FORMAT_UNKNOWN, VLC_FOURCC( 'u', 'n', 'd', 'f' ), "Unknown" }
{ WAVE_FORMAT_UNKNOWN, VLC_CODEC_UNKNOWN, "Unknown" }
};
static inline void wf_tag_to_fourcc( uint16_t i_tag, vlc_fourcc_t *fcc,
......@@ -421,7 +421,7 @@ sub_format_tag_to_fourcc[] =
{ VLC_AMBISONIC_SUBTYPE_PCM, VLC_FOURCC( 'a', 'r', 'a', 'w' ), "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" }
{ VLC_KSDATAFORMAT_SUBTYPE_UNKNOWN, VLC_CODEC_UNKNOWN, "Unknown" }
};
static inline int guidcmpbase( const GUID *s1, const GUID *s2 )
......
......@@ -24,6 +24,8 @@
#ifndef VLC_FOURCC_H
#define VLC_FOURCC_H 1
#define VLC_CODEC_UNKNOWN VLC_FOURCC('u','n','d','f')
/* Video codec */
#define VLC_CODEC_MPGV VLC_FOURCC('m','p','g','v')
#define VLC_CODEC_MP4V VLC_FOURCC('m','p','4','v')
......
......@@ -854,7 +854,7 @@ static int SessionsSetup( demux_t *p_demux )
/* Value taken from mplayer */
if( !strcmp( sub->mediumName(), "audio" ) )
{
es_format_Init( &tk->fmt, AUDIO_ES, VLC_FOURCC('u','n','d','f') );
es_format_Init( &tk->fmt, AUDIO_ES, VLC_CODEC_UNKNOWN );
tk->fmt.audio.i_channels = sub->numChannels();
tk->fmt.audio.i_rate = sub->rtpTimestampFrequency();
......@@ -1001,7 +1001,7 @@ static int SessionsSetup( demux_t *p_demux )
}
else if( !strcmp( sub->mediumName(), "video" ) )
{
es_format_Init( &tk->fmt, VIDEO_ES, VLC_FOURCC('u','n','d','f') );
es_format_Init( &tk->fmt, VIDEO_ES, VLC_CODEC_UNKNOWN );
if( !strcmp( sub->codecName(), "MPV" ) )
{
tk->fmt.i_codec = VLC_CODEC_MPGV;
......@@ -1149,7 +1149,7 @@ static int SessionsSetup( demux_t *p_demux )
}
else if( !strcmp( sub->mediumName(), "text" ) )
{
es_format_Init( &tk->fmt, SPU_ES, VLC_FOURCC('u','n','d','f') );
es_format_Init( &tk->fmt, SPU_ES, VLC_CODEC_UNKNOWN );
if( !strcmp( sub->codecName(), "T140" ) )
{
......
......@@ -360,7 +360,7 @@ int OpenDemux( vlc_object_t *p_this )
const char *psz_type = "unknown";
vlc_fourcc_t fcc = GetVlcFourcc( cp->codec_id );
if( !fcc )
fcc = VLC_FOURCC( 'u', 'n', 'd', 'f' );
fcc = VLC_CODEC_UNKNOWN;
/* Do not use the cover art as a stream */
if( s->disposition == AV_DISPOSITION_ATTACHED_PIC )
......
......@@ -2141,7 +2141,7 @@ vlc_fourcc_t AVI_FourccGetCodec( unsigned int i_cat, vlc_fourcc_t i_codec )
case VIDEO_ES:
return vlc_fourcc_GetCodec( i_cat, i_codec );
default:
return VLC_FOURCC( 'u', 'n', 'd', 'f' );
return VLC_CODEC_UNKNOWN;
}
}
......
......@@ -1335,7 +1335,7 @@ int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
if( p_tk->codec.empty() )
{
msg_Err( &sys.demuxer, "Empty codec id" );
p_tk->fmt.i_codec = VLC_FOURCC( 'u', 'n', 'd', 'f' );
p_tk->fmt.i_codec = VLC_CODEC_UNKNOWN;
return 0;
}
......@@ -1356,7 +1356,7 @@ int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
if( vars.p_tk->i_extra_data < (int)sizeof( VLC_BITMAPINFOHEADER ) )
{
msg_Err(vars.p_demuxer, "missing/invalid VLC_BITMAPINFOHEADER" );
vars.p_fmt->i_codec = VLC_FOURCC( 'u', 'n', 'd', 'f' );
vars.p_fmt->i_codec = VLC_CODEC_UNKNOWN;
}
else
{
......@@ -1511,7 +1511,7 @@ int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
if( p_tk->i_extra_data < (int)sizeof( WAVEFORMATEX ) )
{
msg_Err( vars.p_demuxer, "missing/invalid WAVEFORMATEX" );
p_tk->fmt.i_codec = VLC_FOURCC( 'u', 'n', 'd', 'f' );
p_tk->fmt.i_codec = VLC_CODEC_UNKNOWN;
}
else
{
......@@ -1541,7 +1541,7 @@ int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
/* FIXME should we use Samples */
if( p_tk->fmt.audio.i_channels > 2 &&
( p_tk->fmt.i_codec != VLC_FOURCC( 'u', 'n', 'd', 'f' ) ) )
( p_tk->fmt.i_codec != VLC_CODEC_UNKNOWN ) )
{
uint32_t wfextcm = GetDWLE( &p_wext->dwChannelMask );
int match;
......@@ -1575,7 +1575,7 @@ int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
}
}
if( p_tk->fmt.i_codec == VLC_FOURCC( 'u', 'n', 'd', 'f' ) )
if( p_tk->fmt.i_codec == VLC_CODEC_UNKNOWN )
msg_Err( vars.p_demuxer, "Unrecognized wf tag: 0x%x", GetWLE( &p_wf->wFormatTag ) );
}
p_fmt->b_packetized = !p_fmt->audio.i_blockalign;
......@@ -1743,7 +1743,7 @@ int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
if( memcmp( p, ".ra", 3 ) ) {
msg_Err( vars.p_demuxer, "Invalid Real ExtraData 0x%4.4s", (char *)p );
vars.p_tk->fmt.i_codec = VLC_FOURCC( 'u', 'n', 'd', 'f' );
vars.p_tk->fmt.i_codec = VLC_CODEC_UNKNOWN;
return false;
}
......@@ -1923,7 +1923,7 @@ int32_t matroska_segment_c::TrackInit( mkv_track_t * p_tk )
}
S_CASE_DEFAULT(str) {
msg_Err( vars.p_demuxer, "unknown codec id=`%s'", str );
vars.p_tk->fmt.i_codec = VLC_FOURCC( 'u', 'n', 'd', 'f' );
vars.p_tk->fmt.i_codec = VLC_CODEC_UNKNOWN;
}
};
......
......@@ -1851,8 +1851,7 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
wf_tag_to_fourcc( i_format_tag,
&p_stream->fmt.i_codec, 0 );
if( p_stream->fmt.i_codec ==
VLC_FOURCC('u','n','d','f') )
if( p_stream->fmt.i_codec == VLC_CODEC_UNKNOWN )
{
p_stream->fmt.i_codec = VLC_FOURCC( 'm', 's',
( i_format_tag >> 8 ) & 0xff,
......@@ -1986,8 +1985,7 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
wf_tag_to_fourcc( i_format_tag,
&p_stream->fmt.i_codec, 0 );
if( p_stream->fmt.i_codec ==
VLC_FOURCC('u','n','d','f') )
if( p_stream->fmt.i_codec == VLC_CODEC_UNKNOWN )
{
p_stream->fmt.i_codec = VLC_FOURCC( 'm', 's',
( i_format_tag >> 8 ) & 0xff,
......
......@@ -1872,7 +1872,7 @@ static void DeleteDecoder( decoder_t * p_dec )
/* */
static void DecoderUnsupportedCodec( decoder_t *p_dec, const es_format_t *fmt, bool b_decoding )
{
if (fmt->i_codec != VLC_FOURCC('u','n','d','f') && fmt->i_codec) {
if (fmt->i_codec != VLC_CODEC_UNKNOWN && fmt->i_codec) {
const char *desc = vlc_fourcc_GetDescription(fmt->i_cat, fmt->i_codec);
if (!desc || !*desc)
desc = N_("No description for this codec");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment