Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4_Elements.cpp')
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4_Elements.cpp103
1 files changed, 85 insertions, 18 deletions
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4_Elements.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4_Elements.cpp
index 4866faad8..dad3df2c8 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4_Elements.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4_Elements.cpp
@@ -40,6 +40,9 @@
#if defined(MEDIAINFO_AVC_YES)
#include "MediaInfo/Video/File_Avc.h"
#endif
+#if defined(MEDIAINFO_FFV1_YES)
+ #include "MediaInfo/Video/File_Ffv1.h"
+#endif
#if defined(MEDIAINFO_H263_YES)
#include "MediaInfo/Video/File_H263.h"
#endif
@@ -128,7 +131,7 @@ const char* Mpeg4_Meta_Kind(int32u Kind)
case 0x15 : return "Signed Integer"; //the size of the integer is derived from the container size
case 0x16 : return "Float 32";
case 0x17 : return "Float 64";
- default : return "Unknown";
+ default : return "";
}
}
@@ -145,7 +148,7 @@ const char* Mpeg4_TypeModifierName(int32u TypeModifierName)
case 0x06 : return "Matrix object";
case 0x07 : return "Graphics mode object";
case 0x76696465 : return "Image type";
- default : return "Unknown";
+ default : return "";
}
}
@@ -694,6 +697,9 @@ namespace Elements
const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_clap=0x636C6170;
const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_chan=0x6368616E;
const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_colr=0x636F6C72;
+ const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_colr_clcn=0x636C636E;
+ const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_colr_nclc=0x6E636C63;
+ const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_colr_prof=0x70726F66;
const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_d263=0x64323633;
const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_dac3=0x64616333;
const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_damr=0x64616D72;
@@ -840,7 +846,7 @@ const char* Mpeg4_Description(int32u Description)
case Elements::moov_trak_mdia_minf_stbl_stsd_xxxx_idfm_priv : return "Private";
case Elements::moov_trak_mdia_minf_stbl_stsd_xxxx_idfm_subs : return "Substitute if main codec not available";
case Elements::moov_trak_mdia_minf_stbl_stsd_xxxx_idfm_cspc : return "Native pixel format";
- default : return "Unknown";
+ default : return "";
}
}
@@ -1316,7 +1322,8 @@ void File_Mpeg4::cdat()
#if MEDIAINFO_DEMUX
Demux(Buffer+Buffer_Offset, (size_t)Element_Size, ContentType_MainStream);
- Streams[(int32u)Element_Code].Parsers[0]->FrameInfo=FrameInfo;
+ Streams[(int32u)Element_Code].Parsers[0]->FrameInfo.DTS=FrameInfo.DTS;
+ Streams[(int32u)Element_Code].Parsers[0]->FrameInfo.DUR=FrameInfo.DUR/(Element_Size/2);
#endif //MEDIAINFO_DEMUX
while (Element_Offset+2<=Element_Size)
{
@@ -4056,6 +4063,8 @@ void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxx()
default : Skip_XX(Element_TotalSize_Get()-Element_Offset, "Unknown");
}
}
+ if (Element_IsWaitingForMoreData())
+ return;
if (Streams[moov_trak_tkhd_TrackID].Parsers.size()==1 && !Retrieve(StreamKind_Last, StreamPos_Last, "Encryption").empty())
{
@@ -4488,6 +4497,7 @@ void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxxVideo()
int16u Width, Height, Depth, ColorTableID;
int8u CompressorName_Size;
+ bool IsGreyscale;
Skip_B2( "Version");
Skip_B2( "Revision level");
Skip_C4( "Vendor");
@@ -4511,9 +4521,31 @@ void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxxVideo()
//this is hard-coded 32-byte string
Skip_Local(32, "Compressor name");
Get_B2 (Depth, "Depth");
+ if (Depth>0x20 && Depth<0x40)
+ {
+ Depth-=0x20;
+ IsGreyscale=true;
+ }
+ else if (Depth==1)
+ IsGreyscale=true;
+ else
+ IsGreyscale=false;
Get_B2 (ColorTableID, "Color table ID");
- if (ColorTableID==0 && Width && Height) //In one file, if Zero-filled, Color table is not present
- Skip_XX(32, "Color Table");
+ if (!IsGreyscale && (Depth>1 && Depth<=8) && !ColorTableID)
+ {
+ int32u ColorStart;
+ int16u ColorEnd;
+ Get_B4 (ColorStart, "Color Start");
+ Skip_B2( "Color Count");
+ Get_B2 (ColorEnd, "Color End");
+ for (int32u Color=ColorStart; Color<=ColorEnd; Color++)
+ {
+ Skip_B2( "Alpha");
+ Skip_B2( "Red");
+ Skip_B2( "Green");
+ Skip_B2( "Blue");
+ }
+ }
if (moov_trak_mdia_minf_stbl_stsd_Pos)
return; //Handling only the first description
@@ -4590,6 +4622,13 @@ void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxxVideo()
Streams[moov_trak_tkhd_TrackID].Parsers.push_back(Parser);
}
#endif
+ #if defined(MEDIAINFO_FFV1_YES)
+ if (MediaInfoLib::Config.CodecID_Get(Stream_Video, InfoCodecID_Format_Mpeg4, Ztring().From_CC4((int32u)Element_Code), InfoCodecID_Format)==__T("FFV1"))
+ {
+ File_Ffv1* Parser=new File_Ffv1;
+ Streams[moov_trak_tkhd_TrackID].Parsers.push_back(Parser);
+ }
+ #endif
#if defined(MEDIAINFO_H263_YES)
if (MediaInfoLib::Config.CodecID_Get(Stream_Video, InfoCodecID_Format_Mpeg4, Ztring().From_CC4((int32u)Element_Code), InfoCodecID_Format)==__T("H.263"))
{
@@ -4692,17 +4731,12 @@ void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxxVideo()
//RGB(A)
if (Codec=="raw " || Codec=="rle ")
{
- if (Depth==1)
+ if (IsGreyscale)
{
Fill(Stream_Video, StreamPos_Last, Video_ColorSpace, "Y", Unlimited, true, true);
- Fill(Stream_Video, StreamPos_Last, Video_BitDepth, 1);
- }
- else if (Depth<15)
- {
- Fill(Stream_Video, StreamPos_Last, Video_ColorSpace, "RGB", Unlimited, true, true);
- Fill(Stream_Video, StreamPos_Last, Video_BitDepth, 8);
+ Fill(Stream_Video, StreamPos_Last, Video_BitDepth, Depth);
}
- else if (Depth==32 || Depth==36)
+ else if (Depth==32)
{
Fill(Stream_Video, StreamPos_Last, Video_ColorSpace, "RGBA", Unlimited, true, true);
Fill(Stream_Video, StreamPos_Last, Video_BitDepth, Depth/4);
@@ -5034,11 +5068,37 @@ void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxx_colr()
Element_Name("Color Parameter");
//Parsing
+ int32u ColorParameterType;
+ Get_C4 (ColorParameterType, "Color parameter type");
+ switch (ColorParameterType)
+ {
+ case Elements::moov_trak_mdia_minf_stbl_stsd_xxxx_colr_clcn: moov_trak_mdia_minf_stbl_stsd_xxxx_colr_nclc(true); break;
+ case Elements::moov_trak_mdia_minf_stbl_stsd_xxxx_colr_nclc: moov_trak_mdia_minf_stbl_stsd_xxxx_colr_nclc(); break;
+ case Elements::moov_trak_mdia_minf_stbl_stsd_xxxx_colr_prof: moov_trak_mdia_minf_stbl_stsd_xxxx_colr_prof(); break;
+ default : Skip_XX(Element_Size-Element_Offset, "Unknown");
+ }
+}
+
+//---------------------------------------------------------------------------
+void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxx_colr_nclc(bool LittleEndian)
+{
+ //Parsing
int16u colour_primaries, transfer_characteristics, matrix_coefficients;
- Skip_C4( "Color parameter type");
- Get_B2 (colour_primaries, "Primaries index"); Param_Info1(Mpegv_colour_primaries((int8u)colour_primaries));
- Get_B2 (transfer_characteristics, "Transfer function index"); Param_Info1(Mpegv_transfer_characteristics((int8u)transfer_characteristics));
- Get_B2 (matrix_coefficients, "Matrix index"); Param_Info1(Mpegv_matrix_coefficients((int8u)matrix_coefficients));
+ if (LittleEndian)
+ Get_L2 (colour_primaries, "Primaries index");
+ else
+ Get_B2 (colour_primaries, "Primaries index");
+ Param_Info1(Mpegv_colour_primaries((int8u)colour_primaries));
+ if (LittleEndian)
+ Get_L2 (transfer_characteristics, "Transfer function index");
+ else
+ Get_B2 (transfer_characteristics, "Transfer function index");
+ Param_Info1(Mpegv_transfer_characteristics((int8u)transfer_characteristics));
+ if (LittleEndian)
+ Get_L2 (matrix_coefficients, "Matrix index");
+ else
+ Get_B2 (matrix_coefficients, "Matrix index");
+ Param_Info1(Mpegv_matrix_coefficients((int8u)matrix_coefficients));
FILLING_BEGIN();
if (Retrieve(Stream_Video, StreamPos_Last, Video_colour_description_present).empty()) //Using only the first one met
@@ -5052,6 +5112,13 @@ void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxx_colr()
}
//---------------------------------------------------------------------------
+void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxx_colr_prof()
+{
+ //Parsing
+ Skip_XX(Element_Size-Element_Offset, "ICC profile"); //TODO: parse ICC profile
+}
+
+//---------------------------------------------------------------------------
void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxx_d263()
{
Element_Name("H263SpecificBox");