Codebase list libmediainfo / 54d09ca
Update upstream source from tag 'upstream/22.09+dfsg' Update to upstream version '22.09+dfsg' with Debian dir c782a2ce880c3da5a93c7feed9e6bc7f71e3a17e Chow Loong Jin 1 year, 6 months ago
71 changed file(s) with 2136 addition(s) and 460 deletion(s). Raw diff Collapse all Expand all
00 I changed some elements in the interface.
11 No break in binary compatibily (no crash), but some details.
2
3 22.06 --> 22.09
4 ---------------
5 - TimeCode_Striped replaced by TimeCode_Stripped (value was buggy in previous builds anyway)
6 - ConformanceChecks replaced by ConformanceErrors
27
38 18.05 --> 18.08
49 ---------------
66 bug reports and feature request are here:
77 https://sourceforge.net/p/mediainfo/_list/tickets
88
9 Version 22.09, 2022-10-04
10 -------------
11 + Italian language update
12 + USAC: IOD and sampling rate coherency checking
13 + ADM: support of nested objects and complementary objects
14 + AC-4: Display of Custom downmix targets
15 + IAB: Parsing of IAB bitstream and ADM-like output
16 + Frame rate: store FrameRate_Num/Den also for integer values
17 + MPEG-4/MOV: support of time codes >30 fps
18 + MOV/MPEG-4: List of QuickTime time code discontinuities
19 + Dolby Vision: add info about more profiles
20 x Text streams: show stream frame rate if not same as container frame rate
21 x CDP: fix rounding of frame rate
22 x SCC: fix of CEA-608 FirstDisplay_Delay_Frames
23 x SCC: fix TimeCode_Last
24 x MPEG-4/MOV: last time code value for all kind of QuickTime time codes
25 x MOV/MPEG-4: Fix frame count for NDF non-integer frame rates
26 x JSON: fix invalid output in some corner cases
27 x Several other parsing bug/crash fixes (thanks to fuzzing by users)
28
929 Version 22.06, 2022-06-23
1030 -------------
1131 + MXF: FFV1 support
44 list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules")
55
66 set(MediaInfoLib_MAJOR_VERSION 22)
7 set(MediaInfoLib_MINOR_VERSION 06)
7 set(MediaInfoLib_MINOR_VERSION 09)
88 set(MediaInfoLib_PATCH_VERSION 0)
99 set(MediaInfoLib_VERSION ${MediaInfoLib_MAJOR_VERSION}.${MediaInfoLib_MINOR_VERSION})
1010
44 dnl -------------------------------------------------------------------------
55 dnl Name and version
66 dnl
7 AC_INIT([libmediainfo], [22.06])
7 AC_INIT([libmediainfo], [22.09])
88
99 dnl -------------------------------------------------------------------------
1010 dnl Test if we are at the good place
5959 AC_ARG_ENABLE(minimal, AC_HELP_STRING([--enable-minimal], [Enable minimal management (except parsers)]),MediaInfoMinimal=$enableval, MediaInfoMinimal=depend)
6060 AC_ARG_ENABLE(trace, AC_HELP_STRING([--enable-trace], [Enable trace management]), MediaInfoTrace=$enableval, MediaInfoTrace=depend)
6161 AC_ARG_ENABLE(events, AC_HELP_STRING([--enable-events], [Enable events management]), MediaInfoEvents=$enableval, MediaInfoEvents=depend)
62 AC_ARG_ENABLE(conformance, AC_HELP_STRING([--enable-conformance], [Enable conformance tests]), MediaInfoConformance=$enableval, MediaInfoConformance=depend)
6263 AC_ARG_ENABLE(demux, AC_HELP_STRING([--enable-demux], [Enable demux management]), MediaInfoDemux=$enableval, MediaInfoDemux=depend)
6364 AC_ARG_ENABLE(libmms-describe-support, AC_HELP_STRING([--enable-libmms-describe-support], [Enable customized libmms describe support]), MediaInfoLibmmsDescribeSupport=$enableval, MediaInfoLibmmsDescribeSupport=depend)
6465 AC_ARG_ENABLE(dll, AC_HELP_STRING([--disable-dll], [Disable dll iterface]), MediaInfoDll=$enableval, MediaInfoDll=depend)
223224 if test "$MediaInfoMinimal" = "no"; then AC_DEFINE(MEDIAINFO_MINIMAL_NO) fi; if test "$MediaInfoMinimal" = "yes"; then AC_DEFINE(MEDIAINFO_MINIMAL_YES) fi
224225 if test "$MediaInfoTrace" = "no"; then AC_DEFINE(MEDIAINFO_TRACE_NO) fi; if test "$MediaInfoTrace" = "yes"; then AC_DEFINE(MEDIAINFO_TRACE_YES) fi
225226 if test "$MediaInfoEvents" = "no"; then AC_DEFINE(MEDIAINFO_EVENTS_NO) fi; if test "$MediaInfoEvents" = "yes"; then AC_DEFINE(MEDIAINFO_EVENTS_YES) fi
227 if test "$MediaInfoConformance" = "no"; then AC_DEFINE(MEDIAINFO_CONFORMANCE_NO) fi; if test "$MediaInfoConformance" = "yes"; then AC_DEFINE(MEDIAINFO_CONFORMANCE_YES) fi
226228 if test "$MediaInfoDemux" = "no"; then AC_DEFINE(MEDIAINFO_DEMUX_NO) fi; if test "$MediaInfoDemux" = "yes"; then AC_DEFINE(MEDIAINFO_DEMUX_YES) fi
227229 if test "$MediaInfoJni" = "no"; then AC_DEFINE(MEDIAINFO_JNI_NO) fi; if test "$MediaInfoJni" = "yes"; then AC_DEFINE(MEDIAINFO_JNI_YES) fi
228230 if test "$MediaInfoLibmmsDescribeSupport" = "yes"; then AC_DEFINE(MEDIAINFO_LIBMMS_DESCRIBE_SUPPORT) fi
11 # Maintainer: MediaArea.net SARL <info@mediaarea.net>
22 # Contributor: hydro <hydro@freenet.de>
33
4 pkgname=('libmediainfo' 'python2-mediainfo' 'python-mediainfo')
5 pkgver=22.06
4 pkgname=('libmediainfo' 'python-mediainfo')
5 pkgver=22.09
66 pkgrel=1
77 pkgdesc="shared library for mediainfo"
88 arch=('i686' 'x86_64')
99 url="http://mediaarea.net"
1010 license=('BSD-2-Clause')
11 makedepends=('libtool' 'automake' 'autoconf' 'python' 'python2')
11 makedepends=('libtool' 'automake' 'autoconf' 'python')
1212 depends=( 'curl' 'libmms' 'libzen>=0.4.39')
1313 source=(${pkgname}_${pkgver}.orig.tar.xz)
1414 md5sums=('00000000000000000000000000000000')
3030 done
3131 }
3232
33 package_python2-mediainfo() {
34 pkgdesc="shared library for mediainfo - python2 binding"
35 depends=('python' 'libmediainfo')
36 local dst=$(python2 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
37 install -dm 755 $pkgdir/$dst
38 install -m 644 $srcdir/MediaInfoLib/Source/MediaInfoDLL/MediaInfoDLL.py $pkgdir/$dst
39 python2 -m compileall $pkgdir/$dst
40 }
41
4233 package_python-mediainfo() {
4334 pkgdesc="shared library for mediainfo - python3 binding"
4435 depends=('python3' 'libmediainfo')
11 Source: libmediainfo
22 Binary: libmediainfo-dev, libmediainfo0, python-mediainfodll, python3-mediainfodll, libmediainfo-doc libmediainfo0-dbg
33 Architecture: any all
4 Version: 22.06-1
4 Version: 22.09-1
55 Maintainer: MediaArea.net SARL <info@mediaarea.net>
66 Homepage: http://MediaArea.net/MediaInfo
77 Standards-Version: 3.9.6
1515 python-mediainfodll deb python optional arch=all
1616 python3-mediainfodll deb python optional arch=all
1717 Checksums-Sha1:
18 0000000000000000000000000000000000000000 000000 libmediainfo_22.06.orig.tar.xz
19 0000000000000000000000000000000000000000 000000 libmediainfo_22.06-1.debian.tar.xz
18 0000000000000000000000000000000000000000 000000 libmediainfo_22.09.orig.tar.xz
19 0000000000000000000000000000000000000000 000000 libmediainfo_22.09-1.debian.tar.xz
2020 Checksums-Sha256:
21 0000000000000000000000000000000000000000000000000000000000000000 000000 libmediainfo_22.06.orig.tar.xz
22 0000000000000000000000000000000000000000000000000000000000000000 000000 libmediainfo_22.06-1.debian.tar.xz
21 0000000000000000000000000000000000000000000000000000000000000000 000000 libmediainfo_22.09.orig.tar.xz
22 0000000000000000000000000000000000000000000000000000000000000000 000000 libmediainfo_22.09-1.debian.tar.xz
2323 Files:
24 00000000000000000000000000000000 000000 libmediainfo_22.06.orig.tar.xz
25 00000000000000000000000000000000 000000 libmediainfo_22.06-1.debian.tar.xz
24 00000000000000000000000000000000 000000 libmediainfo_22.09.orig.tar.xz
25 00000000000000000000000000000000 000000 libmediainfo_22.09-1.debian.tar.xz
0 %global libmediainfo_version 22.06
0 %global libmediainfo_version 22.09
11 %global libmediainfo_version_major 22
2 %global libmediainfo_version_minor 06
2 %global libmediainfo_version_minor 09
33 %global libzen_version 0.4.39
44 %global libzen_version_major 0
55 %global libzen_version_minor 4
410410 %endif
411411
412412 %changelog
413 * Sun Jan 01 2012 MediaArea.net SARL <info@mediaarea.net> - 22.06-0
413 * Sun Jan 01 2012 MediaArea.net SARL <info@mediaarea.net> - 22.09-0
414414 - See History.txt for more info and real dates
415415 - Previous packages made by Toni Graffy <toni@links2linux.de>
416416 - Fedora style made by Vasiliy N. Glazov <vascom2@gmail.com>
00 #include <winresrc.h>
11
22 VS_VERSION_INFO VERSIONINFO
3 FILEVERSION 22,06,0,0
4 PRODUCTVERSION 22,06,0,0
3 FILEVERSION 22,09,0,0
4 PRODUCTVERSION 22,09,0,0
55 FILEFLAGSMASK 0x3fL
66 #ifdef _DEBUG
77 FILEFLAGS 0x1L
1818 BEGIN
1919 VALUE "CompanyName", "MediaArea.net"
2020 VALUE "FileDescription", "Most relevant technical and tag data for video and audio files"
21 VALUE "FileVersion", "22.06.0.0"
21 VALUE "FileVersion", "22.09.0.0"
2222 VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL"
2323 VALUE "ProductName", "MediaInfo"
24 VALUE "ProductVersion", "22.06.0.0"
24 VALUE "ProductVersion", "22.09.0.0"
2525 END
2626 END
2727 BLOCK "VarFileInfo"
00 #include <winresrc.h>
11
22 VS_VERSION_INFO VERSIONINFO
3 FILEVERSION 22,06,0,0
4 PRODUCTVERSION 22,06,0,0
3 FILEVERSION 22,09,0,0
4 PRODUCTVERSION 22,09,0,0
55 FILEFLAGSMASK 0x3fL
66 #ifdef _DEBUG
77 FILEFLAGS 0x1L
1818 BEGIN
1919 VALUE "CompanyName", "MediaArea.net"
2020 VALUE "FileDescription", "Most relevant technical and tag data for video and audio files"
21 VALUE "FileVersion", "22.06.0.0"
21 VALUE "FileVersion", "22.09.0.0"
2222 VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL"
2323 VALUE "ProductName", "MediaInfo"
24 VALUE "ProductVersion", "22.06.0.0"
24 VALUE "ProductVersion", "22.09.0.0"
2525 END
2626 END
2727 BLOCK "VarFileInfo"
00 #include <winresrc.h>
11
22 VS_VERSION_INFO VERSIONINFO
3 FILEVERSION 22,06,0,0
4 PRODUCTVERSION 22,06,0,0
3 FILEVERSION 22,09,0,0
4 PRODUCTVERSION 22,09,0,0
55 FILEFLAGSMASK 0x3fL
66 #ifdef _DEBUG
77 FILEFLAGS 0x1L
1818 BEGIN
1919 VALUE "CompanyName", "MediaArea.net"
2020 VALUE "FileDescription", "Most relevant technical and tag data for video and audio files"
21 VALUE "FileVersion", "22.06.0.0"
21 VALUE "FileVersion", "22.09.0.0"
2222 VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL"
2323 VALUE "ProductName", "MediaInfo"
24 VALUE "ProductVersion", "22.06.0.0"
24 VALUE "ProductVersion", "22.09.0.0"
2525 END
2626 END
2727 BLOCK "VarFileInfo"
00 #include <winresrc.h>
11
22 VS_VERSION_INFO VERSIONINFO
3 FILEVERSION 22,06,0,0
4 PRODUCTVERSION 22,06,0,0
3 FILEVERSION 22,09,0,0
4 PRODUCTVERSION 22,09,0,0
55 FILEFLAGSMASK 0x3fL
66 #ifdef _DEBUG
77 FILEFLAGS 0x1L
1818 BEGIN
1919 VALUE "CompanyName", "MediaArea.net"
2020 VALUE "FileDescription", "Most relevant technical and tag data for video and audio files"
21 VALUE "FileVersion", "22.06.0.0"
21 VALUE "FileVersion", "22.09.0.0"
2222 VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL"
2323 VALUE "ProductName", "MediaInfo"
24 VALUE "ProductVersion", "22.06.0.0"
24 VALUE "ProductVersion", "22.09.0.0"
2525 END
2626 END
2727 BLOCK "VarFileInfo"
00 #include <winresrc.h>
11
22 VS_VERSION_INFO VERSIONINFO
3 FILEVERSION 22,06,0,0
4 PRODUCTVERSION 22,06,0,0
3 FILEVERSION 22,09,0,0
4 PRODUCTVERSION 22,09,0,0
55 FILEFLAGSMASK 0x3fL
66 #ifdef _DEBUG
77 FILEFLAGS 0x1L
1818 BEGIN
1919 VALUE "CompanyName", "MediaArea.net"
2020 VALUE "FileDescription", "Most relevant technical and tag data for video and audio files"
21 VALUE "FileVersion", "22.06.0.0"
21 VALUE "FileVersion", "22.09.0.0"
2222 VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL"
2323 VALUE "ProductName", "MediaInfo"
24 VALUE "ProductVersion", "22.06.0.0"
24 VALUE "ProductVersion", "22.09.0.0"
2525 END
2626 END
2727 BLOCK "VarFileInfo"
00 #include <winresrc.h>
11
22 VS_VERSION_INFO VERSIONINFO
3 FILEVERSION 22,06,0,0
4 PRODUCTVERSION 22,06,0,0
3 FILEVERSION 22,09,0,0
4 PRODUCTVERSION 22,09,0,0
55 FILEFLAGSMASK 0x3fL
66 #ifdef _DEBUG
77 FILEFLAGS 0x1L
1818 BEGIN
1919 VALUE "CompanyName", "MediaArea.net"
2020 VALUE "FileDescription", "Most relevant technical and tag data for video and audio files"
21 VALUE "FileVersion", "22.06.0.0"
21 VALUE "FileVersion", "22.09.0.0"
2222 VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL"
2323 VALUE "ProductName", "MediaInfo"
24 VALUE "ProductVersion", "22.06.0.0"
24 VALUE "ProductVersion", "22.09.0.0"
2525 END
2626 END
2727 BLOCK "VarFileInfo"
00 #include <winresrc.h>
11
22 VS_VERSION_INFO VERSIONINFO
3 FILEVERSION 22,06,0,0
4 PRODUCTVERSION 22,06,0,0
3 FILEVERSION 22,09,0,0
4 PRODUCTVERSION 22,09,0,0
55 FILEFLAGSMASK 0x3fL
66 #ifdef _DEBUG
77 FILEFLAGS 0x1L
1818 BEGIN
1919 VALUE "CompanyName", "MediaArea.net"
2020 VALUE "FileDescription", "Most relevant technical and tag data for video and audio files"
21 VALUE "FileVersion", "22.06.0.0"
21 VALUE "FileVersion", "22.09.0.0"
2222 VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL"
2323 VALUE "ProductName", "MediaInfo"
24 VALUE "ProductVersion", "22.06.0.0"
24 VALUE "ProductVersion", "22.09.0.0"
2525 END
2626 END
2727 BLOCK "VarFileInfo"
1818 BEGIN
1919 VALUE "CompanyName", "MediaArea.net"
2020 VALUE "FileDescription", "Most relevant technical and tag data for video and audio files"
21 VALUE "FileVersion", "22.06.0.0"
21 VALUE "FileVersion", "22.09.0.0"
2222 VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL"
2323 VALUE "ProductName", "MediaInfo"
24 VALUE "ProductVersion", "22.06.0.0"
24 VALUE "ProductVersion", "22.09.0.0"
2525 END
2626 END
2727 BLOCK "VarFileInfo"
0 libmediainfo (22.06-1) experimental; urgency=medium
1
2 * Upstream version 22.06
0 libmediainfo (22.09-1) experimental; urgency=medium
1
2 * Upstream version 22.09
33 For details, see https://github.com/MediaArea/MediaInfoLib/blob/master/History_DLL.txt
44
55 -- MediaArea <info@mediaarea.net> Mon, 02 Nov 2015 10:30:00 +0100
11 Source: libmediainfo
22 Binary: libmediainfo-dev, libmediainfo0v5, python-mediainfodll, python3-mediainfodll, libmediainfo-doc libmediainfo0v5-dbg
33 Architecture: any all
4 Version: 22.06-1deb9
4 Version: 22.09-1deb9
55 Maintainer: MediaArea.net SARL <info@mediaarea.net>
66 Homepage: http://MediaArea.net/MediaInfo
77 Standards-Version: 3.9.6
1515 python-mediainfodll deb python optional arch=all
1616 python3-mediainfodll deb python optional arch=all
1717 Checksums-Sha1:
18 0000000000000000000000000000000000000000 000000 libmediainfo_22.06.orig.tar.xz
19 0000000000000000000000000000000000000000 000000 libmediainfo_22.06-1deb9.debian.tar.xz
18 0000000000000000000000000000000000000000 000000 libmediainfo_22.09.orig.tar.xz
19 0000000000000000000000000000000000000000 000000 libmediainfo_22.09-1deb9.debian.tar.xz
2020 Checksums-Sha256:
21 0000000000000000000000000000000000000000000000000000000000000000 000000 libmediainfo_22.06.orig.tar.xz
22 0000000000000000000000000000000000000000000000000000000000000000 000000 libmediainfo_22.06-1deb9.debian.tar.xz
21 0000000000000000000000000000000000000000000000000000000000000000 000000 libmediainfo_22.09.orig.tar.xz
22 0000000000000000000000000000000000000000000000000000000000000000 000000 libmediainfo_22.09-1deb9.debian.tar.xz
2323 Files:
24 00000000000000000000000000000000 000000 libmediainfo_22.06.orig.tar.xz
25 00000000000000000000000000000000 000000 libmediainfo_22.06-1deb9.debian.tar.xz
24 00000000000000000000000000000000 000000 libmediainfo_22.09.orig.tar.xz
25 00000000000000000000000000000000 000000 libmediainfo_22.09-1deb9.debian.tar.xz
88
99 #Creation of known directories and filenames
1010 name="libmediainfo0"
11 version="22.06"
11 version="22.09"
1212 Home=`pwd`
1313 install_prefix=${Home}/mk_package
1414 packagecreation_prefix=${Home}/create_package
2020 export CXX="$(xcrun -sdk iphoneos -find clang++)"
2121 export AR="$(xcrun -sdk iphoneos -find ar)"
2222 export RANLIB="$(xcrun -sdk iphoneos -find ranlib)"
23 export CFLAGS="-stdlib=libc++ -fembed-bitcode -arch ${target} -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform.sdk -miphoneos-version-min=$IPHONEOS_DEPLOYMENT_TARGET"
24 export CXXFLAGS="-stdlib=libc++ -fembed-bitcode -arch ${target} -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform.sdk -miphoneos-version-min=$IPHONEOS_DEPLOYMENT_TARGET"
25 export LDFLAGS="-stdlib=libc++ -fembed-bitcode -arch ${target} -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform.sdk"
23 export CFLAGS="-stdlib=libc++ -arch ${target} -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform.sdk -miphoneos-version-min=$IPHONEOS_DEPLOYMENT_TARGET"
24 export CXXFLAGS="-stdlib=libc++ -arch ${target} -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform.sdk -miphoneos-version-min=$IPHONEOS_DEPLOYMENT_TARGET"
25 export LDFLAGS="-stdlib=libc++ -arch ${target} -isysroot $PLATFORMPATH/$platform.platform/Developer/SDKs/$platform.sdk"
2626
2727 pushd "$(dirname "${BASH_SOURCE[0]}")/../GNU/Library"
2828 ./configure --prefix="$prefix" --disable-shared --enable-static --host=$host-apple-darwin
0 22.06
0 22.09
33 ; Some defines
44 !define PRODUCT_NAME "MediaInfo"
55 !define PRODUCT_PUBLISHER "MediaArea.net"
6 !define PRODUCT_VERSION "22.06"
6 !define PRODUCT_VERSION "22.09"
77 !define PRODUCT_VERSION4 "${PRODUCT_VERSION}.0.0"
88 !define PRODUCT_WEB_SITE "http://MediaArea.net/MediaInfo"
99 !define COMPANY_REGISTRY "Software\MediaArea.net"
33 ; Some defines
44 !define PRODUCT_NAME "MediaInfo"
55 !define PRODUCT_PUBLISHER "MediaArea.net"
6 !define PRODUCT_VERSION "22.06"
6 !define PRODUCT_VERSION "22.09"
77 !define PRODUCT_VERSION4 "${PRODUCT_VERSION}.0.0"
88 !define PRODUCT_WEB_SITE "http://MediaArea.net/MediaInfo"
99 !define COMPANY_REGISTRY "Software\MediaArea.net"
2222 //---------------------------------------------------------------------------
2323 #include "MediaInfo/Audio/File_Aac.h"
2424 #include "MediaInfo/MediaInfo_Config_MediaInfo.h"
25 #include <string>
26 using namespace std;
2527 //---------------------------------------------------------------------------
2628
2729 namespace MediaInfoLib
3234 //***************************************************************************
3335
3436 extern const size_t Aac_sampling_frequency_Size;
37 extern const profilelevel_struct Mpeg4_Descriptors_AudioProfileLevelIndication_Mapping[];
38 extern const char* Mpeg4_Descriptors_AudioProfileLevelIndication_Profile[];
3539
3640 //***************************************************************************
3741 // Constructor/Destructor
6367 Frame_Count_Valid=0;
6468 FrameIsAlwaysComplete=false;
6569 Mode=Mode_Unknown;
70
71 //Conformance
72 #if MEDIAINFO_CONFORMANCE
73 SamplingRate=0;
74 #endif
6675
6776 audioObjectType=(int8u)-1;
6877 extensionAudioObjectType=(int8u)-1;
213222
214223 if (Mode==Mode_ADTS && !ChannelCount_Temp && ChannelPos_Temp && Retrieve_Const(Stream_Audio, 0, Audio_Channel_s_).empty())
215224 Fill(Stream_Audio, 0, Audio_Channel_s_, ChannelPos_Temp);
225
226 #if MEDIAINFO_CONFORMANCE
227 if (audioObjectType==42 && !ConformanceFlags) {
228 ConformanceFlags.set(Usac);
229 if (Profile==AudioProfile_Max) {
230 ConformanceFlags.set(xHEAAC); // TODO: is xHEAAC profiled detectable in LATM? or just ignore xHEAAC in case of LATM
231 }
232 }
233 if (Retrieve_Const(Stream_Audio, 0, "ConformanceErrors").empty()) //TODO: check why called twice in some cases
234 {
235 if (Profile && Mpeg4_Descriptors_AudioProfileLevelIndication_Profile[Profile]
236 && ((audioObjectType==42 && !ConformanceFlags[BaselineUsac] && !ConformanceFlags[xHEAAC])
237 || (audioObjectType!=42 && (ConformanceFlags[BaselineUsac] || ConformanceFlags[xHEAAC])))) {
238 auto ProfileString=string(Mpeg4_Descriptors_AudioProfileLevelIndication_Profile[Profile]);
239 Fill_Conformance("Crosscheck InitialObjectDescriptor-AudioSpecificConfig audioProfileLevelIndication-audioObjectType", ('\"' + ProfileString + "\" vs " + to_string(audioObjectType) + " are not coherent").c_str(), bitset8().set(Usac).set(BaselineUsac).set(xHEAAC));
240 }
241 }
242 Streams_Finish_Conformance();
243 #endif
216244 }
217245
218246 //***************************************************************************
135135 mode Mode;
136136 void AudioSpecificConfig_OutOfBand(int64s sampling_frequency, int8u audioObjectType=(int8u)-1, bool sbrData=false, bool psData=false, bool sbrPresentFlag=false, bool psPresentFlag=false);
137137
138 // Conformance
139 #if MEDIAINFO_CONFORMANCE
140 int16u SamplingRate;
141 #endif
142
138143 //Constructor/Destructor
139144 File_Aac();
140145 ~File_Aac();
571571 Frequency_b=Aac_sampling_frequency[sampling_frequency_index];
572572 else
573573 Frequency_b=0;
574 #if MEDIAINFO_CONFORMANCE
575 if (ConformanceFlags && SamplingRate && Frequency_b!=SamplingRate) //TODO: handling of AAC implicit SBR
576 Fill_Conformance("Crosscheck Container-AudioSpecificConfig SamplingRate-samplingFrequency", (to_string(SamplingRate) + " vs " + to_string(Frequency_b) + " are not coherent").c_str());
577 #endif
574578 Get_S1 (4, channelConfiguration, "channelConfiguration"); Param_Info1(Aac_ChannelConfiguration[channelConfiguration]);
575579 if (audioObjectType==5 || audioObjectType==29)
576580 {
857861 FillInfosHEAACv2(psData ? __T("Explicit") : __T("NBC")); // "Not Backward Compatible");
858862 else if (psData)
859863 Infos["Format_Settings_PS"]=__T("No (Explicit)");
860
861 //Commercial names
862 if (Infos["Format"]==__T("USAC"))
863 Infos["Format_Commercial_IfAny"]=__T("xHE-AAC");
864864 }
865865
866866 //---------------------------------------------------------------------------
3333 namespace MediaInfoLib
3434 {
3535
36 typedef File_Ac4::dmx::cdmx::gain::type gain;
37
3638 //***************************************************************************
3739 // Infos
3840 //***************************************************************************
10551057 { -7, -8}
10561058 };
10571059
1060 //---------------------------------------------------------------------------
1061 static const char* out_ch_config_Values[] =
1062 {
1063 "5.1",
1064 "5.1.2",
1065 "5.1.4",
1066 "7.1",
1067 "7.1.2",
1068 };
1069 static constexpr size_t out_ch_config_Size=sizeof(out_ch_config_Values)/sizeof(const char*);
1070
1071 //---------------------------------------------------------------------------
1072 static const float32 gain_f1_Values(int8u code)
1073 {
1074 if (code>=7)
1075 return -INFINITY;
1076 return 1.5*(-((int)code)+2);
1077 };
1078
1079 //---------------------------------------------------------------------------
1080 static const float32 gain_xx_Values(int8u code)
1081 {
1082 if (code>=7)
1083 return -INFINITY;
1084 if (code>=4)
1085 return 3*(-((int)code)+2);
1086 return 1.5*(-((int)code));
1087 };
1088
1089 //---------------------------------------------------------------------------
1090 static const char* gain_Text[] =
1091 {
1092 "ScreenToCenter",
1093 "ScreenToFront",
1094 "Back4ToBack2",
1095 "Top4ToTop2",
1096 "TopFrontToFront",
1097 "TopFrontToSide",
1098 "TopFrontToBack",
1099 "TopBackToFront",
1100 "TopBackToSide",
1101 "TopBackToBack",
1102 };
1103 static constexpr size_t gain_Size=sizeof(gain_Text)/sizeof(const char*);
1104
10581105 //***************************************************************************
10591106 // Constructor/Destructor
10601107 //***************************************************************************
13851432 Fill_Measure(Stream_Audio, 0, (P+" Downmix LfeMixGain").c_str(), Ztring::ToZtring(10-D.lfe_mixgain).To_UTF8(), " dB");
13861433 if (D.preferred_dmx_method!=(int8u)-1)
13871434 Fill(Stream_Audio, 0, (P+" Downmix PreferredDownmix").c_str(), Value(Ac4_preferred_dmx_method, D.preferred_dmx_method));
1435 }
1436 if (!D.Cdmxs.empty())
1437 {
1438 Fill(Stream_Audio, 0, (P+" Downmix CustomDownmixTargets").c_str(), "Yes");
1439 for (size_t c=0; c<D.Cdmxs.size(); c++)
1440 {
1441 const auto& C=D.Cdmxs[c];
1442 const auto Pdc=P+" Downmix CustomDownmixTargets "+string(out_ch_config_Values[C.out_ch_config])+"ch";
1443 Fill(Stream_Audio, 0, Pdc.c_str(), "Yes");
1444 for (size_t g=0; g<C.Gains.size(); g++)
1445 {
1446 const auto& G=C.Gains[g];
1447 Fill_Measure(Stream_Audio, 0, (Pdc+' '+gain_Text[(size_t)G.Type]).c_str(), gain_xx_Values(G.Value), " dB", 1);
1448 }
1449 }
13881450 }
13891451 }
13901452
40924154 Get_S1(2, n_cdmx_configs, "n_cdmx_configs_minus1");
40934155 n_cdmx_configs++;
40944156
4157 Presentations.back().Dmx.Cdmxs.reserve(n_cdmx_configs);
40954158 for (int8u Pos=0; Pos<n_cdmx_configs; Pos++)
40964159 {
4160 Element_Begin1("cdmx_config");
40974161 int8u out_ch_config;
40984162 if (bs_ch_config==2 || bs_ch_config == 5)
4099 Get_S1 (1, out_ch_config, "out_ch_config[dc]");
4163 Get_S1 (1, out_ch_config, "out_ch_config");
41004164 else
4101 Get_S1 (3, out_ch_config, "out_ch_config[dc]");
4102
4165 Get_S1 (3, out_ch_config, "out_ch_config");
4166 Param_Info1C(out_ch_config<out_ch_config_Size, out_ch_config_Values[out_ch_config]);
4167
4168 Presentations.back().Dmx.Cdmxs.resize(Presentations.back().Dmx.Cdmxs.size()+1);
4169 Presentations.back().Dmx.Cdmxs.back().out_ch_config=out_ch_config;
41034170 cdmx_parameters(bs_ch_config, out_ch_config);
4171 Element_End0();
41044172 }
41054173 TEST_SB_END();
41064174 }
41994267 {
42004268 Element_Begin1("tool_scr_to_c_l");
42014269 TESTELSE_SB_SKIP( "b_put_screen_to_c");
4202 Skip_S1(3, "gain_f1_code");
4270 Get_Gain(3, gain::f1_code, "gain_f1_code");
42034271 TESTELSE_SB_ELSE( "b_put_screen_to_c");
4204 Skip_S1(3, "gain_f2_code");
4272 Get_Gain(3, gain::f2_code, "gain_f2_code");
42054273 TESTELSE_SB_END();
42064274 Element_End0();
42074275 }
42104278 void File_Ac4::tool_b4_to_b2()
42114279 {
42124280 Element_Begin1("tool_b4_to_b2");
4213 Skip_S1(3, "gain_b_code");
4281 Get_Gain(3, gain::b_code, "gain_b_code");
42144282 Element_End0();
42154283 }
42164284
42184286 void File_Ac4::tool_t4_to_t2()
42194287 {
42204288 Element_Begin1("tool_t4_to_t2");
4221 Skip_S1(3, "gain_t1_code");
4289 Get_Gain(3, gain::t1_code, "gain_t1_code");
42224290 Element_End0();
42234291 }
42244292
42274295 {
42284296 Element_Begin1("tool_t4_to_f_s_b");
42294297 TESTELSE_SB_SKIP( "b_top_front_to_front");
4230 Skip_S1(3, "gain_t2a_code");
4298 Get_Gain(3, gain::t2a_code, "gain_t2a_code");
4299 Get_Gain(0, gain::t2b_code, nullptr);
42314300 TESTELSE_SB_ELSE( "b_top_front_to_front");
42324301 TESTELSE_SB_SKIP( "b_top_front_to_side");
4233 Skip_S1(3, "gain_t2b_code");
4302 Get_Gain(3, gain::t2b_code, "gain_t2b_code");
42344303 TESTELSE_SB_ELSE( "b_top_front_to_side");
4235 Skip_S1(3, "gain_t2c_code");
4304 Get_Gain(0, gain::t2b_code, nullptr);
4305 Get_Gain(3, gain::t2c_code, "gain_t2c_code");
42364306 TESTELSE_SB_END();
42374307 TESTELSE_SB_END();
42384308
4239
4240
42414309 TESTELSE_SB_SKIP( "b_top_back_to_front");
4242 Skip_S1(3, "gain_t2d_code");
4310 Get_Gain(3, gain::t2d_code, "gain_t2d_code");
4311 Get_Gain(0, gain::t2e_code, nullptr);
42434312 TESTELSE_SB_ELSE( "b_top_back_to_front");
42444313 TESTELSE_SB_SKIP( "b_top_back_to_side");
4245 Skip_S1(3, "gain_t2e_code");
4314 Get_Gain(3, gain::t2e_code, "gain_t2e_code");
42464315 TESTELSE_SB_ELSE( "b_top_back_to_side");
4247 Skip_S1(3, "gain_t2f_code");
4316 Get_Gain(0, gain::t2e_code, nullptr);
4317 Get_Gain(3, gain::t2f_code, "gain_t2f_code");
42484318 TESTELSE_SB_END();
42494319 TESTELSE_SB_END();
42504320 Element_End0();
42554325 {
42564326 Element_Begin1("tool_t4_to_f_s");
42574327 TESTELSE_SB_SKIP( "b_top_front_to_front");
4258 Skip_S1(3, "gain_t2a_code");
4328 Get_Gain(3, gain::t2a_code, "gain_t2a_code");
4329 Get_Gain(0, gain::t2b_code, nullptr);
42594330 TESTELSE_SB_ELSE( "b_top_front_to_front");
4260 Skip_S1(3, "gain_t2b_code");
4331 Get_Gain(3, gain::t2b_code, "gain_t2b_code");
42614332 TESTELSE_SB_END();
42624333
42634334 TESTELSE_SB_SKIP( "b_top_back_to_front");
4264 Skip_S1(3, "gain_t2d_code");
4335 Get_Gain(3, gain::t2d_code, "gain_t2d_code");
4336 Get_Gain(0, gain::t2e_code, nullptr);
42654337 TESTELSE_SB_ELSE( "b_top_back_to_front");
4266 Skip_S1(3, "gain_t2e_code");
4338 Get_Gain(3, gain::t2e_code, "gain_t2e_code");
42674339 TESTELSE_SB_END();
42684340 Element_End0();
42694341 }
42734345 {
42744346 Element_Begin1("tool_t2_to_f_s_b");
42754347 TESTELSE_SB_SKIP( "b_top_to_front");
4276 Skip_S1(3, "gain_t2a_code");
4348 Get_Gain(3, gain::t2a_code, "gain_t2a_code");
4349 Get_Gain(0, gain::t2b_code, nullptr);
42774350 TESTELSE_SB_ELSE( "b_top_to_front");
42784351 TESTELSE_SB_SKIP( "b_top_to_side");
4279 Skip_S1(3, "gain_t2b_code");
4352 Get_Gain(3, gain::t2b_code, "gain_t2b_code");
42804353 TESTELSE_SB_ELSE( "b_top_to_side");
4281 Skip_S1(3, "gain_t2c_code");
4354 Get_Gain(0, gain::t2b_code, nullptr);
4355 Get_Gain(3, gain::t2c_code, "gain_t2c_code");
42824356 TESTELSE_SB_END();
42834357 TESTELSE_SB_END();
42844358 Element_End0();
42894363 {
42904364 Element_Begin1("tool_t2_to_f_s");
42914365 TESTELSE_SB_SKIP( "b_top_to_front");
4292 Skip_S1(3, "gain_t2a_code");
4366 Get_Gain(3, gain::t2a_code, "gain_t2a_code");
4367 Get_Gain(0, gain::t2b_code, nullptr);
42934368 TESTELSE_SB_ELSE( "b_top_to_front");
4294 Skip_S1(3, "gain_t2b_code");
4369 Get_Gain(3, gain::t2b_code, "gain_t2b_code");
42954370 TESTELSE_SB_END();
42964371 Element_End0();
42974372 }
52915366 return index+64;
52925367 }
52935368
5369 void File_Ac4::Get_Gain(int8u Bits, gain Type, const char* Name)
5370 {
5371 dmx::cdmx::gain Gain;
5372 Gain.Type=Type;
5373 if (Bits)
5374 {
5375 Get_S1(Bits, Gain.Value, Name); Param_Info3(Gain.Type==gain::f1_code?gain_f1_Values(Gain.Value):gain_xx_Values(Gain.Value), " dB", 1);
5376 }
5377 else
5378 Gain.Value=7;
5379 Presentations.back().Dmx.Cdmxs.back().Gains.push_back(Gain);
5380 }
5381
52945382 } //NameSpace
52955383
52965384 #endif //MEDIAINFO_AC4_YES
151151 int8u ltrt_surround_mixgain;
152152 int8u lfe_mixgain;
153153 int8u preferred_dmx_method;
154 struct cdmx
155 {
156 struct gain
157 {
158 enum class type : int8u
159 {
160 f1_code,
161 f2_code,
162 b_code,
163 t1_code,
164 t2a_code,
165 t2b_code,
166 t2c_code,
167 t2d_code,
168 t2e_code,
169 t2f_code,
170 };
171 type Type;
172 int8u Value;
173 };
174 int8u out_ch_config=(int8u)-1;
175 vector<gain> Gains;
176 };
177 vector<cdmx> Cdmxs;
154178
155179 dmx() :
156180 loro_centre_mixgain((int8u)-1),
465489 void ac4_toc_Compute(vector<presentation>& Ps, vector<group>& Gs, bool FromDac4);
466490 int8u Superset(int8u Ch_Mode1, int8u Ch_Mode2);
467491 int16u Huffman_Decode(const ac4_huffman& Table, const char* Name);
492 void Get_Gain(int8u Bits, dmx::cdmx::gain::type Type, const char* Name);
468493
469494 //Temp
470495 int32u frame_size;
2828
2929 //---------------------------------------------------------------------------
3030 #include "MediaInfo/Setup.h"
31 #include <bitset>
3231 //---------------------------------------------------------------------------
3332
3433 //---------------------------------------------------------------------------
3837 //---------------------------------------------------------------------------
3938 #include "MediaInfo/Audio/File_Adm.h"
4039 #include "ThirdParty/tfsxml/tfsxml.h"
40 #include <bitset>
4141 using namespace ZenLib;
4242 using namespace std;
4343 //---------------------------------------------------------------------------
4545 namespace MediaInfoLib
4646 {
4747
48 #define IncoherencyMessage "Incoherency between enums and message strings"
49
4850 //---------------------------------------------------------------------------
4951 static float32 TimeCodeToFloat(string v)
5052 {
151153 || (Value >= 'a' && Value <= 'f');
152154 }
153155
156 static bool IsHexaDigit(const string& Value, size_t pos, size_t len)
157 {
158 len += pos;
159 for (; pos < len; pos++) {
160 if (!IsHexaDigit(Value[pos]))
161 return false;
162 }
163 return true;
164 }
165
154166 enum flags {
155167 Version0,
156168 Version1,
178190 int Elements_Count;
179191 };
180192
181 enum items {
193 enum item {
182194 item_audioTrack,
183195 item_audioProgramme,
184196 item_audioContent,
188200 item_audioTrackUID,
189201 item_audioTrackFormat,
190202 item_audioStreamFormat,
203 item_audioBlockFormat,
204 item_alternativeValueSet,
191205 item_Max
192206 };
193207
208 struct item_info
209 {
210 const char* Name;
211 const char* ID_Begin;
212 enum flags : int8u {
213 Flags_ID_W,
214 Flags_ID_YX,
215 Flags_ID_Z1, // Z width x2
216 Flags_ID_Z2, // Z width x2
217 Flags_Max,
218 };
219 int8u ID_Flags;
220 };
221 #define D(_1,_2,_3) {_1,_2,_3}
222 #define F(_1) (1 << item_info::Flags_##_1)
223 static item_info item_Info[] = {
224 D("TrackIndex", nullptr, 0),
225 D("Programme", "APR", F(ID_W)),
226 D("Content", "ACO", F(ID_W)),
227 D("Object", "AO", F(ID_W)),
228 D("PackFormat", "AP", F(ID_YX)),
229 D("ChannelFormat", "AC", F(ID_YX)),
230 D("TrackUID", "ATU", 0),
231 D("TrackFormat", "AT", F(ID_YX) | F(ID_Z1)),
232 D("StreamFormat", "AS", F(ID_YX)),
233 D("BlockFormat", "AB", F(ID_YX) | F(ID_Z1) | F(ID_Z2)),
234 D("alternativeValueSet", "AVS", F(ID_W) | F(ID_Z2)),
235 };
236 #undef D
237 #undef F
238 static_assert(sizeof(item_Info) / sizeof(item_info) == item_Max, IncoherencyMessage);
239
194240 enum audioTrack_String {
241 audioTrack_audioTrackID,
195242 audioTrack_Summary,
196243 audioTrack_String_Max
197244 };
208255 audioProgramme_start,
209256 audioProgramme_end,
210257 audioProgramme_typeLabel,
258 audioProgramme_typeDefinition,
259 audioProgramme_typeLink,
260 audioProgramme_typeLanguage,
261 audioProgramme_formatLabel,
262 audioProgramme_formatDefinition,
263 audioProgramme_formatLink,
264 audioProgramme_formatLanguage,
265 audioProgramme_maxDuckingDepth,
211266 audioProgramme_String_Max
212267 };
213268
214269 enum audioProgramme_StringVector {
215270 audioProgramme_audioProgrammeLabel,
216271 audioProgramme_audioContentIDRef,
272 audioProgramme_loudnessMetadata,
273 audioProgramme_loudnessMetadata_integratedLoudness,
274 audioProgramme_audioProgrammeReferenceScreen,
275 audioProgramme_authoringInformation,
276 audioProgramme_authoringInformation_referenceLayout,
277 audioProgramme_authoringInformation_referenceLayout_audioPackFormatIDRef,
278 audioProgramme_alternativeValueSetIDRef,
217279 audioProgramme_StringVector_Max
218280 };
219281
228290 enum audioContent_StringVector {
229291 audioContent_dialogue,
230292 audioContent_audioContentLabel,
231 audioContent_integratedLoudness,
293 audioContent_loudnessMetadata,
294 audioContent_loudnessMetadata_integratedLoudness,
232295 audioContent_audioObjectIDRef,
233296 audioContent_StringVector_Max
234297 };
245308 enum audioObject_StringVector {
246309 audioObject_audioPackFormatIDRef,
247310 audioObject_audioTrackUIDRef,
311 audioObject_audioObjectIDRef,
312 audioObject_audioComplementaryObjectIDRef,
248313 audioObject_StringVector_Max
249314 };
250315
337402 { "audioProgrammeLanguage" , (1 << Version0) | (1 << Version1) | (1 << Version2) },
338403 { "start" , (1 << Version0) | (1 << Version1) | (1 << Version2) },
339404 { "end" , (1 << Version0) | (1 << Version1) | (1 << Version2) },
405 { "typeLabel" , (1 << Version0) },
406 { "typeDefinition" , (1 << Version0) },
407 { "typeLink" , (1 << Version0) },
408 { "typeLanguage" , (1 << Version0) },
409 { "formatLabel" , (1 << Version0) },
410 { "formatDefinition" , (1 << Version0) },
411 { "formatLink" , (1 << Version0) },
412 { "formatLanguage" , (1 << Version0) },
340413 { "maxDuckingDepth" , (1 << Version0) | (1 << Version1) | (1 << Version2) },
341414 };
415 static_assert(sizeof(audioProgramme_Attributes) / sizeof(attribute_item) == audioProgramme_String_Max, IncoherencyMessage);
342416
343417 static element_item audioProgramme_Elements[] =
344418 {
345419 { "audioProgrammeLabel" , (1 << Version2) },
346420 { "audioContentIDRef" , (1 << Version0) | (1 << Version1) | (1 << Version2) | (1 << Count1) | (1 << Count2) },
347421 { "loudnessMetadata" , (1 << Version0) | (1 << Version1) | (1 << Version2) },
422 { "integratedLoudness" , (1 << Version0) | (1 << Version1) | (1 << Version2) },
348423 { "audioProgrammeReferenceScreen" , (1 << Version0) | (1 << Version1) | (1 << Version2) | (1 << Count0) | (1 << Count1) },
349424 { "authoringInformation" , (1 << Version2) | (1 << Count0) | (1 << Count1) },
425 { "referenceLayout" , (1 << Version2) | (1 << Count0) | (1 << Count1) },
426 { "audioPackFormatIDRef" , (1 << Version2) | (1 << Count0) | (1 << Count1) },
350427 { "alternativeValueSetIDRef" , (1 << Version2) | (1 << Count0) | (1 << Count1) },
351428 };
429 static_assert(sizeof(audioProgramme_Elements) / sizeof(attribute_item) == audioProgramme_StringVector_Max, IncoherencyMessage);
352430
353431 static element audioProgramme_Element =
354432 {
391469 size_t StringVectors_Size;
392470 };
393471
394 static string Apply_Init(File__Analyze& F, const Char* Name, size_t i, const Items_Struct& audioProgramme_List, Ztring Summary) {
472 static string Apply_Init(File__Analyze& F, const char* Name, size_t i, const Items_Struct& audioProgramme_List, Ztring Summary) {
395473 const Item_Struct& audioProgramme = audioProgramme_List.Items[i];
396 string P = Ztring(Name + Ztring::ToZtring(i)).To_UTF8();
474 string P = Name + to_string(i);
397475 F.Fill(Stream_Audio, 0, P.c_str(), Summary.empty() ? __T("Yes") : Summary);
398476 F.Fill(Stream_Audio, 0, (P + " Pos").c_str(), i);
399477 F.Fill_SetOptions(Stream_Audio, 0, (P + " Pos").c_str(), "N NIY");
400478 return P;
401479 }
402480
403 static void Apply_SubStreams(File__Analyze& F, const string& P_And_LinkedTo, const Item_Struct& Source, size_t i, const Items_Struct& Dest) {
481 static void Apply_SubStreams(File__Analyze& F, const string& P_And_LinkedTo, Item_Struct& Source, size_t i, Items_Struct& Dest) {
404482 ZtringList SubstreamPos, SubstreamNum;
405483 for (size_t j = 0; j < Source.StringVectors[i].size(); j++) {
406484 const string& ID = Source.StringVectors[i][j];
412490 }
413491 }
414492 if (Pos == -1) {
493 auto LinkedTo_Pos = P_And_LinkedTo.find(" LinkedTo_TrackUID_Pos");
494 auto HasTransport = !F.Retrieve_Const(Stream_Audio, 0, "Transport0").empty();
495 if (HasTransport && LinkedTo_Pos != string::npos) { // TODO: better way to avoid common definitions
496 string Message;
497 if (LinkedTo_Pos) {
498 auto Sub_Pos = P_And_LinkedTo.rfind(' ', LinkedTo_Pos - 1);
499 if (Sub_Pos != string::npos) {
500 Message += ":transportTrackFormat:audioTrack:audioTrackUIDRef:\"";
501 Message += ID;
502 Message += "\" is referenced but its description is missing";
503 Source.Errors[Warning].push_back(Message);
504 }
505 }
506 }
415507 continue;
416508 }
417509 SubstreamPos.push_back(Ztring::ToZtring(Pos));
426518 F.Fill(Stream_Audio, 0, (P_And_LinkedTo + "/String").c_str(), SubstreamNum.Read());
427519 F.Fill_SetOptions(Stream_Audio, 0, (P_And_LinkedTo + "/String").c_str(), "Y NIN");
428520 }
521
522
523 //***************************************************************************
524 // Private class
525 //***************************************************************************
526
527 static void CheckErrors_Formating(file_adm_private* File_Adm_Private, const string& ID, const item_info& ID_Start, vector<string>& Errors, const char* Sub = nullptr);
528 static void CheckErrors_Formating(file_adm_private* File_Adm_Private, Items_Struct& MainItem, const item_info& ID_Start, const char* Sub = nullptr);
429529
430530 class file_adm_private
431531 {
470570 void audioFormatExtended();
471571 void frameHeader();
472572 void transportTrackFormat();
573
574 // Common definitions
575 vector<string> audioChannelFormatIDRefs;
473576 };
474577
475578 void file_adm_private::parse()
501604 } \
502605
503606 #define ELEMENT_MIDDLE(NAME) \
504 else if (tfsxml_strcmp_charp(b, "typeLabel")) { \
505 NAME##_Content.Errors[Warning].push_back("Attribute \"" + tfsxml_decode(b) + "\" is out of specs"); \
607 else if (!Items[item_audioProgramme].Items.empty() && &NAME##_Content == &Items[item_audioProgramme].Items.back()) { \
608 NAME##_Content.Errors[Warning].push_back(":XmlAttributes:\"" + tfsxml_decode(b) + "\" is not part of specs"); \
506609 } \
507610 } \
508611 if (!tfsxml_enter(&p)) \
514617 } \
515618
516619 #define ELEMENT_END(NAME) \
517 else if (tfsxml_strcmp_charp(b, "loudnessMetadata") && tfsxml_strcmp_charp(b, "authoringInformation") && tfsxml_strcmp_charp(b, "alternativeValueSetIDRef")) { \
518 NAME##_Content.Errors[Warning].push_back("Element \"" + tfsxml_decode(b) + "\" is out of specs"); \
620 else if (!Items[item_audioProgramme].Items.empty() && &NAME##_Content == &Items[item_audioProgramme].Items.back()) { \
621 NAME##_Content.Errors[Warning].push_back(":XmlElements:\"" + tfsxml_decode(b) + "\" is not part of specs"); \
519622 } \
520623 } \
521624 } \
526629 NAME##_Content.Strings[NAME##_##ATTR].assign(tfsxml_decode(v)); \
527630 } \
528631
529 #define ATTRIBUTE_I(NAME,ATTR) \
632 #define ATTRIB_ID(NAME,ATTR) \
633 else if (!tfsxml_strcmp_charp(b, #ATTR)) { \
634 CheckErrors_Formating(this, tfsxml_decode(v), item_Info[item_##NAME], *this->Items[item_##NAME].Items.back().Errors, #NAME":"#ATTR); \
635 NAME##_Content.Strings[NAME##_##ATTR].assign(tfsxml_decode(v)); \
636 } \
637
638 #define ATTRIBUTE_I(NAME,ATTR) \
530639 else if (!tfsxml_strcmp_charp(b, #ATTR)) { \
531640 } \
532641
664773 if (tfsxml_next(&p, &b))
665774 break;
666775 ELEMENT_START(audioProgramme)
667 ATTRIBUTE(audioProgramme, audioProgrammeID)
776 ATTRIB_ID(audioProgramme, audioProgrammeID)
668777 ATTRIBUTE(audioProgramme, audioProgrammeName)
669778 ATTRIBUTE(audioProgramme, audioProgrammeLanguage)
670779 ATTRIBUTE(audioProgramme, start)
671780 ATTRIBUTE(audioProgramme, end)
781 ATTRIBUTE(audioProgramme, typeLabel)
782 ATTRIBUTE(audioProgramme, typeDefinition)
783 ATTRIBUTE(audioProgramme, typeLink)
784 ATTRIBUTE(audioProgramme, typeLanguage)
785 ATTRIBUTE(audioProgramme, formatLabel)
786 ATTRIBUTE(audioProgramme, formatDefinition)
787 ATTRIBUTE(audioProgramme, formatLink)
788 ATTRIBUTE(audioProgramme, formatLanguage)
789 ATTRIBUTE(audioProgramme, maxDuckingDepth)
672790 ELEMENT_MIDDLE(audioProgramme)
673 ELEMENT(audioProgramme, audioContentIDRef)
674791 else if (!tfsxml_strcmp_charp(b, "audioProgrammeLabel")) {
675792 string Language;
676793 for (;;) {
687804 }
688805 audioProgramme_Content.StringVectors[audioProgramme_audioProgrammeLabel].push_back(Value);
689806 }
807 ELEMENT(audioProgramme, audioContentIDRef)
808 else if (!tfsxml_strcmp_charp(b, "loudnessMetadata")) {
809 if (!tfsxml_enter(&p))
810 {
811 for (;;) {
812 if (tfsxml_next(&p, &b))
813 break;
814 if (!tfsxml_strcmp_charp(b, "integratedLoudness")) {
815 tfsxml_value(&p, &b);
816 audioProgramme_Content.StringVectors[audioProgramme_loudnessMetadata_integratedLoudness].push_back(tfsxml_decode(b));
817 }
818 }
819 }
820 }
821 ELEMENT(audioProgramme, audioProgrammeReferenceScreen)
822 else if (!tfsxml_strcmp_charp(b, "authoringInformation")) {
823 if (!tfsxml_enter(&p))
824 {
825 for (;;) {
826 if (tfsxml_next(&p, &b))
827 break;
828 if (!tfsxml_strcmp_charp(b, "referenceLayout")) {
829 if (!tfsxml_enter(&p))
830 {
831 for (;;) {
832 if (tfsxml_next(&p, &b))
833 break;
834 if (!tfsxml_strcmp_charp(b, "audioPackFormatIDRef")) {
835 tfsxml_value(&p, &b);
836 audioProgramme_Content.StringVectors[audioProgramme_authoringInformation_referenceLayout_audioPackFormatIDRef].push_back(tfsxml_decode(b));
837 }
838 }
839 }
840 }
841 }
842 }
843 }
844 ELEMENT(audioProgramme, alternativeValueSetIDRef)
690845 ELEMENT_END(audioProgramme)
691846 ELEMENT_START(audioContent)
692 ATTRIBUTE(audioContent, audioContentID)
847 ATTRIB_ID(audioContent, audioContentID)
693848 ATTRIBUTE(audioContent, audioContentName)
694849 ATTRIBUTE(audioContent, audioContentLanguage)
695850 ATTRIBUTE(audioContent, typeLabel)
789944 }
790945 audioContent_Content.StringVectors[audioContent_audioContentLabel].push_back(Value);
791946 }
792 if (!tfsxml_strcmp_charp(b, "loudnessMetadata")) {
947 else if (!tfsxml_strcmp_charp(b, "loudnessMetadata")) {
793948 if (!tfsxml_enter(&p))
794949 {
795950 for (;;) {
797952 break;
798953 if (!tfsxml_strcmp_charp(b, "integratedLoudness")) {
799954 tfsxml_value(&p, &b);
800 audioContent_Content.StringVectors[audioContent_integratedLoudness].push_back(tfsxml_decode(b));
955 audioContent_Content.StringVectors[audioContent_loudnessMetadata_integratedLoudness].push_back(tfsxml_decode(b));
801956 }
802957 }
803958 }
805960 ELEMENT(audioContent, dialogue)
806961 ELEMENT_END(audioContent)
807962 ELEMENT_START(audioObject)
808 ATTRIBUTE(audioObject, audioObjectID)
963 ATTRIB_ID(audioObject, audioObjectID)
809964 ATTRIBUTE(audioObject, audioObjectName)
810965 ATTRIBUTE(audioObject, duration)
811966 ATTRIBUTE(audioObject, startTime)
813968 ELEMENT_MIDDLE(audioObject)
814969 ELEMENT(audioObject, audioPackFormatIDRef)
815970 ELEMENT(audioObject, audioTrackUIDRef)
971 ELEMENT(audioObject, audioObjectIDRef)
972 ELEMENT(audioObject, audioComplementaryObjectIDRef)
816973 ELEMENT_END(audioObject)
817974 ELEMENT_START(audioPackFormat)
818 ATTRIBUTE(audioPackFormat, audioPackFormatID)
975 ATTRIB_ID(audioPackFormat, audioPackFormatID)
819976 ATTRIBUTE(audioPackFormat, audioPackFormatName)
820977 ATTRIBUTE(audioPackFormat, typeDefinition)
821978 ATTRIBUTE(audioPackFormat, typeLabel)
823980 ELEMENT(audioPackFormat, audioChannelFormatIDRef)
824981 ELEMENT_END(audioPackFormat)
825982 ELEMENT_START(audioChannelFormat)
826 ATTRIBUTE(audioChannelFormat, audioChannelFormatID)
983 ATTRIB_ID(audioChannelFormat, audioChannelFormatID)
827984 ATTRIBUTE(audioChannelFormat, audioChannelFormatName)
828985 ATTRIBUTE(audioChannelFormat, typeDefinition)
829986 ATTRIBUTE(audioChannelFormat, typeLabel)
830987 ELEMENT_MIDDLE(audioChannelFormat)
831988 else if (!tfsxml_strcmp_charp(b, "audioBlockFormat")) {
989 for (;;) {
990 if (tfsxml_attr(&p, &b, &v))
991 break;
992 if (false) {
993 }
994 else if (!tfsxml_strcmp_charp(b, "audioBlockFormatID")) {
995 CheckErrors_Formating(this, tfsxml_decode(v), item_Info[item_audioBlockFormat], *this->Items[item_audioChannelFormat].Items.back().Errors, "audioBlockFormat:audioBlockFormatID");
996 }
997 }
832998 if (!tfsxml_enter(&p))
833999 {
8341000 for (;;) {
8691035 ELEMENT(audioTrackUID, audioTrackFormatIDRef)
8701036 ELEMENT_END(audioTrackUID)
8711037 ELEMENT_START(audioTrackFormat)
872 ATTRIBUTE(audioTrackFormat, audioTrackFormatID)
1038 ATTRIB_ID(audioTrackFormat, audioTrackFormatID)
8731039 ATTRIBUTE(audioTrackFormat, audioTrackFormatName)
8741040 ATTRIBUTE(audioTrackFormat, formatDefinition)
8751041 ATTRIBUTE(audioTrackFormat, typeDefinition)
8781044 ELEMENT(audioTrackFormat, audioStreamFormatIDRef)
8791045 ELEMENT_END(audioTrackFormat)
8801046 ELEMENT_START(audioStreamFormat)
881 ATTRIBUTE(audioStreamFormat, audioStreamFormatID)
1047 ATTRIB_ID(audioStreamFormat, audioStreamFormatID)
8821048 ATTRIBUTE(audioStreamFormat, audioStreamFormatName)
8831049 ATTRIBUTE(audioStreamFormat, formatDefinition)
8841050 ATTRIBUTE(audioStreamFormat, formatLabel)
9441110 }
9451111 }
9461112
1113 //---------------------------------------------------------------------------
1114 static void FillErrors(file_adm_private* File_Adm_Private, const item Item, size_t i, const char* Name, vector<string>* Errors_Field, vector<string>* Errors_Value, bool WarningError)
1115 {
1116 for (size_t k = 0; k < error_Type_Max; k++) {
1117 if (!File_Adm_Private->Items[Item].Items[i].Errors[k].empty()) {
1118 for (size_t j = 0; j < File_Adm_Private->Items[Item].Items[i].Errors[k].size(); j++) {
1119 string Field = Name;
1120 string Value = File_Adm_Private->Items[Item].Items[i].Errors[k][j];
1121 if (!Value.empty() && Value[0] == '!') {
1122 auto End = Value.find('!', 1);
1123 if (End != string::npos)
1124 {
1125 Field.insert(0, Value.substr(1, End - 1) + ' ');
1126 Value.erase(0, End + 1);
1127 }
1128 }
1129 if (!Value.empty() && Value[0] == ':') {
1130 Field.clear();
1131 auto End = Value.rfind(':');
1132 if (End)
1133 {
1134 if (!Field.empty())
1135 Field += ' ';
1136 Field += Value.substr(1, End - 1);
1137 Value.erase(0, End + 1);
1138 for (;;)
1139 {
1140 auto Next = Field.find(':');
1141 if (Next == string::npos)
1142 break;
1143 Field[Next] = ' ';
1144 }
1145 }
1146 }
1147 Errors_Field[WarningError ? Error : k].push_back(Field);
1148 Errors_Value[WarningError ? Error : k].push_back(Value);
1149 }
1150 }
1151 }
1152 }
1153
1154 //---------------------------------------------------------------------------
1155 static void CheckErrors_Formating(file_adm_private* File_Adm_Private, const string& ID, const item_info& ID_Start, vector<string>& Errors, const char* Sub)
1156 {
1157 auto BeginSize = strlen(ID_Start.ID_Begin);
1158 bitset<item_info::Flags_Max> Flags(ID_Start.ID_Flags);
1159 auto MiddleSize = Flags[item_info::Flags_ID_YX] ? 8 : (Flags[item_info::Flags_ID_W] ? 4 : 0);
1160 static const int end_size [] = {0, 2, 4, 8};
1161 auto EndSize = end_size[Flags[item_info::Flags_ID_Z1] + Flags[item_info::Flags_ID_Z2] * 2];
1162 if (!MiddleSize && !EndSize && ID.size() > BeginSize) {
1163 EndSize = ID.size() - BeginSize - 1;
1164 }
1165 auto TotalMiddleSize = MiddleSize ? (1 + MiddleSize) : 0;
1166 auto TotalEndSize = EndSize ? (1 + EndSize) : 0;
1167 if (ID.size() != BeginSize + TotalMiddleSize + TotalEndSize
1168 || ID.compare(0, BeginSize, ID_Start.ID_Begin, 0, BeginSize)
1169 || ID[BeginSize] != '_'
1170 || !IsHexaDigit(ID, BeginSize + 1, MiddleSize)
1171 || (EndSize && ID[BeginSize + TotalMiddleSize] != '_')
1172 || !IsHexaDigit(ID, BeginSize + TotalMiddleSize + 1, EndSize)
1173 ) {
1174 string Middle;
1175 if (Flags[item_info::Flags_ID_YX]) {
1176 Middle.append(4, 'y');
1177 Middle.append(4, 'x');
1178 }
1179 else if (Flags[item_info::Flags_ID_W]) {
1180 Middle.append(4, 'w');
1181 }
1182 string End;
1183 if (EndSize) {
1184 End.append(EndSize, 'z');
1185 }
1186 string Message = (Sub ? (':' + string(Sub) + ':') : string()) + '"' + ID + '"';
1187 Message += " is not a valid form (";
1188 if (BeginSize) {
1189 Message.append(ID_Start.ID_Begin, BeginSize);
1190 }
1191 Message += '_';
1192 if (!Middle.empty()) {
1193 Message += Middle;
1194 }
1195 if (!Middle.empty() && !End.empty()) {
1196 Message += '_';
1197 }
1198 if (!End.empty()) {
1199 Message += End;
1200 }
1201 Message += " form, ";
1202 if (!Middle.empty()) {
1203 Message += Middle;
1204 }
1205 if (!Middle.empty() && !End.empty()) {
1206 Message += " and ";
1207 }
1208 if (!End.empty()) {
1209 Message += End;
1210 }
1211 Message += " being hexadecimal digits)";
1212 Errors.push_back(Message);
1213 }
1214 }
1215
1216 //---------------------------------------------------------------------------
1217 static void CheckErrors_Formating(file_adm_private* File_Adm_Private, Items_Struct& MainItem, const item_info& ID_Start, const char* Sub)
1218 {
1219 if (!ID_Start.ID_Begin)
1220 return;
1221 for (size_t i = 0; i < MainItem.Items.size(); i++) {
1222 CheckErrors_Formating(File_Adm_Private, MainItem.Items[i].Strings[audioProgramme_audioProgrammeID], ID_Start, *MainItem.Items[i].Errors, Sub);
1223 }
1224 }
1225
1226 static void CheckErrors(file_adm_private* File_Adm_Private)
1227 {
1228 for (size_t t=0; t<item_Max; t++) {
1229 //CheckErrors_Formating(File_Adm_Private, File_Adm_Private->Items[t], item_Info[t]);
1230 }
1231 }
1232
9471233 //***************************************************************************
9481234 // Constructor/Destructor
9491235 //***************************************************************************
9781264 File_Adm_Private->Items[item_audioTrack].Items.erase(File_Adm_Private->Items[item_audioTrack].Items.begin());
9791265 }
9801266
981 #define FILL_COUNT(NAME,FIELD) \
1267 #define FILL_COUNT(NAME) \
9821268 if (!File_Adm_Private->Items[item_##NAME].Items.empty()) \
983 Fill(Stream_Audio, 0, "NumberOf" FIELD "s", File_Adm_Private->Items[item_##NAME].Items.size());
984
985 #define FILL_START(NAME,ATTRIBUTE,FIELD) \
1269 Fill(Stream_Audio, 0, ("NumberOf" + string(item_Info[item_##NAME].Name) + 's').c_str(), File_Adm_Private->Items[item_##NAME].Items.size());
1270
1271 #define FILL_START(NAME,ATTRIBUTE) \
9861272 for (size_t i = 0; i < File_Adm_Private->Items[item_##NAME].Items.size(); i++) { \
9871273 Ztring Summary = Ztring().From_UTF8(File_Adm_Private->Items[item_##NAME].Items[i].Strings[NAME##_##ATTRIBUTE]); \
988 string P = Apply_Init(*this, __T(FIELD), i, File_Adm_Private->Items[item_##NAME], Summary); \
989
990 #define FILL_A(NAME,ATTRIBUTE,FIELD) \
1274 string P = Apply_Init(*this, item_Info[item_##NAME].Name, i, File_Adm_Private->Items[item_##NAME], Summary); \
1275
1276 #define FILL_START_SUB(NAME,ATTRIBUTE,FIELD) \
1277 for (size_t i = 0; i < File_Adm_Private->Items[item_##NAME].Items.size(); i++) { \
1278 Ztring Summary = Ztring().From_UTF8(File_Adm_Private->Items[item_##NAME].Items[i].Strings[NAME##_##ATTRIBUTE]); \
1279 string P = Apply_Init(*this, FIELD, i, File_Adm_Private->Items[item_##NAME], Summary); \
1280
1281 #define FILL_A(NAME,ATTRIBUTE,FIELD) \
9911282 Fill(Stream_Audio, StreamPos_Last, (P + ' ' + FIELD).c_str(), File_Adm_Private->Items[item_##NAME].Items[i].Strings[NAME##_##ATTRIBUTE].c_str(), Unlimited, true, true); \
9921283
9931284 #define FILL_E(NAME,ATTRIBUTE,FIELD) \
10651356 for (size_t i = 0; i < item_Max; i++)
10661357 TotalCount += File_Adm_Private->Items[i].Items.size();
10671358 bool Full = TotalCount < 0x1000 ? true : false;
1068 FILL_COUNT(audioProgramme, "Programme");
1069 FILL_COUNT(audioContent, "Content");
1070 FILL_COUNT(audioObject, "Object");
1071 FILL_COUNT(audioPackFormat, "PackFormat");
1072 FILL_COUNT(audioChannelFormat, "ChannelFormat");
1359 FILL_COUNT(audioProgramme);
1360 FILL_COUNT(audioContent);
1361 FILL_COUNT(audioObject);
1362 FILL_COUNT(audioPackFormat);
1363 FILL_COUNT(audioChannelFormat);
10731364 if (Full)
10741365 {
1075 FILL_COUNT(audioTrackUID, "TrackUID");
1076 FILL_COUNT(audioTrackFormat, "TrackFormat");
1077 FILL_COUNT(audioStreamFormat, "StreamFormat");
1366 FILL_COUNT(audioTrackUID);
1367 FILL_COUNT(audioTrackFormat);
1368 FILL_COUNT(audioStreamFormat);
10781369 }
10791370 #if MEDIAINFO_ADVANCED
10801371 vector<string> Errors_Field[error_Type_Max];
10831374 bool WarningError=MediaInfoLib::Config.WarningError();
10841375 #endif
10851376
1086 FILL_START(audioProgramme, audioProgrammeName, "Programme")
1377 // Common definitions
1378 for (size_t i = 0; i < File_Adm_Private->Items[item_audioPackFormat].Items.size(); i++) {
1379 const Item_Struct& Source = File_Adm_Private->Items[item_audioPackFormat].Items[i];
1380 for (size_t j = 0; j < Source.StringVectors[audioPackFormat_audioChannelFormatIDRef].size(); j++) {
1381
1382 }
1383 }
1384
1385 FILL_START(audioProgramme, audioProgrammeName)
10871386 if (Full)
10881387 FILL_A(audioProgramme, audioProgrammeID, "ID");
10891388 FILL_A(audioProgramme, audioProgrammeName, "Title");
10911390 FILL_A(audioProgramme, audioProgrammeLanguage, "Language");
10921391 FILL_A(audioProgramme, start, "Start");
10931392 FILL_A(audioProgramme, end, "End");
1393 FILL_E(audioProgramme, loudnessMetadata_integratedLoudness, "IntegratedLoudness");
10941394 LINK(audioProgramme, "Content", audioContentIDRef, audioContent);
1395 LINK(audioProgramme, "PackFormat", authoringInformation_referenceLayout_audioPackFormatIDRef, audioPackFormat);
10951396 const Ztring& Label = Retrieve_Const(StreamKind_Last, StreamPos_Last, (P + " Label").c_str());
10961397 if (!Label.empty()) {
10971398 Summary += __T(' ');
11011402 Fill(StreamKind_Last, StreamPos_Last, P.c_str(), Summary, true);
11021403 }
11031404
1104 // Errors
1105 const string& audioProgrammeID = File_Adm_Private->Items[item_audioProgramme].Items[i].Strings[audioProgramme_audioProgrammeID];
1106 if (audioProgrammeID.size() != 8
1107 || audioProgrammeID[0] != 'A'
1108 || audioProgrammeID[1] != 'P'
1109 || audioProgrammeID[2] != 'R'
1110 || audioProgrammeID[3] != '_'
1111 || !IsHexaDigit(audioProgrammeID[4])
1112 || !IsHexaDigit(audioProgrammeID[5])
1113 || !IsHexaDigit(audioProgrammeID[6])
1114 || !IsHexaDigit(audioProgrammeID[7])
1115 ) {
1116 File_Adm_Private->Items[item_audioProgramme].Items[i].Errors->push_back(audioProgrammeID + " is not a valid form (APR_wwww form, wwww is hexadecimal value)");
1117 }
1118
11191405 #if MEDIAINFO_ADVANCED
1120 for (size_t k = 0; k < error_Type_Max; k++) {
1121 if (!File_Adm_Private->Items[item_audioProgramme].Items[i].Errors[k].empty()) {
1122 for (size_t j = 0; j < File_Adm_Private->Items[item_audioProgramme].Items[i].Errors[k].size(); j++) {
1123 Errors_Field[WarningError?Error:k].push_back("audioProgramme");
1124 Errors_Value[WarningError?Error:k].push_back(File_Adm_Private->Items[item_audioProgramme].Items[i].Errors[k][j]);
1125 }
1126 }
1127 }
1128
11291406 //TODO: expand this proof of concept
11301407 if (Config_AdmProfile.Ebu3392==1)
11311408 {
11391416 #endif // MEDIAINFO_ADVANCED
11401417 }
11411418
1142 FILL_START(audioContent, audioContentName, "Content")
1419 FILL_START(audioContent, audioContentName)
11431420 if (Full)
11441421 FILL_A(audioContent, audioContentID, "ID");
11451422 FILL_A(audioContent, audioContentName, "Title");
11461423 FILL_E(audioContent, audioContentLabel, "Label");
11471424 FILL_A(audioContent, audioContentLanguage, "Language");
11481425 FILL_E(audioContent, dialogue, "Mode");
1149 FILL_E(audioContent, integratedLoudness, "IntegratedLoudness");
1426 FILL_E(audioContent, loudnessMetadata_integratedLoudness, "IntegratedLoudness");
11501427 LINK(audioContent, "Object", audioObjectIDRef, audioObject);
11511428 const Ztring& Label = Retrieve_Const(StreamKind_Last, StreamPos_Last, (P + " Label").c_str());
11521429 if (!Label.empty()) {
11581435 }
11591436 }
11601437
1161 FILL_START(audioObject, audioObjectName, "Object")
1438 FILL_START(audioObject, audioObjectName)
11621439 if (Full)
11631440 FILL_A(audioObject, audioObjectID, "ID");
11641441 FILL_A(audioObject, audioObjectName, "Title");
11651442 FILL_A(audioObject, startTime, "Start");
11661443 FILL_A(audioObject, duration, "Duration");
11671444 LINK(audioObject, "PackFormat", audioPackFormatIDRef, audioPackFormat);
1445 LINK(audioObject, "Object", audioObjectIDRef, audioObject);
1446 LINK(audioObject, "ComplementaryObject", audioComplementaryObjectIDRef, audioObject);
11681447 if (Full)
11691448 LINK(audioObject, "TrackUID", audioTrackUIDRef, audioTrackUID);
11701449 }
11711450
1172 FILL_START(audioPackFormat, audioPackFormatName, "PackFormat")
1451 FILL_START(audioPackFormat, audioPackFormatName)
11731452 if (Full)
11741453 FILL_A(audioPackFormat, audioPackFormatID, "ID");
11751454 FILL_A(audioPackFormat, audioPackFormatName, "Title");
12001479 LINK(audioPackFormat, "ChannelFormat", audioChannelFormatIDRef, audioChannelFormat);
12011480 }
12021481
1203 FILL_START(audioChannelFormat, audioChannelFormatName, "ChannelFormat")
1482 FILL_START(audioChannelFormat, audioChannelFormatName)
12041483 if (Full)
12051484 FILL_A(audioChannelFormat, audioChannelFormatID, "ID");
12061485 FILL_A(audioChannelFormat, audioChannelFormatName, "Title");
12111490 }
12121491
12131492 if (Full) {
1214 FILL_START(audioTrackUID, UID, "TrackUID")
1493 FILL_START(audioTrackUID, UID)
12151494 FILL_A(audioTrackUID, UID, "ID");
12161495 FILL_A(audioTrackUID, bitDepth, "BitDepth");
12171496 FILL_A(audioTrackUID, sampleRate, "SamplingRate");
12341513 LINK(audioTrackUID, "TrackFormat", audioTrackFormatIDRef, audioTrackFormat);
12351514 }
12361515
1237 FILL_START(audioTrackFormat, audioTrackFormatName, "TrackFormat")
1516 FILL_START(audioTrackFormat, audioTrackFormatName)
12381517 FILL_A(audioTrackFormat, audioTrackFormatID, "ID");
12391518 FILL_A(audioTrackFormat, audioTrackFormatName, "Title");
12401519 FILL_A(audioTrackFormat, formatDefinition, "FormatDefinition");
12421521 LINK(audioTrackFormat, "StreamFormat", audioStreamFormatIDRef, audioStreamFormat);
12431522 }
12441523
1245 FILL_START(audioStreamFormat, audioStreamFormatName, "StreamFormat")
1524 FILL_START(audioStreamFormat, audioStreamFormatName)
12461525 FILL_A(audioStreamFormat, audioStreamFormatID, "ID");
12471526 FILL_A(audioStreamFormat, audioStreamFormatName, "Title");
12481527 FILL_A(audioStreamFormat, formatDefinition, "Format");
12561535 if (!File_Adm_Private->Items[item_audioTrack].Items.empty())
12571536 {
12581537 Fill(Stream_Audio, 0, "Transport0", "Yes");
1259 FILL_START(audioTrack, Summary, "Transport0 TrackIndex")
1538 FILL_START_SUB(audioTrack, Summary, "Transport0 TrackIndex")
12601539 FILL_E(audioTrack, audioTrackUIDRef, "");
12611540 if (Full)
12621541 LINK(audioTrack, "TrackUID", audioTrackUIDRef, audioTrackUID);
12631542 }
1264
12651543 }
12661544
12671545 if (!Full)
12681546 Fill(Stream_Audio, 0, "PartialDisplay", "Yes");
12691547
1548 // Errors
12701549 #if MEDIAINFO_ADVANCED
1550 CheckErrors(File_Adm_Private);
1551 for (size_t t = 0; t < item_Max; t++) {
1552 for (size_t i = 0; i < File_Adm_Private->Items[t].Items.size(); i++) {
1553 FillErrors(File_Adm_Private, (item)t, i, item_Info[t].Name, &Errors_Field[0], &Errors_Value[0], WarningError); \
1554 }
1555 }
1556
1557 //Conformance
12711558 for (size_t k = 0; k < error_Type_Max; k++) {
12721559 if (!Errors_Field[k].empty()) {
1273 Fill(StreamKind_Last, StreamPos_Last, error_Type_String[k], Errors_Field[k].size());
1560 auto FieldPrefix = "Conformance" + string(error_Type_String[k]);
1561 Fill(StreamKind_Last, StreamPos_Last, FieldPrefix.c_str(), Errors_Field[k].size());
1562 FieldPrefix += ' ';
12741563 for (size_t i = 0; i < Errors_Field[k].size(); i++) {
1275 Fill(StreamKind_Last, StreamPos_Last, (string(error_Type_String[k]) + ' ' + Errors_Field[k][i]).c_str(), Errors_Value[k][i]);
1564 size_t Space = 0;
1565 for (;;)
1566 {
1567 Space = Errors_Field[k][i].find(' ', Space + 1);
1568 if (Space == string::npos) {
1569 break;
1570 }
1571 const auto Field = FieldPrefix + Errors_Field[k][i].substr(0, Space);
1572 const auto& Value = Retrieve_Const(StreamKind_Last, StreamPos_Last, Field.c_str());
1573 if (Value.empty()) {
1574 Fill(StreamKind_Last, StreamPos_Last, Field.c_str(), "Yes");
1575 }
1576 }
1577 const auto Field = FieldPrefix + Errors_Field[k][i];
1578 const auto& Value = Retrieve_Const(StreamKind_Last, StreamPos_Last, Field.c_str());
1579 if (Value == __T("Yes")) {
1580 Clear(StreamKind_Last, StreamPos_Last, Field.c_str());
1581 }
1582 Fill(StreamKind_Last, StreamPos_Last, Field.c_str(), Errors_Value[k][i]);
12761583 }
12771584 }
12781585 }
2121
2222 //---------------------------------------------------------------------------
2323 #include "MediaInfo/Audio/File_Iab.h"
24 using namespace std;
2425 //---------------------------------------------------------------------------
2526
2627 namespace MediaInfoLib
3031 // Infos
3132 //***************************************************************************
3233
34 //---------------------------------------------------------------------------
3335 const int32u Iab_SampleRate[4]=
3436 {
3537 48000,
3840 0,
3941 };
4042
43 //---------------------------------------------------------------------------
4144 const int8u Iab_BitDepth[4]=
4245 {
4346 16,
4649 0,
4750 };
4851
49 const float32 Iab_FrameRate[16] =
52 //---------------------------------------------------------------------------
53 const float32 Iab_FrameRate[16]=
5054 {
5155 24,
5256 25,
6670 0,
6771 };
6872
73 //---------------------------------------------------------------------------
74 const char* Iab_Channel(int32u Code)
75 {
76 static const char* Iab_Channel_Values[]=
77 {
78 "L",
79 "Lc",
80 "C",
81 "Rc",
82 "R",
83 "Lss",
84 "Ls",
85 "Lb",
86 "Rb",
87 "Rss",
88 "Rs",
89 "Tsl",
90 "Tsr",
91 "LFE",
92 "Left Height",
93 "Right Height",
94 "Center Height",
95 "Left Surround Height",
96 "Right Surround Height",
97 "Left Side Surround Height",
98 "Right Side Surround Height",
99 "Left Rear Surround Height",
100 "Right Rear Surround Height",
101 "Tc",
102 //0x18-0x7F reserved
103 "Tfl",
104 "Tfr",
105 "Tbl",
106 "Tbr",
107 "Tsl",
108 "Tsr",
109 "LFE1",
110 "LFE2",
111 "Lw",
112 "Rw",
113 };
114 if (Code<0x18)
115 return Iab_Channel_Values[Code];
116 if (Code>=0x80 && Code<sizeof(Iab_Channel_Values)/sizeof(const char*)-0x18)
117 return Iab_Channel_Values[Code-0x18];
118 return "";
119 }
69120 //***************************************************************************
70121 // Constructor/Destructor
71122 //***************************************************************************
92143 //---------------------------------------------------------------------------
93144 File_Iab::~File_Iab()
94145 {
146 }
147
148 //***************************************************************************
149 // Streams management extra
150 //***************************************************************************
151
152 //---------------------------------------------------------------------------
153 void File_Iab::Streams_Fill_ForAdm()
154 {
155
156 if (Objects.empty())
157 return;
158 Fill(Stream_Audio, 0, "NumberOfProgrammes", 1);
159 Fill(Stream_Audio, 0, "NumberOfContents", 1);
160 Fill(Stream_Audio, 0, "NumberOfObjects", Objects.size());
161 Fill(Stream_Audio, 0, "NumberOfPackFormats", Objects.size());
162 size_t numberOfChannelFormats=0;
163 for (const auto& Object : Objects)
164 {
165 numberOfChannelFormats+=Object.ChannelLayout.empty()?1:Object.ChannelLayout.size();
166 }
167 Fill(Stream_Audio, 0, "NumberOfChannelFormats", numberOfChannelFormats);
168 Fill(Stream_Audio, 0, "NumberOfTrackUIDs", numberOfChannelFormats);
169 Fill(Stream_Audio, 0, "NumberOfTrackFormats", numberOfChannelFormats);
170 Fill(Stream_Audio, 0, "NumberOfStreamFormats", numberOfChannelFormats);
171
172 {
173 auto O="Programme0";
174 Fill(Stream_Audio, 0, O, "Yes");
175 Fill(Stream_Audio, 0, (string(O) + " Pos").c_str(), 0);
176 Fill_SetOptions(Stream_Audio, 0, (string(O) + " Pos").c_str(), "N NIY");
177 auto Content="Programme0 LinkedTo_Content_Pos";
178 Fill(Stream_Audio, 0, Content, 0);
179 Fill_SetOptions(Stream_Audio, 0, Content, "N NIY");
180 auto Content_String="Programme0 LinkedTo_Content_Pos/String";
181 Fill(Stream_Audio, 0, Content_String, 1);
182 Fill_SetOptions(Stream_Audio, 0, Content_String, "Y NIN");
183 }
184 {
185 auto O="Content0";
186 Fill(Stream_Audio, 0, O, "Yes");
187 Fill(Stream_Audio, 0, (string(O) + " Pos").c_str(), 0);
188 Fill_SetOptions(Stream_Audio, 0, (string(O) + " Pos").c_str(), "N NIY");
189 ZtringList SubstreamPos, SubstreamNum;
190 for (size_t i=0; i<Objects.size(); i++)
191 {
192 SubstreamPos.push_back(Ztring::ToZtring(i));
193 SubstreamNum.push_back(Ztring::ToZtring(i+1));
194 }
195 auto Object="Content0 LinkedTo_Object_Pos";
196 SubstreamPos.Separator_Set(0, __T(" + "));
197 Fill(Stream_Audio, 0, Object, SubstreamPos.Read());
198 Fill_SetOptions(Stream_Audio, 0, Object, "N NIY");
199 auto Object_String="Content0 LinkedTo_Object_Pos/String";
200 SubstreamNum.Separator_Set(0, __T(" + "));
201 Fill(Stream_Audio, 0, Object_String, SubstreamNum.Read());
202 Fill_SetOptions(Stream_Audio, 0, Object_String, "Y NIN");
203 }
204
205 numberOfChannelFormats=0;
206 for (size_t i=0; i<Objects.size(); i++)
207 {
208 const auto& Object=Objects[i];
209 auto O="Object"+to_string(i);
210 Fill(Stream_Audio, 0, O.c_str(), "Yes");
211 Fill(Stream_Audio, 0, (O + " Pos").c_str(), i);
212 Fill_SetOptions(Stream_Audio, 0, (O + " Pos").c_str(), "N NIY");
213 auto PackFormat=O+" LinkedTo_PackFormat_Pos";
214 Fill(Stream_Audio, 0, PackFormat.c_str(), i);
215 Fill_SetOptions(Stream_Audio, 0, PackFormat.c_str(), "N NIY");
216 Fill(Stream_Audio, 0, (PackFormat+"/String").c_str(), i+1);
217 Fill_SetOptions(Stream_Audio, 0, (PackFormat+"/String").c_str(), "Y NIN");
218 ZtringList SubstreamPos, SubstreamNum;
219 if (Object.ChannelLayout.empty())
220 {
221 SubstreamPos.push_back(Ztring::ToZtring(numberOfChannelFormats));
222 SubstreamNum.push_back(Ztring::ToZtring(numberOfChannelFormats+1));
223 numberOfChannelFormats++;
224 }
225 else
226 {
227 for (size_t j=0; j<Object.ChannelLayout.size(); j++)
228 {
229 SubstreamPos.push_back(Ztring::ToZtring(numberOfChannelFormats));
230 SubstreamNum.push_back(Ztring::ToZtring(numberOfChannelFormats+1));
231 numberOfChannelFormats++;
232 }
233 }
234 O+=" LinkedTo_TrackUID_Pos";
235 SubstreamPos.Separator_Set(0, __T(" + "));
236 Fill(Stream_Audio, 0, O.c_str(), SubstreamPos.Read());
237 Fill_SetOptions(Stream_Audio, 0, O.c_str(), "N NIY");
238 SubstreamNum.Separator_Set(0, __T(" + "));
239 Fill(Stream_Audio, 0, (O+"/String").c_str(), SubstreamNum.Read());
240 Fill_SetOptions(Stream_Audio, 0, (O+"/String").c_str(), "Y NIN");
241 }
242
243 numberOfChannelFormats = 0;
244 for (size_t i=0; i<Objects.size(); i++)
245 {
246 const auto& Object=Objects[i];
247 auto O="PackFormat"+to_string(i);
248 Fill(Stream_Audio, 0, O.c_str(), "Yes");
249 Fill(Stream_Audio, 0, (O + " Pos").c_str(), i);
250 Fill_SetOptions(Stream_Audio, 0, (O + " Pos").c_str(), "N NIY");
251 ZtringList SubstreamPos, SubstreamNum, ChannelLayout;
252 if (Object.ChannelLayout.empty())
253 {
254 SubstreamPos.push_back(Ztring::ToZtring(numberOfChannelFormats));
255 SubstreamNum.push_back(Ztring::ToZtring(numberOfChannelFormats+1));
256 numberOfChannelFormats++;
257 }
258 else
259 {
260 for (size_t j=0; j<Object.ChannelLayout.size(); j++)
261 {
262 SubstreamPos.push_back(Ztring::ToZtring(numberOfChannelFormats));
263 SubstreamNum.push_back(Ztring::ToZtring(numberOfChannelFormats+1));
264 numberOfChannelFormats++;
265 ChannelLayout.push_back(Iab_Channel(Object.ChannelLayout[j]));
266 }
267 }
268 Fill(Stream_Audio, 0, (O+" TypeDefinition").c_str(), Object.ChannelLayout.empty()?"Objects":"DirectSpeakers");
269 ChannelLayout.Separator_Set(0, __T(" "));
270 Fill(Stream_Audio, 0, (O+" ChannelLayout").c_str(), ChannelLayout.Read());
271 O+=" LinkedTo_ChannelFormat_Pos";
272 SubstreamPos.Separator_Set(0, __T(" + "));
273 Fill(Stream_Audio, 0, O.c_str(), SubstreamPos.Read());
274 Fill_SetOptions(Stream_Audio, 0, O.c_str(), "N NIY");
275 SubstreamNum.Separator_Set(0, __T(" + "));
276 Fill(Stream_Audio, 0, (O+"/String").c_str(), SubstreamNum.Read());
277 Fill_SetOptions(Stream_Audio, 0, (O+"/String").c_str(), "Y NIN");
278 }
279
280 numberOfChannelFormats=0;
281 for (size_t i=0; i<Objects.size(); i++)
282 {
283 const auto& Object=Objects[i];
284 auto O_Base="ChannelFormat";
285 if (Object.ChannelLayout.empty())
286 {
287 auto O=O_Base+to_string(numberOfChannelFormats);
288 Fill(Stream_Audio, 0, O.c_str(), "Yes");
289 Fill(Stream_Audio, 0, (O + " Pos").c_str(), numberOfChannelFormats);
290 Fill_SetOptions(Stream_Audio, 0, (O + " Pos").c_str(), "N NIY");
291 Fill(Stream_Audio, 0, (O+" TypeDefinition").c_str(), "Objects");
292 numberOfChannelFormats++;
293 }
294 else
295 {
296 for (size_t j=0; j<Object.ChannelLayout.size(); j++)
297 {
298 auto O=O_Base+to_string(numberOfChannelFormats);
299 Fill(Stream_Audio, 0, O.c_str(), "Yes");
300 Fill(Stream_Audio, 0, (O + " Pos").c_str(), numberOfChannelFormats);
301 Fill_SetOptions(Stream_Audio, 0, (O + " Pos").c_str(), "N NIY");
302 Fill(Stream_Audio, 0, (O+" TypeDefinition").c_str(), "DirectSpeakers");
303 Fill(Stream_Audio, 0, (O+" ChannelLayout").c_str(), Iab_Channel(Object.ChannelLayout[j]));
304 numberOfChannelFormats++;
305 }
306 }
307 }
308
309 numberOfChannelFormats=0;
310 for (size_t i=0; i<Objects.size(); i++)
311 {
312 const auto& Object=Objects[i];
313 auto O_Base="TrackUID";
314 if (Object.ChannelLayout.empty())
315 {
316 auto O=O_Base+to_string(numberOfChannelFormats);
317 Fill(Stream_Audio, 0, O.c_str(), "Yes");
318 Fill(Stream_Audio, 0, (O + " Pos").c_str(), numberOfChannelFormats);
319 Fill_SetOptions(Stream_Audio, 0, (O + " Pos").c_str(), "N NIY");
320 if (Iab_SampleRate[SampleRate])
321 Fill(Stream_Audio, 0, (O+" SamplingRate").c_str(), Iab_SampleRate[SampleRate]);
322 if (Iab_BitDepth[BitDepth])
323 Fill(Stream_Audio, 0, (O+" BitDepth").c_str(), Iab_BitDepth[BitDepth]);
324 auto PackFormat=O+" LinkedTo_PackFormat_Pos";
325 Fill(Stream_Audio, 0, PackFormat.c_str(), i);
326 Fill_SetOptions(Stream_Audio, 0, PackFormat.c_str(), "N NIY");
327 Fill(Stream_Audio, 0, (PackFormat+"/String").c_str(), i+1);
328 Fill_SetOptions(Stream_Audio, 0, (PackFormat+"/String").c_str(), "Y NIN");
329 auto TrackFormat=O+" LinkedTo_TrackFormat_Pos";
330 Fill(Stream_Audio, 0, TrackFormat.c_str(), numberOfChannelFormats);
331 Fill_SetOptions(Stream_Audio, 0, TrackFormat.c_str(), "N NIY");
332 Fill(Stream_Audio, 0, (TrackFormat+"/String").c_str(), numberOfChannelFormats+1);
333 Fill_SetOptions(Stream_Audio, 0, (TrackFormat+"/String").c_str(), "Y NIN");
334 numberOfChannelFormats++;
335 }
336 else
337 {
338 for (size_t j=0; j<Object.ChannelLayout.size(); j++)
339 {
340 auto O=O_Base+to_string(numberOfChannelFormats);
341 Fill(Stream_Audio, 0, O.c_str(), "Yes");
342 Fill(Stream_Audio, 0, (O + " Pos").c_str(), numberOfChannelFormats);
343 Fill_SetOptions(Stream_Audio, 0, (O + " Pos").c_str(), "N NIY");
344 if (Iab_SampleRate[SampleRate])
345 Fill(Stream_Audio, 0, (O+" SamplingRate").c_str(), Iab_SampleRate[SampleRate]);
346 if (Iab_BitDepth[BitDepth])
347 Fill(Stream_Audio, 0, (O+" BitDepth").c_str(), Iab_BitDepth[BitDepth]);
348 auto PackFormat=O+" LinkedTo_PackFormat_Pos";
349 Fill(Stream_Audio, 0, PackFormat.c_str(), i);
350 Fill_SetOptions(Stream_Audio, 0, PackFormat.c_str(), "N NIY");
351 Fill(Stream_Audio, 0, (PackFormat+"/String").c_str(), i+1);
352 Fill_SetOptions(Stream_Audio, 0, (PackFormat+"/String").c_str(), "Y NIN");
353 auto TrackFormat=O+" LinkedTo_TrackFormat_Pos";
354 Fill(Stream_Audio, 0, TrackFormat.c_str(), numberOfChannelFormats);
355 Fill_SetOptions(Stream_Audio, 0, TrackFormat.c_str(), "N NIY");
356 Fill(Stream_Audio, 0, (TrackFormat+"/String").c_str(), numberOfChannelFormats+1);
357 Fill_SetOptions(Stream_Audio, 0, (TrackFormat+"/String").c_str(), "Y NIN");
358 numberOfChannelFormats++;
359 }
360 }
361 }
362
363 numberOfChannelFormats=0;
364 for (size_t i=0; i<Objects.size(); i++)
365 {
366 const auto& Object=Objects[i];
367 auto O_Base="TrackFormat";
368 if (Object.ChannelLayout.empty())
369 {
370 auto O=O_Base+to_string(numberOfChannelFormats);
371 Fill(Stream_Audio, 0, O.c_str(), "Yes");
372 Fill(Stream_Audio, 0, (O + " Pos").c_str(), numberOfChannelFormats);
373 Fill_SetOptions(Stream_Audio, 0, (O + " Pos").c_str(), "N NIY");
374 Fill(Stream_Audio, 0, (O+" FormatDefinition").c_str(), "PCM");
375 auto StreamFormat=O+" LinkedTo_StreamFormat_Pos";
376 Fill(Stream_Audio, 0, StreamFormat.c_str(), numberOfChannelFormats);
377 Fill_SetOptions(Stream_Audio, 0, StreamFormat.c_str(), "N NIY");
378 Fill(Stream_Audio, 0, (StreamFormat+"/String").c_str(), numberOfChannelFormats+1);
379 Fill_SetOptions(Stream_Audio, 0, (StreamFormat+"/String").c_str(), "Y NIN");
380 numberOfChannelFormats++;
381 }
382 else
383 {
384 for (size_t j=0; j<Object.ChannelLayout.size(); j++)
385 {
386 auto O=O_Base+to_string(numberOfChannelFormats);
387 Fill(Stream_Audio, 0, O.c_str(), "Yes");
388 Fill(Stream_Audio, 0, (O + " Pos").c_str(), numberOfChannelFormats);
389 Fill_SetOptions(Stream_Audio, 0, (O + " Pos").c_str(), "N NIY");
390 Fill(Stream_Audio, 0, (O+" FormatDefinition").c_str(), "PCM");
391 auto StreamFormat=O+" LinkedTo_StreamFormat_Pos";
392 Fill(Stream_Audio, 0, StreamFormat.c_str(), numberOfChannelFormats);
393 Fill_SetOptions(Stream_Audio, 0, StreamFormat.c_str(), "N NIY");
394 Fill(Stream_Audio, 0, (StreamFormat+"/String").c_str(), numberOfChannelFormats+1);
395 Fill_SetOptions(Stream_Audio, 0, (StreamFormat+"/String").c_str(), "Y NIN");
396 numberOfChannelFormats++;
397 }
398 }
399 }
400
401 numberOfChannelFormats=0;
402 for (size_t i=0; i<Objects.size(); i++)
403 {
404 const auto& Object=Objects[i];
405 auto O_Base="StreamFormat";
406 if (Object.ChannelLayout.empty())
407 {
408 auto O=O_Base+to_string(numberOfChannelFormats);
409 Fill(Stream_Audio, 0, O.c_str(), "Yes");
410 Fill(Stream_Audio, 0, (O + " Pos").c_str(), numberOfChannelFormats);
411 Fill(Stream_Audio, 0, (O + " Format").c_str(), "PCM");
412 Fill_SetOptions(Stream_Audio, 0, (O + " Pos").c_str(), "N NIY");
413 auto ChannelFormat=O+" LinkedTo_ChannelFormat_Pos";
414 Fill(Stream_Audio, 0, ChannelFormat.c_str(), numberOfChannelFormats);
415 Fill_SetOptions(Stream_Audio, 0, ChannelFormat.c_str(), "N NIY");
416 Fill(Stream_Audio, 0, (ChannelFormat+"/String").c_str(), numberOfChannelFormats+1);
417 Fill_SetOptions(Stream_Audio, 0, (ChannelFormat+"/String").c_str(), "Y NIN");
418 auto PackFormat=O+" LinkedTo_PackFormat_Pos";
419 Fill(Stream_Audio, 0, PackFormat.c_str(), i);
420 Fill_SetOptions(Stream_Audio, 0, PackFormat.c_str(), "N NIY");
421 Fill(Stream_Audio, 0, (PackFormat+"/String").c_str(), i+1);
422 Fill_SetOptions(Stream_Audio, 0, (PackFormat+"/String").c_str(), "Y NIN");
423 auto TrackFormat=O+" LinkedTo_TrackFormat_Pos";
424 Fill(Stream_Audio, 0, TrackFormat.c_str(), numberOfChannelFormats);
425 Fill_SetOptions(Stream_Audio, 0, TrackFormat.c_str(), "N NIY");
426 Fill(Stream_Audio, 0, (TrackFormat+"/String").c_str(), numberOfChannelFormats+1);
427 Fill_SetOptions(Stream_Audio, 0, (TrackFormat+"/String").c_str(), "Y NIN");
428 numberOfChannelFormats++;
429 }
430 else
431 {
432 for (size_t j=0; j<Object.ChannelLayout.size(); j++)
433 {
434 auto O=O_Base+to_string(numberOfChannelFormats);
435 Fill(Stream_Audio, 0, O.c_str(), "Yes");
436 Fill(Stream_Audio, 0, (O + " Pos").c_str(), numberOfChannelFormats);
437 Fill_SetOptions(Stream_Audio, 0, (O + " Pos").c_str(), "N NIY");
438 auto ChannelFormat=O+" LinkedTo_ChannelFormat_Pos";
439 Fill(Stream_Audio, 0, ChannelFormat.c_str(), numberOfChannelFormats);
440 Fill_SetOptions(Stream_Audio, 0, ChannelFormat.c_str(), "N NIY");
441 Fill(Stream_Audio, 0, (ChannelFormat+"/String").c_str(), numberOfChannelFormats+1);
442 Fill_SetOptions(Stream_Audio, 0, (ChannelFormat+"/String").c_str(), "Y NIN");
443 auto PackFormat=O+" LinkedTo_PackFormat_Pos";
444 Fill(Stream_Audio, 0, PackFormat.c_str(), i);
445 Fill_SetOptions(Stream_Audio, 0, PackFormat.c_str(), "N NIY");
446 Fill(Stream_Audio, 0, (PackFormat+"/String").c_str(), i+1);
447 Fill_SetOptions(Stream_Audio, 0, (PackFormat+"/String").c_str(), "Y NIN");
448 auto TrackFormat=O+" LinkedTo_TrackFormat_Pos";
449 Fill(Stream_Audio, 0, TrackFormat.c_str(), numberOfChannelFormats);
450 Fill_SetOptions(Stream_Audio, 0, TrackFormat.c_str(), "N NIY");
451 Fill(Stream_Audio, 0, (TrackFormat+"/String").c_str(), numberOfChannelFormats+1);
452 Fill_SetOptions(Stream_Audio, 0, (TrackFormat+"/String").c_str(), "Y NIN");
453 numberOfChannelFormats++;
454 }
455 }
456 }
95457 }
96458
97459 //***************************************************************************
139501
140502 //Filling
141503 Header_Fill_Size(Element_Offset+IAFrameLength);
142 Header_Fill_Code(0, "IAFrame");
504 Header_Fill_Code(0, "IAB");
143505 }
144506 else
145507 {
146 Get_Flex8 (ElementID, "ElementID");
147 Get_Flex8 (ElementSize, "ElementSize");
508 Get_Plex8 (ElementID, "ElementID");
509 Get_Plex8 (ElementSize, "ElementSize");
148510
149511 //Filling
150512 Header_Fill_Size(Element_Offset+ElementSize);
165527 //Parsing
166528 switch (Element_Code)
167529 {
168 case 0x00000008: Element_Name("Frame"); FrameHeader(); break;
530 case 0x00000008: Element_Name("IAFrame"); IAFrame(); break;
169531 case 0x00000010: Element_Name("Bed Definition"); BedDefinition(); break;
170 case 0x00000040: Element_Name("Bed Remap"); BedRemap(); break;
532 case 0x00000020: Element_Name("Bed Remap"); BedRemap(); break;
533 case 0x00000040: Element_Name("Object Definition"); ObjectDefinition(); break;
534 case 0x00000400: Element_Name("Audio Data PCM"); AudioDataPCM(); break;
171535 default: Element_Name(Ztring().From_CC4((int32u)Element_Code)); Skip_XX(Element_Size, "Data");
172536 }
173
174 //Finish();
175 }
176
177 //---------------------------------------------------------------------------
178 void File_Iab::FrameHeader()
537 }
538
539 //---------------------------------------------------------------------------
540 void File_Iab::IAFrame()
179541 {
180542 //Parsing
181 Element_Begin1("Frame Header");
182543 int32u MaxRendered, SubElementCount;
183 Get_B1 (Version, "Version");
544 Get_B1 (Version, "Version");
184545 if (Version==1)
185546 {
186547 BS_Begin();
188549 Get_S1 (2, BitDepth, "BitDepth"); Param_Info2C(Iab_BitDepth[BitDepth], Iab_BitDepth[BitDepth], " bits");
189550 Get_S1 (4, FrameRate, "FrameRate"); Param_Info2C(Iab_FrameRate[FrameRate], Iab_FrameRate[FrameRate], " FPS");
190551 BS_End();
191 Get_Flex8(MaxRendered, "MaxRendered");
192 Get_Flex8(SubElementCount, "SubElementCount");
193 Element_End0();
552 Get_Plex8 (MaxRendered, "MaxRendered");
553 Get_Plex8 (SubElementCount, "SubElementCount");
194554 Element_ThisIsAList();
555 if (Frame_Count+1<Frame_Count_Valid)
556 Objects.clear();
195557 }
196558 else
197559 Skip_XX(Element_Size-Element_Offset, "Unknown");
203565 FILLING_END();
204566 }
205567
206
207568 //---------------------------------------------------------------------------
208569 void File_Iab::BedDefinition()
209570 {
571 Objects.resize(Objects.size()+1);
572
573 //Parsing
574 int32u ChannelCount;
575 int8u AudioDescription;
576 bool ConditionalBed;
577 Skip_Plex8( "MetaID");
578 BS_Begin();
579 Get_SB (ConditionalBed, "ConditionalBed");
580 if (ConditionalBed)
581 {
582 Skip_S1(8, "BedUseCase");
583 }
584 Get_Plex(4, ChannelCount, "ChannelCount");
585 for (int32u n=0; n<ChannelCount; n++)
586 {
587 Element_Begin1("Channel");
588 int32u ChannelID;
589 int8u ChannelGainPrefix;
590 bool ChannelDecorInfoExists;
591 Get_Plex (4, ChannelID, "ChannelID"); Element_Info1(Iab_Channel(ChannelID));
592 Skip_Plex(8, "AudioDataID");
593 Get_S1 (2, ChannelGainPrefix, "ChannelGainPrefix");
594 if (ChannelGainPrefix>1)
595 Skip_S1(10, "ChannelGain");
596 Get_SB (ChannelDecorInfoExists, "ChannelDecorInfoExists");
597 if (ChannelDecorInfoExists)
598 {
599 int8u ChannelDecorCoefPrefix;
600 Skip_S2(2, "Reserved");
601 Get_S1 (2, ChannelDecorCoefPrefix, "ChannelDecorCoefPrefix");
602 if (ChannelDecorCoefPrefix>1)
603 Skip_S1(10, "ChannelDecorCoef");
604 }
605 Element_End0();
606 Objects.back().ChannelLayout.push_back(ChannelID);
607 }
608 Skip_S2(10, "0x180");
609 if (Data_BS_Remain()%8)
610 Skip_S1(Data_BS_Remain()%8, "AlignBits");
611 BS_End();
612 Get_B1 (AudioDescription, "AudioDescription");
613 if (AudioDescription&0x80)
614 {
615 size_t Pos=(size_t)Element_Offset+1;
616 while (Pos<Element_Size-1 && Buffer[Buffer_Offset+Pos])
617 Pos++;
618 Skip_XX(Pos-Element_Offset, "AudioDescriptionText");
619 }
620 Skip_B1( "SubElementCount");
621 Element_ThisIsAList();
622 }
623
624 //---------------------------------------------------------------------------
625 void File_Iab::ObjectDefinition()
626 {
627 Objects.resize(Objects.size()+1);
628
629 //Parsing
630 int8u AudioDescription;
631 bool ConditionalBed;
632 Skip_Plex8( "MetaID");
633 Skip_Plex8( "AudioDataID");
634 BS_Begin();
635 Get_SB (ConditionalBed, "ConditionalBed");
636 if (ConditionalBed)
637 {
638 Skip_SB( "1");
639 Skip_S1(8, "ObjectUseCase");
640 }
641 Skip_SB( "0");
642 int32u NumPanSubBlocks=8;
643 for (int32u sb=0; sb<NumPanSubBlocks; sb++)
644 {
645 Element_Begin1("PanSubBlock");
646 bool PanInfoExists;
647 if (!sb)
648 PanInfoExists=true;
649 else
650 Get_SB (PanInfoExists, "PanInfoExists");
651 if (PanInfoExists)
652 {
653 int8u ObjectGainPrefix;
654 bool ObjectSnap, ObjectZoneControl;
655 Get_S1 (2, ObjectGainPrefix, "ObjectGainPrefix");
656 if (ObjectGainPrefix>1)
657 Skip_S1(10, "ObjectGainPrefix");
658 Skip_S1( 3, "b001");
659 Skip_S2(16, "ObjectPosX");
660 Skip_S2(16, "ObjectPosY");
661 Skip_S2(16, "ObjectPosZ");
662 Get_SB (ObjectSnap, "ObjectSnap");
663 if (ObjectSnap)
664 {
665 bool ObjectSnapTolExists;
666 Get_SB (ObjectSnapTolExists, "ObjectSnapTolExists");
667 if (ObjectSnapTolExists)
668 {
669 Skip_S2(12, "ObjectSnapTolerance");
670 }
671 Skip_SB( "0");
672 }
673 Get_SB (ObjectZoneControl, "ObjectZoneControl");
674 if (ObjectZoneControl)
675 {
676 for (int n=0; n<9; n++)
677 {
678 int8u ZoneGainPrefix;
679 Get_S1 (2, ZoneGainPrefix, "ZoneGainPrefix");
680 if (ZoneGainPrefix>1)
681 Skip_S1(10, "ZoneGain");
682 }
683 }
684 int8u ObjectSpreadMode;
685 Get_S1 (2, ObjectSpreadMode, "ObjectSpreadMode");
686 switch (ObjectSpreadMode)
687 {
688 case 0:
689 case 2:
690 {
691 Skip_S1( 8, "ObjectSpread");
692 }
693 break;
694 case 3:
695 {
696 Skip_S2(12, "ObjectSpreadX");
697 Skip_S2(12, "ObjectSpreadY");
698 Skip_S2(12, "ObjectSpreadZ");
699 }
700 break;
701 default: ;
702 }
703 Skip_S1(4, "0");
704 int8u ObjectDecorCoefPrefix;
705 Get_S1 (2, ObjectDecorCoefPrefix, "ObjectDecorCoefPrefix");
706 if (ObjectDecorCoefPrefix>1)
707 Skip_S1(8, "ObjectDecorCoefPrefix");
708 }
709 Element_End0();
710 }
711 BS_End();
712 Get_B1 (AudioDescription, "AudioDescription");
713 if (AudioDescription&0x80)
714 {
715 size_t Pos=(size_t)Element_Offset+1;
716 while (Pos<Element_Size-1 && Buffer[Buffer_Offset+Pos])
717 Pos++;
718 Skip_XX(Pos-Element_Offset, "AudioDescriptionText");
719 }
720 Skip_B1( "SubElementCount");
721 Element_ThisIsAList();
210722 }
211723
212724 //---------------------------------------------------------------------------
213725 void File_Iab::BedRemap()
214726 {
215 }
216
217 //---------------------------------------------------------------------------
218 void File_Iab::Get_Flex8(int32u& Info, const char* Name)
727 int32u SourceChannels, DestinationChannels;
728 Skip_Plex8( "MetaID");
729 Skip_B1 ( "RemapUseCase");
730 BS_Begin();
731 Get_Plex (4, SourceChannels, "SourceChannels");
732 Get_Plex (4, DestinationChannels, "DestinationChannels");
733 int32u NumPanSubBlocks=8;
734 for (int32u sb=0; sb<NumPanSubBlocks; sb++)
735 {
736 Element_Begin1("PanSubBlock");
737 bool RemapInfoExists;
738 if (!sb)
739 RemapInfoExists=true;
740 else
741 Get_SB (RemapInfoExists, "RemapInfoExists");
742 if (RemapInfoExists)
743 {
744 for(int32u oChan=0; oChan<DestinationChannels; oChan++)
745 {
746 Skip_Plex(4, "DestinationChannelID");
747 for (int32u iChan=0; iChan<SourceChannels; iChan++)
748 {
749 int8u RemapGainPrefix;
750 Get_S1 (2, RemapGainPrefix, "RemapGainPrefix");
751 if (RemapGainPrefix>1)
752 Skip_S1(10, "RemapGain");
753 }
754 }
755 }
756 Element_End0();
757 }
758 BS_End();
759 }
760
761 //---------------------------------------------------------------------------
762 void File_Iab::AudioDataPCM()
763 {
764 //Parsing
765 Skip_Plex8( "MetaID");
766 Skip_XX(Element_Size-Element_Offset, "PCMData");
767 }
768
769 //***************************************************************************
770 // Helpers
771 //***************************************************************************
772
773 //---------------------------------------------------------------------------
774 void File_Iab::Get_Plex(int8u Bits, int32u& Info, const char* Name)
775 {
776 for (;;)
777 {
778 Peek_BS(Bits, Info);
779 if (Info!=(1<<Bits)-1 || Bits>=32)
780 {
781 Get_BS(Bits, Info, Name);
782 return;
783 }
784 BS->Skip(Bits);
785 Bits<<=1;
786 }
787 }
788
789 //---------------------------------------------------------------------------
790 void File_Iab::Get_Plex8(int32u& Info, const char* Name)
219791 {
220792 //Element size
221793 int8u Info8;
2424 public :
2525 //In
2626 int64u Frame_Count_Valid;
27
2728 //Constructor/Destructor
2829 File_Iab();
2930 ~File_Iab();
31
32 //Extra
33 void Streams_Fill_ForAdm();
3034
3135 private :
3236 //Streams management
3741 void Data_Parse();
3842
3943 //Elements
40 void FrameHeader();
44 void IAFrame();
4145 void BedDefinition();
46 void ObjectDefinition();
4247 void BedRemap();
48 void AudioDataPCM();
4349
4450 //Temp
4551 int8u Version;
4652 int8u SampleRate;
4753 int8u BitDepth;
4854 int8u FrameRate;
55 struct object
56 {
57 vector<int32u> ChannelLayout;
58 };
59 vector<object> Objects;
4960
5061 //Helpers
51 void Get_Flex8(int32u& Info, const char* Name);
62 void Get_Plex(int8u Bits, int32u& Info, const char* Name);
63 void Get_Plex8(int32u& Info, const char* Name);
64 void Skip_Plex(int8u Bits, const char* Name) { int32u Info; Get_Plex(Bits, Info, Name); }
65 void Skip_Plex8(const char* Name) { int32u Info; Get_Plex8(Info, Name); }
5266 };
5367
5468 } //NameSpace
345345 //---------------------------------------------------------------------------
346346 void File_Mpega::Streams_Fill()
347347 {
348 File__Tags_Helper::Stream_Prepare(Stream_Audio);
349 Fill(Stream_Audio, 0, Audio_Format, "MPEG Audio");
350 if (!Frame_Count)
351 return;
352
348353 //VBR detection without header
349354 if (VBR_Frames==0)
350355 {
353358 BitRate_Mode=__T("VBR");
354359 }
355360
356 File__Tags_Helper::Stream_Prepare(Stream_Audio);
357 Fill(Stream_Audio, 0, Audio_Format, "MPEG Audio");
358361 Fill(Stream_Audio, 0, Audio_Format_Version, Mpega_Format_Profile_Version[ID]);
359362 Fill(Stream_Audio, 0, Audio_Format_Profile, Mpega_Format_Profile_Layer[layer]);
360363 if (mode && mode<4)
261261 //In
262262 MustParse_mhaC=false;
263263 MustParse_mpegh3daFrame=false;
264 #if MEDIAINFO_CONFORMANCE
265 ConformanceFlags.set(MpegH);
266 #endif
264267
265268 //Temp
266269 audioSceneInfoID=0;
620623 //---------------------------------------------------------------------------
621624 void File_Mpegh3da::Streams_Finish()
622625 {
626 Streams_Finish_Conformance();
623627 }
624628
625629 //***************************************************************************
8484 channelConfiguration=(int8u)-1;
8585 sampling_frequency_index=(int8u)-1;
8686 extension_sampling_frequency_index=(int8u)-1;
87
88 #if MEDIAINFO_CONFORMANCE
89 Profile=AudioProfile_Max;
90 #endif
8791 }
8892
8993 //---------------------------------------------------------------------------
9094 File_Usac::~File_Usac()
9195 {
9296 }
97
98 //***********************************************************************
99 // Conformance
100 //***********************************************************************
101
102 //---------------------------------------------------------------------------
103 #if MEDIAINFO_CONFORMANCE
104 void File_Usac::Streams_Finish_Conformance()
105 {
106 if (ConformanceErrors.empty())
107 return;
108 for (size_t i = ConformanceErrors.size() - 1; i < ConformanceErrors.size(); i--) {
109 if (!CheckIf(ConformanceErrors[i].Flags)) {
110 ConformanceErrors.erase(ConformanceErrors.begin() + i);
111 }
112 }
113 if (ConformanceErrors.empty())
114 return;
115 Fill(Stream_Audio, 0, "ConformanceErrors", ConformanceErrors.size());
116 for (const auto& ConformanceError : ConformanceErrors) {
117 const char* FieldPrefix = "ConformanceErrors ";
118 size_t Space = 0;
119 for (;;) {
120 Space = ConformanceError.Field.find(' ', Space + 1);
121 if (Space == string::npos) {
122 break;
123 }
124 const auto Field = FieldPrefix + ConformanceError.Field.substr(0, Space);
125 const auto& Value = Retrieve_Const(StreamKind_Last, StreamPos_Last, Field.c_str());
126 if (Value.empty()) {
127 Fill(StreamKind_Last, StreamPos_Last, Field.c_str(), "Yes");
128 }
129 }
130 Fill(Stream_Audio, 0, (FieldPrefix + ConformanceError.Field).c_str(), ConformanceError.Value);
131 }
132 ConformanceErrors.clear();
133 }
134 #endif
93135
94136 //***************************************************************************
95137 // Elements - USAC
105147 int8u coreSbrFrameLengthIndex;
106148 bool usacConfigExtensionPresent;
107149 Get_S1 (5, sampling_frequency_index, "usacSamplingFrequencyIndex"); Param_Info1C(sampling_frequency_index<Aac_sampling_frequency_Size_Usac && Aac_sampling_frequency[sampling_frequency_index], Aac_sampling_frequency[sampling_frequency_index]);
150 int32u Frequency_b2;
108151 if (sampling_frequency_index==Aac_sampling_frequency_Size_Usac)
109152 {
110153 int32u samplingFrequency;
111154 Get_S3 (24, samplingFrequency, "usacSamplingFrequency");
112 Frequency_b=samplingFrequency;
155 Frequency_b2=samplingFrequency;
113156 sampling_frequency_index=Aac_AudioSpecificConfig_sampling_frequency_index(Frequency_b);
114157 }
115158 else
116 Frequency_b=Aac_sampling_frequency[sampling_frequency_index];
159 Frequency_b2=Aac_sampling_frequency[sampling_frequency_index];
160 #if MEDIAINFO_CONFORMANCE
161 if (Frequency_b && Frequency_b2!=Frequency_b)
162 Fill_Conformance("Crosscheck AudioSpecificConfig-UsacConfig samplingFrequency-usacSamplingFrequency", (to_string(Frequency_b) + " vs " + to_string(Frequency_b2) + " are not coherent").c_str());
163 #endif
117164 Get_S1 (3, coreSbrFrameLengthIndex, "coreSbrFrameLengthIndex");
118165 Get_S1 (5, channelConfiguration, "channelConfiguration"); Param_Info1C(channelConfiguration, Aac_ChannelLayout_GetString(channelConfiguration));
119166 if (!channelConfiguration)
178225 string FieldPrefix;
179226 if (Prefix)
180227 {
181 FieldPrefix+=Prefix;
228 FieldPrefix += Prefix;
182229 FieldPrefix += ' ';
183230 }
184231 string FieldSuffix;
185232
186 bool DefaultIdPresent=false;
187 for (int8u i=0; i<2; i++)
233 bool DefaultIdPresent = false;
234 for (int8u i = 0; i < 2; i++)
188235 {
189236 if (i)
190 FieldSuffix="_Album";
237 FieldSuffix = "_Album";
191238 if (!loudnessInfo_Data[i].empty())
192239 {
193 Fill(Stream_Audio, 0, (FieldPrefix+"Loudness_Count"+FieldSuffix).c_str(), loudnessInfo_Data[i].size());
194 Fill_SetOptions(Stream_Audio, 0, (FieldPrefix+"Loudness_Count"+FieldSuffix).c_str(), "N NI"); // Hidden in text output
240 Fill(Stream_Audio, 0, (FieldPrefix + "Loudness_Count" + FieldSuffix).c_str(), loudnessInfo_Data[i].size());
241 Fill_SetOptions(Stream_Audio, 0, (FieldPrefix + "Loudness_Count" + FieldSuffix).c_str(), "N NI"); // Hidden in text output
195242 }
196243 ZtringList Ids;
197244 ZtringList SamplePeakLevel;
198245 ZtringList TruePeakLevel;
199246 ZtringList Measurements[16];
200 for (std::map<Ztring, loudness_info>::iterator Item=loudnessInfo_Data[i].begin(); Item!=loudnessInfo_Data[i].end(); ++Item)
247 for (std::map<Ztring, loudness_info>::iterator Item = loudnessInfo_Data[i].begin(); Item != loudnessInfo_Data[i].end(); ++Item)
201248 {
202249 Ids.push_back(Item->first);
203250 SamplePeakLevel.push_back(Item->second.SamplePeakLevel);
204251 TruePeakLevel.push_back(Item->second.TruePeakLevel);
205 for (int8u j=1; j<16; j++)
252 for (int8u j = 1; j < 16; j++)
206253 Measurements[j].push_back(Item->second.Measurements.Values[j]);
207254 }
208 if (Ids.size()>=1 && Ids.front().empty())
255 if (Ids.size() >= 1 && Ids.front().empty())
209256 {
210257 if (!i)
211 DefaultIdPresent=true;
212 if (Ids.size()==1)
258 DefaultIdPresent = true;
259 if (Ids.size() == 1)
213260 Ids.clear();
214261 }
215 Fill(Stream_Audio, 0, (FieldPrefix+"SamplePeakLevel"+FieldSuffix).c_str(), SamplePeakLevel, Ids);
216 Fill(Stream_Audio, 0, (FieldPrefix+"TruePeakLevel"+FieldSuffix).c_str(), TruePeakLevel, Ids);
217 for (int8u j=1; j<16; j++)
262 Fill(Stream_Audio, 0, (FieldPrefix + "SamplePeakLevel" + FieldSuffix).c_str(), SamplePeakLevel, Ids);
263 Fill(Stream_Audio, 0, (FieldPrefix + "TruePeakLevel" + FieldSuffix).c_str(), TruePeakLevel, Ids);
264 for (int8u j = 1; j < 16; j++)
218265 {
219266 string Field;
220 if (j<=LoudnessMeaning_Size)
221 Field=LoudnessMeaning[j-1];
267 if (j <= LoudnessMeaning_Size)
268 Field = LoudnessMeaning[j - 1];
222269 else
223 Field="LoudnessMeaning"+Ztring::ToZtring(j).To_UTF8();
224 Fill(Stream_Audio, 0, (FieldPrefix+Field+FieldSuffix).c_str(), Measurements[j], Ids);
225 }
226 }
227
228 if (NoConCh)
229 return;
230 if (!loudnessInfoSet_Present)
231 {
232 Fill(Stream_Audio, 0, (FieldPrefix+"ConformanceCheck").c_str(), "Invalid: loudnessInfoSet is missing");
233 Fill(Stream_Audio, 0, "ConformanceCheck/Short", "Invalid: loudnessInfoSet missing");
234 }
235 else if (loudnessInfo_Data[0].empty())
236 {
237 Fill(Stream_Audio, 0, (FieldPrefix+"ConformanceCheck").c_str(), "Invalid: loudnessInfoSet is empty");
238 Fill(Stream_Audio, 0, "ConformanceCheck/Short", "Invalid: loudnessInfoSet empty");
239 }
240 else if (!DefaultIdPresent)
241 {
242 Fill(Stream_Audio, 0, (FieldPrefix+"ConformanceCheck").c_str(), "Invalid: Default loudnessInfo is missing");
243 Fill(Stream_Audio, 0, "ConformanceCheck/Short", "Invalid: Default loudnessInfo missing");
244 }
245 else if (loudnessInfo_Data[0].begin()->second.Measurements.Values[1].empty() && loudnessInfo_Data[0].begin()->second.Measurements.Values[2].empty())
246 {
247 Fill(Stream_Audio, 0, (FieldPrefix+"ConformanceCheck").c_str(), "Invalid: None of program loudness or anchor loudness is present in default loudnessInfo");
248 Fill(Stream_Audio, 0, "ConformanceCheck/Short", "Invalid: Default loudnessInfo incomplete");
249 }
250 if (!Retrieve_Const(Stream_Audio, 0, "ConformanceCheck/Short").empty())
251 Fill_SetOptions(Stream_Audio, 0, "ConformanceCheck/Short", "N NT"); // Hidden in text output
270 Field = "LoudnessMeaning" + Ztring::ToZtring(j).To_UTF8();
271 Fill(Stream_Audio, 0, (FieldPrefix + Field + FieldSuffix).c_str(), Measurements[j], Ids);
272 }
273 }
274
275 #if MEDIAINFO_CONFORMANCE
276 if (NoConCh)
277 return;
278 constexpr14 auto CheckFlags = bitset8().set(xHEAAC).set(MpegH);
279 if (!CheckIf(CheckFlags) || Profile==AudioProfile_Unspecified)
280 {
281 }
282 else if (!loudnessInfoSet_Present)
283 {
284 Fill_Conformance((string(ConformanceFlags[MpegH] ? "mpegh3daConfig" : "UsacConfig") + " loudnessInfoSet Coherency").c_str(), "Is missing", CheckFlags);
285 Fill(Stream_Audio, 0, (FieldPrefix + "ConformanceCheck").c_str(), "Invalid: loudnessInfoSet is missing");
286 Fill(Stream_Audio, 0, "ConformanceCheck/Short", "Invalid: loudnessInfoSet missing");
287 }
288 else if (loudnessInfo_Data[0].empty())
289 {
290 Fill_Conformance((string(ConformanceFlags[MpegH] ? "mpegh3daConfig" : "UsacConfig") + " loudnessInfoSet loudnessInfoCount").c_str(), "Is 0", CheckFlags);
291 Fill(Stream_Audio, 0, (FieldPrefix + "ConformanceCheck").c_str(), "Invalid: loudnessInfoSet is empty");
292 Fill(Stream_Audio, 0, "ConformanceCheck/Short", "Invalid: loudnessInfoSet empty");
293 }
294 else if (!DefaultIdPresent)
295 {
296 Fill_Conformance((string(ConformanceFlags[MpegH] ? "mpegh3daConfig" : "UsacConfig") + " loudnessInfoSet Coherency").c_str(), "Default loudnessInfo is missing", CheckFlags);
297 Fill(Stream_Audio, 0, (FieldPrefix + "ConformanceCheck").c_str(), "Invalid: Default loudnessInfo is missing");
298 Fill(Stream_Audio, 0, "ConformanceCheck/Short", "Invalid: Default loudnessInfo missing");
299 }
300 else if (loudnessInfo_Data[0].begin()->second.Measurements.Values[1].empty() && loudnessInfo_Data[0].begin()->second.Measurements.Values[2].empty())
301 {
302 Fill_Conformance((string(ConformanceFlags[MpegH] ? "mpegh3daConfig" : "UsacConfig") + " loudnessInfoSet Coherency").c_str(), "None of program loudness or anchor loudness is present in default loudnessInfo", CheckFlags);
303 Fill(Stream_Audio, 0, (FieldPrefix + "ConformanceCheck").c_str(), "Invalid: None of program loudness or anchor loudness is present in default loudnessInfo");
304 Fill(Stream_Audio, 0, "ConformanceCheck/Short", "Invalid: Default loudnessInfo incomplete");
305 }
306 if (!Retrieve_Const(Stream_Audio, 0, "ConformanceCheck/Short").empty())
307 {
308 Fill_SetOptions(Stream_Audio, 0, "ConformanceCheck", "N NT"); // Hidden in text output (deprecated)
309 Fill_SetOptions(Stream_Audio, 0, "ConformanceCheck/Short", "N NT"); // Hidden in text output
310 }
311 #endif
252312 }
253313
254314 //---------------------------------------------------------------------------
470530 int8u downmixInstructionsCount, drcCoefficientsBasicCount, drcInstructionsBasicCount, drcCoefficientsUniDrcCount, drcInstructionsUniDrcCount;
471531 TEST_SB_SKIP( "sampleRatePresent");
472532 Skip_S3(18, "bsSampleRate");
533 Fill(Stream_Audio, 0, "bsSampleRate", "bsSampleRate");
473534 TEST_SB_END();
474535 Get_S1 (7, downmixInstructionsCount, "downmixInstructionsCount");
475536 TESTELSE_SB_SKIP( "drcDescriptionBasicPresent");
1515 //---------------------------------------------------------------------------
1616
1717 //---------------------------------------------------------------------------
18 #ifdef MEDIAINFO_MPEG4_YES
19 #include "MediaInfo/Multiple/File_Mpeg4_Descriptors.h"
20 #endif
1821 #include "MediaInfo/File__Analyze.h"
22 #include "MediaInfo/TimeCode.h"
1923 //---------------------------------------------------------------------------
2024
2125 namespace MediaInfoLib
7175 int8u sampling_frequency_index;
7276 int8u extension_sampling_frequency_index;
7377
78 //***********************************************************************
79 // Conformance
80 //***********************************************************************
81
82 #if MEDIAINFO_CONFORMANCE
83 enum conformance_flags
84 {
85 Usac,
86 BaselineUsac,
87 xHEAAC,
88 MpegH,
89 Conformance_Max,
90 };
91 bitset8 ConformanceFlags;
92 struct field_value
93 {
94 string Field;
95 string Value;
96 bitset8 Flags;
97
98 field_value(string&& Field, string&& Value, bitset8 Flags)
99 : Field(Field)
100 , Value(Value)
101 , Flags(Flags)
102 {}
103 };
104 vector<field_value> ConformanceErrors;
105 audio_profile Profile;
106 void Streams_Finish_Conformance();
107 void Fill_Conformance(const char* Field, const char* Value, bitset8 Flags = {}) { ConformanceErrors.emplace_back(Field, Value, Flags); }
108 void Fill_Conformance(const char* Field, const char* Value, conformance_flags Flag) { ConformanceErrors.emplace_back(Field, Value, bitset8().set(Flag)); }
109 bool CheckIf(const bitset8 Flags) { return !ConformanceFlags || !Flags || (ConformanceFlags & Flags); }
110 #else
111 inline void Streams_Finish_Conformance() {}
112 #endif
113
114 //***********************************************************************
115 // Others
116 //***********************************************************************
117
74118 struct drc_info
75119 {
76120 string drcSetEffectTotal;
13961396 }
13971397
13981398 if (!MI.Get(Stream_Other, StreamPos, Other_ID).empty())
1399 Add_TechnicalAttributeBoolean(Child, MI.Get(Stream_Other, StreamPos, __T("TimeCode_Striped")), "Stripped");
1399 Add_TechnicalAttributeBoolean(Child, MI.Get(Stream_Other, StreamPos, __T("TimeCode_Stripped")), "Stripped");
14001400
14011401 if (Is1_5)
14021402 Child->XmlCommentOut="(timecodeFormat not in XSD)";
984984 }
985985
986986 if (!MI.Get(Stream_Other, StreamPos, Other_ID).empty())
987 ToReturn+=__T("\t\t\t\t\t<ebucore:technicalAttributeBoolean typeLabel=\"Stripped\">")+Ztring(MI.Get(Stream_Other, StreamPos, __T("TimeCode_Striped"))==__T("Yes")?__T("true"):__T("false"))+__T("</ebucore:technicalAttributeBoolean>\n");
987 ToReturn+=__T("\t\t\t\t\t<ebucore:technicalAttributeBoolean typeLabel=\"Stripped\">")+Ztring(MI.Get(Stream_Other, StreamPos, __T("TimeCode_Stripped"))==__T("Yes")?__T("true"):__T("false"))+__T("</ebucore:technicalAttributeBoolean>\n");
988988
989989 ToReturn+=__T("\t\t\t\t</ebucore:timecodeFormat>\n");
990990
5252 }
5353
5454 //---------------------------------------------------------------------------
55 Ztring Element2Html(MediaInfo_Internal &MI, stream_t StreamKind, size_t StreamPos, Ztring Element, Ztring Format, Ztring FG, Ztring BG, Ztring HFG, Ztring HBG)
55 Ztring Element2Html(MediaInfo_Internal &MI, stream_t StreamKind, size_t StreamPos, Ztring Element, Ztring Format, Ztring FG, Ztring BG, Ztring HFG, Ztring HBG, bool HasNestedObjects=false)
5656 {
5757 Ztring ToReturn;
5858 ToReturn+=__T("<table border='0' cellborder='0' cellspacing='0'>");
6060 ToReturn+=__T("<td colspan='2' bgcolor='")+HBG+__T("'>");
6161 ToReturn+=__T("<font color='")+HFG+__T("'>");
6262 ToReturn+=__T("<b>")+XML_Encode(MI.Get(StreamKind, StreamPos, Element, Info_Name_Text))+__T("</b>");
63 ToReturn+=__T("<br/>");
6463 Ztring Sub=XML_Encode(MI.Get(StreamKind, StreamPos, Element, Info_Text));
65 if (Sub.size() && Sub[Sub.size()-1]==__T(')'))
66 {
67 if (Sub.FindAndReplace(__T("("), __T("<br/>"), 0))
68 Sub.erase(Sub.size()-1);
69 }
70 Sub.FindAndReplace(__T(" / "), __T("<br/>"), 0, Ztring_Recursive);
71 ToReturn+=Sub;
64 if (!HasNestedObjects || Sub!=__T("Yes"))
65 {
66 ToReturn+=__T("<br/>");
67 if (Sub.size() && Sub[Sub.size()-1]==__T(')'))
68 {
69 if (Sub.FindAndReplace(__T("("), __T("<br/>"), 0))
70 Sub.erase(Sub.size()-1);
71 }
72 Sub.FindAndReplace(__T(" / "), __T("<br/>"), 0, Ztring_Recursive);
73 ToReturn+=Sub;
74 }
7275 ToReturn+=__T("</font>");
7376 ToReturn+=__T("</td>");
7477 ToReturn+=__T("</tr>");
241244 Temp+=NewLine(Level++)+Stream+__T("_")+Object+__T(" ["); \
242245 Temp+=NewLine(Level)+__T("shape=plaintext"); \
243246 Temp+=NewLine(Level)+__T("label=<"); \
244 Temp+=Element2Html(MI, Stream_Audio, StreamPos, Object, Format, __T(FOREGROUND_COLOR), __T(BACKGROUND_COLOR), __T(TITLE_FOREGROUND_COLOR), __T(TITLE_BACKGROUND_COLOR)); \
247 Temp+=Element2Html(MI, Stream_Audio, StreamPos, Object, Format, __T(FOREGROUND_COLOR), __T(BACKGROUND_COLOR), __T(TITLE_FOREGROUND_COLOR), __T(TITLE_BACKGROUND_COLOR), true); \
245248 Temp+=__T(">");\
246249 Temp+=NewLine(--Level)+__T("]");
247250
252255 Linked##NAME##s.Write(MI.Get(Stream_Audio, StreamPos, Object+__T(" LinkedTo_" #NAME "_Pos"), Info_Text)); \
253256 for (size_t NAME##Pos=0; NAME##Pos<Linked##NAME##s.size(); NAME##Pos++) \
254257 Relations.push_back(relation(Stream+__T("_")+Object, Stream+__T("_" #NAME)+Linked##NAME##s[NAME##Pos], __T("[color=\"" COLOR "\"]"))); \
258 }
259
260 #define OBJECT_LINK_TO2(NAME, NAME2, COLOR) \
261 { \
262 ZtringList Linked##NAME##s; \
263 Linked##NAME##s.Separator_Set(0, __T(" + ")); \
264 Linked##NAME##s.Write(MI.Get(Stream_Audio, StreamPos, Object+__T(" LinkedTo_" #NAME2 "_Pos"), Info_Text)); \
265 for (size_t NAME##Pos=0; NAME##Pos<Linked##NAME##s.size(); NAME##Pos++) \
266 Relations.push_back(relation(Stream+__T("_")+Object, Stream+__T("_" #NAME)+Linked##NAME##s[NAME##Pos], __T("[color=\"" COLOR "\", style=\"dashed\"]"))); \
255267 }
256268
257269 #define OBJECT_END() \
463475 Ztring Export_Graph::Adm_Graph(MediaInfo_Internal &MI, size_t StreamPos, size_t Level)
464476 {
465477 Ztring ToReturn;
466 if (MI.Get(Stream_Audio, StreamPos, __T("Metadata_Format")).find(__T("ADM, "), 0)!=0)
478 if (MI.Get(Stream_Audio, StreamPos, __T("Metadata_Format")).find(__T("ADM, "), 0)!=0
479 && MI.Get(Stream_Audio, StreamPos, __T("Format"))!=__T("IAB"))
467480 return ToReturn;
468481
469482 Ztring Format=__T("ADM");
482495
483496 OBJECT_START(Programme, "NumberOfProgrammes", "#000000", "#c5cae9", "#ffffff", "#303f9f")
484497 OBJECT_LINK_TO(Content, "#c5cae9")
498 OBJECT_LINK_TO(PackFormat, "#c5cae9")
485499 OBJECT_END()
486500
487501 OBJECT_START(Content, "NumberOfContents", "#000000", "#bbdefb", "#ffffff", "#1976d2")
489503 OBJECT_END()
490504
491505 OBJECT_START(Object, "NumberOfObjects", "#000000", "#b3e5fc", "#ffffff", "#0288d1")
506 OBJECT_LINK_TO(Object, "black")
507 OBJECT_LINK_TO2(Object, ComplementaryObject, "black")
492508 OBJECT_LINK_TO(PackFormat, "#b3e5fc")
493509 if (MediaInfoLib::Config.Graph_Adm_ShowTrackUIDs_Get())
494510 OBJECT_LINK_TO(TrackUID, "#b3e5fc")
626642 if (!Temp.empty())
627643 ToReturn+=Temp;
628644 else
629 ToReturn+=NewLine(Level)+__T("message [shape=plaintext, fontcolor=\"#1565c0\", label=<<b>Graphs are currently available for AC-4, MPEG-H, Dolby ED2 and ADM formats.</b>>]");
645 ToReturn+=NewLine(Level)+__T("message [shape=plaintext, fontcolor=\"#1565c0\", label=<<b>Graphs are currently available for AC-4, MPEG-H, Dolby ED2, IAB and ADM formats.</b>>]");
630646 ToReturn+=__T("\n}");
631647
632648 #ifdef MEDIAINFO_GRAPHVIZ_YES
187187 return;
188188 }
189189 else if (CC4(Buffer)==0x504C5646) {Format=__T("PlayLater Video");}
190 else if (CC4(Buffer)==CC4("")) {Format=__T("");}
191190
192191 if (Format.empty())
193192 {
13151315 Text_DisplayAspectRatio_Original_String,
13161316 Text_FrameRate_Mode,
13171317 Text_FrameRate_Mode_String,
1318 Text_FrameRate_Mode_Original,
1319 Text_FrameRate_Mode_Original_String,
13181320 Text_FrameRate,
13191321 Text_FrameRate_String,
13201322 Text_FrameRate_Num,
13271329 Text_FrameRate_Maximum_String,
13281330 Text_FrameRate_Original,
13291331 Text_FrameRate_Original_String,
1332 Text_FrameRate_Original_Num,
1333 Text_FrameRate_Original_Den,
13301334 Text_FrameCount,
13311335 Text_ElementCount,
13321336 Text_Source_FrameCount,
16001604 Other_TimeCode_LastFrame,
16011605 Other_TimeCode_DropFrame,
16021606 Other_TimeCode_Settings,
1603 Other_TimeCode_Striped,
1604 Other_TimeCode_Striped_String,
1607 Other_TimeCode_Stripped,
1608 Other_TimeCode_Stripped_String,
16051609 Other_TimeCode_Source,
16061610 Other_StreamSize,
16071611 Other_StreamSize_String,
13081308 Fill(StreamKind, StreamPos, FrameRate_Num, Value*1000, 0, Replace);
13091309 Fill(StreamKind, StreamPos, FrameRate_Den, 1000, 10, Replace);
13101310 }
1311 if (!(Value - (int)Value)) // Detection of integer values
1312 {
1313 Fill(StreamKind, StreamPos, FrameRate_Num, (int)Value, 10, Replace);
1314 Fill(StreamKind, StreamPos, FrameRate_Den, 1, 10, Replace);
1315 }
13111316 }
13121317 }
13131318
18831888 Channels_Temp[3]=Retrieve(Stream_Audio, StreamPos_To, Audio_ChannelPositions_String2);
18841889 Channels_Temp[1]=Retrieve(Stream_Audio, StreamPos_To, Audio_ChannelLayout);
18851890 }
1891 if (StreamKind==Stream_Text)
1892 {
1893 FrameRate_Temp=Retrieve(Stream_Text, StreamPos_To, Text_FrameRate);
1894 FrameRate_Num_Temp=Retrieve(Stream_Text, StreamPos_To, Text_FrameRate_Num);
1895 FrameRate_Den_Temp=Retrieve(Stream_Text, StreamPos_To, Text_FrameRate_Den);
1896 FrameRate_Mode_Temp=Retrieve(Stream_Text, StreamPos_To, Text_FrameRate_Mode);
1897 }
18861898 if (ToAdd.Retrieve(StreamKind, StreamPos_From, Fill_Parameter(StreamKind, Generic_Delay_Source))==__T("Container"))
18871899 {
18881900 Fill(StreamKind, StreamPos_To, "Delay_Original", Retrieve(StreamKind, StreamPos_To, "Delay"), true);
20742086 Fill_SetOptions(Stream_Audio, StreamPos_To, Original.c_str(), Retrieve_Const(Stream_Audio, StreamPos_To, AudioField[i], Info_Options).To_UTF8().c_str());
20752087 Fill(Stream_Audio, StreamPos_To, AudioField[i], Channels_Temp[i], true);
20762088 }
2089 }
2090 if (StreamKind==Stream_Text)
2091 {
2092 if (!FrameRate_Temp.empty())
2093 {
2094 const Ztring& FramesPerContainerBlock=Retrieve(Stream_Text, StreamPos_To, "FramesPerContainerBlock");
2095 if (!FramesPerContainerBlock.empty())
2096 FrameRate_Temp.From_Number(FrameRate_Temp.To_float64()*FramesPerContainerBlock.To_float64());
2097 }
2098 if ((!FrameRate_Temp.empty() && FrameRate_Temp!=Retrieve(Stream_Text, StreamPos_To, Text_FrameRate))
2099 || (!FrameRate_Num_Temp.empty() && FrameRate_Num_Temp!=Retrieve(Stream_Text, StreamPos_To, Text_FrameRate_Num))
2100 || (!FrameRate_Den_Temp.empty() && FrameRate_Den_Temp!=Retrieve(Stream_Text, StreamPos_To, Text_FrameRate_Den)))
2101 {
2102 Fill(Stream_Text, StreamPos_To, Text_FrameRate_Original, ToAdd.Retrieve(Stream_Text, StreamPos_To, Text_FrameRate), true);
2103 Fill(Stream_Text, StreamPos_To, Text_FrameRate_Original_Num, ToAdd.Retrieve(Stream_Text, StreamPos_To, Text_FrameRate_Num), true);
2104 Fill(Stream_Text, StreamPos_To, Text_FrameRate_Original_Den, ToAdd.Retrieve(Stream_Text, StreamPos_To, Text_FrameRate_Den), true);
2105 Fill(Stream_Text, StreamPos_To, Text_FrameRate, FrameRate_Temp, true);
2106 Fill(Stream_Text, StreamPos_To, Text_FrameRate_Num, FrameRate_Num_Temp, true);
2107 Fill(Stream_Text, StreamPos_To, Text_FrameRate_Den, FrameRate_Den_Temp, true);
2108 }
2109 if (!FrameRate_Mode_Temp.empty() && FrameRate_Mode_Temp!=Retrieve(Stream_Text, StreamPos_To, Text_FrameRate_Mode))
2110 {
2111 Fill(Stream_Text, StreamPos_To, Text_FrameRate_Mode_Original, (*Stream)[Stream_Text][StreamPos_To][Text_FrameRate_Mode], true);
2112 Fill(Stream_Text, StreamPos_To, Text_FrameRate_Mode, FrameRate_Mode_Temp, true);
2113 }
20772114 }
20782115 if (!Delay_Source_Temp.empty() && Delay_Source_Temp!=Retrieve(StreamKind, StreamPos_To, "Delay_Source"))
20792116 {
29082945 const auto& FrameRate_Den=Retrieve_Const(StreamKind, StreamPos, Fill_Parameter(StreamKind, Generic_FrameRate_Den));
29092946 if (!FrameRate.empty()
29102947 && !FrameRate_Num.empty()
2911 && !FrameRate_Den.empty())
2948 && !FrameRate_Den.empty()
2949 && FrameRate_Den.To_int32u()!=1)
29122950 List2[List2.size()-1]=MediaInfoLib::Config.Language_Get(FrameRate+__T(" (")+FrameRate_Num+__T("/")+FrameRate_Den+__T(")"), __T(" fps"));
29132951 }
29142952 if (StreamKind==Stream_Video
29152953 && Parameter==Video_FrameRate_Original
29162954 && !Retrieve(StreamKind, StreamPos, Video_FrameRate_Original).empty()
29172955 && !Retrieve(StreamKind, StreamPos, Video_FrameRate_Original_Num).empty()
2918 && !Retrieve(StreamKind, StreamPos, Video_FrameRate_Original_Den).empty())
2956 && !Retrieve(StreamKind, StreamPos, Video_FrameRate_Original_Den).empty()
2957 && Retrieve(StreamKind, StreamPos, Video_FrameRate_Original_Den).To_int32u()!=1)
29192958 List2[List2.size()-1]=MediaInfoLib::Config.Language_Get(Retrieve(StreamKind, StreamPos, Video_FrameRate_Original)+__T(" (")+Retrieve(StreamKind, StreamPos, Video_FrameRate_Original_Num)+__T("/")+Retrieve(StreamKind, StreamPos, Video_FrameRate_Original_Den)+__T(")"), __T(" fps"));
2959 if (StreamKind==Stream_Text
2960 && Parameter==Text_FrameRate_Original
2961 && !Retrieve(StreamKind, StreamPos, Text_FrameRate_Original).empty()
2962 && !Retrieve(StreamKind, StreamPos, Text_FrameRate_Original_Num).empty()
2963 && !Retrieve(StreamKind, StreamPos, Text_FrameRate_Original_Den).empty()
2964 && Retrieve(StreamKind, StreamPos, Text_FrameRate_Original_Den).To_int32u()!=1)
2965 List2[List2.size()-1]=MediaInfoLib::Config.Language_Get(Retrieve(StreamKind, StreamPos, Text_FrameRate_Original)+__T(" (")+Retrieve(StreamKind, StreamPos, Text_FrameRate_Original_Num)+__T("/")+Retrieve(StreamKind, StreamPos, Text_FrameRate_Original_Den)+__T(")"), __T(" fps"));
29202966
29212967 //Special cases - 120 fps 24/30 mode
29222968 if (StreamKind==Stream_Video
12541254 if (!Z1.empty())
12551255 Fill(Stream_Audio, Pos, Audio_BitRate_Mode, Z1);
12561256 }
1257
1258 //Commercial name
1259 if (Retrieve(Stream_Audio, Pos, Audio_Format_Commercial_IfAny).empty() && Retrieve(Stream_Audio, Pos, Audio_Format)==__T("USAC") && Retrieve(Stream_Audio, Pos, Audio_Format_Profile).rfind(__T("Extended HE AAC@"), 0)==0)
1260 {
1261 Fill(Stream_Audio, Pos, Audio_Format_Commercial_IfAny, "xHE-AAC");
1262 }
12571263 }
12581264
12591265 //---------------------------------------------------------------------------
135135 {
136136
137137 //---------------------------------------------------------------------------
138 const Char* MediaInfo_Version=__T("MediaInfoLib - v22.06");
138 const Char* MediaInfo_Version=__T("MediaInfoLib - v22.09");
139139 const Char* MediaInfo_Url=__T("http://MediaArea.net/MediaInfo");
140140 Ztring EmptyZtring; //Use it when we can't return a reference to a true Ztring
141141 const Ztring EmptyZtring_Const; //Use it when we can't return a reference to a true Ztring, const version
178178 ": ;: \n"
179179 "3D;3D\n"
180180 "3DType;3D Type\n"
181 "5.1.2ch;5.1.2\n"
182 "5.1.4ch;5.1.4\n"
183 "5.1ch;5.1\n"
181184 "608_Mode;EIA-608 conversion mode\n"
185 "7.1.2ch;7.1.2\n"
186 "7.1ch;7.1\n"
182187 "About;About\n"
183188 "About_Hint;How to contact me and find last version\n"
184189 "Accompaniment;Accompaniment\n"
226231 "AudioSceneInfoID;Audio scene info ID\n"
227232 "AudioTrackLayout;Audio Track Layout\n"
228233 "Author;Author\n"
234 "Back4ToBack2;Four backs to two backs\n"
235 "Balance_FrontBackListener;Front/back listener balance\n"
229236 "Balance_FrontBackOverheadFloor;Front/back overhead/floor balance\n"
230 "Balance_FrontBackListener;Front/back listener balance\n"
231237 "BarCode;BarCode\n"
232238 "Basic;Basic\n"
233239 "Basic_Note;Note : for more information about this file, you must select a different view (Sheet, Tree...)\n"
252258 "Channel(s);Channel(s)\n"
253259 "ChannelCoded;Channel coded\n"
254260 "ChannelConfiguration;Channel configuration\n"
261 "ChannelFormat;Channel format\n"
255262 "ChannelLayout;Channel layout\n"
256263 "ChannelMode;Channel mode\n"
257264 "ChannelPositions;Channel positions\n"
308315 "Comment;Comment\n"
309316 "CommissionedBy;Commissioned by\n"
310317 "Compilation;Compilation\n"
318 "ComplementaryObject;Complementary object\n"
311319 "CompleteName;Complete name\n"
312320 "CompletionDate;Completion Date\n"
313321 "ComplexityIndex;Complexity index\n"
318326 "Compression_Ratio;Compression ratio\n"
319327 "Conductor;Conductor\n"
320328 "ConformanceCheck;Conformance check\n"
329 "ConformanceErrors;Conformance errors\n"
330 "ConformanceWarnings;Conformance warnings\n"
331 "ConformanceInfos;Conformance information\n"
321332 "ContactEmail;Contact Email\n"
322333 "ContactTelephoneNumber;Contact Telephone Number\n"
323334 "Container and general information;Container and general information\n"
335 "Content;Content\n"
324336 "ContentType;ContentType\n"
325337 "CoProducer;Coproducer\n"
326338 "Copyright;Copyright\n"
335347 "Cover_Type;Cover type\n"
336348 "Cropped;Crop dimensions\n"
337349 "Custom;Custom\n"
350 "CustomDownmixTargets;Custom downmix targets\n"
338351 "Customize;Customize\n"
339352 "Date;Date\n"
340353 "Debug;Debug\n"
360373 "DisplayAspectRatio_Original;Original display aspect ratio\n"
361374 "DistributedBy;Distributed by\n"
362375 "Distributor;Distributor\n"
376 "Dolby_Atmos_Metadata;Dolby Atmos metadata\n"
363377 "DolbyAtmos;Dolby Atmos\n"
364 "Dolby_Atmos_Metadata;Dolby Atmos metadata\n"
365378 "Donate;Donate\n"
366379 "DotsPerInch;Dots per inch\n"
367380 "Downmix;Downmix\n"
381 "Downmix_5.1.x;5.1 and 5.1.x downmix\n"
368382 "Downmix_5to2;5.1 to 2.0 downmix\n"
369 "Downmix_5.1.x;5.1 and 5.1.x downmix\n"
370383 "DrcSets_Count;DRC set count\n"
371384 "DrcSets_Effects;DRC effect type(s)\n"
372385 "Duration;Duration\n"
375388 "Duration_Start;Start time\n"
376389 "Duration_Start_Command;Start time (commands)\n"
377390 "Duration_Start2End;Duration of the visible content\n"
391 "DynamicObject;Dynamic object\n"
378392 "DynamicRangeControl;Dynamic Range Control\n"
379393 "Eac3DrcProfile;E-AC-3 DRC profile\n"
380394 "Edit;Edit\n"
381395 "EditedBy;Edited by\n"
382396 "EditorialClassification;Editorial classification\n"
397 "ElementaryStream;Elementary stream\n"
383398 "ElementCount;Count of elements\n"
384399 "EMail;E-Mail\n"
385400 "Encoded_Application;Writing application\n"
429444 "Format;Format\n"
430445 "Format_Commercial;Commercial name\n"
431446 "Format_Commercial_IfAny;Commercial name\n"
447 "Format_Compression;Compression\n"
432448 "Format_Description;Format description\n"
433449 "Format_Info;Details for format\n"
434450 "Format_Level;Format level\n"
462478 "Format_Tier;Format tier\n"
463479 "Format_Url;Weblink for format\n"
464480 "Format_Version;Format version\n"
481 "FormatDefinition;Format definition\n"
465482 "FpaManufacturer;FPA Manufacturer\n"
466483 "FpaPass;FPA Pass\n"
467484 "FpaVersion;FPA Version\n"
561578 "Genre_081;Folk-Rock\n"
562579 "Genre_082;National Folk\n"
563580 "Genre_083;Swing\n"
564 "Genre_084;Fast-Fusion\n"
581 "Genre_084;Fast Fusion\n"
565582 "Genre_085;Bebop\n"
566583 "Genre_086;Latin\n"
567584 "Genre_087;Revival\n"
701718 "ImmersiveStereo;Immersive stereo\n"
702719 "Info;Info\n"
703720 "Instruments;Instruments\n"
721 "IntegratedLoudness;Integrated loudness\n"
704722 "IntegratedLoudness_Level;Integrated loudness (level gated)\n"
705723 "IntegratedLoudness_Speech;Integrated loudness (speech gated)\n"
706724 "InteractivityEnabled;Interactivity enabled\n"
934952 "LineUpStart;Line Up Start\n"
935953 "LinkedTo_Bed_Pos;Bed #s\n"
936954 "LinkedTo_ChannelFormat_Pos;Channel format #s\n"
955 "LinkedTo_ComplementaryObject_Pos;Complementary object #s\n"
937956 "LinkedTo_Content_Pos;Content #s\n"
938957 "LinkedTo_Group_Pos;Group #s\n"
939958 "LinkedTo_Object_Pos;Object #s\n"
940959 "LinkedTo_PackFormat_Pos;Pack format #s\n"
941960 "LinkedTo_SignalGroup_Pos;Signal group #s\n"
961 "LinkedTo_StreamFormat_Pos;Stream format #s\n"
942962 "LinkedTo_Substream_Pos;Substream #s\n"
943963 "LinkedTo_TrackFormat_Pos;Track format #s\n"
944964 "LinkedTo_TrackUID_Pos;Track UID #s\n"
10211041 "NumberOfPackFormats;Number of pack formats\n"
10221042 "NumberOfPresentations;Number of presentations\n"
10231043 "NumberOfProgrammes;Number of programmes\n"
1044 "NumberOfStreamFormats;Number of stream formats\n"
10241045 "NumberOfSubstreams;Number of substreams\n"
1046 "NumberOfTrackFormats;Number of track formats\n"
10251047 "NumberOfTrackUIDs;Number of track UIDs\n"
1026 "NumberOfTrackFormats;Number of track formats\n"
1027 "NumberOfStreamFormats;Number of stream formats\n"
10281048 "NumColors;Number of colors\n"
1049 "Object;Object\n"
10291050 "ObjectCount;Object Count\n"
10301051 "OK;OK\n"
10311052 "One output file per input file;One output file per input file\n"
10881109 "OverallBitRate_Mode;Overall bit rate mode\n"
10891110 "OverallBitRate_Nominal;Nominal Overall bit rate\n"
10901111 "PackageName;Package name\n"
1112 "PackFormat;Pack format\n"
10911113 "Part;Part\n"
10921114 "Part_Count;Total count\n"
10931115 "PartNumber;Part Number\n"
11171139 "PreferredDownmix;Preferred downmix\n"
11181140 "PreselectionLabel;Preselection label\n"
11191141 "Presentation;Presentation\n"
1142 "Presentation;Presentation\n"
11201143 "PresentationConfig;Presentation config\n"
11211144 "PresentationConfig_ContentClassifier;Presentation config from content classifiers\n"
11221145 "PresentationID;Presentation ID\n"
11281151 "ProductionNumber;Production Number\n"
11291152 "ProductionStudio;Production studio\n"
11301153 "ProductPlacement;Product Placement\n"
1154 "Programme;Programme\n"
11311155 "ProgrammeHasText;Programme Has Text\n"
11321156 "ProgrammeTextLanguage;Programme Text Language\n"
11331157 "ProgrammeTitle;Programme Title\n"
11611185 "ScanType_Original;Original scan type\n"
11621186 "ScanType_StoreMethod;Scan type, store method\n"
11631187 "ScreenplayBy;Screenplay by\n"
1188 "ScreenToCenter;Screen to center\n"
1189 "ScreenToFront;Screen to front\n"
11641190 "Season;Season\n"
11651191 "SecondaryAudioLanguage;Secondary Audio Language\n"
11661192 "see below;see below\n"
12071233 "Stream;Stream\n"
12081234 "Stream_MoreInfo;More information about the stream\n"
12091235 "StreamCount;Count of stream of this kind\n"
1236 "StreamFormat;Stream format\n"
12101237 "StreamID;Stream ID\n"
12111238 "streamIdentifier;Stream identifier\n"
12121239 "StreamKind;Kind of stream\n"
12171244 "StreamSize_Encoded;Encoded stream size\n"
12181245 "StreamSize_Proportion;Proportion of this stream\n"
12191246 "Subject;Subject\n"
1247 "Substream;Substream\n"
12201248 "Substream;Substream\n"
12211249 "SubTrack;SubTrack\n"
12221250 "SubtstreamIdChannel;Substream start ID & channel index\n"
12541282 "TimeCode_MaxFrameNumber_Theory;Theoritical maximum frame number in time codes\n"
12551283 "TimeCode_Settings;Time code settings\n"
12561284 "TimeCode_Source;Time code source\n"
1257 "TimeCode_Striped;Time code, striped\n"
1285 "TimeCode_Stripped;Time code, stripped\n"
12581286 "TimeStamp;Time stamp\n"
12591287 "TimeZone;Timezone\n"
12601288 "Title;Title\n"
12611289 "Title_More;Title, more info\n"
1290 "Top4ToTop2;Four fronts to two fronts\n"
1291 "TopBackToFront;Top backs to front\n"
1292 "TopBackToSide;Top backs to side\n"
1293 "TopFrontToBack;Top fronts to back\n"
1294 "TopFrontToFront;Top fronts to front\n"
1295 "TopFrontToSide;Top fronts to side\n"
12621296 "Total;Total\n"
12631297 "TotalNumberOfParts;Total Number Of Parts\n"
12641298 "TotalProgrammeDuration;Total Programme Duration\n"
12651299 "Track;Track name\n"
12661300 "Track_Count;Track count\n"
1301 "TrackFormat;Track format\n"
12671302 "TrackIndex;Track index\n"
1268 "TrackUID;TrackUID\n"
1303 "TrackUID;Track UID\n"
12691304 "transfer_characteristics;Transfer characteristics\n"
12701305 "Translator;Translator\n"
12711306 "Transport;Transport\n"
12871322 "TruePeakLevel;True peak level\n"
12881323 "TruePeakLevel_Album;True peak level (album)\n"
12891324 "Type;Type\n"
1290 "TypeDefinition;TypeDefinition\n"
1325 "TypeDefinition;Type definition\n"
12911326 "UniqueID;Unique ID\n"
12921327 "UniversalAdID;Universal Ad ID\n"
12931328 "UniversalAdID_Registry;Universal Ad ID registry\n"
54195454 "DisplayAspectRatio_Original/String;;;Y NT;;;Original (in the raw stream) Display Aspect ratio\n"
54205455 "FrameRate_Mode;;;N YTY;;;Frame rate mode (CFR, VFR)\n"
54215456 "FrameRate_Mode/String;;;N NT;;;Frame rate mode (Constant, Variable)\n"
5457 "FrameRate_Mode_Original;;;N YTY;;;Original frame rate mode (CFR, VFR)\n"
5458 "FrameRate_Mode_Original/String;;;Y NT;;;Original frame rate mode (Constant, Variable)\n"
54225459 "FrameRate;; fps;N YFY;;;Frames per second\n"
54235460 "FrameRate/String;;;Y NT;;;Frames per second (with measurement)\n"
54245461 "FrameRate_Num;;;N NIN;;;Frames per second, numerator\n"
54295466 "FrameRate_Nominal/String;;;N NT;;;Nominal Frames per second (with measurement)\n"
54305467 "FrameRate_Maximum;; fps;N YFY;;;Maximum Frames per second\n"
54315468 "FrameRate_Maximum/String;;;N NT;;;Maximum Frames per second (with measurement)\n"
5432 "FrameRate_Original;; fps;N YFY;;;Original (in the raw stream) Frames per second\n"
5433 "FrameRate_Original/String;;;N NT;;;Original (in the raw stream) Frames per second (with measurement)\n"
5469 "FrameRate_Original;; fps;N YFY;;;Original (in the raw stream) frames per second\n"
5470 "FrameRate_Original/String;;;Y NT;;;Original (in the raw stream) frames per second (with measurement)\n"
5471 "FrameRate_Original_Num;;;N NFN;;;Frames per second, numerator\n"
5472 "FrameRate_Original_Den;;;N NFN;;;Frames per second, denominator\n"
54345473 "FrameCount;;;N NIY;;;Number of frames\n"
54355474 "ElementCount;;;Y NIY;;;Number of displayed elements\n"
54365475 "Source_FrameCount;;;N NIY;;;Source Number of frames\n"
54645503 "Delay_Original_Settings;;;N NT;;;Delay settings (in case of timecode for example)\n"
54655504 "Delay_Original_DropFrame;;;N NT;;;Delay drop frame info\n"
54665505 "Delay_Original_Source;;;N NTY;;;Delay source (Stream or empty)\n"
5467 "Video_Delay;; ms;N NI;;;Delay fixed in the stream (absolute / video)\n"
5506 "Video_Delay;; ms;N NF;;;Delay fixed in the stream (absolute / video)\n"
54685507 "Video_Delay/String;;;Y NT\n"
54695508 "Video_Delay/String1;;;N NT\n"
54705509 "Video_Delay/String2;;;N NT\n"
56835722 "Delay_Original_Settings;;;N NT;;;Delay settings (in case of timecode for example)\n"
56845723 "Delay_Original_DropFrame;;;N NT;;;Delay drop frame info\n"
56855724 "Delay_Original_Source;;;N NT;;;Delay source (Stream or empty)\n"
5686 "Video_Delay;; ms;N NI;;;Delay fixed in the stream (absolute / video)\n"
5725 "Video_Delay;; ms;N NF;;;Delay fixed in the stream (absolute / video)\n"
56875726 "Video_Delay/String;;;Y NT\n"
56885727 "Video_Delay/String1;;;N NT\n"
56895728 "Video_Delay/String2;;;N NT\n"
57085747 "TimeCode_LastFrame;;;Y YCY;;;Time code of the last frame (excluding the duration of the last frame) in HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available format\n"
57095748 "TimeCode_DropFrame;;;N NT;;;Delay drop frame\n"
57105749 "TimeCode_Settings;;;Y YTY;;;Time code settings\n"
5711 "TimeCode_Striped;;Yes;N YTY;;;Time code is striped (only 1st time code, no discontinuity)\n"
5712 "TimeCode_Striped/String;;;Y NT;;;Time code is striped (only 1st time code, no discontinuity)\n"
5750 "TimeCode_Stripped;;Yes;N YTY;;;Time code is Stripped (only 1st time code, no discontinuity)\n"
5751 "TimeCode_Stripped/String;;;Y NT;;;Time code is Stripped (only 1st time code, no discontinuity)\n"
57135752 "TimeCode_Source;;;Y YTY;;;Time code source (Container, Stream, SystemScheme1, SDTI, ANC...)\n"
57145753 "StreamSize;; byte;N YIY;;;Streamsize in bytes\n"
57155754 "StreamSize/String;;;Y NT;;;Streamsize in with percentage value\n"
66366675 Info.Write(Ztring().From_UTF8(
66376676 "General;[%Format/String%][ (%Format_Profile%)][ (%Format_Commercial_IfAny%)]$if(%Format/String%,$: $)%FileSize/String%[, %Duration/String%]\n"
66386677 "Video;[%Language/String%, ][%BitRate/String%$if(%BitRate_Nominal/String%, \\(%BitRate_Nominal/String%\\)), ][%Width%*][%Height%][ (%DisplayAspectRatio/String%), ][$at$ %FrameRate/String%, ][%Format/String%][ (%CodecID/Hint%)][ (%Standard%)]$if(%MuxingMode%, \\(%MuxingMode%\\))$if(%Format_Version%, \\(%Format_Version%\\))$if(%Format_Profile%, \\(%Format_Profile%\\))$if(%Format_Settings%, \\(%Format_Settings%\\))[ (%Format_Commercial_IfAny%)][, %HDR_Format_Commercial%]\n"
6639 "Audio;[%Language/String%, ][%BitRate/String%$if(%BitRate_Nominal/String%, \\(%BitRate_Nominal/String%\\)), ][%SamplingRate/String%, ][%BitDepth/String%, ][%Channel(s)_Original/String% / ][%Channel(s)/String%, ][%Format/String%][ (%CodecID/Hint%)]$if(%MuxingMode%, \\(%MuxingMode%\\))$if(%Format_Version%, \\(%Format_Version%\\))$if(%Format_Profile%, \\(%Format_Profile%\\))$if(%Format_Settings%, \\(%Format_Settings%\\))[ (%Format_Commercial_IfAny%)][ (%ConformanceCheck/Short%)][, %NumberOfPresentations% presentations][, %NumberOfSubstreams% substreams][ (%AdmProfile_Format% ADM profile)]\n"
6678 "Audio;[%Language/String%, ][%BitRate/String%$if(%BitRate_Nominal/String%, \\(%BitRate_Nominal/String%\\)), ][%SamplingRate/String%, ][%BitDepth/String%, ][%Channel(s)_Original/String% / ][%Channel(s)/String%, ][%Format/String%][ (%CodecID/Hint%)]$if(%MuxingMode%, \\(%MuxingMode%\\))$if(%Format_Version%, \\(%Format_Version%\\))$if(%Format_Profile%, \\(%Format_Profile%\\))$if(%Format_Settings%, \\(%Format_Settings%\\))[ (%Format_Commercial_IfAny%)][, %NumberOfProgrammes% programmes][, %NumberOfObjects% objects][, %NumberOfPresentations% presentations][, %NumberOfSubstreams% substreams][ (%AdmProfile_Format% ADM profile)]$if(%ConformanceErrors%, \\(%ConformanceErrors% conformance errors\\))$if(%ConformanceWarnings%, \\(%ConformanceWarnings% conformance warnings\\))\n"
66406679 "Text;[%Language/String%, ][%Format/String%][ (%Format_Commercial_IfAny%)]$if(%MuxingMode%, \\(%MuxingMode%\\))\n"
66416680 "Image;[%Language/String%, ][%Width%*][%Height%][ (%DisplayAspectRatio/String%)][, %Format/String%]\n"
66426681 "Chapters;[%Language/String%, ]%Total% chapters[, %Format/String%][ (%Format_Commercial_IfAny%)]\n"
15681568 if (Up_Pos!=string::npos && Up_Pos_End==Name.size()-4)
15691569 {
15701570 Ztring Up=Name.substr(Up_Pos);
1571 auto IsComplementary=Up.FindAndReplace(__T("Complementary"), Ztring());
15711572
15721573 //Hide
15731574 Ztring ToHide=Name+__T("/String");
16891690 if (!ID2.empty())
16901691 Temp.back()[Info_Name].insert(ToSearch.size(), __T("-Alt")+ID2);
16911692 Temp.back()[Info_Name].insert(0, SpacesCount, __T(' '));
1693 if (IsComplementary)
1694 Temp.back()[Info_Name].FindAndReplace(__T(" Object"), __T("ComplementaryObject"));
16921695 if (!Found.empty())
16931696 Temp.back()[Info_Text]=Found;;
16941697 }
8080 if (!(ToReturn[ToReturn_Pos]>=__T('A') && ToReturn[ToReturn_Pos]<=__T('Z'))
8181 && !(ToReturn[ToReturn_Pos]>=__T('a') && ToReturn[ToReturn_Pos]<=__T('z'))
8282 && !(ToReturn[ToReturn_Pos]>=__T('0') && ToReturn[ToReturn_Pos]<=__T('9'))
83 && !(ToReturn[ToReturn_Pos]==__T('-')) // Authorized if not first pos
8384 && !(ToReturn[ToReturn_Pos]==__T('_')))
8485 ToReturn.erase(ToReturn_Pos, 1);
8586 else
8687 ToReturn_Pos++;
8788 }
8889
89 if (ToReturn.operator()(0)>='0' && ToReturn.operator()(0)<='9')
90 if ((ToReturn.operator()(0)>='0' && ToReturn.operator()(0)<='9') || ToReturn.operator()(0)=='-')
9091 ToReturn.insert(0, 1, __T('_'));
9192
9293 if (ToReturn.empty())
716717 size_t Space=SubName.rfind(' ');
717718 if (Space!=(size_t)-1)
718719 SubName.erase(0, Space+1);
719 size_t NumbersPos=SubName.find_last_not_of("0123456789");
720 size_t NumbersPos=SubName.find_first_of("0123456789");
720721 if (NumbersPos!=(size_t)-1)
721 SubName.resize(NumbersPos+1);
722 bool IsArray=(NextName.size()==Nom.size()+4 && NextName.find(__T(" Pos"), Nom.size())==Nom.size());
722 SubName.resize(NumbersPos);
723 if (XML_0_7_78 || JSON)
724 SubName=Xml_Name_Escape_0_7_78(Ztring().From_UTF8(SubName)).To_UTF8();
725 else
726 SubName=Xml_Name_Escape(Ztring().From_UTF8(SubName)).To_UTF8();
727 bool IsArray=NumbersPos!=(size_t)-1;
723728 Node* Node_Sub=new Node(SubName.c_str(), IsArray);
724729 Fields_Current->push_back(Node_Sub);
725730 Nested.resize(Nested.size()+1);
943948 Elements_Index=2;
944949 }
945950 else
946 Elements_Index=2;
951 {
952 if (!Get(StreamKind, StreamPos, Elements(0)).empty())
953 Elements_Index=1;
954 else
955 Elements_Index=2;
956 }
947957
948958 //Replace
949959 while (Elements(Elements_Index).SubString(__T("%"), __T("%")).size()>0)
679679 if (!Rdd18_Parser->Status[IsFinished])
680680 {
681681 Rdd18_Parser->Frame_Count=Frame_Count;
682 Open_Buffer_Continue(Rdd18_Parser, Payload+1, (size_t)DataCount-1);
682 if (DataCount)
683 Open_Buffer_Continue(Rdd18_Parser, Payload+1, (size_t)DataCount-1);
683684 }
684685 #endif //defined(MEDIAINFO_MXF_YES)
685686 break;
143143 Sequence->StreamKind=Stream_Other;
144144 Sequence->Infos["Type"]=__T("Time code");
145145 Sequence->Infos["Format"]=__T("CPL TC");
146 Sequence->Infos["TimeCode_Striped"]=__T("Yes");
146 Sequence->Infos["TimeCode_Stripped"]=__T("Yes");
147147 bool IsDropFrame=false;
148148
149149 for (XMLElement* CompositionTimecode_Item=CompositionPlaylist_Item->FirstChildElement(); CompositionTimecode_Item; CompositionTimecode_Item=CompositionTimecode_Item->NextSiblingElement())
18541854 Event1.Audio_Data_Errors_Count=16;
18551855 Event1.Audio_Data_Errors=Audio_Errors_PerDseq;
18561856 }
1857 if (true)
1857 if (!DirectionSpeed.empty())
18581858 {
18591859 if (!MoreData)
18601860 MoreData=new int8u[4096]+sizeof(size_t); // TODO: more dynamic allocation
1861 MoreData[MoreData_Offset++]=2+DirectionSpeed.size();
1861 MoreData[MoreData_Offset++]=DirectionSpeed.size();
18621862 MoreData[MoreData_Offset++]=2; // DirectionSpeed values
18631863 for (std::vector<int8u>::iterator DirectionSpeed_Item=DirectionSpeed.begin(); DirectionSpeed_Item!=DirectionSpeed.end(); ++DirectionSpeed_Item)
18641864 {
318318 {
319319 int64u TimeCode_FirstFrame_ms=((File_Gxf_TimeCode*)Streams[TimeCode->first].Parsers[0])->TimeCode_FirstFrame_ms;
320320 string TimeCode_FirstFrame=((File_Gxf_TimeCode*)Streams[TimeCode->first].Parsers[0])->TimeCode_FirstFrame;
321 bool TimeCode_FirstFrame_Striped=false;
321 bool TimeCode_FirstFrame_Stripped=false;
322322 if (TimeCode_FirstFrame_ms==(int64u)-1)
323323 {
324324 TimeCode_FirstFrame_ms=TimeCode->second.Milliseconds;
325325 TimeCode_FirstFrame=TimeCode->second.String;
326 TimeCode_FirstFrame_Striped=true;
326 TimeCode_FirstFrame_Stripped=true;
327327 }
328328 if (TimeCode_FirstFrame_ms!=(int64u)-1)
329329 {
333333 Fill(Stream_Other, StreamPos_Last, Other_Type, "Time code");
334334 Fill(Stream_Other, StreamPos_Last, Other_Format, "SMPTE TC");
335335 Fill(Stream_Other, StreamPos_Last, Other_TimeCode_FirstFrame, TimeCode_FirstFrame.c_str());
336 if (TimeCode_FirstFrame_Striped)
337 Fill(Stream_Other, StreamPos_Last, Other_TimeCode_Striped, "Yes");
336 if (TimeCode_FirstFrame_Stripped)
337 Fill(Stream_Other, StreamPos_Last, Other_TimeCode_Stripped, "Yes");
338338 if (TimeCode->first<Streams.size())
339339 Fill(Stream_Other, StreamPos_Last, Other_Title, Streams[TimeCode->first].MediaName);
340340 }
10161016 for (size_t StreamPos=0; StreamPos<New_Count; StreamPos++)
10171017 {
10181018 Stream_Prepare(NewKind, NewPos1+StreamPos);
1019 for (size_t Pos=0; Pos<StreamSave.size(); Pos++)
1020 if (Pos!=General_ID && Retrieve(StreamKind_Last, StreamPos_Last, Pos).empty())
1021 Fill(StreamKind_Last, StreamPos_Last, Pos, StreamSave[Pos]);
1022 for (size_t Pos=0; Pos<StreamMoreSave.size(); Pos++)
1023 {
1024 Fill(StreamKind_Last, StreamPos_Last, StreamMoreSave(Pos, 0).To_UTF8().c_str(), StreamMoreSave(Pos, 1));
1025 Fill_SetOptions(StreamKind_Last, StreamPos_Last, StreamMoreSave(Pos, 0).To_UTF8().c_str(), StreamMoreSave(Pos, Info_Options).To_UTF8().c_str());
1026 }
10191027 Merge(*Temp->second.Parsers[0], StreamKind_Last, StreamPos, StreamPos_Last);
10201028 Ztring Parser_ID=ID+__T('-')+Retrieve(StreamKind_Last, StreamPos_Last, General_ID);
10211029 if (ID.size()+1==Parser_ID.size())
10221030 Parser_ID.resize(ID.size());
10231031 Fill(StreamKind_Last, StreamPos_Last, General_ID, Parser_ID, true);
1024 for (size_t Pos=0; Pos<StreamSave.size(); Pos++)
1025 if (Retrieve(StreamKind_Last, StreamPos_Last, Pos).empty())
1026 Fill(StreamKind_Last, StreamPos_Last, Pos, StreamSave[Pos]);
1027 for (size_t Pos=0; Pos<StreamMoreSave.size(); Pos++)
1028 Fill(StreamKind_Last, StreamPos_Last, StreamMoreSave(Pos, 0).To_UTF8().c_str(), StreamMoreSave(Pos, 1));
10291032 if (StreamPos)
10301033 {
10311034 if (StreamSize_Encoded)
11881191 Fill(Stream_Audio, Pos, Audio_StreamSize_Encoded, 0); //Included in the DV stream size
11891192 Ztring ID=Retrieve(Stream_Audio, Pos, Audio_ID);
11901193 Fill(Stream_Audio, Pos, Audio_ID, Retrieve(Stream_Video, Temp->second.StreamPos, Video_ID)+__T("-")+ID, true);
1194 Fill(Stream_Audio, Pos, "Delay", Retrieve(Stream_Video, Temp->second.StreamPos, "Delay"), true);
1195 Fill(Stream_Audio, Pos, "Delay_DropFrame", Retrieve(Stream_Video, Temp->second.StreamPos, "Delay_DropFrame"), true);
1196 Fill(Stream_Audio, Pos, "Delay_Source", Retrieve(Stream_Video, Temp->second.StreamPos, "Delay_Source"), true);
11911197 Fill(Stream_Audio, Pos, "Source", Retrieve(Stream_Video, Temp->second.StreamPos, "Source"));
11921198 Fill(Stream_Audio, Pos, "Source_Info", Retrieve(Stream_Video, Temp->second.StreamPos, "Source_Info"));
11931199 }
12061212 Fill(Stream_Text, Pos, Text_StreamSize_Encoded, 0); //Included in the DV stream size
12071213 Ztring ID=Retrieve(Stream_Text, Pos, Text_ID);
12081214 Fill(Stream_Text, Pos, Text_ID, Retrieve(Stream_Video, Temp->second.StreamPos, Video_ID)+__T("-")+ID, true);
1215 Fill(Stream_Text, Pos, "Delay_Source", Retrieve(Stream_Video, Temp->second.StreamPos, "Delay_Source"), true);
1216 Fill(Stream_Text, Pos, "Source", Retrieve(Stream_Video, Temp->second.StreamPos, "Source"));
1217 Fill(Stream_Text, Pos, "Source_Info", Retrieve(Stream_Video, Temp->second.StreamPos, "Source_Info"));
12091218 Fill(Stream_Text, Pos, "Source", Retrieve(Stream_Video, Temp->second.StreamPos, "Source"));
12101219 Fill(Stream_Text, Pos, "Source_Info", Retrieve(Stream_Video, Temp->second.StreamPos, "Source_Info"));
12111220 }
13861395 if (ES_ID_Info->first==Temp->first && ES_ID_Info->second.StreamKind==Temp->second.StreamKind)
13871396 {
13881397 if (Retrieve_Const(StreamKind_Last, StreamPos_Last, "Format_Profile").empty())
1389 Fill(StreamKind_Last, StreamPos_Last, "Format_Profile", ES_ID_Info->second.ProfileLevel);
1398 Fill(StreamKind_Last, StreamPos_Last, "Format_Profile", ES_ID_Info->second.ProfileLevelString);
13901399 else if (StreamKind_Last==Stream_Audio && Retrieve_Const(Stream_Audio, StreamPos_Last, Audio_Format).find(__T("AAC"))!=string::npos && Retrieve_Const(Stream_Audio, StreamPos_Last, Audio_Format_Level).empty())
13911400 {
13921401 //Legacy issue with AAC, "Format_Profile" was used for something else, cheating with "Format_Level" for storing profile+level
1393 Fill(Stream_Audio, StreamPos_Last, Audio_Format_Level, ES_ID_Info->second.ProfileLevel);
1402 Fill(Stream_Audio, StreamPos_Last, Audio_Format_Level, ES_ID_Info->second.ProfileLevelString);
13941403 }
13951404 }
13961405 }
14091418 {
14101419 switch (i)
14111420 {
1421 case Video_FrameRate:
14121422 case Video_Sampled_Width:
14131423 case Video_Sampled_Height:
14141424 continue;
24192429 #endif //MEDIAINFO_DEMUX
24202430 size_t stco_Count=(size_t)-1;
24212431 bool stco_IsDifferent=false;
2432 int64u LocalPTS=0;
24222433
24232434 //For each stream
24242435 for (std::map<int32u, stream>::iterator Temp=Streams.begin(); Temp!=Streams.end(); ++Temp)
24592470 #endif // MEDIAINFO_DEMUX
24602471 continue;
24612472 }
2462
2463 // TODO: correctly demux timecodes spanned accross the file
2464 if (Temp->second.TimeCode && Temp->second.stco.size()>1)
2465 Temp->second.stco.resize(1);
24662473
24672474 if (!Temp->second.stsz.empty() || Temp->second.stsz_Sample_Size)
24682475 {
25722579 mdat_Pos_Temp2.Offset = *stco_Current + Chunk_Offset;
25732580 mdat_Pos_Temp2.StreamID = Temp->first;
25742581 mdat_Pos_Temp2.Size = Size;
2575 mdat_Pos.push_back(mdat_Pos_Temp2);
2582 bool UseIt=true;
2583 if (Temp->second.TimeCode && Temp->second.edts.size()==1 && Temp->second.edts[0].Delay && Temp->second.stts.size()==1 && Temp->second.stts[0].SampleCount!=1 && Temp->second.stts[0].SampleDuration)
2584 {
2585 LocalPTS+=Temp->second.stts[0].SampleDuration;
2586 if (LocalPTS<Temp->second.edts[0].Delay
2587 || LocalPTS*moov_mvhd_TimeScale>=Temp->second.edts[0].Delay*moov_mvhd_TimeScale+Temp->second.edts[0].Duration*Temp->second.mdhd_TimeScale)
2588 UseIt=false;
2589 }
2590 if (UseIt)
2591 {
2592 Temp->second.LastUsedOffset=mdat_Pos_Temp2.Offset;
2593 if (Temp->second.FirstUsedOffset==(int64u)-1)
2594 Temp->second.FirstUsedOffset=mdat_Pos_Temp2.Offset;
2595 mdat_Pos.push_back(mdat_Pos_Temp2);
2596 }
25762597 Chunk_Offset += Size;
25772598 if (Chunk_Offset >= File_Size)
25782599 {
25812602 }
25822603 Chunk_FrameCount++;
25832604 }
2584 if (Chunk_FrameCount >= FrameCount_MaxPerStream)
2605 if (!Temp->second.TimeCode && Chunk_FrameCount >= FrameCount_MaxPerStream)
25852606 break;
25862607 }
25872608
27862807 if (!Streams[mdat_Pos_ToParseInPriority_StreamIDs[0]].stco.empty())
27872808 {
27882809 mdat_Pos_Type* Temp=&mdat_Pos[0];
2789 int64u stco_ToFind=Streams[mdat_Pos_ToParseInPriority_StreamIDs[0]].stco[0];
2810 int64u stco_ToFind=Streams[mdat_Pos_ToParseInPriority_StreamIDs[0]].FirstUsedOffset;
27902811 while (Temp<mdat_Pos_Max && Temp->Offset!=stco_ToFind)
27912812 Temp++;
27922813 if (Temp<mdat_Pos_Max && Temp->Offset<File_Size) //Skipping data not in a truncated file
27932814 {
27942815 Element_Show();
2795 while (Element_Level>0)
2796 Element_End0();
2797 Element_Begin1("Priority streams");
2816 if (mdat_Pos_ToParseInPriority_StreamIDs_ToRemove.empty())
2817 {
2818 while (Element_Level>0)
2819 Element_End0();
2820 Element_Begin1("Priority streams");
2821 }
27982822
27992823 mdat_Pos_Temp=Temp;
2824 mdat_Pos_ToParseInPriority_StreamIDs_ToRemove.push_back(Temp->StreamID);
28002825 GoTo(Temp->Offset);
28012826 IsParsing_mdat_Set();
2827
2828 //Remove offset if it is not stripped
2829 const auto& StreamTemp=Streams[mdat_Pos_ToParseInPriority_StreamIDs[0]];
2830 if (StreamTemp.TimeCode && (StreamTemp.stts.size()>1 || (!StreamTemp.stts.empty() && StreamTemp.stts[0].SampleCount>1 && StreamTemp.Parsers.size()==1)))
2831 {
2832 ((File_Mpeg4_TimeCode*)StreamTemp.Parsers[0])->FirstEditOffset=0;
2833 if (Config->ParseSpeed<=0.5)
2834 {
2835 auto StreamID=Temp->StreamID;
2836 for (int j=mdat_Pos.size()-1; j>=0; j--)
2837 if (StreamID==mdat_Pos[j].StreamID && mdat_Pos[j].Offset!=StreamTemp.FirstUsedOffset && mdat_Pos[j].Offset!=StreamTemp.LastUsedOffset)
2838 mdat_Pos.erase(mdat_Pos.begin()+j);
2839 }
2840 }
28022841 }
28032842 }
28042843 mdat_Pos_ToParseInPriority_StreamIDs.erase(mdat_Pos_ToParseInPriority_StreamIDs.begin());
28122851 Element_Begin1("Second pass");
28132852 Element_WantNextLevel=true;
28142853
2815 mdat_Pos_Temp=mdat_Pos_Temp_ToJump?mdat_Pos_Temp_ToJump:&mdat_Pos[0];
2816 ToJump=mdat_Pos_Temp->Offset;
2817 GoTo(ToJump);
2854 // Don't parse twice
2855 sort(mdat_Pos_ToParseInPriority_StreamIDs_ToRemove.begin(), mdat_Pos_ToParseInPriority_StreamIDs_ToRemove.end());
2856 if (!mdat_Pos_ToParseInPriority_StreamIDs_ToRemove.empty())
2857 {
2858 for (int i=mdat_Pos_ToParseInPriority_StreamIDs_ToRemove.size()-1; i>=0; i--)
2859 {
2860 auto StreamID=mdat_Pos_ToParseInPriority_StreamIDs_ToRemove[i];
2861 for (int j=mdat_Pos.size()-1; j>=0; j--)
2862 if (StreamID==mdat_Pos[j].StreamID)
2863 mdat_Pos.erase(mdat_Pos.begin()+j);
2864 }
2865 mdat_Pos_ToParseInPriority_StreamIDs_ToRemove.clear();
2866 }
2867
2868 if (!mdat_Pos.empty())
2869 {
2870 mdat_Pos_Temp=mdat_Pos_Temp_ToJump?mdat_Pos_Temp_ToJump:&mdat_Pos[0];
2871 mdat_Pos_Max=&mdat_Pos[0]+mdat_Pos.size();
2872 ToJump=mdat_Pos_Temp->Offset;
2873 GoTo(ToJump);
2874 }
28182875 IsParsing_mdat_Set();
28192876 mdat_Pos_NormalParsing=true;
28202877 }
30143071 MI.KindOfStream=StreamKind_Last;
30153072 MI.PosOfStream=StreamPos_Last;
30163073 MI.Parser_DoNotFreeIt=true;
3074 MI.ES_ID_Infos=ES_ID_Infos;
3075 #if MEDIAINFO_CONFORMANCE
3076 MI.SamplingRate=Retrieve_Const(Stream_Audio, 0, Audio_SamplingRate).To_int16u();
3077 #endif
30173078
30183079 int64u Elemen_Code_Save=Element_Code;
30193080 Element_Code=moov_trak_tkhd_TrackID; //Element_Code is use for stream identifier
30773138 for (std::map<int32u, stream>::iterator Strea=Streams.begin(); Strea!=Streams.end(); ++Strea)
30783139 if ((!Streams[TrackID].Parsers.empty() && (IsGeneral && Strea->second.StreamKind!=Stream_Max)) || Strea->second.TimeCode_TrackID==TrackID)
30793140 {
3141 Streams[TrackID].Parsers[0]->Fill();
30803142 if (Strea->second.StreamKind==Stream_Video)
30813143 {
30823144 Fill(Stream_Video, Strea->second.StreamPos, Video_Delay_Settings, Ztring(__T("DropFrame="))+(Streams[TrackID].TimeCode->DropFrame?__T("Yes"):__T("No")));
215215 void moov_trak_mdia_minf_stbl_stsd_xxxx_dvc1();
216216 void moov_trak_mdia_minf_stbl_stsd_xxxx_dvcC();
217217 void moov_trak_mdia_minf_stbl_stsd_xxxx_dvvC() {moov_trak_mdia_minf_stbl_stsd_xxxx_dvcC();}
218 void moov_trak_mdia_minf_stbl_stsd_xxxx_dvwC() {moov_trak_mdia_minf_stbl_stsd_xxxx_dvcC();}
218219 void moov_trak_mdia_minf_stbl_stsd_xxxx_esds();
219220 void moov_trak_mdia_minf_stbl_stsd_xxxx_fiel();
220221 void moov_trak_mdia_minf_stbl_stsd_xxxx_gama();
470471 int64u stts_Duration_FirstFrame;
471472 int64u stts_Duration_LastFrame;
472473 int64u stts_SampleDuration;
474 int64u FirstUsedOffset;
475 int64u LastUsedOffset;
473476 int32u mvex_trex_default_sample_duration;
474477 int32u mvex_trex_default_sample_size;
475478 int32u TimeCode_TrackID;
552555 stts_Duration_FirstFrame=0;
553556 stts_Duration_LastFrame=0;
554557 stts_SampleDuration = 0;
558 FirstUsedOffset=(int64u)-1;
559 LastUsedOffset=(int64u)-1;
555560 mvex_trex_default_sample_duration=0;
556561 mvex_trex_default_sample_size=0;
557562 TimeCode_TrackID=(int32u)-1;
637642 mdat_Pos_Type* mdat_Pos_Temp_ToJump;
638643 mdat_Pos_Type* mdat_Pos_Max;
639644 std::vector<int32u> mdat_Pos_ToParseInPriority_StreamIDs;
645 std::vector<int32u> mdat_Pos_ToParseInPriority_StreamIDs_ToRemove;
640646 bool mdat_Pos_NormalParsing;
641647 void Skip_NulString(const char* Name);
642648
198198 }
199199
200200 //---------------------------------------------------------------------------
201 static const char* Mpeg4_Descriptors_AudioProfileLevelIndication_Profile[]=
201 const char* Mpeg4_Descriptors_AudioProfileLevelIndication_Profile[]=
202202 {
203203 "",
204204 "Main Audio",
218218 "ALS Simple",
219219 "Baseline USAC",
220220 "Extended HE AAC",
221 };
222 enum profile
223 {
224 NoProfile,
225 Main_Audio,
226 Scalable_Audio,
227 Speech_Audio,
228 Synthesis_Audio,
229 High_Quality_Audio,
230 Low_Delay_Audio,
231 Natural_Audio,
232 Mobile_Audio_Internetworking,
233 AAC,
234 High_Efficiency_AAC,
235 High_Efficiency_AAC_v2,
236 Low_Delay_AAC,
237 Baseline_MPEG_Surround,
238 High_Definition_AAC,
239 ALS_Simple,
240 Baseline_USAC,
241 Extended_HE_AAC,
242 };
243 struct profilelevel_struct
244 {
245 int8u profile;
246 int8u level;
221 #if MEDIAINFO_CONFORMANCE
222 nullptr,
223 nullptr,
224 "No audio capability required",
225 #endif
247226 };
248227 static const size_t Mpeg4_Descriptors_AudioProfileLevelIndication_Size=0x58;
249 static const profilelevel_struct Mpeg4_Descriptors_AudioProfileLevelIndication_Mapping[Mpeg4_Descriptors_AudioProfileLevelIndication_Size]=
228 const profilelevel_struct Mpeg4_Descriptors_AudioProfileLevelIndication_Mapping[Mpeg4_Descriptors_AudioProfileLevelIndication_Size]=
250229 {
251230 { NoProfile, 0 },
252231 { Main_Audio, 1 },
396375
397376 //Temp
398377 ObjectTypeId=0x00;
378
379 //Conformance
380 #if MEDIAINFO_CONFORMANCE
381 SamplingRate=0;
382 #endif
399383 }
400384
401385 //---------------------------------------------------------------------------
546530 for (int8u i=0; i<5; i++)
547531 if (ProfileLevel[i]!=0xFF)
548532 ProfileLevel_Count++;
533 es_id_info& ES_ID_Info=ES_ID_Infos[(int32u)-1];
549534 if (ProfileLevel_Count==1)
550535 {
551536 for (int8u i=0; i<5; i++)
552537 {
553538 if (ProfileLevel[i]!=0xFF)
554539 {
555 es_id_info& ES_ID_Info=ES_ID_Infos[(int32u)-1];
556540 switch (i)
557541 {
558542 case 2 : ES_ID_Info.StreamKind=Stream_Audio;
559 ES_ID_Info.ProfileLevel=Mpeg4_Descriptors_AudioProfileLevelIndication(ProfileLevel[i]);
543 ES_ID_Info.ProfileLevelString=Mpeg4_Descriptors_AudioProfileLevelIndication(ProfileLevel[i]);
560544 break;
561545 case 3 :
562546 ES_ID_Info.StreamKind=Stream_Video;
563 ES_ID_Info.ProfileLevel=Mpeg4v_Profile_Level(ProfileLevel[i]);
547 ES_ID_Info.ProfileLevelString=Mpeg4v_Profile_Level(ProfileLevel[i]);
564548 break;
565549 default : ;
566550 }
567 if (ES_ID_Info.ProfileLevel.empty() && ProfileLevel[i]!=0xFE)
568 ES_ID_Info.ProfileLevel.From_Number(ProfileLevel[i]);
551 if (ES_ID_Info.ProfileLevelString.empty() && ProfileLevel[i]!=0xFE)
552 ES_ID_Info.ProfileLevelString.From_Number(ProfileLevel[i]);
569553 }
570554 }
571555 }
556 memcpy(ES_ID_Info.ProfileLevel, ProfileLevel, sizeof(ProfileLevel));
572557 }
573558 Element_ThisIsAList();
574559 FILLING_END();
805790 Parser=new File_Aac;
806791 ((File_Aac*)Parser)->Mode=File_Aac::Mode_AudioSpecificConfig;
807792 ((File_Aac*)Parser)->FrameIsAlwaysComplete=true;
793 #if MEDIAINFO_CONFORMANCE
794 ((File_Aac*)Parser)->SamplingRate=SamplingRate;
795 if (ES_ID)
796 {
797 auto const ES_ID_Info=ES_ID_Infos.find(ES_ID);
798 if (ES_ID_Info!=ES_ID_Infos.end())
799 {
800 auto AudioProfileLevelIndication=ES_ID_Info->second.ProfileLevel[2];
801 audio_profile AudioProfile;
802 if (AudioProfileLevelIndication==0xFE)
803 AudioProfile=AudioProfile_Unspecified;
804 else if (AudioProfileLevelIndication==0xFF)
805 AudioProfile=AudioProfile_NoAudio;
806 else if (AudioProfileLevelIndication<Mpeg4_Descriptors_AudioProfileLevelIndication_Size)
807 AudioProfile=Mpeg4_Descriptors_AudioProfileLevelIndication_Mapping[AudioProfileLevelIndication].profile;
808 else
809 AudioProfile=NoProfile;
810 ((File_Aac*)Parser)->Profile=AudioProfile;
811 File_Aac::conformance_flags Profile;
812 switch (AudioProfile)
813 {
814 case Baseline_USAC: Profile=File_Aac::BaselineUsac; break;
815 case Extended_HE_AAC: Profile=File_Aac::xHEAAC; break;
816 default: Profile=File_Aac::Conformance_Max;
817 }
818 if (Profile!=File_Aac::Conformance_Max)
819 ((File_Aac*)Parser)->ConformanceFlags.set(Profile);
820 }
821 }
822 #endif
808823 #endif
809824 break;
810825 case 0x60 :
2121 namespace MediaInfoLib
2222 {
2323
24 enum audio_profile
25 {
26 NoProfile,
27 Main_Audio,
28 Scalable_Audio,
29 Speech_Audio,
30 Synthesis_Audio,
31 High_Quality_Audio,
32 Low_Delay_Audio,
33 Natural_Audio,
34 Mobile_Audio_Internetworking,
35 AAC,
36 High_Efficiency_AAC,
37 High_Efficiency_AAC_v2,
38 Low_Delay_AAC,
39 Baseline_MPEG_Surround,
40 High_Definition_AAC,
41 ALS_Simple,
42 Baseline_USAC,
43 Extended_HE_AAC,
44 AudioProfile_Max,
45 #if MEDIAINFO_CONFORMANCE
46 AudioProfile_Unspecified,
47 AudioProfile_NoAudio,
48 #endif
49 };
50 struct profilelevel_struct
51 {
52 audio_profile profile;
53 int8u level;
54 };
55
2456 //***************************************************************************
2557 // Class File_Mpeg4_Descriptors
2658 //***************************************************************************
4072 struct es_id_info
4173 {
4274 stream_t StreamKind;
43 Ztring ProfileLevel;
75 Ztring ProfileLevelString;
76 int8u ProfileLevel[5];
4477
4578 es_id_info() :
4679 StreamKind(Stream_Max)
4881 };
4982 typedef map<int32u, es_id_info> es_id_infos;
5083 es_id_infos ES_ID_Infos;
84
85 // Conformance
86 #if MEDIAINFO_CONFORMANCE
87 int16u SamplingRate;
88 #endif
5189
5290 struct slconfig
5391 {
800800 const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_dvc1=0x64766331;
801801 const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_dvcC=0x64766343;
802802 const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_dvvC=0x64767643;
803 const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_dvwC=0x64767743;
803804 const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_esds=0x65736473;
804805 const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_fiel=0x6669656C;
805806 const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_gama=0x67616D61;
12071208 ATOM(moov_trak_mdia_minf_stbl_stsd_xxxx_dvc1)
12081209 ATOM(moov_trak_mdia_minf_stbl_stsd_xxxx_dvcC)
12091210 ATOM(moov_trak_mdia_minf_stbl_stsd_xxxx_dvvC)
1211 ATOM(moov_trak_mdia_minf_stbl_stsd_xxxx_dvwC)
12101212 ATOM(moov_trak_mdia_minf_stbl_stsd_xxxx_esds)
12111213 ATOM(moov_trak_mdia_minf_stbl_stsd_xxxx_fiel)
12121214 ATOM(moov_trak_mdia_minf_stbl_stsd_xxxx_gama)
20252027 if (!Stream_Temp.IsFilled && Stream_Temp.Parsers[Pos]->Status[IsFilled])
20262028 {
20272029 #if MEDIAINFO_DEMUX
2028 if (Stream_Temp.StreamKind==Stream_Other) //If this is a TimeCode track
2030 if (Stream_Temp.TimeCode) //If this is a TimeCode track
20292031 {
20302032 if (((File_Mpeg4_TimeCode*)Stream_Temp.Parsers[Pos])->Pos!=(int32u)-1)
20312033 {
20412043
20422044 Stream_Temp.IsFilled=true;
20432045
2044 if (Config->ParseSpeed<1 && !mdat_Pos.empty())
2046 if (Config->ParseSpeed<1 && !mdat_Pos.empty() && !Stream_Temp.TimeCode)
20452047 {
20462048 bool File_Offset_Next_IsValid;
20472049 int64u File_Offset_Next;
21302132
21312133 //Finding right file offset
21322134 int64u ToJump=File_Size;
2135 if (!mdat_Pos_ToParseInPriority_StreamIDs_ToRemove.empty())
2136 {
2137 int32u StreamIDNext=mdat_Pos_ToParseInPriority_StreamIDs_ToRemove[mdat_Pos_ToParseInPriority_StreamIDs_ToRemove.size()-1];
2138 while (mdat_Pos_Temp!=mdat_Pos_Max && mdat_Pos_Temp->StreamID!=StreamIDNext)
2139 mdat_Pos_Temp++;
2140 }
21332141 if (!mdat_Pos.empty() && mdat_Pos_Temp!=mdat_Pos_Max)
21342142 ToJump=mdat_Pos_Temp->Offset;
21352143 if (ToJump>File_Size)
29532961 //Filling
29542962 Stream->second.stsz_StreamSize+=sample_size;
29552963 Stream->second.stsz_Total.push_back(sample_size);
2956 if (Stream->second.stsz.size()<FrameCount_MaxPerStream)
2964 if (Stream->second.stsz.size()<FrameCount_MaxPerStream || Stream->second.TimeCode)
29572965 Stream->second.stsz.push_back(sample_size);
29582966 }
29592967 if (sample_flags_present)
46584666 return;
46594667
46604668 std::vector<int64u> &stco=Streams[moov_trak_tkhd_TrackID].stco;
4661 stco.resize(Count<FrameCount_MaxPerStream?Count:FrameCount_MaxPerStream);
4669 stco.resize((Count<FrameCount_MaxPerStream || Streams[moov_trak_tkhd_TrackID].TimeCode)?Count:FrameCount_MaxPerStream);
46624670 int64u* stco_Data=&stco[0];
46634671
46644672 for (int32u Pos=0; Pos<Count; Pos++)
46744682 Offset=BigEndian2int64u(Buffer+Buffer_Offset+(size_t)Element_Offset);
46754683 Element_Offset+=8;
46764684
4677 if (Pos<FrameCount_MaxPerStream)
4685 if (Pos<FrameCount_MaxPerStream || Streams[moov_trak_tkhd_TrackID].TimeCode)
46784686 {
46794687 (*stco_Data)=Offset;
46804688 stco_Data++;
47514759 Offset=BigEndian2int32u(Buffer+Buffer_Offset+(size_t)Element_Offset);
47524760 Element_Offset+=4;
47534761
4754 if (Pos<FrameCount_MaxPerStream)
4762 if (Pos<FrameCount_MaxPerStream || Streams[moov_trak_tkhd_TrackID].TimeCode)
47554763 Streams[moov_trak_tkhd_TrackID].stco.push_back(Offset);
47564764 }
47574765 }
48374845 */
48384846
48394847 //Faster
4840 if (Pos<FrameCount_MaxPerStream)
4848 if (Pos<FrameCount_MaxPerStream || Streams[moov_trak_tkhd_TrackID].TimeCode)
48414849 {
48424850 if (Element_Offset+12>Element_Size)
48434851 break; //Problem
50915099 Parser->mvhd_Duration_TimeScale=moov_mvhd_TimeScale;
50925100 Parser->mdhd_Duration=Streams[moov_trak_tkhd_TrackID].mdhd_Duration;
50935101 Parser->mdhd_Duration_TimeScale=Streams[moov_trak_tkhd_TrackID].mdhd_TimeScale;
5102 Parser->tmcd_Duration = tc->FrameDuration;
5103 Parser->tmcd_Duration_TimeScale = tc->TimeScale;
50945104
50955105 //Get delay from timecode track's edit list
50965106 int64s FrameDurationInMediaUnits = tc->FrameDuration * Streams[moov_trak_tkhd_TrackID].mdhd_TimeScale;
53345344 {
53355345 Channels=Channels16;
53365346 SampleSize=SampleSize16;
5337 SampleRate=SampleRate16;
5338 }
5347 }
5348 SampleRate=SampleRate16;
53395349 }
53405350 else
53415351 {
77857795
77867796 Stream->second.stsz_StreamSize+=Size;
77877797 Stream->second.stsz_Total.push_back(Size);
7788 if (Pos<FrameCount_MaxPerStream)
7798 if (Pos<FrameCount_MaxPerStream || Stream->second.TimeCode)
77897799 Stream->second.stsz.push_back(Size);
77907800 }
77917801 /*
2323 #include "MediaInfo/Multiple/File_Mpeg4_TimeCode.h"
2424 #include "MediaInfo/TimeCode.h"
2525 #include "MediaInfo/MediaInfo_Config_MediaInfo.h"
26 #include <limits>
27 using namespace std;
2628 //---------------------------------------------------------------------------
2729
2830 namespace MediaInfoLib
3739 :File__Analyze()
3840 {
3941 //Out
40 Pos=(int32u)-1;
42 Pos=numeric_limits<int64s>::max();
4143
4244 FirstEditOffset=0;
4345 FirstEditDuration=(int64u)-1;
4749 NegativeTimes=false;
4850 tkhd_Duration=0;
4951 mvhd_Duration_TimeScale=0;
52
53 //Temp
54 FrameMultiplier_Pos=0;
5055 }
5156
5257 //***************************************************************************
5459 //***************************************************************************
5560
5661 //---------------------------------------------------------------------------
62 void File_Mpeg4_TimeCode::Streams_Accept()
63 {
64 Stream_Prepare(Stream_Other);
65 Fill(Stream_Other, StreamPos_Last, Other_Type, "Time code");
66 }
67
68 //---------------------------------------------------------------------------
5769 void File_Mpeg4_TimeCode::Streams_Fill()
5870 {
59 if (Pos!=(int32u)-1 && NumberOfFrames)
60 {
61 int64s Pos_Temp=Pos;
62 float64 FrameRate_WithDF=NumberOfFrames;
63 if (DropFrame)
64 {
65 int FramesToRemove=0;
66 int NumberOfFramesMultiplier=0;
67 while (NumberOfFrames>NumberOfFramesMultiplier)
68 {
69 FramesToRemove+=108;
70 NumberOfFramesMultiplier+=30;
71 }
72 float64 FramesPerHour_NDF=FrameRate_WithDF*60*60;
73 FrameRate_WithDF*=(FramesPerHour_NDF-FramesToRemove)/FramesPerHour_NDF;
74 }
75
76 Fill(Stream_General, 0, "Delay", Pos_Temp*1000/FrameRate_WithDF, 0);
77
78 TimeCode TC(Pos_Temp, NumberOfFrames-1, DropFrame);
71 if (Pos!=numeric_limits<int64s>::max())
72 {
73 float64 FrameRate_WithDF;
74 if (tmcd_Duration && tmcd_Duration_TimeScale)
75 {
76 FrameRate_WithDF=(float64)tmcd_Duration_TimeScale/(float64)tmcd_Duration;
77 if (!NumberOfFrames)
78 NumberOfFrames=(int8u)float64_int64s(FrameRate_WithDF)/FrameMultiplier;
79 }
80 else
81 {
82 FrameRate_WithDF=NumberOfFrames;
83 if (DropFrame)
84 {
85 int FramesToRemove=0;
86 int NumberOfFramesMultiplier=0;
87 while (NumberOfFrames>NumberOfFramesMultiplier)
88 {
89 FramesToRemove+=108;
90 NumberOfFramesMultiplier+=30;
91 }
92 float64 FramesPerHour_NDF=FrameRate_WithDF*60*60;
93 FrameRate_WithDF*=(FramesPerHour_NDF-FramesToRemove)/FramesPerHour_NDF;
94 }
95
96 }
97 Fill(Stream_General, 0, "Delay", Pos*FrameMultiplier*1000/FrameRate_WithDF, 0);
98 }
99 }
100
101 //---------------------------------------------------------------------------
102 void File_Mpeg4_TimeCode::Streams_Finish()
103 {
104 if (Pos!=numeric_limits<int64s>::max())
105 {
106 float64 FrameRate_WithDF;
107 if (tmcd_Duration && tmcd_Duration_TimeScale)
108 {
109 FrameRate_WithDF=(float64)tmcd_Duration_TimeScale/(float64)tmcd_Duration;
110 if (!NumberOfFrames)
111 NumberOfFrames=(int8u)float64_int64s(FrameRate_WithDF)/FrameMultiplier;
112 }
113 else
114 {
115 FrameRate_WithDF=NumberOfFrames;
116 if (DropFrame)
117 {
118 int FramesToRemove=0;
119 int NumberOfFramesMultiplier=0;
120 while (NumberOfFrames>NumberOfFramesMultiplier)
121 {
122 FramesToRemove+=108;
123 NumberOfFramesMultiplier+=30;
124 }
125 float64 FramesPerHour_NDF=FrameRate_WithDF*60*60;
126 FrameRate_WithDF*=(FramesPerHour_NDF-FramesToRemove)/FramesPerHour_NDF;
127 }
128
129 }
130
131 TimeCode TC(Pos, NumberOfFrames-1, DropFrame);
79132 if (FrameMultiplier>1)
80133 {
81134 int64s Frames=TC.GetFrames();
83136 TC=TimeCode(TC.ToFrames()*FrameMultiplier, NumberOfFrames*FrameMultiplier-1, DropFrame);
84137 TC+=Frames*FrameMultiplier;
85138 }
86 Stream_Prepare(Stream_Other);
87 Fill(Stream_Other, StreamPos_Last, Other_Type, "Time code");
88139 Fill(Stream_Other, StreamPos_Last, Other_TimeCode_FirstFrame, TC.ToString().c_str());
140 int64s FrameCount;
141 if (NumberOfFrames==mdhd_Duration_TimeScale) // Prioritize mdhd or edit list for in case there are drop frame and integer frame rate
142 {
143 if (FirstEditDuration!=(int64u)-1)
144 {
145 float64 FrameCountF=(float64)FirstEditDuration/mvhd_Duration_TimeScale*FrameRate_WithDF*FrameMultiplier;
146 FrameCount=(int64u)float64_int64s(FrameCountF);
147 if (FrameCountF-FrameCount>0.01) // TODO: avoid rouding issues and better way to manage partial frames
148 FrameCount++;
149 }
150 else
151 FrameCount=mdhd_Duration-FirstEditOffset;
152 }
153 else
154 {
155 float64 FrameCountF=(float64)tkhd_Duration/mvhd_Duration_TimeScale*FrameRate_WithDF*FrameMultiplier;
156 FrameCount=(int64u)float64_int64s(FrameCountF);
157 if (FrameCountF-FrameCount>0.01) // TODO: avoid rouding issues and better way to manage partial frames
158 FrameCount++;
159 }
160 Fill(Stream_Other, StreamPos_Last, Other_FrameCount, FrameCount);
89161 if (Frame_Count==1)
90162 {
91 Fill(Stream_Other, StreamPos_Last, Other_TimeCode_Striped, "Yes");
92 int64s FrameCount;
93 if (NumberOfFrames==mdhd_Duration_TimeScale) // Prioritize mdhd or edit list for in case there are drop frame and integer frame rate
94 {
95 if (FirstEditDuration!=(int64u)-1)
96 {
97 float64 FrameCountF=(float64)FirstEditDuration/mvhd_Duration_TimeScale*FrameRate_WithDF;
98 FrameCount=(int64u)FrameCountF;
99 if (FrameCount!=FrameCountF)
100 FrameCount++;
101 }
102 else
103 FrameCount=mdhd_Duration-FirstEditOffset;
104 }
105 else
106 {
107 float64 FrameCountF=(float64)tkhd_Duration/mvhd_Duration_TimeScale*FrameRate_WithDF*FrameMultiplier;
108 FrameCount=(int64u)FrameCountF;
109 if (FrameCount!=FrameCountF && FrameCount*1000!=float64_int64s(FrameCountF*1000000/1001)) // TODO: better catch of 1/1.001
110 FrameCount++;
111 }
112 Fill(Stream_Other, StreamPos_Last, Other_FrameCount, FrameCount);
163 Fill(Stream_Other, StreamPos_Last, Other_TimeCode_Stripped, "Yes");
113164 if (FrameCount)
114165 Fill(Stream_Other, StreamPos_Last, Other_TimeCode_LastFrame, (TC+(FrameCount-1)).ToString().c_str());
166 }
167 else
168 {
169 Fill(Stream_Other, StreamPos_Last, Other_TimeCode_Stripped, "No");
170 TimeCode TC_Last(Pos_Last, NumberOfFrames-1, DropFrame);
171 if (FrameMultiplier>1)
172 {
173 int64s Frames=TC_Last.GetFrames();
174 TC_Last-=TC_Last.GetFrames();
175 TC_Last=TimeCode(TC_Last.ToFrames()*FrameMultiplier, NumberOfFrames*FrameMultiplier-1, DropFrame);
176 TC_Last+=Frames*FrameMultiplier+(Config->ParseSpeed<=0.5?(FrameMultiplier-1):FrameMultiplier_Pos);
177 }
178 Fill(Stream_Other, StreamPos_Last, Other_TimeCode_LastFrame, TC_Last.ToString().c_str());
115179 }
116180 }
117181 }
136200 void File_Mpeg4_TimeCode::Read_Buffer_Continue()
137201 {
138202 //Parsing
139 int32u Position=0;
140203 while (Element_Offset<Element_Size)
141204 {
205 int32u Position=0;
142206 Get_B4 (Position, "Position");
143 if (Pos==(int32u)-1) //First time code
144 {
145 Pos=Position + FirstEditOffset;
146 if (NegativeTimes)
147 Pos=(int32s)Position;
148 if (Config->ParseSpeed<=1.0 && Element_Offset!=Element_Size)
207 int64s Pos_Last_Temp;
208 if (NegativeTimes)
209 Pos_Last_Temp=(int32s)Position;
210 else
211 Pos_Last_Temp=Position;
212 Pos_Last_Temp+=FirstEditOffset;
213 if (Pos==numeric_limits<int64s>::max()) //First time code
214 {
215 Pos=Pos_Last_Temp;
216 if (Config->ParseSpeed<=0.5 && Element_Offset!=Element_Size)
149217 Skip_XX(Element_Size-Element_Offset, "Other positions");
150218 }
219 else if (Config->ParseSpeed>0.5)
220 {
221 FrameMultiplier_Pos++;
222 if (FrameMultiplier_Pos>=FrameMultiplier)
223 {
224 FrameMultiplier_Pos=0;
225 Pos_Last++;
226 }
227 if (Pos_Last!=Pos_Last_Temp)
228 {
229 const Ztring& Discontinuities=Retrieve_Const(Stream_Other, 0, "Discontinuities");
230 if (Discontinuities.size()>25*10)
231 {
232 if (Discontinuities[Discontinuities.size()-1]!=']')
233 Fill(Stream_Other, 0, "Discontinuities", "[...]");
234 }
235 else
236 {
237 Pos_Last--;
238 TimeCode TC_Last1(Pos_Last, NumberOfFrames-1, DropFrame);
239 if (FrameMultiplier>1)
240 {
241 int64s Frames=TC_Last1.GetFrames();
242 TC_Last1-=TC_Last1.GetFrames();
243 TC_Last1=TimeCode(TC_Last1.ToFrames()*FrameMultiplier, NumberOfFrames*FrameMultiplier-1, DropFrame);
244 TC_Last1+=Frames*FrameMultiplier;
245 }
246 string Discontinuity=TC_Last1.ToString();
247 TimeCode TC_Last2(Pos_Last_Temp, NumberOfFrames-1, DropFrame);
248 if (FrameMultiplier>1)
249 {
250 int64s Frames=TC_Last2.GetFrames();
251 TC_Last2-=TC_Last2.GetFrames();
252 TC_Last2=TimeCode(TC_Last2.ToFrames()*FrameMultiplier, NumberOfFrames*FrameMultiplier-1, DropFrame);
253 TC_Last2+=(Frames+1)*FrameMultiplier-1;
254 }
255 Discontinuity+='-';
256 Discontinuity+=TC_Last2.ToString();
257 Fill(Stream_Other, 0, "Discontinuities", Discontinuity);
258 }
259 }
260 }
261 Pos_Last=Pos_Last_Temp;
151262 }
152263
153264 FILLING_BEGIN();
3333 int64u mvhd_Duration_TimeScale;
3434 int64u mdhd_Duration;
3535 int64u mdhd_Duration_TimeScale;
36 int64u tmcd_Duration;
37 int64u tmcd_Duration_TimeScale;
3638
3739 //Out
3840 int64s Pos;
41 int64s Pos_Last;
42 int64u FrameMultiplier_Pos;
3943
4044 //Constructor/Destructor
4145 File_Mpeg4_TimeCode();
4246
4347 protected :
4448 //Streams management
49 void Streams_Accept();
4550 void Streams_Fill();
51 void Streams_Finish();
4652
4753 //Buffer - Global
4854 void Read_Buffer_Init();
108108
109109 namespace MediaInfoLib
110110 {
111
112 #if defined(MEDIAINFO_IAB_YES)
113 Ztring ChannelLayout_2018_Rename(const Ztring& Channels, const Ztring& Format);
114 #endif
111115
112116 //***************************************************************************
113117 //
23472351 #endif //MEDIAINFO_NEXTPACKET
23482352 #if defined(MEDIAINFO_ANCILLARY_YES)
23492353 Ancillary=NULL;
2350 Ancillary_IsBinded=false;
23512354 #endif //defined(MEDIAINFO_ANCILLARY_YES)
23522355
23532356 ExtraMetadata_Offset=(int64u)-1;
23552358 DolbyAudioMetadata=NULL;
23562359 #if defined(MEDIAINFO_ADM_YES)
23572360 Adm=NULL;
2361 Adm_ForLaterMerge=NULL;
23582362 #endif
23592363
23602364 #if MEDIAINFO_DEMUX
23862390 File_Mxf::~File_Mxf()
23872391 {
23882392 #if defined(MEDIAINFO_ANCILLARY_YES)
2389 if (!Ancillary_IsBinded)
2393 if (Ancillary)
2394 {
2395 for (essences::iterator Essence=Essences.begin(); Essence!=Essences.end(); ++Essence)
2396 for (parsers::iterator Parser=Essence->second.Parsers.begin(); Parser!=Essence->second.Parsers.end(); ++Parser)
2397 if (*Parser == Ancillary)
2398 *Parser = nullptr;
23902399 delete Ancillary;
2400 }
23912401 #endif //defined(MEDIAINFO_ANCILLARY_YES)
23922402
23932403 for (size_t i = 0; i < AcquisitionMetadataLists.size(); i++)
27972807 Finish(Adm);
27982808 Merge(*Adm, Stream_Audio, 0, 0);
27992809 }
2810 if (Adm_ForLaterMerge)
2811 {
2812 auto& S=*Adm_ForLaterMerge->Stream_More;
2813 size_t Start=(Stream_Audio<S.size() && !S[Stream_Audio].empty())?S[Stream_Audio][0].size():0;
2814 Adm_ForLaterMerge->Streams_Fill_ForAdm();
2815 if (Adm)
2816 {
2817 //Check if compatible
2818 size_t End=(Stream_Audio<S.size() && !S[Stream_Audio].empty())?S[Stream_Audio][0].size():0;
2819 for (size_t i=Start; i<End; i++)
2820 {
2821 const auto& Field_Name=S[Stream_Audio][0][i][Info_Name];
2822 const auto& Field_Text_Iab=S[Stream_Audio][0][i][Info_Text];
2823 const auto& Field_Text_Adm=Retrieve_Const(Stream_Audio, 0, Field_Name.To_UTF8().c_str());
2824 if ((Field_Text_Iab==__T("Yes") && Field_Text_Adm.empty())
2825 || (Field_Text_Iab!=__T("Yes") && Field_Text_Iab!=Field_Text_Adm && (Field_Name.find(__T(" ChannelLayout"))==string::npos
2826 || ChannelLayout_2018_Rename(Field_Text_Iab, __T("IAB"))!=ChannelLayout_2018_Rename(Field_Text_Adm, __T("ADM")))))
2827 {
2828 Fill(Stream_Audio, 0, "Warnings", "Potential IAB/ADM coherency issues detected");
2829 }
2830
2831 }
2832 }
2833 else
2834 {
2835 //Merge
2836 Merge(*Adm_ForLaterMerge, Stream_Audio, 0, 0);
2837 }
2838 }
28002839 if (DolbyAudioMetadata) //After ADM for having content inside ADM stuff
28012840 DolbyAudioMetadata->Merge(*this, 0);
28022841 if (Adm && (!DolbyAudioMetadata || !DolbyAudioMetadata->HasSegment9) && Retrieve_Const(Stream_Audio, 0, "AdmProfile_Format")==__T("Dolby Atmos Master"))
31833222 Fill(Stream_Audio, StreamPos_Last, Audio_Channel_s_, Descriptor->second.ChannelCount);
31843223 break;
31853224 }
3225 if (!Adm_ForLaterMerge && (*Parser)->Retrieve(Stream_Audio, StreamPos_Last, Audio_Format)==__T("IAB"))
3226 Adm_ForLaterMerge=(File_Iab*)*Parser; // Will be used later for ADM
31863227
31873228 MergedStreams_Last.clear(); //TODO: better way to do this
31883229
42654306 }
42664307 }
42674308 Fill(Stream_Other, StreamPos_Last, Other_TimeCode_Settings, IsSourcePackage?__T("Source Package"):__T("Material Package"));
4268 Fill(Stream_Other, StreamPos_Last, Other_TimeCode_Striped, "Yes");
4309 Fill(Stream_Other, StreamPos_Last, Other_TimeCode_Stripped, "Yes");
42694310 Fill(Stream_Other, StreamPos_Last, Other_Title, TrackName);
42704311
42714312 if ((!TimeCodeFromMaterialPackage && IsSourcePackage) || (TimeCodeFromMaterialPackage && !IsSourcePackage))
62426283
62436284 essences::iterator Essence=Essences.find(Code_Compare4);
62446285 if (Essence==Essences.end())
6245 Essence=Essences.insert(make_pair(Code_Compare4,essence())).first;
6286 {
6287 Essences[Code_Compare4];
6288 Essence=Essences.find(Code_Compare4);
6289 }
62466290
62476291 #if MEDIAINFO_TRACE
62486292 if (Trace_Activated)
63616405 ChooseParser(Essence, Descriptor); //Searching by the descriptor
63626406 if (Essence->second.Parsers.empty())
63636407 ChooseParser__FromEssence(Essence, Descriptor); //Searching by the track identifier
6364
6365 #ifdef MEDIAINFO_VC3_YES
6366 if (Ztring().From_UTF8(Mxf_EssenceContainer(Descriptor->second.EssenceContainer))==__T("VC-3"))
6367 ((File_Vc3*)(*(Essence->second.Parsers.begin())))->FrameRate=Descriptor->second.SampleRate;
6368 #endif //MEDIAINFO_VC3_YES
63696408
63706409 #ifdef MEDIAINFO_DEMUX
63716410 if (Ztring().From_UTF8(Mxf_EssenceContainer(Descriptor->second.EssenceContainer))==__T("AVC"))
64976536 Demux_random_access=true;
64986537
64996538 bool ShouldDemux=true;
6500 if (Essence->second.ShouldCheckAvcHeaders)
6539 if (!Essence->second.Parsers.empty() && Essence->second.ShouldCheckAvcHeaders)
65016540 {
65026541 if (Essence->second.Parsers[0]->Status[IsAccepted])
65036542 ShouldDemux=false;
1706517104 switch (Code_Compare4_3)
1706617105 {
1706717106 case 0x01 : //MXF in MXF?
17068 Essence->second.Parsers.push_back(new File_Mxf());
17107 if (!IsSub)
17108 Essence->second.Parsers.push_back(new File_Mxf());
1706917109 break;
1707017110 default : ;
1707117111 }
1718317223 case 0x02 : //Ancillary
1718417224 #if defined(MEDIAINFO_ANCILLARY_YES)
1718517225 if (!Ancillary)
17186 {
1718717226 Ancillary=new File_Ancillary();
17188 MayHaveCaptionsInStream=true;
17189 }
17227 MayHaveCaptionsInStream=true;
1719017228 Essence->second.Parsers.push_back(Ancillary);
17191 Ancillary_IsBinded=true;
1719217229 #endif //defined(MEDIAINFO_ANCILLARY_YES)
1719317230 break;
1719417231 case 0x08 : //Line Wrapped Data Element, SMPTE 384M
3232
3333 class File_DolbyVisionMetadata;
3434 class File_Adm;
35 class File_Iab;
3536 class File_DolbyAudioMetadata;
3637
3738 //***************************************************************************
789790 ShouldCheckAvcHeaders=0;
790791 FrameInfo.DTS=(int64u)-1;
791792 }
793 essence(const essence&) = delete;
794 essence(essence&&) = delete;
792795
793796 ~essence()
794797 {
931934 SoundfieldGroupLinkID.hi=(int64u)-1;
932935 SoundfieldGroupLinkID.lo=(int64u)-1;
933936 }
937 descriptor(const descriptor&) = delete;
938 descriptor(descriptor& b)
939 {
940 *this = b;
941 b.Parser = nullptr;
942 }
943
934944 ~descriptor()
935945 {
936946 delete Parser;
12491259 #endif //MEDIAINFO_ADVANCED
12501260 #if defined(MEDIAINFO_ANCILLARY_YES)
12511261 File_Ancillary* Ancillary;
1252 bool Ancillary_IsBinded;
12531262 #endif //defined(MEDIAINFO_ANCILLARY_YES)
12541263
12551264 //Hints
13511360 File_DolbyAudioMetadata* DolbyAudioMetadata;
13521361 #if defined(MEDIAINFO_ADM_YES)
13531362 File_Adm* Adm;
1363 #endif
1364 #if defined(MEDIAINFO_IAB_YES)
1365 File_Iab* Adm_ForLaterMerge;
13541366 #endif
13551367
13561368 //Demux
6767 #if !defined (MEDIAINFO_TRACE_NO) && !defined (MEDIAINFO_TRACE_YES)
6868 #define MEDIAINFO_TRACE_NO
6969 #endif
70 #if !defined (MEDIAINFO_CONFORMANCE_NO) && !defined (MEDIAINFO_CONFORMANCE_YES)
71 #define MEDIAINFO_CONFORMANCE_NO
72 #endif
7073 #if !defined (MEDIAINFO_FILTER_NO) && !defined (MEDIAINFO_FILTER_YES)
7174 #define MEDIAINFO_FILTER_NO
7275 #endif
245248 #define MEDIAINFO_ADVANCED2 1
246249 #else
247250 #define MEDIAINFO_ADVANCED2 0
251 #endif
252 #endif
253 #if !defined(MEDIAINFO_CONFORMANCE)
254 #if defined(MEDIAINFO_CONFORMANCE_NO) && defined(MEDIAINFO_CONFORMANCE_YES)
255 #undef MEDIAINFO_CONFORMANCE_NO //MEDIAINFO_CONFORMANCE_YES has priority
256 #endif
257 #if defined(MEDIAINFO_CONFORMANCE_NO)
258 #define MEDIAINFO_CONFORMANCE 0
259 #else
260 #define MEDIAINFO_CONFORMANCE 1
248261 #endif
249262 #endif
250263 #if !defined(MEDIAINFO_MD5)
5454 }
5555
5656 //---------------------------------------------------------------------------
57 static float32 Cdp_cdp_frame_rate(int8u cdp_frame_rate)
57 static float64 Cdp_cdp_frame_rate(int8u cdp_frame_rate)
5858 {
5959 switch (cdp_frame_rate)
6060 {
61 case 1 : return (float32)23.976;
62 case 2 : return (float32)24.000;
63 case 3 : return (float32)25.000;
64 case 4 : return (float32)29.970;
65 case 5 : return (float32)30.000;
66 case 6 : return (float32)50.000;
67 case 7 : return (float32)59.940;
68 case 8 : return (float32)60.000;
69 default : return (float32) 0.000;
61 case 1 : return (float64)24/1.001;
62 case 2 : return (float64)24;
63 case 3 : return (float64)25;
64 case 4 : return (float64)30/1.001;
65 case 5 : return (float64)30;
66 case 6 : return (float64)50;
67 case 7 : return (float64)60/1.001;
68 case 8 : return (float64)60;
69 default : return (float64) 0;
7070 }
7171 }
7272
350350 TimeCode Temp(TimeStamp);
351351 Temp.SetFramesMax(FrameRate-1);
352352 Temp.Set1001(FrameRate_Is1001);
353 Parser->Frame_Count_NotParsedIncluded=Temp.ToFrames()-TimeCode_FirstFrame.ToFrames();
353 Frame_Count_NotParsedIncluded=Temp.ToFrames()-TimeCode_FirstFrame.ToFrames();
354354 Parser->FrameInfo.DTS=Temp.ToMilliseconds()*1000000;
355355 Parser->FrameInfo.DUR=FrameDurationNanoSeconds;
356356 while (Element_Offset+5<=Element_Size)
362362 | Char2Hex(Buffer[Buffer_Offset+(size_t)Element_Offset+4]);
363363 Open_Buffer_Continue(Parser, Buffer_Temp, 2);
364364 Element_Offset+=5;
365 }
366 Frame_Count_NotParsedIncluded=Parser->Frame_Count_NotParsedIncluded;
365 Frame_Count_NotParsedIncluded=Parser->Frame_Count_NotParsedIncluded;
366 }
367367 }
368368
369369 //***************************************************************************
348348 Fill(Stream_General, 0, General_FrameRate, FrameRate);
349349 Fill(Stream_Text, 0, Text_FrameRate, FrameRate);
350350 }
351 if (FrameRate_Int && FrameRateMultiplier_Den!=1)
351 if (FrameRate_Int && FrameRateMultiplier_Num && FrameRateMultiplier_Den)
352352 {
353353 Fill(Stream_Text, 0, Text_FrameRate_Num, FrameRate_Int*FrameRateMultiplier_Num, 10, true);
354354 Fill(Stream_Text, 0, Text_FrameRate_Den, FrameRateMultiplier_Den, 10, true);
6262 size_t const pos;
6363 };
6464
65 constexpr14 bitset8() : stored(0) {}
66 constexpr14 bitset8(int8u val) : stored(val) {}
67
6568 constexpr14 bitset8& reset() noexcept
6669 {
6770 stored=0;
98101 constexpr14 bool operator[](size_t pos) const noexcept
99102 {
100103 return test(pos);
104 }
105
106 constexpr14 int8u to_int8u() const noexcept
107 {
108 return stored;
109 }
110
111 constexpr14 explicit operator bool() const noexcept
112 {
113 return stored;
101114 }
102115
103116 private:
104117 int8u stored=0;
105118 };
119
120 inline int8u operator | (const bitset8 a, const bitset8 b) noexcept
121 {
122 return a.to_int8u() | b.to_int8u();
123 }
124
125 inline int8u operator & (const bitset8 a, const bitset8 b) noexcept
126 {
127 return a.to_int8u() & b.to_int8u();
128 }
129
130
106131
107132 //***************************************************************************
108133 // Class TimeCode
970970 TemporalReferences_Offset=0;
971971 TemporalReferences_Offset_pic_order_cnt_lsb_Last=0;
972972 TemporalReferences_pic_order_cnt_Min=0;
973 pic_order_cnt_DTS_Ref=(int64u)-1;
973974
974975 //Text
975976 #if defined(MEDIAINFO_DTVCCTRANSPORT_YES)
30013002 FrameRate=0;
30023003 if (first_slice_segment_in_pic_flag && pic_order_cnt_DTS_Ref!=(int64u)-1 && FrameInfo.PTS!=(int64u)-1 && FrameRate && TemporalReferences_Reserved)
30033004 {
3005 int64s pic_order_cnt=float64_int64s(int64s(FrameInfo.PTS-pic_order_cnt_DTS_Ref)*FrameRate/1000000000);
3006 if (pic_order_cnt>=TemporalReferences.size()/4 || pic_order_cnt<=-((int64s)TemporalReferences.size()/4))
3007 pic_order_cnt_DTS_Ref=(int64u)-1; // Incoherency in DTS? Disabling compute by DTS, TODO: more generic test (all formats)
3008 }
3009 if (first_slice_segment_in_pic_flag && pic_order_cnt_DTS_Ref!=(int64u)-1 && FrameInfo.PTS!=(int64u)-1 && FrameRate && TemporalReferences_Reserved)
3010 {
30043011 //Frame order detection
3005 int64s pic_order_cnt=float64_int64s((FrameInfo.PTS-pic_order_cnt_DTS_Ref)*FrameRate/1000000000);
3012 int64s pic_order_cnt=float64_int64s(int64s(FrameInfo.PTS-pic_order_cnt_DTS_Ref)*FrameRate/1000000000);
30063013 if (pic_order_cnt<TemporalReferences_pic_order_cnt_Min)
30073014 {
30083015 if (pic_order_cnt<0)
123123 #endif //MEDIAINFODLL_NAME
124124 #else //_UNICODE
125125 #ifndef MEDIAINFODLL_NAME
126 #define MEDIAINFODLL_NAME L"MediaInfo.dll"
126 #define MEDIAINFODLL_NAME "MediaInfo.dll"
127127 #endif //MEDIAINFODLL_NAME
128128 #endif //_UNICODE
129129 #elif defined(__APPLE__) && defined(__MACH__)
00 #include <winresrc.h>
11
22 VS_VERSION_INFO VERSIONINFO
3 FILEVERSION 22,06,0,0
4 PRODUCTVERSION 22,06,0,0
3 FILEVERSION 22,09,0,0
4 PRODUCTVERSION 22,09,0,0
55 FILEFLAGSMASK 0x3fL
66 #ifdef _DEBUG
77 FILEFLAGS 0x1L
1818 BEGIN
1919 VALUE "CompanyName", "MediaArea.net"
2020 VALUE "FileDescription", "Most relevant technical and tag data for video and audio files"
21 VALUE "FileVersion", "22.06.0.0"
21 VALUE "FileVersion", "22.09.0.0"
2222 VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL"
2323 VALUE "ProductName", "MediaInfo"
24 VALUE "ProductVersion", "22.06.0.0"
24 VALUE "ProductVersion", "22.09.0.0"
2525 END
2626 END
2727 BLOCK "VarFileInfo"
149149 : ;:
150150 3D;3D
151151 3DType;3D Type
152 5.1.2ch;5.1.2
153 5.1.4ch;5.1.4
154 5.1ch;5.1
152155 608_Mode;EIA-608 conversion mode
156 7.1.2ch;7.1.2
157 7.1ch;7.1
153158 About;About
154159 About_Hint;How to contact me and find last version
155160 Accompaniment;Accompaniment
197202 AudioSceneInfoID;Audio scene info ID
198203 AudioTrackLayout;Audio Track Layout
199204 Author;Author
205 Back4ToBack2;Four backs to two backs
206 Balance_FrontBackListener;Front/back listener balance
200207 Balance_FrontBackOverheadFloor;Front/back overhead/floor balance
201 Balance_FrontBackListener;Front/back listener balance
202208 BarCode;BarCode
203209 Basic;Basic
204210 Basic_Note;Note : for more information about this file, you must select a different view (Sheet, Tree...)
223229 Channel(s);Channel(s)
224230 ChannelCoded;Channel coded
225231 ChannelConfiguration;Channel configuration
232 ChannelFormat;Channel format
226233 ChannelLayout;Channel layout
227234 ChannelMode;Channel mode
228235 ChannelPositions;Channel positions
279286 Comment;Comment
280287 CommissionedBy;Commissioned by
281288 Compilation;Compilation
289 ComplementaryObject;Complementary object
282290 CompleteName;Complete name
283291 CompletionDate;Completion Date
284292 ComplexityIndex;Complexity index
289297 Compression_Ratio;Compression ratio
290298 Conductor;Conductor
291299 ConformanceCheck;Conformance check
300 ConformanceErrors;Conformance errors
301 ConformanceWarnings;Conformance warnings
302 ConformanceInfos;Conformance information
292303 ContactEmail;Contact Email
293304 ContactTelephoneNumber;Contact Telephone Number
294305 Container and general information;Container and general information
306 Content;Content
295307 ContentType;ContentType
296308 CoProducer;Coproducer
297309 Copyright;Copyright
306318 Cover_Type;Cover type
307319 Cropped;Crop dimensions
308320 Custom;Custom
321 CustomDownmixTargets;Custom downmix targets
309322 Customize;Customize
310323 Date;Date
311324 Debug;Debug
331344 DisplayAspectRatio_Original;Original display aspect ratio
332345 DistributedBy;Distributed by
333346 Distributor;Distributor
347 Dolby_Atmos_Metadata;Dolby Atmos metadata
334348 DolbyAtmos;Dolby Atmos
335 Dolby_Atmos_Metadata;Dolby Atmos metadata
336349 Donate;Donate
337350 DotsPerInch;Dots per inch
338351 Downmix;Downmix
352 Downmix_5.1.x;5.1 and 5.1.x downmix
339353 Downmix_5to2;5.1 to 2.0 downmix
340 Downmix_5.1.x;5.1 and 5.1.x downmix
341354 DrcSets_Count;DRC set count
342355 DrcSets_Effects;DRC effect type(s)
343356 Duration;Duration
346359 Duration_Start;Start time
347360 Duration_Start_Command;Start time (commands)
348361 Duration_Start2End;Duration of the visible content
362 DynamicObject;Dynamic object
349363 DynamicRangeControl;Dynamic Range Control
350364 Eac3DrcProfile;E-AC-3 DRC profile
351365 Edit;Edit
352366 EditedBy;Edited by
353367 EditorialClassification;Editorial classification
368 ElementaryStream;Elementary stream
354369 ElementCount;Count of elements
355370 EMail;E-Mail
356371 Encoded_Application;Writing application
400415 Format;Format
401416 Format_Commercial;Commercial name
402417 Format_Commercial_IfAny;Commercial name
418 Format_Compression;Compression
403419 Format_Description;Format description
404420 Format_Info;Details for format
405421 Format_Level;Format level
433449 Format_Tier;Format tier
434450 Format_Url;Weblink for format
435451 Format_Version;Format version
452 FormatDefinition;Format definition
436453 FpaManufacturer;FPA Manufacturer
437454 FpaPass;FPA Pass
438455 FpaVersion;FPA Version
532549 Genre_081;Folk-Rock
533550 Genre_082;National Folk
534551 Genre_083;Swing
535 Genre_084;Fast-Fusion
552 Genre_084;Fast Fusion
536553 Genre_085;Bebop
537554 Genre_086;Latin
538555 Genre_087;Revival
672689 ImmersiveStereo;Immersive stereo
673690 Info;Info
674691 Instruments;Instruments
692 IntegratedLoudness;Integrated loudness
675693 IntegratedLoudness_Level;Integrated loudness (level gated)
676694 IntegratedLoudness_Speech;Integrated loudness (speech gated)
677695 InteractivityEnabled;Interactivity enabled
905923 LineUpStart;Line Up Start
906924 LinkedTo_Bed_Pos;Bed #s
907925 LinkedTo_ChannelFormat_Pos;Channel format #s
926 LinkedTo_ComplementaryObject_Pos;Complementary object #s
908927 LinkedTo_Content_Pos;Content #s
909928 LinkedTo_Group_Pos;Group #s
910929 LinkedTo_Object_Pos;Object #s
911930 LinkedTo_PackFormat_Pos;Pack format #s
912931 LinkedTo_SignalGroup_Pos;Signal group #s
932 LinkedTo_StreamFormat_Pos;Stream format #s
913933 LinkedTo_Substream_Pos;Substream #s
914934 LinkedTo_TrackFormat_Pos;Track format #s
915935 LinkedTo_TrackUID_Pos;Track UID #s
9921012 NumberOfPackFormats;Number of pack formats
9931013 NumberOfPresentations;Number of presentations
9941014 NumberOfProgrammes;Number of programmes
1015 NumberOfStreamFormats;Number of stream formats
9951016 NumberOfSubstreams;Number of substreams
1017 NumberOfTrackFormats;Number of track formats
9961018 NumberOfTrackUIDs;Number of track UIDs
997 NumberOfTrackFormats;Number of track formats
998 NumberOfStreamFormats;Number of stream formats
9991019 NumColors;Number of colors
1020 Object;Object
10001021 ObjectCount;Object Count
10011022 OK;OK
10021023 One output file per input file;One output file per input file
10591080 OverallBitRate_Mode;Overall bit rate mode
10601081 OverallBitRate_Nominal;Nominal Overall bit rate
10611082 PackageName;Package name
1083 PackFormat;Pack format
10621084 Part;Part
10631085 Part_Count;Total count
10641086 PartNumber;Part Number
10881110 PreferredDownmix;Preferred downmix
10891111 PreselectionLabel;Preselection label
10901112 Presentation;Presentation
1113 Presentation;Presentation
10911114 PresentationConfig;Presentation config
10921115 PresentationConfig_ContentClassifier;Presentation config from content classifiers
10931116 PresentationID;Presentation ID
10991122 ProductionNumber;Production Number
11001123 ProductionStudio;Production studio
11011124 ProductPlacement;Product Placement
1125 Programme;Programme
11021126 ProgrammeHasText;Programme Has Text
11031127 ProgrammeTextLanguage;Programme Text Language
11041128 ProgrammeTitle;Programme Title
11321156 ScanType_Original;Original scan type
11331157 ScanType_StoreMethod;Scan type, store method
11341158 ScreenplayBy;Screenplay by
1159 ScreenToCenter;Screen to center
1160 ScreenToFront;Screen to front
11351161 Season;Season
11361162 SecondaryAudioLanguage;Secondary Audio Language
11371163 see below;see below
11781204 Stream;Stream
11791205 Stream_MoreInfo;More information about the stream
11801206 StreamCount;Count of stream of this kind
1207 StreamFormat;Stream format
11811208 StreamID;Stream ID
11821209 streamIdentifier;Stream identifier
11831210 StreamKind;Kind of stream
11881215 StreamSize_Encoded;Encoded stream size
11891216 StreamSize_Proportion;Proportion of this stream
11901217 Subject;Subject
1218 Substream;Substream
11911219 Substream;Substream
11921220 SubTrack;SubTrack
11931221 SubtstreamIdChannel;Substream start ID & channel index
12251253 TimeCode_MaxFrameNumber_Theory;Theoritical maximum frame number in time codes
12261254 TimeCode_Settings;Time code settings
12271255 TimeCode_Source;Time code source
1228 TimeCode_Striped;Time code, striped
1256 TimeCode_Stripped;Time code, stripped
12291257 TimeStamp;Time stamp
12301258 TimeZone;Timezone
12311259 Title;Title
12321260 Title_More;Title, more info
1261 Top4ToTop2;Four fronts to two fronts
1262 TopBackToFront;Top backs to front
1263 TopBackToSide;Top backs to side
1264 TopFrontToBack;Top fronts to back
1265 TopFrontToFront;Top fronts to front
1266 TopFrontToSide;Top fronts to side
12331267 Total;Total
12341268 TotalNumberOfParts;Total Number Of Parts
12351269 TotalProgrammeDuration;Total Programme Duration
12361270 Track;Track name
12371271 Track_Count;Track count
1272 TrackFormat;Track format
12381273 TrackIndex;Track index
1239 TrackUID;TrackUID
1274 TrackUID;Track UID
12401275 transfer_characteristics;Transfer characteristics
12411276 Translator;Translator
12421277 Transport;Transport
12581293 TruePeakLevel;True peak level
12591294 TruePeakLevel_Album;True peak level (album)
12601295 Type;Type
1261 TypeDefinition;TypeDefinition
1296 TypeDefinition;Type definition
12621297 UniqueID;Unique ID
12631298 UniversalAdID;Universal Ad ID
12641299 UniversalAdID_Registry;Universal Ad ID registry
00 General;[%Format/String%][ (%Format_Profile%)][ (%Format_Commercial_IfAny%)]$if(%Format/String%,$: $)%FileSize/String%[, %Duration/String%]
11 Video;[%Language/String%, ][%BitRate/String%$if(%BitRate_Nominal/String%, \\(%BitRate_Nominal/String%\\)), ][%Width%*][%Height%][ (%DisplayAspectRatio/String%), ][$at$ %FrameRate/String%, ][%Format/String%][ (%CodecID/Hint%)][ (%Standard%)]$if(%MuxingMode%, \\(%MuxingMode%\\))$if(%Format_Version%, \\(%Format_Version%\\))$if(%Format_Profile%, \\(%Format_Profile%\\))$if(%Format_Settings%, \\(%Format_Settings%\\))[ (%Format_Commercial_IfAny%)][, %HDR_Format_Commercial%]
2 Audio;[%Language/String%, ][%BitRate/String%$if(%BitRate_Nominal/String%, \\(%BitRate_Nominal/String%\\)), ][%SamplingRate/String%, ][%BitDepth/String%, ][%Channel(s)_Original/String% / ][%Channel(s)/String%, ][%Format/String%][ (%CodecID/Hint%)]$if(%MuxingMode%, \\(%MuxingMode%\\))$if(%Format_Version%, \\(%Format_Version%\\))$if(%Format_Profile%, \\(%Format_Profile%\\))$if(%Format_Settings%, \\(%Format_Settings%\\))[ (%Format_Commercial_IfAny%)][ (%ConformanceCheck/Short%)][, %NumberOfPresentations% presentations][, %NumberOfSubstreams% substreams][ (%AdmProfile_Format% ADM profile)]
2 Audio;[%Language/String%, ][%BitRate/String%$if(%BitRate_Nominal/String%, \\(%BitRate_Nominal/String%\\)), ][%SamplingRate/String%, ][%BitDepth/String%, ][%Channel(s)_Original/String% / ][%Channel(s)/String%, ][%Format/String%][ (%CodecID/Hint%)]$if(%MuxingMode%, \\(%MuxingMode%\\))$if(%Format_Version%, \\(%Format_Version%\\))$if(%Format_Profile%, \\(%Format_Profile%\\))$if(%Format_Settings%, \\(%Format_Settings%\\))[ (%Format_Commercial_IfAny%)][, %NumberOfProgrammes% programmes][, %NumberOfObjects% objects][, %NumberOfPresentations% presentations][, %NumberOfSubstreams% substreams][ (%AdmProfile_Format% ADM profile)]$if(%ConformanceErrors%, \\(%ConformanceErrors% conformance errors\\))$if(%ConformanceWarnings%, \\(%ConformanceWarnings% conformance warnings\\))
33 Text;[%Language/String%, ][%Format/String%][ (%Format_Commercial_IfAny%)]$if(%MuxingMode%, \\(%MuxingMode%\\))
44 Image;[%Language/String%, ][%Width%*][%Height%][ (%DisplayAspectRatio/String%)][, %Format/String%]
55 Chapters;[%Language/String%, ]%Total% chapters[, %Format/String%][ (%Format_Commercial_IfAny%)]
128128 TimeCode_LastFrame;;;Y YCY;;;Time code of the last frame (excluding the duration of the last frame) in HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available format
129129 TimeCode_DropFrame;;;N NT;;;Delay drop frame;
130130 TimeCode_Settings;;;Y YTY;;;Time code settings
131 TimeCode_Striped;;Yes;N YTY;;;Time code is striped (only 1st time code, no discontinuity)
132 TimeCode_Striped/String;;;Y NT;;;Time code is striped (only 1st time code, no discontinuity)
131 TimeCode_Stripped;;Yes;N YTY;;;Time code is Stripped (only 1st time code, no discontinuity)
132 TimeCode_Stripped/String;;;Y NT;;;Time code is Stripped (only 1st time code, no discontinuity)
133133 TimeCode_Source;;;Y YTY;;;Time code source (Container, Stream, SystemScheme1, SDTI, ANC...)
134134 StreamSize;; byte;N YIY;;;Streamsize in bytes;;
135135 StreamSize/String;;;Y NT;;;Streamsize in with percentage value;;
141141 DisplayAspectRatio_Original/String;;;Y NT;;;Original (in the raw stream) Display Aspect ratio
142142 FrameRate_Mode;;;N YTY;;;Frame rate mode (CFR, VFR)
143143 FrameRate_Mode/String;;;N NT;;;Frame rate mode (Constant, Variable)
144 FrameRate_Mode_Original;;;N YTY;;;Original frame rate mode (CFR, VFR)
145 FrameRate_Mode_Original/String;;;Y NT;;;Original frame rate mode (Constant, Variable)
144146 FrameRate;; fps;N YFY;;;Frames per second
145147 FrameRate/String;;;Y NT;;;Frames per second (with measurement)
146148 FrameRate_Num;;;N NIN;;;Frames per second, numerator
151153 FrameRate_Nominal/String;;;N NT;;;Nominal Frames per second (with measurement)
152154 FrameRate_Maximum;; fps;N YFY;;;Maximum Frames per second
153155 FrameRate_Maximum/String;;;N NT;;;Maximum Frames per second (with measurement)
154 FrameRate_Original;; fps;N YFY;;;Original (in the raw stream) Frames per second
155 FrameRate_Original/String;;;N NT;;;Original (in the raw stream) Frames per second (with measurement)
156 FrameRate_Original;; fps;N YFY;;;Original (in the raw stream) frames per second
157 FrameRate_Original/String;;;Y NT;;;Original (in the raw stream) frames per second (with measurement)
158 FrameRate_Original_Num;;;N NFN;;;Frames per second, numerator
159 FrameRate_Original_Den;;;N NFN;;;Frames per second, denominator
156160 FrameCount;;;N NIY;;;Number of frames
157161 ElementCount;;;Y NIY;;;Number of displayed elements
158162 Source_FrameCount;;;N NIY;;;Source Number of frames
357357 {
358358 /* Value */
359359 const char quote = *priv->buf;
360 if (!priv->len)
361 return -1;
360362 next_char(priv);
361363 v->buf = priv->buf;
362364 while (priv->len && *priv->buf != quote)