/* Copyright (c) MediaArea.net SARL. All Rights Reserved. * * Use of this source code is governed by a BSD-style license that can * be found in the License.html file in the root of the source tree. */ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // // AES3 PCM and non-PCM (SMPTE 337M) // //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //--------------------------------------------------------------------------- // Pre-compilation #include "MediaInfo/PreComp.h" #ifdef __BORLANDC__ #pragma hdrstop #endif //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #include "MediaInfo/Setup.h" //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #if defined(MEDIAINFO_SMPTEST0331_YES) //--------------------------------------------------------------------------- //--------------------------------------------------------------------------- #include "MediaInfo/Audio/File_SmpteSt0331.h" #if MEDIAINFO_EVENTS #include "MediaInfo/MediaInfo_Events.h" #endif //MEDIAINFO_EVENTS #if MEDIAINFO_SEEK #include "MediaInfo/MediaInfo_Internal.h" #endif //MEDIAINFO_SEEK //--------------------------------------------------------------------------- namespace MediaInfoLib { //*************************************************************************** // Constructor/Destructor //*************************************************************************** //--------------------------------------------------------------------------- File_SmpteSt0331::File_SmpteSt0331() :File__Analyze() { //Configuration #if MEDIAINFO_EVENTS ParserIDs[0]=MediaInfo_Parser_Aes3; #endif //MEDIAINFO_EVENTS #if MEDIAINFO_TRACE Trace_Layers_Update(8); //Stream #endif //MEDIAINFO_TRACE PTS_DTS_Needed=true; StreamSource=IsStream; //In QuantizationBits=0; } //*************************************************************************** // Streams management //*************************************************************************** //--------------------------------------------------------------------------- void File_SmpteSt0331::Streams_Fill() { int8u Channels_Count=0; for (int8u Pos=0; Pos<8; Pos++) if (Channels_valid&(1<>4) | ((Buffer[Buffer_Pos+2]<<4)&0xF0 ); Info[Info_Offset+1] = (Buffer[Buffer_Pos+2]>>4) | ((Buffer[Buffer_Pos+3]<<4)&0xF0 ); } else { Info[Info_Offset+0] = (Buffer[Buffer_Pos+0]>>4) | ((Buffer[Buffer_Pos+1]<<4)&0xF0 ); Info[Info_Offset+1] = (Buffer[Buffer_Pos+1]>>4) | ((Buffer[Buffer_Pos+2]<<4)&0xF0 ); Info[Info_Offset+2] = (Buffer[Buffer_Pos+2]>>4) | ((Buffer[Buffer_Pos+3]<<4)&0xF0 ); } Info_Offset+=QuantizationBits==16?2:3; } Element_Offset+=4; } } Element_Offset=4; #if MEDIAINFO_DEMUX OriginalBuffer_Size=(size_t)Element_Size; OriginalBuffer=(int8u*)(Buffer+Buffer_Offset); FrameInfo.PTS=FrameInfo.DTS; FrameInfo.DUR=(Element_Size-4)*1000000000/48000/32; // 48 kHz, 4 bytes per sample Demux_random_access=true; Element_Code=(int64u)-1; Element_Offset=0; Demux(Info, Info_Offset, ContentType_MainStream); Element_Offset=4; OriginalBuffer_Size=0; OriginalBuffer=NULL; #endif //MEDIAINFO_DEMUX delete[] Info; } Skip_XX(Element_Size-4, "Data"); Frame_Count++; Frame_Count_InThisBlock++; if (Frame_Count_NotParsedIncluded!=(int64u)-1) Frame_Count_NotParsedIncluded++; #if MEDIAINFO_DEMUX if (FrameInfo.DUR!=(int64u)-1) { if (FrameInfo.DTS!=(int64u)-1) FrameInfo.DTS+=FrameInfo.DUR; if (FrameInfo.PTS!=(int64u)-1) FrameInfo.PTS+=FrameInfo.DUR; } else { FrameInfo.DTS=(int64u)-1; FrameInfo.PTS=(int64u)-1; } #endif //MEDIAINFO_DEMUX FILLING_BEGIN(); if (!Status[IsAccepted]) Accept("SMPTE ST 331"); if (!Status[IsFilled]) Fill("SMPTE ST 331"); FILLING_END(); } //*************************************************************************** // C++ //*************************************************************************** } //NameSpace #endif //MEDIAINFO_SMPTEST0331_YES