X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fmisc%2Ffourcc.c;h=8a6121b5aadd9832b892a3edba55d27eda3b3e71;hb=4db53934dd02d9f2564a429ec9255279ae9e237c;hp=72ff10518e1ccd95f862152788c00ad9afe1ff0c;hpb=e6d6cbdfdf092ce84d6210d3b27b5994af5e2212;p=vlc diff --git a/src/misc/fourcc.c b/src/misc/fourcc.c index 72ff10518e..8a6121b5aa 100644 --- a/src/misc/fourcc.c +++ b/src/misc/fourcc.c @@ -1,7 +1,7 @@ /***************************************************************************** * fourcc.c: fourcc helpers functions ***************************************************************************** - * Copyright (C) 2003-2004 the VideoLAN team + * Copyright (C) 2009 Laurent Aimar * $Id$ * * Authors: Laurent Aimar @@ -56,16 +56,18 @@ typedef struct /* */ static const entry_t p_list_video[] = { - B(VLC_CODEC_MP1V, "MPEG-1 Video"), + + B(VLC_CODEC_MPGV, "MPEG-1/2 Video"), + A("mpgv"), A("mp1v"), A("mpeg"), A("mpg1"), - E("PIM1", "Pinnacle DC1000 (MPEG-1 Video)"), - - B(VLC_CODEC_MP2V, "MPEG-2 Video"), A("mp2v"), A("MPEG"), A("mpg2"), + + E("PIM1", "Pinnacle DC1000 (MPEG-1 Video)"), + E("hdv1", "HDV 720p30 (MPEG-2 Video)"), E("hdv2", "Sony HDV (MPEG-2 Video)"), E("hdv3", "FCP HDV (MPEG-2 Video)"), @@ -80,11 +82,39 @@ static const entry_t p_list_video[] = { E("mx4p", "MPEG2 IMX PAL 625/50 40mb/s (FCP)"), E("mx3n", "MPEG2 IMX NTSC 525/60 30mb/s (FCP)"), E("mx3p", "MPEG2 IMX NTSC 625/50 30mb/s (FCP)"), - E("xdv2", "XDCAM HD 1080i60"), + + E("xdv1", "XDCAM HD"), + E("xdv2", "XDCAM HD 1080i60 35mb/s"), + E("xdv3", "XDCAM HD 1080i50 35mb/s"), + E("xdv4", "XDCAM HD"), + E("xdv5", "XDCAM HD"), + E("xdv6", "XDCAM HD 1080p24 35mb/s"), + E("xdv7", "XDCAM HD 1080p25 35mb/s"), + E("xdv8", "XDCAM HD 1080p30 35mb/s"), + E("xdv9", "XDCAM HD"), + + E("xdva", "XDCAM"), + E("xdvb", "XDCAM"), + E("xdvc", "XDCAM"), + E("xdvd", "XDCAM"), + E("xdve", "XDCAM"), + E("xdvf", "XDCAM"), + + E("xd5a", "XDCAM"), + E("xd5b", "XDCAM"), + E("xd5c", "XDCAM"), + E("xd5d", "XDCAM"), + E("xd5e", "XDCAM"), + E("xd5f", "XDCAM"), + E("xd59", "XDCAM"), + E("AVmp", "AVID IMX PAL"), + E("MMES", "Matrox MPEG-2"), + E("mmes", "Matrox MPEG-2"), + E("PIM2", "Pinnacle MPEG-2"), + E("LMP2", "Lead MPEG-2"), - B(VLC_CODEC_MPGV, "MPEG-1/2 Video"), - A("mpgv"), + E("VCR2", "ATI VCR-2"), B(VLC_CODEC_MP4V, "MPEG-4 Video"), A("mp4v"), @@ -94,7 +124,6 @@ static const entry_t p_list_video[] = { A("mp4s"), A("M4S2"), A("m4s2"), - A("mp4v"), A("MP4V"), A("\x04\x00\x00\x00"), A("m4cc"), @@ -102,10 +131,8 @@ static const entry_t p_list_video[] = { A("FMP4"), A("fmp4"), A("DCOD"), - A("fmp4"), A("MVXM"), A("PM4V"), - A("fmp4"), A("M4T3"), A("GEOX"), A("DMK2"), @@ -140,7 +167,10 @@ static const entry_t p_list_video[] = { E("FVFW", "FFmpeg MPEG-4"), E("FFDS", "FFDShow MPEG-4"), E("VIDM", "vidm 4.01 codec"), - + /* 3ivx delta 3.5 Unsupported + * putting it here gives extreme distorted images */ + //E("3IV1", "3ivx delta 3.5 MPEG-4 Video"), + //E("3iv1", "3ivx delta 3.5 MPEG-4 Video"), /* MSMPEG4 v1 */ B(VLC_CODEC_DIV1, "MS MPEG-4 Video v1"), @@ -172,6 +202,8 @@ static const entry_t p_list_video[] = { A("div5"), A("DIV6"), A("div6"), + E("divf", "DivX 4.12"), + E("DIVF", "DivX 4.12"), /* Cool Codec */ A("COL1"), A("col1"), @@ -185,6 +217,7 @@ static const entry_t p_list_video[] = { /* who knows? */ A("3VID"), A("3vid"), + A("DVX3"), /* Sorenson v1 */ B(VLC_CODEC_SVQ1, "SVQ-1 (Sorenson Video v1)"), @@ -246,6 +279,7 @@ static const entry_t p_list_video[] = { /* Flash (H263) variant */ B(VLC_CODEC_FLV1, "Flash Video"), A("FLV1"), + A("flv "), /* H261 */ B(VLC_CODEC_H261, "H.261"), @@ -265,12 +299,17 @@ static const entry_t p_list_video[] = { A("JFIF"), A("JPGL"), A("AVDJ"), + A("MMJP"), + A("QIVG"), /* AVID MJPEG */ E("AVRn", "Avid Motion JPEG"), + E("AVDJ", "Avid Motion JPEG"), E("ADJV", "Avid Motion JPEG"), E("dmb1", "Motion JPEG OpenDML Video"), + E("ijpg", "Intergraph JPEG Video"), E("IJPG", "Intergraph JPEG Video"), E("ACDV", "ACD Systems Digital"), + E("SLMJ", "SL M-JPEG"), B(VLC_CODEC_MJPGB, "Motion JPEG B Video"), A("mjpb"), @@ -294,9 +333,11 @@ static const entry_t p_list_video[] = { /* DV */ B(VLC_CODEC_DV, "DV Video"), A("dv "), - A("dvsd"), A("dvsl"), A("DVSD"), + A("dvsd"), + A("DVCS"), + A("dvcs"), A("dvhd"), A("dvhp"), A("dvhq"), @@ -308,9 +349,11 @@ static const entry_t p_list_video[] = { A("dvc "), A("dv25"), A("dvh1"), + A("dvs1"), E("dvcp", "DV Video PAL"), E("dvp ", "DV Video Pro"), E("dvpp", "DV Video Pro PAL"), + E("dv50", "DV Video C Pro 50"), E("dv5p", "DV Video C Pro 50 PAL"), E("dv5n", "DV Video C Pro 50 NTSC"), E("AVdv", "AVID DV"), @@ -318,6 +361,7 @@ static const entry_t p_list_video[] = { E("CDVC", "Canopus DV Video"), E("cdvc", "Canopus DV Video"), E("CDVH", "Canopus DV Video"), + E("cdvh", "Canopus DV Video"), /* Windows Media Video */ B(VLC_CODEC_WMV1, "Windows Media Video 7"), @@ -381,6 +425,7 @@ static const entry_t p_list_video[] = { B(VLC_CODEC_VP3, "On2's VP3 Video"), A("VP3 "), A("VP30"), + A("vp30"), A("VP31"), A("vp31"), @@ -453,6 +498,8 @@ static const entry_t p_list_video[] = { B(VLC_CODEC_RPZA, "Apple Video"), A("rpza"), A("azpr"), + A("RPZA"), + A("AZPR"), B(VLC_CODEC_SMC, "Apple graphics"), A("smc "), @@ -482,6 +529,7 @@ static const entry_t p_list_video[] = { /* Duck TrueMotion */ B(VLC_CODEC_TRUEMOTION1, "Duck TrueMotion v1 Video"), A("DUCK"), + A("PVEZ"), B(VLC_CODEC_TRUEMOTION2, "Duck TrueMotion v2.0 Video"), A("TM20"), @@ -506,6 +554,7 @@ static const entry_t p_list_video[] = { B(VLC_CODEC_VIXL, "Miro/Pinnacle VideoXL Video"), A("VIXL"), + A("XIXL"), E("PIXL", "Pinnacle VideoXL Video"), B(VLC_CODEC_LOCO, "LOCO Video"), @@ -540,6 +589,7 @@ static const entry_t p_list_video[] = { B(VLC_CODEC_CAVS, "Chinese AVS"), A("CAVS"), A("AVs2"), + A("avs2"), /* */ B(VLC_CODEC_DNXHD, "DNxHD"), @@ -635,6 +685,9 @@ static const entry_t p_list_video[] = { A("cyuv"), A("CYUV"), + B(VLC_CODEC_V210, "10-bit 4:2:2 Component YCbCr"), + A("v210"), + /* Videogames Codecs */ /* Interplay MVE */ @@ -714,12 +767,6 @@ static const entry_t p_list_video[] = { B(VLC_CODEC_PCX, "Personal Computer Exchange Image"), A("pcx "), - /* 3ivx delta 3.5 Unsupported - * putting it here gives extreme distorted images - { VLC_FOURCC('3','I','V','1'), CODEC_ID_MPEG4, - VIDEO_ES, "MPEG-4 Video" }, - { VLC_FOURCC('3','i','v','1'), CODEC_ID_MPEG4, - VIDEO_ES, "MPEG-4 Video" }, */ B(0, "") }; static const entry_t p_list_audio[] = { @@ -1139,6 +1186,87 @@ vlc_fourcc_t vlc_fourcc_GetCodec( int i_cat, vlc_fourcc_t i_fourcc ) return CreateFourcc( e.p_class ); } +vlc_fourcc_t vlc_fourcc_GetCodecFromString( int i_cat, const char *psz_fourcc ) +{ + if( !psz_fourcc || strlen(psz_fourcc) != 4 ) + return 0; + return vlc_fourcc_GetCodec( i_cat, + VLC_FOURCC( psz_fourcc[0], psz_fourcc[1], + psz_fourcc[2], psz_fourcc[3] ) ); +} + +vlc_fourcc_t vlc_fourcc_GetCodecAudio( vlc_fourcc_t i_fourcc, int i_bits ) +{ + const int i_bytes = ( i_bits + 7 ) / 8; + + if( i_fourcc == VLC_FOURCC( 'a', 'f', 'l', 't' ) ) + { + switch( i_bytes ) + { + case 4: + return VLC_CODEC_FL32; + case 8: + return VLC_CODEC_FL64; + default: + return 0; + } + } + else if( i_fourcc == VLC_FOURCC( 'a', 'r', 'a', 'w' ) || + i_fourcc == VLC_FOURCC( 'p', 'c', 'm', ' ' ) ) + { + switch( i_bytes ) + { + case 1: + return VLC_CODEC_U8; + case 2: + return VLC_CODEC_S16L; + case 3: + return VLC_CODEC_S24L; + break; + case 4: + return VLC_CODEC_S32L; + default: + return 0; + } + } + else if( i_fourcc == VLC_FOURCC( 't', 'w', 'o', 's' ) ) + { + switch( i_bytes ) + { + case 1: + return VLC_CODEC_S8; + case 2: + return VLC_CODEC_S16B; + case 3: + return VLC_CODEC_S24B; + case 4: + return VLC_CODEC_S32B; + default: + return 0; + } + } + else if( i_fourcc == VLC_FOURCC( 's', 'o', 'w', 't' ) ) + { + switch( i_bytes ) + { + case 1: + return VLC_CODEC_S8; + case 2: + return VLC_CODEC_S16L; + case 3: + return VLC_CODEC_S24L; + case 4: + return VLC_CODEC_S32L; + default: + return 0; + } + } + else + { + return vlc_fourcc_GetCodec( AUDIO_ES, i_fourcc ); + } +} + /* */ const char *vlc_fourcc_GetDescription( int i_cat, vlc_fourcc_t i_fourcc ) {