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
0 | 0 | I changed some elements in the interface. |
1 | 1 | 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 | |
2 | 7 | |
3 | 8 | 18.05 --> 18.08 |
4 | 9 | --------------- |
6 | 6 | bug reports and feature request are here: |
7 | 7 | https://sourceforge.net/p/mediainfo/_list/tickets |
8 | 8 | |
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 | ||
9 | 29 | Version 22.06, 2022-06-23 |
10 | 30 | ------------- |
11 | 31 | + MXF: FFV1 support |
4 | 4 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules") |
5 | 5 | |
6 | 6 | set(MediaInfoLib_MAJOR_VERSION 22) |
7 | set(MediaInfoLib_MINOR_VERSION 06) | |
7 | set(MediaInfoLib_MINOR_VERSION 09) | |
8 | 8 | set(MediaInfoLib_PATCH_VERSION 0) |
9 | 9 | set(MediaInfoLib_VERSION ${MediaInfoLib_MAJOR_VERSION}.${MediaInfoLib_MINOR_VERSION}) |
10 | 10 |
4 | 4 | dnl ------------------------------------------------------------------------- |
5 | 5 | dnl Name and version |
6 | 6 | dnl |
7 | AC_INIT([libmediainfo], [22.06]) | |
7 | AC_INIT([libmediainfo], [22.09]) | |
8 | 8 | |
9 | 9 | dnl ------------------------------------------------------------------------- |
10 | 10 | dnl Test if we are at the good place |
59 | 59 | AC_ARG_ENABLE(minimal, AC_HELP_STRING([--enable-minimal], [Enable minimal management (except parsers)]),MediaInfoMinimal=$enableval, MediaInfoMinimal=depend) |
60 | 60 | AC_ARG_ENABLE(trace, AC_HELP_STRING([--enable-trace], [Enable trace management]), MediaInfoTrace=$enableval, MediaInfoTrace=depend) |
61 | 61 | 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) | |
62 | 63 | AC_ARG_ENABLE(demux, AC_HELP_STRING([--enable-demux], [Enable demux management]), MediaInfoDemux=$enableval, MediaInfoDemux=depend) |
63 | 64 | AC_ARG_ENABLE(libmms-describe-support, AC_HELP_STRING([--enable-libmms-describe-support], [Enable customized libmms describe support]), MediaInfoLibmmsDescribeSupport=$enableval, MediaInfoLibmmsDescribeSupport=depend) |
64 | 65 | AC_ARG_ENABLE(dll, AC_HELP_STRING([--disable-dll], [Disable dll iterface]), MediaInfoDll=$enableval, MediaInfoDll=depend) |
223 | 224 | if test "$MediaInfoMinimal" = "no"; then AC_DEFINE(MEDIAINFO_MINIMAL_NO) fi; if test "$MediaInfoMinimal" = "yes"; then AC_DEFINE(MEDIAINFO_MINIMAL_YES) fi |
224 | 225 | if test "$MediaInfoTrace" = "no"; then AC_DEFINE(MEDIAINFO_TRACE_NO) fi; if test "$MediaInfoTrace" = "yes"; then AC_DEFINE(MEDIAINFO_TRACE_YES) fi |
225 | 226 | 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 | |
226 | 228 | if test "$MediaInfoDemux" = "no"; then AC_DEFINE(MEDIAINFO_DEMUX_NO) fi; if test "$MediaInfoDemux" = "yes"; then AC_DEFINE(MEDIAINFO_DEMUX_YES) fi |
227 | 229 | if test "$MediaInfoJni" = "no"; then AC_DEFINE(MEDIAINFO_JNI_NO) fi; if test "$MediaInfoJni" = "yes"; then AC_DEFINE(MEDIAINFO_JNI_YES) fi |
228 | 230 | if test "$MediaInfoLibmmsDescribeSupport" = "yes"; then AC_DEFINE(MEDIAINFO_LIBMMS_DESCRIBE_SUPPORT) fi |
1 | 1 | # Maintainer: MediaArea.net SARL <info@mediaarea.net> |
2 | 2 | # Contributor: hydro <hydro@freenet.de> |
3 | 3 | |
4 | pkgname=('libmediainfo' 'python2-mediainfo' 'python-mediainfo') | |
5 | pkgver=22.06 | |
4 | pkgname=('libmediainfo' 'python-mediainfo') | |
5 | pkgver=22.09 | |
6 | 6 | pkgrel=1 |
7 | 7 | pkgdesc="shared library for mediainfo" |
8 | 8 | arch=('i686' 'x86_64') |
9 | 9 | url="http://mediaarea.net" |
10 | 10 | license=('BSD-2-Clause') |
11 | makedepends=('libtool' 'automake' 'autoconf' 'python' 'python2') | |
11 | makedepends=('libtool' 'automake' 'autoconf' 'python') | |
12 | 12 | depends=( 'curl' 'libmms' 'libzen>=0.4.39') |
13 | 13 | source=(${pkgname}_${pkgver}.orig.tar.xz) |
14 | 14 | md5sums=('00000000000000000000000000000000') |
30 | 30 | done |
31 | 31 | } |
32 | 32 | |
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 | ||
42 | 33 | package_python-mediainfo() { |
43 | 34 | pkgdesc="shared library for mediainfo - python3 binding" |
44 | 35 | depends=('python3' 'libmediainfo') |
1 | 1 | Source: libmediainfo |
2 | 2 | Binary: libmediainfo-dev, libmediainfo0, python-mediainfodll, python3-mediainfodll, libmediainfo-doc libmediainfo0-dbg |
3 | 3 | Architecture: any all |
4 | Version: 22.06-1 | |
4 | Version: 22.09-1 | |
5 | 5 | Maintainer: MediaArea.net SARL <info@mediaarea.net> |
6 | 6 | Homepage: http://MediaArea.net/MediaInfo |
7 | 7 | Standards-Version: 3.9.6 |
15 | 15 | python-mediainfodll deb python optional arch=all |
16 | 16 | python3-mediainfodll deb python optional arch=all |
17 | 17 | 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 | |
20 | 20 | 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 | |
23 | 23 | 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 | |
1 | 1 | %global libmediainfo_version_major 22 |
2 | %global libmediainfo_version_minor 06 | |
2 | %global libmediainfo_version_minor 09 | |
3 | 3 | %global libzen_version 0.4.39 |
4 | 4 | %global libzen_version_major 0 |
5 | 5 | %global libzen_version_minor 4 |
410 | 410 | %endif |
411 | 411 | |
412 | 412 | %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 | |
414 | 414 | - See History.txt for more info and real dates |
415 | 415 | - Previous packages made by Toni Graffy <toni@links2linux.de> |
416 | 416 | - Fedora style made by Vasiliy N. Glazov <vascom2@gmail.com> |
0 | 0 | #include <winresrc.h> |
1 | 1 | |
2 | 2 | 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 | |
5 | 5 | FILEFLAGSMASK 0x3fL |
6 | 6 | #ifdef _DEBUG |
7 | 7 | FILEFLAGS 0x1L |
18 | 18 | BEGIN |
19 | 19 | VALUE "CompanyName", "MediaArea.net" |
20 | 20 | 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" | |
22 | 22 | VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL" |
23 | 23 | VALUE "ProductName", "MediaInfo" |
24 | VALUE "ProductVersion", "22.06.0.0" | |
24 | VALUE "ProductVersion", "22.09.0.0" | |
25 | 25 | END |
26 | 26 | END |
27 | 27 | BLOCK "VarFileInfo" |
0 | 0 | #include <winresrc.h> |
1 | 1 | |
2 | 2 | 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 | |
5 | 5 | FILEFLAGSMASK 0x3fL |
6 | 6 | #ifdef _DEBUG |
7 | 7 | FILEFLAGS 0x1L |
18 | 18 | BEGIN |
19 | 19 | VALUE "CompanyName", "MediaArea.net" |
20 | 20 | 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" | |
22 | 22 | VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL" |
23 | 23 | VALUE "ProductName", "MediaInfo" |
24 | VALUE "ProductVersion", "22.06.0.0" | |
24 | VALUE "ProductVersion", "22.09.0.0" | |
25 | 25 | END |
26 | 26 | END |
27 | 27 | BLOCK "VarFileInfo" |
0 | 0 | #include <winresrc.h> |
1 | 1 | |
2 | 2 | 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 | |
5 | 5 | FILEFLAGSMASK 0x3fL |
6 | 6 | #ifdef _DEBUG |
7 | 7 | FILEFLAGS 0x1L |
18 | 18 | BEGIN |
19 | 19 | VALUE "CompanyName", "MediaArea.net" |
20 | 20 | 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" | |
22 | 22 | VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL" |
23 | 23 | VALUE "ProductName", "MediaInfo" |
24 | VALUE "ProductVersion", "22.06.0.0" | |
24 | VALUE "ProductVersion", "22.09.0.0" | |
25 | 25 | END |
26 | 26 | END |
27 | 27 | BLOCK "VarFileInfo" |
0 | 0 | #include <winresrc.h> |
1 | 1 | |
2 | 2 | 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 | |
5 | 5 | FILEFLAGSMASK 0x3fL |
6 | 6 | #ifdef _DEBUG |
7 | 7 | FILEFLAGS 0x1L |
18 | 18 | BEGIN |
19 | 19 | VALUE "CompanyName", "MediaArea.net" |
20 | 20 | 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" | |
22 | 22 | VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL" |
23 | 23 | VALUE "ProductName", "MediaInfo" |
24 | VALUE "ProductVersion", "22.06.0.0" | |
24 | VALUE "ProductVersion", "22.09.0.0" | |
25 | 25 | END |
26 | 26 | END |
27 | 27 | BLOCK "VarFileInfo" |
0 | 0 | #include <winresrc.h> |
1 | 1 | |
2 | 2 | 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 | |
5 | 5 | FILEFLAGSMASK 0x3fL |
6 | 6 | #ifdef _DEBUG |
7 | 7 | FILEFLAGS 0x1L |
18 | 18 | BEGIN |
19 | 19 | VALUE "CompanyName", "MediaArea.net" |
20 | 20 | 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" | |
22 | 22 | VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL" |
23 | 23 | VALUE "ProductName", "MediaInfo" |
24 | VALUE "ProductVersion", "22.06.0.0" | |
24 | VALUE "ProductVersion", "22.09.0.0" | |
25 | 25 | END |
26 | 26 | END |
27 | 27 | BLOCK "VarFileInfo" |
0 | 0 | #include <winresrc.h> |
1 | 1 | |
2 | 2 | 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 | |
5 | 5 | FILEFLAGSMASK 0x3fL |
6 | 6 | #ifdef _DEBUG |
7 | 7 | FILEFLAGS 0x1L |
18 | 18 | BEGIN |
19 | 19 | VALUE "CompanyName", "MediaArea.net" |
20 | 20 | 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" | |
22 | 22 | VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL" |
23 | 23 | VALUE "ProductName", "MediaInfo" |
24 | VALUE "ProductVersion", "22.06.0.0" | |
24 | VALUE "ProductVersion", "22.09.0.0" | |
25 | 25 | END |
26 | 26 | END |
27 | 27 | BLOCK "VarFileInfo" |
0 | 0 | #include <winresrc.h> |
1 | 1 | |
2 | 2 | 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 | |
5 | 5 | FILEFLAGSMASK 0x3fL |
6 | 6 | #ifdef _DEBUG |
7 | 7 | FILEFLAGS 0x1L |
18 | 18 | BEGIN |
19 | 19 | VALUE "CompanyName", "MediaArea.net" |
20 | 20 | 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" | |
22 | 22 | VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL" |
23 | 23 | VALUE "ProductName", "MediaInfo" |
24 | VALUE "ProductVersion", "22.06.0.0" | |
24 | VALUE "ProductVersion", "22.09.0.0" | |
25 | 25 | END |
26 | 26 | END |
27 | 27 | BLOCK "VarFileInfo" |
18 | 18 | BEGIN |
19 | 19 | VALUE "CompanyName", "MediaArea.net" |
20 | 20 | 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" | |
22 | 22 | VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL" |
23 | 23 | VALUE "ProductName", "MediaInfo" |
24 | VALUE "ProductVersion", "22.06.0.0" | |
24 | VALUE "ProductVersion", "22.09.0.0" | |
25 | 25 | END |
26 | 26 | END |
27 | 27 | 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 | |
3 | 3 | For details, see https://github.com/MediaArea/MediaInfoLib/blob/master/History_DLL.txt |
4 | 4 | |
5 | 5 | -- MediaArea <info@mediaarea.net> Mon, 02 Nov 2015 10:30:00 +0100 |
1 | 1 | Source: libmediainfo |
2 | 2 | Binary: libmediainfo-dev, libmediainfo0v5, python-mediainfodll, python3-mediainfodll, libmediainfo-doc libmediainfo0v5-dbg |
3 | 3 | Architecture: any all |
4 | Version: 22.06-1deb9 | |
4 | Version: 22.09-1deb9 | |
5 | 5 | Maintainer: MediaArea.net SARL <info@mediaarea.net> |
6 | 6 | Homepage: http://MediaArea.net/MediaInfo |
7 | 7 | Standards-Version: 3.9.6 |
15 | 15 | python-mediainfodll deb python optional arch=all |
16 | 16 | python3-mediainfodll deb python optional arch=all |
17 | 17 | 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 | |
20 | 20 | 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 | |
23 | 23 | 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 |
8 | 8 | |
9 | 9 | #Creation of known directories and filenames |
10 | 10 | name="libmediainfo0" |
11 | version="22.06" | |
11 | version="22.09" | |
12 | 12 | Home=`pwd` |
13 | 13 | install_prefix=${Home}/mk_package |
14 | 14 | packagecreation_prefix=${Home}/create_package |
20 | 20 | export CXX="$(xcrun -sdk iphoneos -find clang++)" |
21 | 21 | export AR="$(xcrun -sdk iphoneos -find ar)" |
22 | 22 | 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" | |
26 | 26 | |
27 | 27 | pushd "$(dirname "${BASH_SOURCE[0]}")/../GNU/Library" |
28 | 28 | ./configure --prefix="$prefix" --disable-shared --enable-static --host=$host-apple-darwin |
3 | 3 | ; Some defines |
4 | 4 | !define PRODUCT_NAME "MediaInfo" |
5 | 5 | !define PRODUCT_PUBLISHER "MediaArea.net" |
6 | !define PRODUCT_VERSION "22.06" | |
6 | !define PRODUCT_VERSION "22.09" | |
7 | 7 | !define PRODUCT_VERSION4 "${PRODUCT_VERSION}.0.0" |
8 | 8 | !define PRODUCT_WEB_SITE "http://MediaArea.net/MediaInfo" |
9 | 9 | !define COMPANY_REGISTRY "Software\MediaArea.net" |
3 | 3 | ; Some defines |
4 | 4 | !define PRODUCT_NAME "MediaInfo" |
5 | 5 | !define PRODUCT_PUBLISHER "MediaArea.net" |
6 | !define PRODUCT_VERSION "22.06" | |
6 | !define PRODUCT_VERSION "22.09" | |
7 | 7 | !define PRODUCT_VERSION4 "${PRODUCT_VERSION}.0.0" |
8 | 8 | !define PRODUCT_WEB_SITE "http://MediaArea.net/MediaInfo" |
9 | 9 | !define COMPANY_REGISTRY "Software\MediaArea.net" |
22 | 22 | //--------------------------------------------------------------------------- |
23 | 23 | #include "MediaInfo/Audio/File_Aac.h" |
24 | 24 | #include "MediaInfo/MediaInfo_Config_MediaInfo.h" |
25 | #include <string> | |
26 | using namespace std; | |
25 | 27 | //--------------------------------------------------------------------------- |
26 | 28 | |
27 | 29 | namespace MediaInfoLib |
32 | 34 | //*************************************************************************** |
33 | 35 | |
34 | 36 | 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[]; | |
35 | 39 | |
36 | 40 | //*************************************************************************** |
37 | 41 | // Constructor/Destructor |
63 | 67 | Frame_Count_Valid=0; |
64 | 68 | FrameIsAlwaysComplete=false; |
65 | 69 | Mode=Mode_Unknown; |
70 | ||
71 | //Conformance | |
72 | #if MEDIAINFO_CONFORMANCE | |
73 | SamplingRate=0; | |
74 | #endif | |
66 | 75 | |
67 | 76 | audioObjectType=(int8u)-1; |
68 | 77 | extensionAudioObjectType=(int8u)-1; |
213 | 222 | |
214 | 223 | if (Mode==Mode_ADTS && !ChannelCount_Temp && ChannelPos_Temp && Retrieve_Const(Stream_Audio, 0, Audio_Channel_s_).empty()) |
215 | 224 | 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 | |
216 | 244 | } |
217 | 245 | |
218 | 246 | //*************************************************************************** |
135 | 135 | mode Mode; |
136 | 136 | void AudioSpecificConfig_OutOfBand(int64s sampling_frequency, int8u audioObjectType=(int8u)-1, bool sbrData=false, bool psData=false, bool sbrPresentFlag=false, bool psPresentFlag=false); |
137 | 137 | |
138 | // Conformance | |
139 | #if MEDIAINFO_CONFORMANCE | |
140 | int16u SamplingRate; | |
141 | #endif | |
142 | ||
138 | 143 | //Constructor/Destructor |
139 | 144 | File_Aac(); |
140 | 145 | ~File_Aac(); |
571 | 571 | Frequency_b=Aac_sampling_frequency[sampling_frequency_index]; |
572 | 572 | else |
573 | 573 | 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 | |
574 | 578 | Get_S1 (4, channelConfiguration, "channelConfiguration"); Param_Info1(Aac_ChannelConfiguration[channelConfiguration]); |
575 | 579 | if (audioObjectType==5 || audioObjectType==29) |
576 | 580 | { |
857 | 861 | FillInfosHEAACv2(psData ? __T("Explicit") : __T("NBC")); // "Not Backward Compatible"); |
858 | 862 | else if (psData) |
859 | 863 | 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"); | |
864 | 864 | } |
865 | 865 | |
866 | 866 | //--------------------------------------------------------------------------- |
33 | 33 | namespace MediaInfoLib |
34 | 34 | { |
35 | 35 | |
36 | typedef File_Ac4::dmx::cdmx::gain::type gain; | |
37 | ||
36 | 38 | //*************************************************************************** |
37 | 39 | // Infos |
38 | 40 | //*************************************************************************** |
1055 | 1057 | { -7, -8} |
1056 | 1058 | }; |
1057 | 1059 | |
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 | ||
1058 | 1105 | //*************************************************************************** |
1059 | 1106 | // Constructor/Destructor |
1060 | 1107 | //*************************************************************************** |
1385 | 1432 | Fill_Measure(Stream_Audio, 0, (P+" Downmix LfeMixGain").c_str(), Ztring::ToZtring(10-D.lfe_mixgain).To_UTF8(), " dB"); |
1386 | 1433 | if (D.preferred_dmx_method!=(int8u)-1) |
1387 | 1434 | 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 | } | |
1388 | 1450 | } |
1389 | 1451 | } |
1390 | 1452 | |
4092 | 4154 | Get_S1(2, n_cdmx_configs, "n_cdmx_configs_minus1"); |
4093 | 4155 | n_cdmx_configs++; |
4094 | 4156 | |
4157 | Presentations.back().Dmx.Cdmxs.reserve(n_cdmx_configs); | |
4095 | 4158 | for (int8u Pos=0; Pos<n_cdmx_configs; Pos++) |
4096 | 4159 | { |
4160 | Element_Begin1("cdmx_config"); | |
4097 | 4161 | int8u out_ch_config; |
4098 | 4162 | 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"); | |
4100 | 4164 | 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; | |
4103 | 4170 | cdmx_parameters(bs_ch_config, out_ch_config); |
4171 | Element_End0(); | |
4104 | 4172 | } |
4105 | 4173 | TEST_SB_END(); |
4106 | 4174 | } |
4199 | 4267 | { |
4200 | 4268 | Element_Begin1("tool_scr_to_c_l"); |
4201 | 4269 | 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"); | |
4203 | 4271 | 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"); | |
4205 | 4273 | TESTELSE_SB_END(); |
4206 | 4274 | Element_End0(); |
4207 | 4275 | } |
4210 | 4278 | void File_Ac4::tool_b4_to_b2() |
4211 | 4279 | { |
4212 | 4280 | Element_Begin1("tool_b4_to_b2"); |
4213 | Skip_S1(3, "gain_b_code"); | |
4281 | Get_Gain(3, gain::b_code, "gain_b_code"); | |
4214 | 4282 | Element_End0(); |
4215 | 4283 | } |
4216 | 4284 | |
4218 | 4286 | void File_Ac4::tool_t4_to_t2() |
4219 | 4287 | { |
4220 | 4288 | Element_Begin1("tool_t4_to_t2"); |
4221 | Skip_S1(3, "gain_t1_code"); | |
4289 | Get_Gain(3, gain::t1_code, "gain_t1_code"); | |
4222 | 4290 | Element_End0(); |
4223 | 4291 | } |
4224 | 4292 | |
4227 | 4295 | { |
4228 | 4296 | Element_Begin1("tool_t4_to_f_s_b"); |
4229 | 4297 | 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); | |
4231 | 4300 | TESTELSE_SB_ELSE( "b_top_front_to_front"); |
4232 | 4301 | 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"); | |
4234 | 4303 | 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"); | |
4236 | 4306 | TESTELSE_SB_END(); |
4237 | 4307 | TESTELSE_SB_END(); |
4238 | 4308 | |
4239 | ||
4240 | ||
4241 | 4309 | 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); | |
4243 | 4312 | TESTELSE_SB_ELSE( "b_top_back_to_front"); |
4244 | 4313 | 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"); | |
4246 | 4315 | 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"); | |
4248 | 4318 | TESTELSE_SB_END(); |
4249 | 4319 | TESTELSE_SB_END(); |
4250 | 4320 | Element_End0(); |
4255 | 4325 | { |
4256 | 4326 | Element_Begin1("tool_t4_to_f_s"); |
4257 | 4327 | 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); | |
4259 | 4330 | 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"); | |
4261 | 4332 | TESTELSE_SB_END(); |
4262 | 4333 | |
4263 | 4334 | 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); | |
4265 | 4337 | 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"); | |
4267 | 4339 | TESTELSE_SB_END(); |
4268 | 4340 | Element_End0(); |
4269 | 4341 | } |
4273 | 4345 | { |
4274 | 4346 | Element_Begin1("tool_t2_to_f_s_b"); |
4275 | 4347 | 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); | |
4277 | 4350 | TESTELSE_SB_ELSE( "b_top_to_front"); |
4278 | 4351 | TESTELSE_SB_SKIP( "b_top_to_side"); |
4279 | Skip_S1(3, "gain_t2b_code"); | |
4352 | Get_Gain(3, gain::t2b_code, "gain_t2b_code"); | |
4280 | 4353 | 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"); | |
4282 | 4356 | TESTELSE_SB_END(); |
4283 | 4357 | TESTELSE_SB_END(); |
4284 | 4358 | Element_End0(); |
4289 | 4363 | { |
4290 | 4364 | Element_Begin1("tool_t2_to_f_s"); |
4291 | 4365 | 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); | |
4293 | 4368 | TESTELSE_SB_ELSE( "b_top_to_front"); |
4294 | Skip_S1(3, "gain_t2b_code"); | |
4369 | Get_Gain(3, gain::t2b_code, "gain_t2b_code"); | |
4295 | 4370 | TESTELSE_SB_END(); |
4296 | 4371 | Element_End0(); |
4297 | 4372 | } |
5291 | 5366 | return index+64; |
5292 | 5367 | } |
5293 | 5368 | |
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 | ||
5294 | 5382 | } //NameSpace |
5295 | 5383 | |
5296 | 5384 | #endif //MEDIAINFO_AC4_YES |
151 | 151 | int8u ltrt_surround_mixgain; |
152 | 152 | int8u lfe_mixgain; |
153 | 153 | 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; | |
154 | 178 | |
155 | 179 | dmx() : |
156 | 180 | loro_centre_mixgain((int8u)-1), |
465 | 489 | void ac4_toc_Compute(vector<presentation>& Ps, vector<group>& Gs, bool FromDac4); |
466 | 490 | int8u Superset(int8u Ch_Mode1, int8u Ch_Mode2); |
467 | 491 | int16u Huffman_Decode(const ac4_huffman& Table, const char* Name); |
492 | void Get_Gain(int8u Bits, dmx::cdmx::gain::type Type, const char* Name); | |
468 | 493 | |
469 | 494 | //Temp |
470 | 495 | int32u frame_size; |
28 | 28 | |
29 | 29 | //--------------------------------------------------------------------------- |
30 | 30 | #include "MediaInfo/Setup.h" |
31 | #include <bitset> | |
32 | 31 | //--------------------------------------------------------------------------- |
33 | 32 | |
34 | 33 | //--------------------------------------------------------------------------- |
38 | 37 | //--------------------------------------------------------------------------- |
39 | 38 | #include "MediaInfo/Audio/File_Adm.h" |
40 | 39 | #include "ThirdParty/tfsxml/tfsxml.h" |
40 | #include <bitset> | |
41 | 41 | using namespace ZenLib; |
42 | 42 | using namespace std; |
43 | 43 | //--------------------------------------------------------------------------- |
45 | 45 | namespace MediaInfoLib |
46 | 46 | { |
47 | 47 | |
48 | #define IncoherencyMessage "Incoherency between enums and message strings" | |
49 | ||
48 | 50 | //--------------------------------------------------------------------------- |
49 | 51 | static float32 TimeCodeToFloat(string v) |
50 | 52 | { |
151 | 153 | || (Value >= 'a' && Value <= 'f'); |
152 | 154 | } |
153 | 155 | |
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 | ||
154 | 166 | enum flags { |
155 | 167 | Version0, |
156 | 168 | Version1, |
178 | 190 | int Elements_Count; |
179 | 191 | }; |
180 | 192 | |
181 | enum items { | |
193 | enum item { | |
182 | 194 | item_audioTrack, |
183 | 195 | item_audioProgramme, |
184 | 196 | item_audioContent, |
188 | 200 | item_audioTrackUID, |
189 | 201 | item_audioTrackFormat, |
190 | 202 | item_audioStreamFormat, |
203 | item_audioBlockFormat, | |
204 | item_alternativeValueSet, | |
191 | 205 | item_Max |
192 | 206 | }; |
193 | 207 | |
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 | ||
194 | 240 | enum audioTrack_String { |
241 | audioTrack_audioTrackID, | |
195 | 242 | audioTrack_Summary, |
196 | 243 | audioTrack_String_Max |
197 | 244 | }; |
208 | 255 | audioProgramme_start, |
209 | 256 | audioProgramme_end, |
210 | 257 | 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, | |
211 | 266 | audioProgramme_String_Max |
212 | 267 | }; |
213 | 268 | |
214 | 269 | enum audioProgramme_StringVector { |
215 | 270 | audioProgramme_audioProgrammeLabel, |
216 | 271 | 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, | |
217 | 279 | audioProgramme_StringVector_Max |
218 | 280 | }; |
219 | 281 | |
228 | 290 | enum audioContent_StringVector { |
229 | 291 | audioContent_dialogue, |
230 | 292 | audioContent_audioContentLabel, |
231 | audioContent_integratedLoudness, | |
293 | audioContent_loudnessMetadata, | |
294 | audioContent_loudnessMetadata_integratedLoudness, | |
232 | 295 | audioContent_audioObjectIDRef, |
233 | 296 | audioContent_StringVector_Max |
234 | 297 | }; |
245 | 308 | enum audioObject_StringVector { |
246 | 309 | audioObject_audioPackFormatIDRef, |
247 | 310 | audioObject_audioTrackUIDRef, |
311 | audioObject_audioObjectIDRef, | |
312 | audioObject_audioComplementaryObjectIDRef, | |
248 | 313 | audioObject_StringVector_Max |
249 | 314 | }; |
250 | 315 | |
337 | 402 | { "audioProgrammeLanguage" , (1 << Version0) | (1 << Version1) | (1 << Version2) }, |
338 | 403 | { "start" , (1 << Version0) | (1 << Version1) | (1 << Version2) }, |
339 | 404 | { "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) }, | |
340 | 413 | { "maxDuckingDepth" , (1 << Version0) | (1 << Version1) | (1 << Version2) }, |
341 | 414 | }; |
415 | static_assert(sizeof(audioProgramme_Attributes) / sizeof(attribute_item) == audioProgramme_String_Max, IncoherencyMessage); | |
342 | 416 | |
343 | 417 | static element_item audioProgramme_Elements[] = |
344 | 418 | { |
345 | 419 | { "audioProgrammeLabel" , (1 << Version2) }, |
346 | 420 | { "audioContentIDRef" , (1 << Version0) | (1 << Version1) | (1 << Version2) | (1 << Count1) | (1 << Count2) }, |
347 | 421 | { "loudnessMetadata" , (1 << Version0) | (1 << Version1) | (1 << Version2) }, |
422 | { "integratedLoudness" , (1 << Version0) | (1 << Version1) | (1 << Version2) }, | |
348 | 423 | { "audioProgrammeReferenceScreen" , (1 << Version0) | (1 << Version1) | (1 << Version2) | (1 << Count0) | (1 << Count1) }, |
349 | 424 | { "authoringInformation" , (1 << Version2) | (1 << Count0) | (1 << Count1) }, |
425 | { "referenceLayout" , (1 << Version2) | (1 << Count0) | (1 << Count1) }, | |
426 | { "audioPackFormatIDRef" , (1 << Version2) | (1 << Count0) | (1 << Count1) }, | |
350 | 427 | { "alternativeValueSetIDRef" , (1 << Version2) | (1 << Count0) | (1 << Count1) }, |
351 | 428 | }; |
429 | static_assert(sizeof(audioProgramme_Elements) / sizeof(attribute_item) == audioProgramme_StringVector_Max, IncoherencyMessage); | |
352 | 430 | |
353 | 431 | static element audioProgramme_Element = |
354 | 432 | { |
391 | 469 | size_t StringVectors_Size; |
392 | 470 | }; |
393 | 471 | |
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) { | |
395 | 473 | 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); | |
397 | 475 | F.Fill(Stream_Audio, 0, P.c_str(), Summary.empty() ? __T("Yes") : Summary); |
398 | 476 | F.Fill(Stream_Audio, 0, (P + " Pos").c_str(), i); |
399 | 477 | F.Fill_SetOptions(Stream_Audio, 0, (P + " Pos").c_str(), "N NIY"); |
400 | 478 | return P; |
401 | 479 | } |
402 | 480 | |
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) { | |
404 | 482 | ZtringList SubstreamPos, SubstreamNum; |
405 | 483 | for (size_t j = 0; j < Source.StringVectors[i].size(); j++) { |
406 | 484 | const string& ID = Source.StringVectors[i][j]; |
412 | 490 | } |
413 | 491 | } |
414 | 492 | 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 | } | |
415 | 507 | continue; |
416 | 508 | } |
417 | 509 | SubstreamPos.push_back(Ztring::ToZtring(Pos)); |
426 | 518 | F.Fill(Stream_Audio, 0, (P_And_LinkedTo + "/String").c_str(), SubstreamNum.Read()); |
427 | 519 | F.Fill_SetOptions(Stream_Audio, 0, (P_And_LinkedTo + "/String").c_str(), "Y NIN"); |
428 | 520 | } |
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); | |
429 | 529 | |
430 | 530 | class file_adm_private |
431 | 531 | { |
470 | 570 | void audioFormatExtended(); |
471 | 571 | void frameHeader(); |
472 | 572 | void transportTrackFormat(); |
573 | ||
574 | // Common definitions | |
575 | vector<string> audioChannelFormatIDRefs; | |
473 | 576 | }; |
474 | 577 | |
475 | 578 | void file_adm_private::parse() |
501 | 604 | } \ |
502 | 605 | |
503 | 606 | #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"); \ | |
506 | 609 | } \ |
507 | 610 | } \ |
508 | 611 | if (!tfsxml_enter(&p)) \ |
514 | 617 | } \ |
515 | 618 | |
516 | 619 | #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"); \ | |
519 | 622 | } \ |
520 | 623 | } \ |
521 | 624 | } \ |
526 | 629 | NAME##_Content.Strings[NAME##_##ATTR].assign(tfsxml_decode(v)); \ |
527 | 630 | } \ |
528 | 631 | |
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) \ | |
530 | 639 | else if (!tfsxml_strcmp_charp(b, #ATTR)) { \ |
531 | 640 | } \ |
532 | 641 | |
664 | 773 | if (tfsxml_next(&p, &b)) |
665 | 774 | break; |
666 | 775 | ELEMENT_START(audioProgramme) |
667 | ATTRIBUTE(audioProgramme, audioProgrammeID) | |
776 | ATTRIB_ID(audioProgramme, audioProgrammeID) | |
668 | 777 | ATTRIBUTE(audioProgramme, audioProgrammeName) |
669 | 778 | ATTRIBUTE(audioProgramme, audioProgrammeLanguage) |
670 | 779 | ATTRIBUTE(audioProgramme, start) |
671 | 780 | 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) | |
672 | 790 | ELEMENT_MIDDLE(audioProgramme) |
673 | ELEMENT(audioProgramme, audioContentIDRef) | |
674 | 791 | else if (!tfsxml_strcmp_charp(b, "audioProgrammeLabel")) { |
675 | 792 | string Language; |
676 | 793 | for (;;) { |
687 | 804 | } |
688 | 805 | audioProgramme_Content.StringVectors[audioProgramme_audioProgrammeLabel].push_back(Value); |
689 | 806 | } |
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) | |
690 | 845 | ELEMENT_END(audioProgramme) |
691 | 846 | ELEMENT_START(audioContent) |
692 | ATTRIBUTE(audioContent, audioContentID) | |
847 | ATTRIB_ID(audioContent, audioContentID) | |
693 | 848 | ATTRIBUTE(audioContent, audioContentName) |
694 | 849 | ATTRIBUTE(audioContent, audioContentLanguage) |
695 | 850 | ATTRIBUTE(audioContent, typeLabel) |
789 | 944 | } |
790 | 945 | audioContent_Content.StringVectors[audioContent_audioContentLabel].push_back(Value); |
791 | 946 | } |
792 | if (!tfsxml_strcmp_charp(b, "loudnessMetadata")) { | |
947 | else if (!tfsxml_strcmp_charp(b, "loudnessMetadata")) { | |
793 | 948 | if (!tfsxml_enter(&p)) |
794 | 949 | { |
795 | 950 | for (;;) { |
797 | 952 | break; |
798 | 953 | if (!tfsxml_strcmp_charp(b, "integratedLoudness")) { |
799 | 954 | 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)); | |
801 | 956 | } |
802 | 957 | } |
803 | 958 | } |
805 | 960 | ELEMENT(audioContent, dialogue) |
806 | 961 | ELEMENT_END(audioContent) |
807 | 962 | ELEMENT_START(audioObject) |
808 | ATTRIBUTE(audioObject, audioObjectID) | |
963 | ATTRIB_ID(audioObject, audioObjectID) | |
809 | 964 | ATTRIBUTE(audioObject, audioObjectName) |
810 | 965 | ATTRIBUTE(audioObject, duration) |
811 | 966 | ATTRIBUTE(audioObject, startTime) |
813 | 968 | ELEMENT_MIDDLE(audioObject) |
814 | 969 | ELEMENT(audioObject, audioPackFormatIDRef) |
815 | 970 | ELEMENT(audioObject, audioTrackUIDRef) |
971 | ELEMENT(audioObject, audioObjectIDRef) | |
972 | ELEMENT(audioObject, audioComplementaryObjectIDRef) | |
816 | 973 | ELEMENT_END(audioObject) |
817 | 974 | ELEMENT_START(audioPackFormat) |
818 | ATTRIBUTE(audioPackFormat, audioPackFormatID) | |
975 | ATTRIB_ID(audioPackFormat, audioPackFormatID) | |
819 | 976 | ATTRIBUTE(audioPackFormat, audioPackFormatName) |
820 | 977 | ATTRIBUTE(audioPackFormat, typeDefinition) |
821 | 978 | ATTRIBUTE(audioPackFormat, typeLabel) |
823 | 980 | ELEMENT(audioPackFormat, audioChannelFormatIDRef) |
824 | 981 | ELEMENT_END(audioPackFormat) |
825 | 982 | ELEMENT_START(audioChannelFormat) |
826 | ATTRIBUTE(audioChannelFormat, audioChannelFormatID) | |
983 | ATTRIB_ID(audioChannelFormat, audioChannelFormatID) | |
827 | 984 | ATTRIBUTE(audioChannelFormat, audioChannelFormatName) |
828 | 985 | ATTRIBUTE(audioChannelFormat, typeDefinition) |
829 | 986 | ATTRIBUTE(audioChannelFormat, typeLabel) |
830 | 987 | ELEMENT_MIDDLE(audioChannelFormat) |
831 | 988 | 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 | } | |
832 | 998 | if (!tfsxml_enter(&p)) |
833 | 999 | { |
834 | 1000 | for (;;) { |
869 | 1035 | ELEMENT(audioTrackUID, audioTrackFormatIDRef) |
870 | 1036 | ELEMENT_END(audioTrackUID) |
871 | 1037 | ELEMENT_START(audioTrackFormat) |
872 | ATTRIBUTE(audioTrackFormat, audioTrackFormatID) | |
1038 | ATTRIB_ID(audioTrackFormat, audioTrackFormatID) | |
873 | 1039 | ATTRIBUTE(audioTrackFormat, audioTrackFormatName) |
874 | 1040 | ATTRIBUTE(audioTrackFormat, formatDefinition) |
875 | 1041 | ATTRIBUTE(audioTrackFormat, typeDefinition) |
878 | 1044 | ELEMENT(audioTrackFormat, audioStreamFormatIDRef) |
879 | 1045 | ELEMENT_END(audioTrackFormat) |
880 | 1046 | ELEMENT_START(audioStreamFormat) |
881 | ATTRIBUTE(audioStreamFormat, audioStreamFormatID) | |
1047 | ATTRIB_ID(audioStreamFormat, audioStreamFormatID) | |
882 | 1048 | ATTRIBUTE(audioStreamFormat, audioStreamFormatName) |
883 | 1049 | ATTRIBUTE(audioStreamFormat, formatDefinition) |
884 | 1050 | ATTRIBUTE(audioStreamFormat, formatLabel) |
944 | 1110 | } |
945 | 1111 | } |
946 | 1112 | |
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 | ||
947 | 1233 | //*************************************************************************** |
948 | 1234 | // Constructor/Destructor |
949 | 1235 | //*************************************************************************** |
978 | 1264 | File_Adm_Private->Items[item_audioTrack].Items.erase(File_Adm_Private->Items[item_audioTrack].Items.begin()); |
979 | 1265 | } |
980 | 1266 | |
981 | #define FILL_COUNT(NAME,FIELD) \ | |
1267 | #define FILL_COUNT(NAME) \ | |
982 | 1268 | 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) \ | |
986 | 1272 | for (size_t i = 0; i < File_Adm_Private->Items[item_##NAME].Items.size(); i++) { \ |
987 | 1273 | 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) \ | |
991 | 1282 | 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); \ |
992 | 1283 | |
993 | 1284 | #define FILL_E(NAME,ATTRIBUTE,FIELD) \ |
1065 | 1356 | for (size_t i = 0; i < item_Max; i++) |
1066 | 1357 | TotalCount += File_Adm_Private->Items[i].Items.size(); |
1067 | 1358 | 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); | |
1073 | 1364 | if (Full) |
1074 | 1365 | { |
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); | |
1078 | 1369 | } |
1079 | 1370 | #if MEDIAINFO_ADVANCED |
1080 | 1371 | vector<string> Errors_Field[error_Type_Max]; |
1083 | 1374 | bool WarningError=MediaInfoLib::Config.WarningError(); |
1084 | 1375 | #endif |
1085 | 1376 | |
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) | |
1087 | 1386 | if (Full) |
1088 | 1387 | FILL_A(audioProgramme, audioProgrammeID, "ID"); |
1089 | 1388 | FILL_A(audioProgramme, audioProgrammeName, "Title"); |
1091 | 1390 | FILL_A(audioProgramme, audioProgrammeLanguage, "Language"); |
1092 | 1391 | FILL_A(audioProgramme, start, "Start"); |
1093 | 1392 | FILL_A(audioProgramme, end, "End"); |
1393 | FILL_E(audioProgramme, loudnessMetadata_integratedLoudness, "IntegratedLoudness"); | |
1094 | 1394 | LINK(audioProgramme, "Content", audioContentIDRef, audioContent); |
1395 | LINK(audioProgramme, "PackFormat", authoringInformation_referenceLayout_audioPackFormatIDRef, audioPackFormat); | |
1095 | 1396 | const Ztring& Label = Retrieve_Const(StreamKind_Last, StreamPos_Last, (P + " Label").c_str()); |
1096 | 1397 | if (!Label.empty()) { |
1097 | 1398 | Summary += __T(' '); |
1101 | 1402 | Fill(StreamKind_Last, StreamPos_Last, P.c_str(), Summary, true); |
1102 | 1403 | } |
1103 | 1404 | |
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 | ||
1119 | 1405 | #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 | ||
1129 | 1406 | //TODO: expand this proof of concept |
1130 | 1407 | if (Config_AdmProfile.Ebu3392==1) |
1131 | 1408 | { |
1139 | 1416 | #endif // MEDIAINFO_ADVANCED |
1140 | 1417 | } |
1141 | 1418 | |
1142 | FILL_START(audioContent, audioContentName, "Content") | |
1419 | FILL_START(audioContent, audioContentName) | |
1143 | 1420 | if (Full) |
1144 | 1421 | FILL_A(audioContent, audioContentID, "ID"); |
1145 | 1422 | FILL_A(audioContent, audioContentName, "Title"); |
1146 | 1423 | FILL_E(audioContent, audioContentLabel, "Label"); |
1147 | 1424 | FILL_A(audioContent, audioContentLanguage, "Language"); |
1148 | 1425 | FILL_E(audioContent, dialogue, "Mode"); |
1149 | FILL_E(audioContent, integratedLoudness, "IntegratedLoudness"); | |
1426 | FILL_E(audioContent, loudnessMetadata_integratedLoudness, "IntegratedLoudness"); | |
1150 | 1427 | LINK(audioContent, "Object", audioObjectIDRef, audioObject); |
1151 | 1428 | const Ztring& Label = Retrieve_Const(StreamKind_Last, StreamPos_Last, (P + " Label").c_str()); |
1152 | 1429 | if (!Label.empty()) { |
1158 | 1435 | } |
1159 | 1436 | } |
1160 | 1437 | |
1161 | FILL_START(audioObject, audioObjectName, "Object") | |
1438 | FILL_START(audioObject, audioObjectName) | |
1162 | 1439 | if (Full) |
1163 | 1440 | FILL_A(audioObject, audioObjectID, "ID"); |
1164 | 1441 | FILL_A(audioObject, audioObjectName, "Title"); |
1165 | 1442 | FILL_A(audioObject, startTime, "Start"); |
1166 | 1443 | FILL_A(audioObject, duration, "Duration"); |
1167 | 1444 | LINK(audioObject, "PackFormat", audioPackFormatIDRef, audioPackFormat); |
1445 | LINK(audioObject, "Object", audioObjectIDRef, audioObject); | |
1446 | LINK(audioObject, "ComplementaryObject", audioComplementaryObjectIDRef, audioObject); | |
1168 | 1447 | if (Full) |
1169 | 1448 | LINK(audioObject, "TrackUID", audioTrackUIDRef, audioTrackUID); |
1170 | 1449 | } |
1171 | 1450 | |
1172 | FILL_START(audioPackFormat, audioPackFormatName, "PackFormat") | |
1451 | FILL_START(audioPackFormat, audioPackFormatName) | |
1173 | 1452 | if (Full) |
1174 | 1453 | FILL_A(audioPackFormat, audioPackFormatID, "ID"); |
1175 | 1454 | FILL_A(audioPackFormat, audioPackFormatName, "Title"); |
1200 | 1479 | LINK(audioPackFormat, "ChannelFormat", audioChannelFormatIDRef, audioChannelFormat); |
1201 | 1480 | } |
1202 | 1481 | |
1203 | FILL_START(audioChannelFormat, audioChannelFormatName, "ChannelFormat") | |
1482 | FILL_START(audioChannelFormat, audioChannelFormatName) | |
1204 | 1483 | if (Full) |
1205 | 1484 | FILL_A(audioChannelFormat, audioChannelFormatID, "ID"); |
1206 | 1485 | FILL_A(audioChannelFormat, audioChannelFormatName, "Title"); |
1211 | 1490 | } |
1212 | 1491 | |
1213 | 1492 | if (Full) { |
1214 | FILL_START(audioTrackUID, UID, "TrackUID") | |
1493 | FILL_START(audioTrackUID, UID) | |
1215 | 1494 | FILL_A(audioTrackUID, UID, "ID"); |
1216 | 1495 | FILL_A(audioTrackUID, bitDepth, "BitDepth"); |
1217 | 1496 | FILL_A(audioTrackUID, sampleRate, "SamplingRate"); |
1234 | 1513 | LINK(audioTrackUID, "TrackFormat", audioTrackFormatIDRef, audioTrackFormat); |
1235 | 1514 | } |
1236 | 1515 | |
1237 | FILL_START(audioTrackFormat, audioTrackFormatName, "TrackFormat") | |
1516 | FILL_START(audioTrackFormat, audioTrackFormatName) | |
1238 | 1517 | FILL_A(audioTrackFormat, audioTrackFormatID, "ID"); |
1239 | 1518 | FILL_A(audioTrackFormat, audioTrackFormatName, "Title"); |
1240 | 1519 | FILL_A(audioTrackFormat, formatDefinition, "FormatDefinition"); |
1242 | 1521 | LINK(audioTrackFormat, "StreamFormat", audioStreamFormatIDRef, audioStreamFormat); |
1243 | 1522 | } |
1244 | 1523 | |
1245 | FILL_START(audioStreamFormat, audioStreamFormatName, "StreamFormat") | |
1524 | FILL_START(audioStreamFormat, audioStreamFormatName) | |
1246 | 1525 | FILL_A(audioStreamFormat, audioStreamFormatID, "ID"); |
1247 | 1526 | FILL_A(audioStreamFormat, audioStreamFormatName, "Title"); |
1248 | 1527 | FILL_A(audioStreamFormat, formatDefinition, "Format"); |
1256 | 1535 | if (!File_Adm_Private->Items[item_audioTrack].Items.empty()) |
1257 | 1536 | { |
1258 | 1537 | Fill(Stream_Audio, 0, "Transport0", "Yes"); |
1259 | FILL_START(audioTrack, Summary, "Transport0 TrackIndex") | |
1538 | FILL_START_SUB(audioTrack, Summary, "Transport0 TrackIndex") | |
1260 | 1539 | FILL_E(audioTrack, audioTrackUIDRef, ""); |
1261 | 1540 | if (Full) |
1262 | 1541 | LINK(audioTrack, "TrackUID", audioTrackUIDRef, audioTrackUID); |
1263 | 1542 | } |
1264 | ||
1265 | 1543 | } |
1266 | 1544 | |
1267 | 1545 | if (!Full) |
1268 | 1546 | Fill(Stream_Audio, 0, "PartialDisplay", "Yes"); |
1269 | 1547 | |
1548 | // Errors | |
1270 | 1549 | #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 | |
1271 | 1558 | for (size_t k = 0; k < error_Type_Max; k++) { |
1272 | 1559 | 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 += ' '; | |
1274 | 1563 | 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]); | |
1276 | 1583 | } |
1277 | 1584 | } |
1278 | 1585 | } |
21 | 21 | |
22 | 22 | //--------------------------------------------------------------------------- |
23 | 23 | #include "MediaInfo/Audio/File_Iab.h" |
24 | using namespace std; | |
24 | 25 | //--------------------------------------------------------------------------- |
25 | 26 | |
26 | 27 | namespace MediaInfoLib |
30 | 31 | // Infos |
31 | 32 | //*************************************************************************** |
32 | 33 | |
34 | //--------------------------------------------------------------------------- | |
33 | 35 | const int32u Iab_SampleRate[4]= |
34 | 36 | { |
35 | 37 | 48000, |
38 | 40 | 0, |
39 | 41 | }; |
40 | 42 | |
43 | //--------------------------------------------------------------------------- | |
41 | 44 | const int8u Iab_BitDepth[4]= |
42 | 45 | { |
43 | 46 | 16, |
46 | 49 | 0, |
47 | 50 | }; |
48 | 51 | |
49 | const float32 Iab_FrameRate[16] = | |
52 | //--------------------------------------------------------------------------- | |
53 | const float32 Iab_FrameRate[16]= | |
50 | 54 | { |
51 | 55 | 24, |
52 | 56 | 25, |
66 | 70 | 0, |
67 | 71 | }; |
68 | 72 | |
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 | } | |
69 | 120 | //*************************************************************************** |
70 | 121 | // Constructor/Destructor |
71 | 122 | //*************************************************************************** |
92 | 143 | //--------------------------------------------------------------------------- |
93 | 144 | File_Iab::~File_Iab() |
94 | 145 | { |
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 | } | |
95 | 457 | } |
96 | 458 | |
97 | 459 | //*************************************************************************** |
139 | 501 | |
140 | 502 | //Filling |
141 | 503 | Header_Fill_Size(Element_Offset+IAFrameLength); |
142 | Header_Fill_Code(0, "IAFrame"); | |
504 | Header_Fill_Code(0, "IAB"); | |
143 | 505 | } |
144 | 506 | else |
145 | 507 | { |
146 | Get_Flex8 (ElementID, "ElementID"); | |
147 | Get_Flex8 (ElementSize, "ElementSize"); | |
508 | Get_Plex8 (ElementID, "ElementID"); | |
509 | Get_Plex8 (ElementSize, "ElementSize"); | |
148 | 510 | |
149 | 511 | //Filling |
150 | 512 | Header_Fill_Size(Element_Offset+ElementSize); |
165 | 527 | //Parsing |
166 | 528 | switch (Element_Code) |
167 | 529 | { |
168 | case 0x00000008: Element_Name("Frame"); FrameHeader(); break; | |
530 | case 0x00000008: Element_Name("IAFrame"); IAFrame(); break; | |
169 | 531 | 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; | |
171 | 535 | default: Element_Name(Ztring().From_CC4((int32u)Element_Code)); Skip_XX(Element_Size, "Data"); |
172 | 536 | } |
173 | ||
174 | //Finish(); | |
175 | } | |
176 | ||
177 | //--------------------------------------------------------------------------- | |
178 | void File_Iab::FrameHeader() | |
537 | } | |
538 | ||
539 | //--------------------------------------------------------------------------- | |
540 | void File_Iab::IAFrame() | |
179 | 541 | { |
180 | 542 | //Parsing |
181 | Element_Begin1("Frame Header"); | |
182 | 543 | int32u MaxRendered, SubElementCount; |
183 | Get_B1 (Version, "Version"); | |
544 | Get_B1 (Version, "Version"); | |
184 | 545 | if (Version==1) |
185 | 546 | { |
186 | 547 | BS_Begin(); |
188 | 549 | Get_S1 (2, BitDepth, "BitDepth"); Param_Info2C(Iab_BitDepth[BitDepth], Iab_BitDepth[BitDepth], " bits"); |
189 | 550 | Get_S1 (4, FrameRate, "FrameRate"); Param_Info2C(Iab_FrameRate[FrameRate], Iab_FrameRate[FrameRate], " FPS"); |
190 | 551 | 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"); | |
194 | 554 | Element_ThisIsAList(); |
555 | if (Frame_Count+1<Frame_Count_Valid) | |
556 | Objects.clear(); | |
195 | 557 | } |
196 | 558 | else |
197 | 559 | Skip_XX(Element_Size-Element_Offset, "Unknown"); |
203 | 565 | FILLING_END(); |
204 | 566 | } |
205 | 567 | |
206 | ||
207 | 568 | //--------------------------------------------------------------------------- |
208 | 569 | void File_Iab::BedDefinition() |
209 | 570 | { |
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(); | |
210 | 722 | } |
211 | 723 | |
212 | 724 | //--------------------------------------------------------------------------- |
213 | 725 | void File_Iab::BedRemap() |
214 | 726 | { |
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) | |
219 | 791 | { |
220 | 792 | //Element size |
221 | 793 | int8u Info8; |
24 | 24 | public : |
25 | 25 | //In |
26 | 26 | int64u Frame_Count_Valid; |
27 | ||
27 | 28 | //Constructor/Destructor |
28 | 29 | File_Iab(); |
29 | 30 | ~File_Iab(); |
31 | ||
32 | //Extra | |
33 | void Streams_Fill_ForAdm(); | |
30 | 34 | |
31 | 35 | private : |
32 | 36 | //Streams management |
37 | 41 | void Data_Parse(); |
38 | 42 | |
39 | 43 | //Elements |
40 | void FrameHeader(); | |
44 | void IAFrame(); | |
41 | 45 | void BedDefinition(); |
46 | void ObjectDefinition(); | |
42 | 47 | void BedRemap(); |
48 | void AudioDataPCM(); | |
43 | 49 | |
44 | 50 | //Temp |
45 | 51 | int8u Version; |
46 | 52 | int8u SampleRate; |
47 | 53 | int8u BitDepth; |
48 | 54 | int8u FrameRate; |
55 | struct object | |
56 | { | |
57 | vector<int32u> ChannelLayout; | |
58 | }; | |
59 | vector<object> Objects; | |
49 | 60 | |
50 | 61 | //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); } | |
52 | 66 | }; |
53 | 67 | |
54 | 68 | } //NameSpace |
345 | 345 | //--------------------------------------------------------------------------- |
346 | 346 | void File_Mpega::Streams_Fill() |
347 | 347 | { |
348 | File__Tags_Helper::Stream_Prepare(Stream_Audio); | |
349 | Fill(Stream_Audio, 0, Audio_Format, "MPEG Audio"); | |
350 | if (!Frame_Count) | |
351 | return; | |
352 | ||
348 | 353 | //VBR detection without header |
349 | 354 | if (VBR_Frames==0) |
350 | 355 | { |
353 | 358 | BitRate_Mode=__T("VBR"); |
354 | 359 | } |
355 | 360 | |
356 | File__Tags_Helper::Stream_Prepare(Stream_Audio); | |
357 | Fill(Stream_Audio, 0, Audio_Format, "MPEG Audio"); | |
358 | 361 | Fill(Stream_Audio, 0, Audio_Format_Version, Mpega_Format_Profile_Version[ID]); |
359 | 362 | Fill(Stream_Audio, 0, Audio_Format_Profile, Mpega_Format_Profile_Layer[layer]); |
360 | 363 | if (mode && mode<4) |
261 | 261 | //In |
262 | 262 | MustParse_mhaC=false; |
263 | 263 | MustParse_mpegh3daFrame=false; |
264 | #if MEDIAINFO_CONFORMANCE | |
265 | ConformanceFlags.set(MpegH); | |
266 | #endif | |
264 | 267 | |
265 | 268 | //Temp |
266 | 269 | audioSceneInfoID=0; |
620 | 623 | //--------------------------------------------------------------------------- |
621 | 624 | void File_Mpegh3da::Streams_Finish() |
622 | 625 | { |
626 | Streams_Finish_Conformance(); | |
623 | 627 | } |
624 | 628 | |
625 | 629 | //*************************************************************************** |
84 | 84 | channelConfiguration=(int8u)-1; |
85 | 85 | sampling_frequency_index=(int8u)-1; |
86 | 86 | extension_sampling_frequency_index=(int8u)-1; |
87 | ||
88 | #if MEDIAINFO_CONFORMANCE | |
89 | Profile=AudioProfile_Max; | |
90 | #endif | |
87 | 91 | } |
88 | 92 | |
89 | 93 | //--------------------------------------------------------------------------- |
90 | 94 | File_Usac::~File_Usac() |
91 | 95 | { |
92 | 96 | } |
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 | |
93 | 135 | |
94 | 136 | //*************************************************************************** |
95 | 137 | // Elements - USAC |
105 | 147 | int8u coreSbrFrameLengthIndex; |
106 | 148 | bool usacConfigExtensionPresent; |
107 | 149 | 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; | |
108 | 151 | if (sampling_frequency_index==Aac_sampling_frequency_Size_Usac) |
109 | 152 | { |
110 | 153 | int32u samplingFrequency; |
111 | 154 | Get_S3 (24, samplingFrequency, "usacSamplingFrequency"); |
112 | Frequency_b=samplingFrequency; | |
155 | Frequency_b2=samplingFrequency; | |
113 | 156 | sampling_frequency_index=Aac_AudioSpecificConfig_sampling_frequency_index(Frequency_b); |
114 | 157 | } |
115 | 158 | 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 | |
117 | 164 | Get_S1 (3, coreSbrFrameLengthIndex, "coreSbrFrameLengthIndex"); |
118 | 165 | Get_S1 (5, channelConfiguration, "channelConfiguration"); Param_Info1C(channelConfiguration, Aac_ChannelLayout_GetString(channelConfiguration)); |
119 | 166 | if (!channelConfiguration) |
178 | 225 | string FieldPrefix; |
179 | 226 | if (Prefix) |
180 | 227 | { |
181 | FieldPrefix+=Prefix; | |
228 | FieldPrefix += Prefix; | |
182 | 229 | FieldPrefix += ' '; |
183 | 230 | } |
184 | 231 | string FieldSuffix; |
185 | 232 | |
186 | bool DefaultIdPresent=false; | |
187 | for (int8u i=0; i<2; i++) | |
233 | bool DefaultIdPresent = false; | |
234 | for (int8u i = 0; i < 2; i++) | |
188 | 235 | { |
189 | 236 | if (i) |
190 | FieldSuffix="_Album"; | |
237 | FieldSuffix = "_Album"; | |
191 | 238 | if (!loudnessInfo_Data[i].empty()) |
192 | 239 | { |
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 | |
195 | 242 | } |
196 | 243 | ZtringList Ids; |
197 | 244 | ZtringList SamplePeakLevel; |
198 | 245 | ZtringList TruePeakLevel; |
199 | 246 | 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) | |
201 | 248 | { |
202 | 249 | Ids.push_back(Item->first); |
203 | 250 | SamplePeakLevel.push_back(Item->second.SamplePeakLevel); |
204 | 251 | TruePeakLevel.push_back(Item->second.TruePeakLevel); |
205 | for (int8u j=1; j<16; j++) | |
252 | for (int8u j = 1; j < 16; j++) | |
206 | 253 | Measurements[j].push_back(Item->second.Measurements.Values[j]); |
207 | 254 | } |
208 | if (Ids.size()>=1 && Ids.front().empty()) | |
255 | if (Ids.size() >= 1 && Ids.front().empty()) | |
209 | 256 | { |
210 | 257 | if (!i) |
211 | DefaultIdPresent=true; | |
212 | if (Ids.size()==1) | |
258 | DefaultIdPresent = true; | |
259 | if (Ids.size() == 1) | |
213 | 260 | Ids.clear(); |
214 | 261 | } |
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++) | |
218 | 265 | { |
219 | 266 | string Field; |
220 | if (j<=LoudnessMeaning_Size) | |
221 | Field=LoudnessMeaning[j-1]; | |
267 | if (j <= LoudnessMeaning_Size) | |
268 | Field = LoudnessMeaning[j - 1]; | |
222 | 269 | 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 | |
252 | 312 | } |
253 | 313 | |
254 | 314 | //--------------------------------------------------------------------------- |
470 | 530 | int8u downmixInstructionsCount, drcCoefficientsBasicCount, drcInstructionsBasicCount, drcCoefficientsUniDrcCount, drcInstructionsUniDrcCount; |
471 | 531 | TEST_SB_SKIP( "sampleRatePresent"); |
472 | 532 | Skip_S3(18, "bsSampleRate"); |
533 | Fill(Stream_Audio, 0, "bsSampleRate", "bsSampleRate"); | |
473 | 534 | TEST_SB_END(); |
474 | 535 | Get_S1 (7, downmixInstructionsCount, "downmixInstructionsCount"); |
475 | 536 | TESTELSE_SB_SKIP( "drcDescriptionBasicPresent"); |
15 | 15 | //--------------------------------------------------------------------------- |
16 | 16 | |
17 | 17 | //--------------------------------------------------------------------------- |
18 | #ifdef MEDIAINFO_MPEG4_YES | |
19 | #include "MediaInfo/Multiple/File_Mpeg4_Descriptors.h" | |
20 | #endif | |
18 | 21 | #include "MediaInfo/File__Analyze.h" |
22 | #include "MediaInfo/TimeCode.h" | |
19 | 23 | //--------------------------------------------------------------------------- |
20 | 24 | |
21 | 25 | namespace MediaInfoLib |
71 | 75 | int8u sampling_frequency_index; |
72 | 76 | int8u extension_sampling_frequency_index; |
73 | 77 | |
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 | ||
74 | 118 | struct drc_info |
75 | 119 | { |
76 | 120 | string drcSetEffectTotal; |
1396 | 1396 | } |
1397 | 1397 | |
1398 | 1398 | 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"); | |
1400 | 1400 | |
1401 | 1401 | if (Is1_5) |
1402 | 1402 | Child->XmlCommentOut="(timecodeFormat not in XSD)"; |
984 | 984 | } |
985 | 985 | |
986 | 986 | 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"); | |
988 | 988 | |
989 | 989 | ToReturn+=__T("\t\t\t\t</ebucore:timecodeFormat>\n"); |
990 | 990 |
52 | 52 | } |
53 | 53 | |
54 | 54 | //--------------------------------------------------------------------------- |
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) | |
56 | 56 | { |
57 | 57 | Ztring ToReturn; |
58 | 58 | ToReturn+=__T("<table border='0' cellborder='0' cellspacing='0'>"); |
60 | 60 | ToReturn+=__T("<td colspan='2' bgcolor='")+HBG+__T("'>"); |
61 | 61 | ToReturn+=__T("<font color='")+HFG+__T("'>"); |
62 | 62 | ToReturn+=__T("<b>")+XML_Encode(MI.Get(StreamKind, StreamPos, Element, Info_Name_Text))+__T("</b>"); |
63 | ToReturn+=__T("<br/>"); | |
64 | 63 | 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 | } | |
72 | 75 | ToReturn+=__T("</font>"); |
73 | 76 | ToReturn+=__T("</td>"); |
74 | 77 | ToReturn+=__T("</tr>"); |
241 | 244 | Temp+=NewLine(Level++)+Stream+__T("_")+Object+__T(" ["); \ |
242 | 245 | Temp+=NewLine(Level)+__T("shape=plaintext"); \ |
243 | 246 | 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); \ | |
245 | 248 | Temp+=__T(">");\ |
246 | 249 | Temp+=NewLine(--Level)+__T("]"); |
247 | 250 | |
252 | 255 | Linked##NAME##s.Write(MI.Get(Stream_Audio, StreamPos, Object+__T(" LinkedTo_" #NAME "_Pos"), Info_Text)); \ |
253 | 256 | for (size_t NAME##Pos=0; NAME##Pos<Linked##NAME##s.size(); NAME##Pos++) \ |
254 | 257 | 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\"]"))); \ | |
255 | 267 | } |
256 | 268 | |
257 | 269 | #define OBJECT_END() \ |
463 | 475 | Ztring Export_Graph::Adm_Graph(MediaInfo_Internal &MI, size_t StreamPos, size_t Level) |
464 | 476 | { |
465 | 477 | 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")) | |
467 | 480 | return ToReturn; |
468 | 481 | |
469 | 482 | Ztring Format=__T("ADM"); |
482 | 495 | |
483 | 496 | OBJECT_START(Programme, "NumberOfProgrammes", "#000000", "#c5cae9", "#ffffff", "#303f9f") |
484 | 497 | OBJECT_LINK_TO(Content, "#c5cae9") |
498 | OBJECT_LINK_TO(PackFormat, "#c5cae9") | |
485 | 499 | OBJECT_END() |
486 | 500 | |
487 | 501 | OBJECT_START(Content, "NumberOfContents", "#000000", "#bbdefb", "#ffffff", "#1976d2") |
489 | 503 | OBJECT_END() |
490 | 504 | |
491 | 505 | OBJECT_START(Object, "NumberOfObjects", "#000000", "#b3e5fc", "#ffffff", "#0288d1") |
506 | OBJECT_LINK_TO(Object, "black") | |
507 | OBJECT_LINK_TO2(Object, ComplementaryObject, "black") | |
492 | 508 | OBJECT_LINK_TO(PackFormat, "#b3e5fc") |
493 | 509 | if (MediaInfoLib::Config.Graph_Adm_ShowTrackUIDs_Get()) |
494 | 510 | OBJECT_LINK_TO(TrackUID, "#b3e5fc") |
626 | 642 | if (!Temp.empty()) |
627 | 643 | ToReturn+=Temp; |
628 | 644 | 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>>]"); | |
630 | 646 | ToReturn+=__T("\n}"); |
631 | 647 | |
632 | 648 | #ifdef MEDIAINFO_GRAPHVIZ_YES |
187 | 187 | return; |
188 | 188 | } |
189 | 189 | else if (CC4(Buffer)==0x504C5646) {Format=__T("PlayLater Video");} |
190 | else if (CC4(Buffer)==CC4("")) {Format=__T("");} | |
191 | 190 | |
192 | 191 | if (Format.empty()) |
193 | 192 | { |
1315 | 1315 | Text_DisplayAspectRatio_Original_String, |
1316 | 1316 | Text_FrameRate_Mode, |
1317 | 1317 | Text_FrameRate_Mode_String, |
1318 | Text_FrameRate_Mode_Original, | |
1319 | Text_FrameRate_Mode_Original_String, | |
1318 | 1320 | Text_FrameRate, |
1319 | 1321 | Text_FrameRate_String, |
1320 | 1322 | Text_FrameRate_Num, |
1327 | 1329 | Text_FrameRate_Maximum_String, |
1328 | 1330 | Text_FrameRate_Original, |
1329 | 1331 | Text_FrameRate_Original_String, |
1332 | Text_FrameRate_Original_Num, | |
1333 | Text_FrameRate_Original_Den, | |
1330 | 1334 | Text_FrameCount, |
1331 | 1335 | Text_ElementCount, |
1332 | 1336 | Text_Source_FrameCount, |
1600 | 1604 | Other_TimeCode_LastFrame, |
1601 | 1605 | Other_TimeCode_DropFrame, |
1602 | 1606 | Other_TimeCode_Settings, |
1603 | Other_TimeCode_Striped, | |
1604 | Other_TimeCode_Striped_String, | |
1607 | Other_TimeCode_Stripped, | |
1608 | Other_TimeCode_Stripped_String, | |
1605 | 1609 | Other_TimeCode_Source, |
1606 | 1610 | Other_StreamSize, |
1607 | 1611 | Other_StreamSize_String, |
1308 | 1308 | Fill(StreamKind, StreamPos, FrameRate_Num, Value*1000, 0, Replace); |
1309 | 1309 | Fill(StreamKind, StreamPos, FrameRate_Den, 1000, 10, Replace); |
1310 | 1310 | } |
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 | } | |
1311 | 1316 | } |
1312 | 1317 | } |
1313 | 1318 | |
1883 | 1888 | Channels_Temp[3]=Retrieve(Stream_Audio, StreamPos_To, Audio_ChannelPositions_String2); |
1884 | 1889 | Channels_Temp[1]=Retrieve(Stream_Audio, StreamPos_To, Audio_ChannelLayout); |
1885 | 1890 | } |
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 | } | |
1886 | 1898 | if (ToAdd.Retrieve(StreamKind, StreamPos_From, Fill_Parameter(StreamKind, Generic_Delay_Source))==__T("Container")) |
1887 | 1899 | { |
1888 | 1900 | Fill(StreamKind, StreamPos_To, "Delay_Original", Retrieve(StreamKind, StreamPos_To, "Delay"), true); |
2074 | 2086 | Fill_SetOptions(Stream_Audio, StreamPos_To, Original.c_str(), Retrieve_Const(Stream_Audio, StreamPos_To, AudioField[i], Info_Options).To_UTF8().c_str()); |
2075 | 2087 | Fill(Stream_Audio, StreamPos_To, AudioField[i], Channels_Temp[i], true); |
2076 | 2088 | } |
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 | } | |
2077 | 2114 | } |
2078 | 2115 | if (!Delay_Source_Temp.empty() && Delay_Source_Temp!=Retrieve(StreamKind, StreamPos_To, "Delay_Source")) |
2079 | 2116 | { |
2908 | 2945 | const auto& FrameRate_Den=Retrieve_Const(StreamKind, StreamPos, Fill_Parameter(StreamKind, Generic_FrameRate_Den)); |
2909 | 2946 | if (!FrameRate.empty() |
2910 | 2947 | && !FrameRate_Num.empty() |
2911 | && !FrameRate_Den.empty()) | |
2948 | && !FrameRate_Den.empty() | |
2949 | && FrameRate_Den.To_int32u()!=1) | |
2912 | 2950 | List2[List2.size()-1]=MediaInfoLib::Config.Language_Get(FrameRate+__T(" (")+FrameRate_Num+__T("/")+FrameRate_Den+__T(")"), __T(" fps")); |
2913 | 2951 | } |
2914 | 2952 | if (StreamKind==Stream_Video |
2915 | 2953 | && Parameter==Video_FrameRate_Original |
2916 | 2954 | && !Retrieve(StreamKind, StreamPos, Video_FrameRate_Original).empty() |
2917 | 2955 | && !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) | |
2919 | 2958 | 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")); | |
2920 | 2966 | |
2921 | 2967 | //Special cases - 120 fps 24/30 mode |
2922 | 2968 | if (StreamKind==Stream_Video |
1254 | 1254 | if (!Z1.empty()) |
1255 | 1255 | Fill(Stream_Audio, Pos, Audio_BitRate_Mode, Z1); |
1256 | 1256 | } |
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 | } | |
1257 | 1263 | } |
1258 | 1264 | |
1259 | 1265 | //--------------------------------------------------------------------------- |
135 | 135 | { |
136 | 136 | |
137 | 137 | //--------------------------------------------------------------------------- |
138 | const Char* MediaInfo_Version=__T("MediaInfoLib - v22.06"); | |
138 | const Char* MediaInfo_Version=__T("MediaInfoLib - v22.09"); | |
139 | 139 | const Char* MediaInfo_Url=__T("http://MediaArea.net/MediaInfo"); |
140 | 140 | Ztring EmptyZtring; //Use it when we can't return a reference to a true Ztring |
141 | 141 | const Ztring EmptyZtring_Const; //Use it when we can't return a reference to a true Ztring, const version |
178 | 178 | ": ;: \n" |
179 | 179 | "3D;3D\n" |
180 | 180 | "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" | |
181 | 184 | "608_Mode;EIA-608 conversion mode\n" |
185 | "7.1.2ch;7.1.2\n" | |
186 | "7.1ch;7.1\n" | |
182 | 187 | "About;About\n" |
183 | 188 | "About_Hint;How to contact me and find last version\n" |
184 | 189 | "Accompaniment;Accompaniment\n" |
226 | 231 | "AudioSceneInfoID;Audio scene info ID\n" |
227 | 232 | "AudioTrackLayout;Audio Track Layout\n" |
228 | 233 | "Author;Author\n" |
234 | "Back4ToBack2;Four backs to two backs\n" | |
235 | "Balance_FrontBackListener;Front/back listener balance\n" | |
229 | 236 | "Balance_FrontBackOverheadFloor;Front/back overhead/floor balance\n" |
230 | "Balance_FrontBackListener;Front/back listener balance\n" | |
231 | 237 | "BarCode;BarCode\n" |
232 | 238 | "Basic;Basic\n" |
233 | 239 | "Basic_Note;Note : for more information about this file, you must select a different view (Sheet, Tree...)\n" |
252 | 258 | "Channel(s);Channel(s)\n" |
253 | 259 | "ChannelCoded;Channel coded\n" |
254 | 260 | "ChannelConfiguration;Channel configuration\n" |
261 | "ChannelFormat;Channel format\n" | |
255 | 262 | "ChannelLayout;Channel layout\n" |
256 | 263 | "ChannelMode;Channel mode\n" |
257 | 264 | "ChannelPositions;Channel positions\n" |
308 | 315 | "Comment;Comment\n" |
309 | 316 | "CommissionedBy;Commissioned by\n" |
310 | 317 | "Compilation;Compilation\n" |
318 | "ComplementaryObject;Complementary object\n" | |
311 | 319 | "CompleteName;Complete name\n" |
312 | 320 | "CompletionDate;Completion Date\n" |
313 | 321 | "ComplexityIndex;Complexity index\n" |
318 | 326 | "Compression_Ratio;Compression ratio\n" |
319 | 327 | "Conductor;Conductor\n" |
320 | 328 | "ConformanceCheck;Conformance check\n" |
329 | "ConformanceErrors;Conformance errors\n" | |
330 | "ConformanceWarnings;Conformance warnings\n" | |
331 | "ConformanceInfos;Conformance information\n" | |
321 | 332 | "ContactEmail;Contact Email\n" |
322 | 333 | "ContactTelephoneNumber;Contact Telephone Number\n" |
323 | 334 | "Container and general information;Container and general information\n" |
335 | "Content;Content\n" | |
324 | 336 | "ContentType;ContentType\n" |
325 | 337 | "CoProducer;Coproducer\n" |
326 | 338 | "Copyright;Copyright\n" |
335 | 347 | "Cover_Type;Cover type\n" |
336 | 348 | "Cropped;Crop dimensions\n" |
337 | 349 | "Custom;Custom\n" |
350 | "CustomDownmixTargets;Custom downmix targets\n" | |
338 | 351 | "Customize;Customize\n" |
339 | 352 | "Date;Date\n" |
340 | 353 | "Debug;Debug\n" |
360 | 373 | "DisplayAspectRatio_Original;Original display aspect ratio\n" |
361 | 374 | "DistributedBy;Distributed by\n" |
362 | 375 | "Distributor;Distributor\n" |
376 | "Dolby_Atmos_Metadata;Dolby Atmos metadata\n" | |
363 | 377 | "DolbyAtmos;Dolby Atmos\n" |
364 | "Dolby_Atmos_Metadata;Dolby Atmos metadata\n" | |
365 | 378 | "Donate;Donate\n" |
366 | 379 | "DotsPerInch;Dots per inch\n" |
367 | 380 | "Downmix;Downmix\n" |
381 | "Downmix_5.1.x;5.1 and 5.1.x downmix\n" | |
368 | 382 | "Downmix_5to2;5.1 to 2.0 downmix\n" |
369 | "Downmix_5.1.x;5.1 and 5.1.x downmix\n" | |
370 | 383 | "DrcSets_Count;DRC set count\n" |
371 | 384 | "DrcSets_Effects;DRC effect type(s)\n" |
372 | 385 | "Duration;Duration\n" |
375 | 388 | "Duration_Start;Start time\n" |
376 | 389 | "Duration_Start_Command;Start time (commands)\n" |
377 | 390 | "Duration_Start2End;Duration of the visible content\n" |
391 | "DynamicObject;Dynamic object\n" | |
378 | 392 | "DynamicRangeControl;Dynamic Range Control\n" |
379 | 393 | "Eac3DrcProfile;E-AC-3 DRC profile\n" |
380 | 394 | "Edit;Edit\n" |
381 | 395 | "EditedBy;Edited by\n" |
382 | 396 | "EditorialClassification;Editorial classification\n" |
397 | "ElementaryStream;Elementary stream\n" | |
383 | 398 | "ElementCount;Count of elements\n" |
384 | 399 | "EMail;E-Mail\n" |
385 | 400 | "Encoded_Application;Writing application\n" |
429 | 444 | "Format;Format\n" |
430 | 445 | "Format_Commercial;Commercial name\n" |
431 | 446 | "Format_Commercial_IfAny;Commercial name\n" |
447 | "Format_Compression;Compression\n" | |
432 | 448 | "Format_Description;Format description\n" |
433 | 449 | "Format_Info;Details for format\n" |
434 | 450 | "Format_Level;Format level\n" |
462 | 478 | "Format_Tier;Format tier\n" |
463 | 479 | "Format_Url;Weblink for format\n" |
464 | 480 | "Format_Version;Format version\n" |
481 | "FormatDefinition;Format definition\n" | |
465 | 482 | "FpaManufacturer;FPA Manufacturer\n" |
466 | 483 | "FpaPass;FPA Pass\n" |
467 | 484 | "FpaVersion;FPA Version\n" |
561 | 578 | "Genre_081;Folk-Rock\n" |
562 | 579 | "Genre_082;National Folk\n" |
563 | 580 | "Genre_083;Swing\n" |
564 | "Genre_084;Fast-Fusion\n" | |
581 | "Genre_084;Fast Fusion\n" | |
565 | 582 | "Genre_085;Bebop\n" |
566 | 583 | "Genre_086;Latin\n" |
567 | 584 | "Genre_087;Revival\n" |
701 | 718 | "ImmersiveStereo;Immersive stereo\n" |
702 | 719 | "Info;Info\n" |
703 | 720 | "Instruments;Instruments\n" |
721 | "IntegratedLoudness;Integrated loudness\n" | |
704 | 722 | "IntegratedLoudness_Level;Integrated loudness (level gated)\n" |
705 | 723 | "IntegratedLoudness_Speech;Integrated loudness (speech gated)\n" |
706 | 724 | "InteractivityEnabled;Interactivity enabled\n" |
934 | 952 | "LineUpStart;Line Up Start\n" |
935 | 953 | "LinkedTo_Bed_Pos;Bed #s\n" |
936 | 954 | "LinkedTo_ChannelFormat_Pos;Channel format #s\n" |
955 | "LinkedTo_ComplementaryObject_Pos;Complementary object #s\n" | |
937 | 956 | "LinkedTo_Content_Pos;Content #s\n" |
938 | 957 | "LinkedTo_Group_Pos;Group #s\n" |
939 | 958 | "LinkedTo_Object_Pos;Object #s\n" |
940 | 959 | "LinkedTo_PackFormat_Pos;Pack format #s\n" |
941 | 960 | "LinkedTo_SignalGroup_Pos;Signal group #s\n" |
961 | "LinkedTo_StreamFormat_Pos;Stream format #s\n" | |
942 | 962 | "LinkedTo_Substream_Pos;Substream #s\n" |
943 | 963 | "LinkedTo_TrackFormat_Pos;Track format #s\n" |
944 | 964 | "LinkedTo_TrackUID_Pos;Track UID #s\n" |
1021 | 1041 | "NumberOfPackFormats;Number of pack formats\n" |
1022 | 1042 | "NumberOfPresentations;Number of presentations\n" |
1023 | 1043 | "NumberOfProgrammes;Number of programmes\n" |
1044 | "NumberOfStreamFormats;Number of stream formats\n" | |
1024 | 1045 | "NumberOfSubstreams;Number of substreams\n" |
1046 | "NumberOfTrackFormats;Number of track formats\n" | |
1025 | 1047 | "NumberOfTrackUIDs;Number of track UIDs\n" |
1026 | "NumberOfTrackFormats;Number of track formats\n" | |
1027 | "NumberOfStreamFormats;Number of stream formats\n" | |
1028 | 1048 | "NumColors;Number of colors\n" |
1049 | "Object;Object\n" | |
1029 | 1050 | "ObjectCount;Object Count\n" |
1030 | 1051 | "OK;OK\n" |
1031 | 1052 | "One output file per input file;One output file per input file\n" |
1088 | 1109 | "OverallBitRate_Mode;Overall bit rate mode\n" |
1089 | 1110 | "OverallBitRate_Nominal;Nominal Overall bit rate\n" |
1090 | 1111 | "PackageName;Package name\n" |
1112 | "PackFormat;Pack format\n" | |
1091 | 1113 | "Part;Part\n" |
1092 | 1114 | "Part_Count;Total count\n" |
1093 | 1115 | "PartNumber;Part Number\n" |
1117 | 1139 | "PreferredDownmix;Preferred downmix\n" |
1118 | 1140 | "PreselectionLabel;Preselection label\n" |
1119 | 1141 | "Presentation;Presentation\n" |
1142 | "Presentation;Presentation\n" | |
1120 | 1143 | "PresentationConfig;Presentation config\n" |
1121 | 1144 | "PresentationConfig_ContentClassifier;Presentation config from content classifiers\n" |
1122 | 1145 | "PresentationID;Presentation ID\n" |
1128 | 1151 | "ProductionNumber;Production Number\n" |
1129 | 1152 | "ProductionStudio;Production studio\n" |
1130 | 1153 | "ProductPlacement;Product Placement\n" |
1154 | "Programme;Programme\n" | |
1131 | 1155 | "ProgrammeHasText;Programme Has Text\n" |
1132 | 1156 | "ProgrammeTextLanguage;Programme Text Language\n" |
1133 | 1157 | "ProgrammeTitle;Programme Title\n" |
1161 | 1185 | "ScanType_Original;Original scan type\n" |
1162 | 1186 | "ScanType_StoreMethod;Scan type, store method\n" |
1163 | 1187 | "ScreenplayBy;Screenplay by\n" |
1188 | "ScreenToCenter;Screen to center\n" | |
1189 | "ScreenToFront;Screen to front\n" | |
1164 | 1190 | "Season;Season\n" |
1165 | 1191 | "SecondaryAudioLanguage;Secondary Audio Language\n" |
1166 | 1192 | "see below;see below\n" |
1207 | 1233 | "Stream;Stream\n" |
1208 | 1234 | "Stream_MoreInfo;More information about the stream\n" |
1209 | 1235 | "StreamCount;Count of stream of this kind\n" |
1236 | "StreamFormat;Stream format\n" | |
1210 | 1237 | "StreamID;Stream ID\n" |
1211 | 1238 | "streamIdentifier;Stream identifier\n" |
1212 | 1239 | "StreamKind;Kind of stream\n" |
1217 | 1244 | "StreamSize_Encoded;Encoded stream size\n" |
1218 | 1245 | "StreamSize_Proportion;Proportion of this stream\n" |
1219 | 1246 | "Subject;Subject\n" |
1247 | "Substream;Substream\n" | |
1220 | 1248 | "Substream;Substream\n" |
1221 | 1249 | "SubTrack;SubTrack\n" |
1222 | 1250 | "SubtstreamIdChannel;Substream start ID & channel index\n" |
1254 | 1282 | "TimeCode_MaxFrameNumber_Theory;Theoritical maximum frame number in time codes\n" |
1255 | 1283 | "TimeCode_Settings;Time code settings\n" |
1256 | 1284 | "TimeCode_Source;Time code source\n" |
1257 | "TimeCode_Striped;Time code, striped\n" | |
1285 | "TimeCode_Stripped;Time code, stripped\n" | |
1258 | 1286 | "TimeStamp;Time stamp\n" |
1259 | 1287 | "TimeZone;Timezone\n" |
1260 | 1288 | "Title;Title\n" |
1261 | 1289 | "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" | |
1262 | 1296 | "Total;Total\n" |
1263 | 1297 | "TotalNumberOfParts;Total Number Of Parts\n" |
1264 | 1298 | "TotalProgrammeDuration;Total Programme Duration\n" |
1265 | 1299 | "Track;Track name\n" |
1266 | 1300 | "Track_Count;Track count\n" |
1301 | "TrackFormat;Track format\n" | |
1267 | 1302 | "TrackIndex;Track index\n" |
1268 | "TrackUID;TrackUID\n" | |
1303 | "TrackUID;Track UID\n" | |
1269 | 1304 | "transfer_characteristics;Transfer characteristics\n" |
1270 | 1305 | "Translator;Translator\n" |
1271 | 1306 | "Transport;Transport\n" |
1287 | 1322 | "TruePeakLevel;True peak level\n" |
1288 | 1323 | "TruePeakLevel_Album;True peak level (album)\n" |
1289 | 1324 | "Type;Type\n" |
1290 | "TypeDefinition;TypeDefinition\n" | |
1325 | "TypeDefinition;Type definition\n" | |
1291 | 1326 | "UniqueID;Unique ID\n" |
1292 | 1327 | "UniversalAdID;Universal Ad ID\n" |
1293 | 1328 | "UniversalAdID_Registry;Universal Ad ID registry\n" |
5419 | 5454 | "DisplayAspectRatio_Original/String;;;Y NT;;;Original (in the raw stream) Display Aspect ratio\n" |
5420 | 5455 | "FrameRate_Mode;;;N YTY;;;Frame rate mode (CFR, VFR)\n" |
5421 | 5456 | "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" | |
5422 | 5459 | "FrameRate;; fps;N YFY;;;Frames per second\n" |
5423 | 5460 | "FrameRate/String;;;Y NT;;;Frames per second (with measurement)\n" |
5424 | 5461 | "FrameRate_Num;;;N NIN;;;Frames per second, numerator\n" |
5429 | 5466 | "FrameRate_Nominal/String;;;N NT;;;Nominal Frames per second (with measurement)\n" |
5430 | 5467 | "FrameRate_Maximum;; fps;N YFY;;;Maximum Frames per second\n" |
5431 | 5468 | "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" | |
5434 | 5473 | "FrameCount;;;N NIY;;;Number of frames\n" |
5435 | 5474 | "ElementCount;;;Y NIY;;;Number of displayed elements\n" |
5436 | 5475 | "Source_FrameCount;;;N NIY;;;Source Number of frames\n" |
5464 | 5503 | "Delay_Original_Settings;;;N NT;;;Delay settings (in case of timecode for example)\n" |
5465 | 5504 | "Delay_Original_DropFrame;;;N NT;;;Delay drop frame info\n" |
5466 | 5505 | "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" | |
5468 | 5507 | "Video_Delay/String;;;Y NT\n" |
5469 | 5508 | "Video_Delay/String1;;;N NT\n" |
5470 | 5509 | "Video_Delay/String2;;;N NT\n" |
5683 | 5722 | "Delay_Original_Settings;;;N NT;;;Delay settings (in case of timecode for example)\n" |
5684 | 5723 | "Delay_Original_DropFrame;;;N NT;;;Delay drop frame info\n" |
5685 | 5724 | "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" | |
5687 | 5726 | "Video_Delay/String;;;Y NT\n" |
5688 | 5727 | "Video_Delay/String1;;;N NT\n" |
5689 | 5728 | "Video_Delay/String2;;;N NT\n" |
5708 | 5747 | "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" |
5709 | 5748 | "TimeCode_DropFrame;;;N NT;;;Delay drop frame\n" |
5710 | 5749 | "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" | |
5713 | 5752 | "TimeCode_Source;;;Y YTY;;;Time code source (Container, Stream, SystemScheme1, SDTI, ANC...)\n" |
5714 | 5753 | "StreamSize;; byte;N YIY;;;Streamsize in bytes\n" |
5715 | 5754 | "StreamSize/String;;;Y NT;;;Streamsize in with percentage value\n" |
6636 | 6675 | Info.Write(Ztring().From_UTF8( |
6637 | 6676 | "General;[%Format/String%][ (%Format_Profile%)][ (%Format_Commercial_IfAny%)]$if(%Format/String%,$: $)%FileSize/String%[, %Duration/String%]\n" |
6638 | 6677 | "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" | |
6640 | 6679 | "Text;[%Language/String%, ][%Format/String%][ (%Format_Commercial_IfAny%)]$if(%MuxingMode%, \\(%MuxingMode%\\))\n" |
6641 | 6680 | "Image;[%Language/String%, ][%Width%*][%Height%][ (%DisplayAspectRatio/String%)][, %Format/String%]\n" |
6642 | 6681 | "Chapters;[%Language/String%, ]%Total% chapters[, %Format/String%][ (%Format_Commercial_IfAny%)]\n" |
1568 | 1568 | if (Up_Pos!=string::npos && Up_Pos_End==Name.size()-4) |
1569 | 1569 | { |
1570 | 1570 | Ztring Up=Name.substr(Up_Pos); |
1571 | auto IsComplementary=Up.FindAndReplace(__T("Complementary"), Ztring()); | |
1571 | 1572 | |
1572 | 1573 | //Hide |
1573 | 1574 | Ztring ToHide=Name+__T("/String"); |
1689 | 1690 | if (!ID2.empty()) |
1690 | 1691 | Temp.back()[Info_Name].insert(ToSearch.size(), __T("-Alt")+ID2); |
1691 | 1692 | Temp.back()[Info_Name].insert(0, SpacesCount, __T(' ')); |
1693 | if (IsComplementary) | |
1694 | Temp.back()[Info_Name].FindAndReplace(__T(" Object"), __T("ComplementaryObject")); | |
1692 | 1695 | if (!Found.empty()) |
1693 | 1696 | Temp.back()[Info_Text]=Found;; |
1694 | 1697 | } |
80 | 80 | if (!(ToReturn[ToReturn_Pos]>=__T('A') && ToReturn[ToReturn_Pos]<=__T('Z')) |
81 | 81 | && !(ToReturn[ToReturn_Pos]>=__T('a') && ToReturn[ToReturn_Pos]<=__T('z')) |
82 | 82 | && !(ToReturn[ToReturn_Pos]>=__T('0') && ToReturn[ToReturn_Pos]<=__T('9')) |
83 | && !(ToReturn[ToReturn_Pos]==__T('-')) // Authorized if not first pos | |
83 | 84 | && !(ToReturn[ToReturn_Pos]==__T('_'))) |
84 | 85 | ToReturn.erase(ToReturn_Pos, 1); |
85 | 86 | else |
86 | 87 | ToReturn_Pos++; |
87 | 88 | } |
88 | 89 | |
89 | if (ToReturn.operator()(0)>='0' && ToReturn.operator()(0)<='9') | |
90 | if ((ToReturn.operator()(0)>='0' && ToReturn.operator()(0)<='9') || ToReturn.operator()(0)=='-') | |
90 | 91 | ToReturn.insert(0, 1, __T('_')); |
91 | 92 | |
92 | 93 | if (ToReturn.empty()) |
716 | 717 | size_t Space=SubName.rfind(' '); |
717 | 718 | if (Space!=(size_t)-1) |
718 | 719 | SubName.erase(0, Space+1); |
719 | size_t NumbersPos=SubName.find_last_not_of("0123456789"); | |
720 | size_t NumbersPos=SubName.find_first_of("0123456789"); | |
720 | 721 | 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; | |
723 | 728 | Node* Node_Sub=new Node(SubName.c_str(), IsArray); |
724 | 729 | Fields_Current->push_back(Node_Sub); |
725 | 730 | Nested.resize(Nested.size()+1); |
943 | 948 | Elements_Index=2; |
944 | 949 | } |
945 | 950 | 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 | } | |
947 | 957 | |
948 | 958 | //Replace |
949 | 959 | while (Elements(Elements_Index).SubString(__T("%"), __T("%")).size()>0) |
679 | 679 | if (!Rdd18_Parser->Status[IsFinished]) |
680 | 680 | { |
681 | 681 | 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); | |
683 | 684 | } |
684 | 685 | #endif //defined(MEDIAINFO_MXF_YES) |
685 | 686 | break; |
143 | 143 | Sequence->StreamKind=Stream_Other; |
144 | 144 | Sequence->Infos["Type"]=__T("Time code"); |
145 | 145 | Sequence->Infos["Format"]=__T("CPL TC"); |
146 | Sequence->Infos["TimeCode_Striped"]=__T("Yes"); | |
146 | Sequence->Infos["TimeCode_Stripped"]=__T("Yes"); | |
147 | 147 | bool IsDropFrame=false; |
148 | 148 | |
149 | 149 | for (XMLElement* CompositionTimecode_Item=CompositionPlaylist_Item->FirstChildElement(); CompositionTimecode_Item; CompositionTimecode_Item=CompositionTimecode_Item->NextSiblingElement()) |
1854 | 1854 | Event1.Audio_Data_Errors_Count=16; |
1855 | 1855 | Event1.Audio_Data_Errors=Audio_Errors_PerDseq; |
1856 | 1856 | } |
1857 | if (true) | |
1857 | if (!DirectionSpeed.empty()) | |
1858 | 1858 | { |
1859 | 1859 | if (!MoreData) |
1860 | 1860 | MoreData=new int8u[4096]+sizeof(size_t); // TODO: more dynamic allocation |
1861 | MoreData[MoreData_Offset++]=2+DirectionSpeed.size(); | |
1861 | MoreData[MoreData_Offset++]=DirectionSpeed.size(); | |
1862 | 1862 | MoreData[MoreData_Offset++]=2; // DirectionSpeed values |
1863 | 1863 | for (std::vector<int8u>::iterator DirectionSpeed_Item=DirectionSpeed.begin(); DirectionSpeed_Item!=DirectionSpeed.end(); ++DirectionSpeed_Item) |
1864 | 1864 | { |
318 | 318 | { |
319 | 319 | int64u TimeCode_FirstFrame_ms=((File_Gxf_TimeCode*)Streams[TimeCode->first].Parsers[0])->TimeCode_FirstFrame_ms; |
320 | 320 | 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; | |
322 | 322 | if (TimeCode_FirstFrame_ms==(int64u)-1) |
323 | 323 | { |
324 | 324 | TimeCode_FirstFrame_ms=TimeCode->second.Milliseconds; |
325 | 325 | TimeCode_FirstFrame=TimeCode->second.String; |
326 | TimeCode_FirstFrame_Striped=true; | |
326 | TimeCode_FirstFrame_Stripped=true; | |
327 | 327 | } |
328 | 328 | if (TimeCode_FirstFrame_ms!=(int64u)-1) |
329 | 329 | { |
333 | 333 | Fill(Stream_Other, StreamPos_Last, Other_Type, "Time code"); |
334 | 334 | Fill(Stream_Other, StreamPos_Last, Other_Format, "SMPTE TC"); |
335 | 335 | 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"); | |
338 | 338 | if (TimeCode->first<Streams.size()) |
339 | 339 | Fill(Stream_Other, StreamPos_Last, Other_Title, Streams[TimeCode->first].MediaName); |
340 | 340 | } |
1016 | 1016 | for (size_t StreamPos=0; StreamPos<New_Count; StreamPos++) |
1017 | 1017 | { |
1018 | 1018 | 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 | } | |
1019 | 1027 | Merge(*Temp->second.Parsers[0], StreamKind_Last, StreamPos, StreamPos_Last); |
1020 | 1028 | Ztring Parser_ID=ID+__T('-')+Retrieve(StreamKind_Last, StreamPos_Last, General_ID); |
1021 | 1029 | if (ID.size()+1==Parser_ID.size()) |
1022 | 1030 | Parser_ID.resize(ID.size()); |
1023 | 1031 | 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)); | |
1029 | 1032 | if (StreamPos) |
1030 | 1033 | { |
1031 | 1034 | if (StreamSize_Encoded) |
1188 | 1191 | Fill(Stream_Audio, Pos, Audio_StreamSize_Encoded, 0); //Included in the DV stream size |
1189 | 1192 | Ztring ID=Retrieve(Stream_Audio, Pos, Audio_ID); |
1190 | 1193 | 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); | |
1191 | 1197 | Fill(Stream_Audio, Pos, "Source", Retrieve(Stream_Video, Temp->second.StreamPos, "Source")); |
1192 | 1198 | Fill(Stream_Audio, Pos, "Source_Info", Retrieve(Stream_Video, Temp->second.StreamPos, "Source_Info")); |
1193 | 1199 | } |
1206 | 1212 | Fill(Stream_Text, Pos, Text_StreamSize_Encoded, 0); //Included in the DV stream size |
1207 | 1213 | Ztring ID=Retrieve(Stream_Text, Pos, Text_ID); |
1208 | 1214 | 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")); | |
1209 | 1218 | Fill(Stream_Text, Pos, "Source", Retrieve(Stream_Video, Temp->second.StreamPos, "Source")); |
1210 | 1219 | Fill(Stream_Text, Pos, "Source_Info", Retrieve(Stream_Video, Temp->second.StreamPos, "Source_Info")); |
1211 | 1220 | } |
1386 | 1395 | if (ES_ID_Info->first==Temp->first && ES_ID_Info->second.StreamKind==Temp->second.StreamKind) |
1387 | 1396 | { |
1388 | 1397 | 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); | |
1390 | 1399 | 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()) |
1391 | 1400 | { |
1392 | 1401 | //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); | |
1394 | 1403 | } |
1395 | 1404 | } |
1396 | 1405 | } |
1409 | 1418 | { |
1410 | 1419 | switch (i) |
1411 | 1420 | { |
1421 | case Video_FrameRate: | |
1412 | 1422 | case Video_Sampled_Width: |
1413 | 1423 | case Video_Sampled_Height: |
1414 | 1424 | continue; |
2419 | 2429 | #endif //MEDIAINFO_DEMUX |
2420 | 2430 | size_t stco_Count=(size_t)-1; |
2421 | 2431 | bool stco_IsDifferent=false; |
2432 | int64u LocalPTS=0; | |
2422 | 2433 | |
2423 | 2434 | //For each stream |
2424 | 2435 | for (std::map<int32u, stream>::iterator Temp=Streams.begin(); Temp!=Streams.end(); ++Temp) |
2459 | 2470 | #endif // MEDIAINFO_DEMUX |
2460 | 2471 | continue; |
2461 | 2472 | } |
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); | |
2466 | 2473 | |
2467 | 2474 | if (!Temp->second.stsz.empty() || Temp->second.stsz_Sample_Size) |
2468 | 2475 | { |
2572 | 2579 | mdat_Pos_Temp2.Offset = *stco_Current + Chunk_Offset; |
2573 | 2580 | mdat_Pos_Temp2.StreamID = Temp->first; |
2574 | 2581 | 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 | } | |
2576 | 2597 | Chunk_Offset += Size; |
2577 | 2598 | if (Chunk_Offset >= File_Size) |
2578 | 2599 | { |
2581 | 2602 | } |
2582 | 2603 | Chunk_FrameCount++; |
2583 | 2604 | } |
2584 | if (Chunk_FrameCount >= FrameCount_MaxPerStream) | |
2605 | if (!Temp->second.TimeCode && Chunk_FrameCount >= FrameCount_MaxPerStream) | |
2585 | 2606 | break; |
2586 | 2607 | } |
2587 | 2608 | |
2786 | 2807 | if (!Streams[mdat_Pos_ToParseInPriority_StreamIDs[0]].stco.empty()) |
2787 | 2808 | { |
2788 | 2809 | 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; | |
2790 | 2811 | while (Temp<mdat_Pos_Max && Temp->Offset!=stco_ToFind) |
2791 | 2812 | Temp++; |
2792 | 2813 | if (Temp<mdat_Pos_Max && Temp->Offset<File_Size) //Skipping data not in a truncated file |
2793 | 2814 | { |
2794 | 2815 | 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 | } | |
2798 | 2822 | |
2799 | 2823 | mdat_Pos_Temp=Temp; |
2824 | mdat_Pos_ToParseInPriority_StreamIDs_ToRemove.push_back(Temp->StreamID); | |
2800 | 2825 | GoTo(Temp->Offset); |
2801 | 2826 | 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 | } | |
2802 | 2841 | } |
2803 | 2842 | } |
2804 | 2843 | mdat_Pos_ToParseInPriority_StreamIDs.erase(mdat_Pos_ToParseInPriority_StreamIDs.begin()); |
2812 | 2851 | Element_Begin1("Second pass"); |
2813 | 2852 | Element_WantNextLevel=true; |
2814 | 2853 | |
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 | } | |
2818 | 2875 | IsParsing_mdat_Set(); |
2819 | 2876 | mdat_Pos_NormalParsing=true; |
2820 | 2877 | } |
3014 | 3071 | MI.KindOfStream=StreamKind_Last; |
3015 | 3072 | MI.PosOfStream=StreamPos_Last; |
3016 | 3073 | 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 | |
3017 | 3078 | |
3018 | 3079 | int64u Elemen_Code_Save=Element_Code; |
3019 | 3080 | Element_Code=moov_trak_tkhd_TrackID; //Element_Code is use for stream identifier |
3077 | 3138 | for (std::map<int32u, stream>::iterator Strea=Streams.begin(); Strea!=Streams.end(); ++Strea) |
3078 | 3139 | if ((!Streams[TrackID].Parsers.empty() && (IsGeneral && Strea->second.StreamKind!=Stream_Max)) || Strea->second.TimeCode_TrackID==TrackID) |
3079 | 3140 | { |
3141 | Streams[TrackID].Parsers[0]->Fill(); | |
3080 | 3142 | if (Strea->second.StreamKind==Stream_Video) |
3081 | 3143 | { |
3082 | 3144 | Fill(Stream_Video, Strea->second.StreamPos, Video_Delay_Settings, Ztring(__T("DropFrame="))+(Streams[TrackID].TimeCode->DropFrame?__T("Yes"):__T("No"))); |
215 | 215 | void moov_trak_mdia_minf_stbl_stsd_xxxx_dvc1(); |
216 | 216 | void moov_trak_mdia_minf_stbl_stsd_xxxx_dvcC(); |
217 | 217 | 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();} | |
218 | 219 | void moov_trak_mdia_minf_stbl_stsd_xxxx_esds(); |
219 | 220 | void moov_trak_mdia_minf_stbl_stsd_xxxx_fiel(); |
220 | 221 | void moov_trak_mdia_minf_stbl_stsd_xxxx_gama(); |
470 | 471 | int64u stts_Duration_FirstFrame; |
471 | 472 | int64u stts_Duration_LastFrame; |
472 | 473 | int64u stts_SampleDuration; |
474 | int64u FirstUsedOffset; | |
475 | int64u LastUsedOffset; | |
473 | 476 | int32u mvex_trex_default_sample_duration; |
474 | 477 | int32u mvex_trex_default_sample_size; |
475 | 478 | int32u TimeCode_TrackID; |
552 | 555 | stts_Duration_FirstFrame=0; |
553 | 556 | stts_Duration_LastFrame=0; |
554 | 557 | stts_SampleDuration = 0; |
558 | FirstUsedOffset=(int64u)-1; | |
559 | LastUsedOffset=(int64u)-1; | |
555 | 560 | mvex_trex_default_sample_duration=0; |
556 | 561 | mvex_trex_default_sample_size=0; |
557 | 562 | TimeCode_TrackID=(int32u)-1; |
637 | 642 | mdat_Pos_Type* mdat_Pos_Temp_ToJump; |
638 | 643 | mdat_Pos_Type* mdat_Pos_Max; |
639 | 644 | std::vector<int32u> mdat_Pos_ToParseInPriority_StreamIDs; |
645 | std::vector<int32u> mdat_Pos_ToParseInPriority_StreamIDs_ToRemove; | |
640 | 646 | bool mdat_Pos_NormalParsing; |
641 | 647 | void Skip_NulString(const char* Name); |
642 | 648 |
198 | 198 | } |
199 | 199 | |
200 | 200 | //--------------------------------------------------------------------------- |
201 | static const char* Mpeg4_Descriptors_AudioProfileLevelIndication_Profile[]= | |
201 | const char* Mpeg4_Descriptors_AudioProfileLevelIndication_Profile[]= | |
202 | 202 | { |
203 | 203 | "", |
204 | 204 | "Main Audio", |
218 | 218 | "ALS Simple", |
219 | 219 | "Baseline USAC", |
220 | 220 | "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 | |
247 | 226 | }; |
248 | 227 | 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]= | |
250 | 229 | { |
251 | 230 | { NoProfile, 0 }, |
252 | 231 | { Main_Audio, 1 }, |
396 | 375 | |
397 | 376 | //Temp |
398 | 377 | ObjectTypeId=0x00; |
378 | ||
379 | //Conformance | |
380 | #if MEDIAINFO_CONFORMANCE | |
381 | SamplingRate=0; | |
382 | #endif | |
399 | 383 | } |
400 | 384 | |
401 | 385 | //--------------------------------------------------------------------------- |
546 | 530 | for (int8u i=0; i<5; i++) |
547 | 531 | if (ProfileLevel[i]!=0xFF) |
548 | 532 | ProfileLevel_Count++; |
533 | es_id_info& ES_ID_Info=ES_ID_Infos[(int32u)-1]; | |
549 | 534 | if (ProfileLevel_Count==1) |
550 | 535 | { |
551 | 536 | for (int8u i=0; i<5; i++) |
552 | 537 | { |
553 | 538 | if (ProfileLevel[i]!=0xFF) |
554 | 539 | { |
555 | es_id_info& ES_ID_Info=ES_ID_Infos[(int32u)-1]; | |
556 | 540 | switch (i) |
557 | 541 | { |
558 | 542 | 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]); | |
560 | 544 | break; |
561 | 545 | case 3 : |
562 | 546 | 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]); | |
564 | 548 | break; |
565 | 549 | default : ; |
566 | 550 | } |
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]); | |
569 | 553 | } |
570 | 554 | } |
571 | 555 | } |
556 | memcpy(ES_ID_Info.ProfileLevel, ProfileLevel, sizeof(ProfileLevel)); | |
572 | 557 | } |
573 | 558 | Element_ThisIsAList(); |
574 | 559 | FILLING_END(); |
805 | 790 | Parser=new File_Aac; |
806 | 791 | ((File_Aac*)Parser)->Mode=File_Aac::Mode_AudioSpecificConfig; |
807 | 792 | ((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 | |
808 | 823 | #endif |
809 | 824 | break; |
810 | 825 | case 0x60 : |
21 | 21 | namespace MediaInfoLib |
22 | 22 | { |
23 | 23 | |
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 | ||
24 | 56 | //*************************************************************************** |
25 | 57 | // Class File_Mpeg4_Descriptors |
26 | 58 | //*************************************************************************** |
40 | 72 | struct es_id_info |
41 | 73 | { |
42 | 74 | stream_t StreamKind; |
43 | Ztring ProfileLevel; | |
75 | Ztring ProfileLevelString; | |
76 | int8u ProfileLevel[5]; | |
44 | 77 | |
45 | 78 | es_id_info() : |
46 | 79 | StreamKind(Stream_Max) |
48 | 81 | }; |
49 | 82 | typedef map<int32u, es_id_info> es_id_infos; |
50 | 83 | es_id_infos ES_ID_Infos; |
84 | ||
85 | // Conformance | |
86 | #if MEDIAINFO_CONFORMANCE | |
87 | int16u SamplingRate; | |
88 | #endif | |
51 | 89 | |
52 | 90 | struct slconfig |
53 | 91 | { |
800 | 800 | const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_dvc1=0x64766331; |
801 | 801 | const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_dvcC=0x64766343; |
802 | 802 | const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_dvvC=0x64767643; |
803 | const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_dvwC=0x64767743; | |
803 | 804 | const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_esds=0x65736473; |
804 | 805 | const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_fiel=0x6669656C; |
805 | 806 | const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_gama=0x67616D61; |
1207 | 1208 | ATOM(moov_trak_mdia_minf_stbl_stsd_xxxx_dvc1) |
1208 | 1209 | ATOM(moov_trak_mdia_minf_stbl_stsd_xxxx_dvcC) |
1209 | 1210 | ATOM(moov_trak_mdia_minf_stbl_stsd_xxxx_dvvC) |
1211 | ATOM(moov_trak_mdia_minf_stbl_stsd_xxxx_dvwC) | |
1210 | 1212 | ATOM(moov_trak_mdia_minf_stbl_stsd_xxxx_esds) |
1211 | 1213 | ATOM(moov_trak_mdia_minf_stbl_stsd_xxxx_fiel) |
1212 | 1214 | ATOM(moov_trak_mdia_minf_stbl_stsd_xxxx_gama) |
2025 | 2027 | if (!Stream_Temp.IsFilled && Stream_Temp.Parsers[Pos]->Status[IsFilled]) |
2026 | 2028 | { |
2027 | 2029 | #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 | |
2029 | 2031 | { |
2030 | 2032 | if (((File_Mpeg4_TimeCode*)Stream_Temp.Parsers[Pos])->Pos!=(int32u)-1) |
2031 | 2033 | { |
2041 | 2043 | |
2042 | 2044 | Stream_Temp.IsFilled=true; |
2043 | 2045 | |
2044 | if (Config->ParseSpeed<1 && !mdat_Pos.empty()) | |
2046 | if (Config->ParseSpeed<1 && !mdat_Pos.empty() && !Stream_Temp.TimeCode) | |
2045 | 2047 | { |
2046 | 2048 | bool File_Offset_Next_IsValid; |
2047 | 2049 | int64u File_Offset_Next; |
2130 | 2132 | |
2131 | 2133 | //Finding right file offset |
2132 | 2134 | 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 | } | |
2133 | 2141 | if (!mdat_Pos.empty() && mdat_Pos_Temp!=mdat_Pos_Max) |
2134 | 2142 | ToJump=mdat_Pos_Temp->Offset; |
2135 | 2143 | if (ToJump>File_Size) |
2953 | 2961 | //Filling |
2954 | 2962 | Stream->second.stsz_StreamSize+=sample_size; |
2955 | 2963 | 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) | |
2957 | 2965 | Stream->second.stsz.push_back(sample_size); |
2958 | 2966 | } |
2959 | 2967 | if (sample_flags_present) |
4658 | 4666 | return; |
4659 | 4667 | |
4660 | 4668 | 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); | |
4662 | 4670 | int64u* stco_Data=&stco[0]; |
4663 | 4671 | |
4664 | 4672 | for (int32u Pos=0; Pos<Count; Pos++) |
4674 | 4682 | Offset=BigEndian2int64u(Buffer+Buffer_Offset+(size_t)Element_Offset); |
4675 | 4683 | Element_Offset+=8; |
4676 | 4684 | |
4677 | if (Pos<FrameCount_MaxPerStream) | |
4685 | if (Pos<FrameCount_MaxPerStream || Streams[moov_trak_tkhd_TrackID].TimeCode) | |
4678 | 4686 | { |
4679 | 4687 | (*stco_Data)=Offset; |
4680 | 4688 | stco_Data++; |
4751 | 4759 | Offset=BigEndian2int32u(Buffer+Buffer_Offset+(size_t)Element_Offset); |
4752 | 4760 | Element_Offset+=4; |
4753 | 4761 | |
4754 | if (Pos<FrameCount_MaxPerStream) | |
4762 | if (Pos<FrameCount_MaxPerStream || Streams[moov_trak_tkhd_TrackID].TimeCode) | |
4755 | 4763 | Streams[moov_trak_tkhd_TrackID].stco.push_back(Offset); |
4756 | 4764 | } |
4757 | 4765 | } |
4837 | 4845 | */ |
4838 | 4846 | |
4839 | 4847 | //Faster |
4840 | if (Pos<FrameCount_MaxPerStream) | |
4848 | if (Pos<FrameCount_MaxPerStream || Streams[moov_trak_tkhd_TrackID].TimeCode) | |
4841 | 4849 | { |
4842 | 4850 | if (Element_Offset+12>Element_Size) |
4843 | 4851 | break; //Problem |
5091 | 5099 | Parser->mvhd_Duration_TimeScale=moov_mvhd_TimeScale; |
5092 | 5100 | Parser->mdhd_Duration=Streams[moov_trak_tkhd_TrackID].mdhd_Duration; |
5093 | 5101 | Parser->mdhd_Duration_TimeScale=Streams[moov_trak_tkhd_TrackID].mdhd_TimeScale; |
5102 | Parser->tmcd_Duration = tc->FrameDuration; | |
5103 | Parser->tmcd_Duration_TimeScale = tc->TimeScale; | |
5094 | 5104 | |
5095 | 5105 | //Get delay from timecode track's edit list |
5096 | 5106 | int64s FrameDurationInMediaUnits = tc->FrameDuration * Streams[moov_trak_tkhd_TrackID].mdhd_TimeScale; |
5334 | 5344 | { |
5335 | 5345 | Channels=Channels16; |
5336 | 5346 | SampleSize=SampleSize16; |
5337 | SampleRate=SampleRate16; | |
5338 | } | |
5347 | } | |
5348 | SampleRate=SampleRate16; | |
5339 | 5349 | } |
5340 | 5350 | else |
5341 | 5351 | { |
7785 | 7795 | |
7786 | 7796 | Stream->second.stsz_StreamSize+=Size; |
7787 | 7797 | Stream->second.stsz_Total.push_back(Size); |
7788 | if (Pos<FrameCount_MaxPerStream) | |
7798 | if (Pos<FrameCount_MaxPerStream || Stream->second.TimeCode) | |
7789 | 7799 | Stream->second.stsz.push_back(Size); |
7790 | 7800 | } |
7791 | 7801 | /* |
23 | 23 | #include "MediaInfo/Multiple/File_Mpeg4_TimeCode.h" |
24 | 24 | #include "MediaInfo/TimeCode.h" |
25 | 25 | #include "MediaInfo/MediaInfo_Config_MediaInfo.h" |
26 | #include <limits> | |
27 | using namespace std; | |
26 | 28 | //--------------------------------------------------------------------------- |
27 | 29 | |
28 | 30 | namespace MediaInfoLib |
37 | 39 | :File__Analyze() |
38 | 40 | { |
39 | 41 | //Out |
40 | Pos=(int32u)-1; | |
42 | Pos=numeric_limits<int64s>::max(); | |
41 | 43 | |
42 | 44 | FirstEditOffset=0; |
43 | 45 | FirstEditDuration=(int64u)-1; |
47 | 49 | NegativeTimes=false; |
48 | 50 | tkhd_Duration=0; |
49 | 51 | mvhd_Duration_TimeScale=0; |
52 | ||
53 | //Temp | |
54 | FrameMultiplier_Pos=0; | |
50 | 55 | } |
51 | 56 | |
52 | 57 | //*************************************************************************** |
54 | 59 | //*************************************************************************** |
55 | 60 | |
56 | 61 | //--------------------------------------------------------------------------- |
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 | //--------------------------------------------------------------------------- | |
57 | 69 | void File_Mpeg4_TimeCode::Streams_Fill() |
58 | 70 | { |
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); | |
79 | 132 | if (FrameMultiplier>1) |
80 | 133 | { |
81 | 134 | int64s Frames=TC.GetFrames(); |
83 | 136 | TC=TimeCode(TC.ToFrames()*FrameMultiplier, NumberOfFrames*FrameMultiplier-1, DropFrame); |
84 | 137 | TC+=Frames*FrameMultiplier; |
85 | 138 | } |
86 | Stream_Prepare(Stream_Other); | |
87 | Fill(Stream_Other, StreamPos_Last, Other_Type, "Time code"); | |
88 | 139 | 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); | |
89 | 161 | if (Frame_Count==1) |
90 | 162 | { |
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"); | |
113 | 164 | if (FrameCount) |
114 | 165 | 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()); | |
115 | 179 | } |
116 | 180 | } |
117 | 181 | } |
136 | 200 | void File_Mpeg4_TimeCode::Read_Buffer_Continue() |
137 | 201 | { |
138 | 202 | //Parsing |
139 | int32u Position=0; | |
140 | 203 | while (Element_Offset<Element_Size) |
141 | 204 | { |
205 | int32u Position=0; | |
142 | 206 | 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) | |
149 | 217 | Skip_XX(Element_Size-Element_Offset, "Other positions"); |
150 | 218 | } |
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; | |
151 | 262 | } |
152 | 263 | |
153 | 264 | FILLING_BEGIN(); |
33 | 33 | int64u mvhd_Duration_TimeScale; |
34 | 34 | int64u mdhd_Duration; |
35 | 35 | int64u mdhd_Duration_TimeScale; |
36 | int64u tmcd_Duration; | |
37 | int64u tmcd_Duration_TimeScale; | |
36 | 38 | |
37 | 39 | //Out |
38 | 40 | int64s Pos; |
41 | int64s Pos_Last; | |
42 | int64u FrameMultiplier_Pos; | |
39 | 43 | |
40 | 44 | //Constructor/Destructor |
41 | 45 | File_Mpeg4_TimeCode(); |
42 | 46 | |
43 | 47 | protected : |
44 | 48 | //Streams management |
49 | void Streams_Accept(); | |
45 | 50 | void Streams_Fill(); |
51 | void Streams_Finish(); | |
46 | 52 | |
47 | 53 | //Buffer - Global |
48 | 54 | void Read_Buffer_Init(); |
108 | 108 | |
109 | 109 | namespace MediaInfoLib |
110 | 110 | { |
111 | ||
112 | #if defined(MEDIAINFO_IAB_YES) | |
113 | Ztring ChannelLayout_2018_Rename(const Ztring& Channels, const Ztring& Format); | |
114 | #endif | |
111 | 115 | |
112 | 116 | //*************************************************************************** |
113 | 117 | // |
2347 | 2351 | #endif //MEDIAINFO_NEXTPACKET |
2348 | 2352 | #if defined(MEDIAINFO_ANCILLARY_YES) |
2349 | 2353 | Ancillary=NULL; |
2350 | Ancillary_IsBinded=false; | |
2351 | 2354 | #endif //defined(MEDIAINFO_ANCILLARY_YES) |
2352 | 2355 | |
2353 | 2356 | ExtraMetadata_Offset=(int64u)-1; |
2355 | 2358 | DolbyAudioMetadata=NULL; |
2356 | 2359 | #if defined(MEDIAINFO_ADM_YES) |
2357 | 2360 | Adm=NULL; |
2361 | Adm_ForLaterMerge=NULL; | |
2358 | 2362 | #endif |
2359 | 2363 | |
2360 | 2364 | #if MEDIAINFO_DEMUX |
2386 | 2390 | File_Mxf::~File_Mxf() |
2387 | 2391 | { |
2388 | 2392 | #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; | |
2390 | 2399 | delete Ancillary; |
2400 | } | |
2391 | 2401 | #endif //defined(MEDIAINFO_ANCILLARY_YES) |
2392 | 2402 | |
2393 | 2403 | for (size_t i = 0; i < AcquisitionMetadataLists.size(); i++) |
2797 | 2807 | Finish(Adm); |
2798 | 2808 | Merge(*Adm, Stream_Audio, 0, 0); |
2799 | 2809 | } |
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 | } | |
2800 | 2839 | if (DolbyAudioMetadata) //After ADM for having content inside ADM stuff |
2801 | 2840 | DolbyAudioMetadata->Merge(*this, 0); |
2802 | 2841 | if (Adm && (!DolbyAudioMetadata || !DolbyAudioMetadata->HasSegment9) && Retrieve_Const(Stream_Audio, 0, "AdmProfile_Format")==__T("Dolby Atmos Master")) |
3183 | 3222 | Fill(Stream_Audio, StreamPos_Last, Audio_Channel_s_, Descriptor->second.ChannelCount); |
3184 | 3223 | break; |
3185 | 3224 | } |
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 | |
3186 | 3227 | |
3187 | 3228 | MergedStreams_Last.clear(); //TODO: better way to do this |
3188 | 3229 | |
4265 | 4306 | } |
4266 | 4307 | } |
4267 | 4308 | 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"); | |
4269 | 4310 | Fill(Stream_Other, StreamPos_Last, Other_Title, TrackName); |
4270 | 4311 | |
4271 | 4312 | if ((!TimeCodeFromMaterialPackage && IsSourcePackage) || (TimeCodeFromMaterialPackage && !IsSourcePackage)) |
6242 | 6283 | |
6243 | 6284 | essences::iterator Essence=Essences.find(Code_Compare4); |
6244 | 6285 | 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 | } | |
6246 | 6290 | |
6247 | 6291 | #if MEDIAINFO_TRACE |
6248 | 6292 | if (Trace_Activated) |
6361 | 6405 | ChooseParser(Essence, Descriptor); //Searching by the descriptor |
6362 | 6406 | if (Essence->second.Parsers.empty()) |
6363 | 6407 | 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 | |
6369 | 6408 | |
6370 | 6409 | #ifdef MEDIAINFO_DEMUX |
6371 | 6410 | if (Ztring().From_UTF8(Mxf_EssenceContainer(Descriptor->second.EssenceContainer))==__T("AVC")) |
6497 | 6536 | Demux_random_access=true; |
6498 | 6537 | |
6499 | 6538 | bool ShouldDemux=true; |
6500 | if (Essence->second.ShouldCheckAvcHeaders) | |
6539 | if (!Essence->second.Parsers.empty() && Essence->second.ShouldCheckAvcHeaders) | |
6501 | 6540 | { |
6502 | 6541 | if (Essence->second.Parsers[0]->Status[IsAccepted]) |
6503 | 6542 | ShouldDemux=false; |
17065 | 17104 | switch (Code_Compare4_3) |
17066 | 17105 | { |
17067 | 17106 | 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()); | |
17069 | 17109 | break; |
17070 | 17110 | default : ; |
17071 | 17111 | } |
17183 | 17223 | case 0x02 : //Ancillary |
17184 | 17224 | #if defined(MEDIAINFO_ANCILLARY_YES) |
17185 | 17225 | if (!Ancillary) |
17186 | { | |
17187 | 17226 | Ancillary=new File_Ancillary(); |
17188 | MayHaveCaptionsInStream=true; | |
17189 | } | |
17227 | MayHaveCaptionsInStream=true; | |
17190 | 17228 | Essence->second.Parsers.push_back(Ancillary); |
17191 | Ancillary_IsBinded=true; | |
17192 | 17229 | #endif //defined(MEDIAINFO_ANCILLARY_YES) |
17193 | 17230 | break; |
17194 | 17231 | case 0x08 : //Line Wrapped Data Element, SMPTE 384M |
32 | 32 | |
33 | 33 | class File_DolbyVisionMetadata; |
34 | 34 | class File_Adm; |
35 | class File_Iab; | |
35 | 36 | class File_DolbyAudioMetadata; |
36 | 37 | |
37 | 38 | //*************************************************************************** |
789 | 790 | ShouldCheckAvcHeaders=0; |
790 | 791 | FrameInfo.DTS=(int64u)-1; |
791 | 792 | } |
793 | essence(const essence&) = delete; | |
794 | essence(essence&&) = delete; | |
792 | 795 | |
793 | 796 | ~essence() |
794 | 797 | { |
931 | 934 | SoundfieldGroupLinkID.hi=(int64u)-1; |
932 | 935 | SoundfieldGroupLinkID.lo=(int64u)-1; |
933 | 936 | } |
937 | descriptor(const descriptor&) = delete; | |
938 | descriptor(descriptor& b) | |
939 | { | |
940 | *this = b; | |
941 | b.Parser = nullptr; | |
942 | } | |
943 | ||
934 | 944 | ~descriptor() |
935 | 945 | { |
936 | 946 | delete Parser; |
1249 | 1259 | #endif //MEDIAINFO_ADVANCED |
1250 | 1260 | #if defined(MEDIAINFO_ANCILLARY_YES) |
1251 | 1261 | File_Ancillary* Ancillary; |
1252 | bool Ancillary_IsBinded; | |
1253 | 1262 | #endif //defined(MEDIAINFO_ANCILLARY_YES) |
1254 | 1263 | |
1255 | 1264 | //Hints |
1351 | 1360 | File_DolbyAudioMetadata* DolbyAudioMetadata; |
1352 | 1361 | #if defined(MEDIAINFO_ADM_YES) |
1353 | 1362 | File_Adm* Adm; |
1363 | #endif | |
1364 | #if defined(MEDIAINFO_IAB_YES) | |
1365 | File_Iab* Adm_ForLaterMerge; | |
1354 | 1366 | #endif |
1355 | 1367 | |
1356 | 1368 | //Demux |
67 | 67 | #if !defined (MEDIAINFO_TRACE_NO) && !defined (MEDIAINFO_TRACE_YES) |
68 | 68 | #define MEDIAINFO_TRACE_NO |
69 | 69 | #endif |
70 | #if !defined (MEDIAINFO_CONFORMANCE_NO) && !defined (MEDIAINFO_CONFORMANCE_YES) | |
71 | #define MEDIAINFO_CONFORMANCE_NO | |
72 | #endif | |
70 | 73 | #if !defined (MEDIAINFO_FILTER_NO) && !defined (MEDIAINFO_FILTER_YES) |
71 | 74 | #define MEDIAINFO_FILTER_NO |
72 | 75 | #endif |
245 | 248 | #define MEDIAINFO_ADVANCED2 1 |
246 | 249 | #else |
247 | 250 | #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 | |
248 | 261 | #endif |
249 | 262 | #endif |
250 | 263 | #if !defined(MEDIAINFO_MD5) |
54 | 54 | } |
55 | 55 | |
56 | 56 | //--------------------------------------------------------------------------- |
57 | static float32 Cdp_cdp_frame_rate(int8u cdp_frame_rate) | |
57 | static float64 Cdp_cdp_frame_rate(int8u cdp_frame_rate) | |
58 | 58 | { |
59 | 59 | switch (cdp_frame_rate) |
60 | 60 | { |
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; | |
70 | 70 | } |
71 | 71 | } |
72 | 72 |
350 | 350 | TimeCode Temp(TimeStamp); |
351 | 351 | Temp.SetFramesMax(FrameRate-1); |
352 | 352 | Temp.Set1001(FrameRate_Is1001); |
353 | Parser->Frame_Count_NotParsedIncluded=Temp.ToFrames()-TimeCode_FirstFrame.ToFrames(); | |
353 | Frame_Count_NotParsedIncluded=Temp.ToFrames()-TimeCode_FirstFrame.ToFrames(); | |
354 | 354 | Parser->FrameInfo.DTS=Temp.ToMilliseconds()*1000000; |
355 | 355 | Parser->FrameInfo.DUR=FrameDurationNanoSeconds; |
356 | 356 | while (Element_Offset+5<=Element_Size) |
362 | 362 | | Char2Hex(Buffer[Buffer_Offset+(size_t)Element_Offset+4]); |
363 | 363 | Open_Buffer_Continue(Parser, Buffer_Temp, 2); |
364 | 364 | Element_Offset+=5; |
365 | } | |
366 | Frame_Count_NotParsedIncluded=Parser->Frame_Count_NotParsedIncluded; | |
365 | Frame_Count_NotParsedIncluded=Parser->Frame_Count_NotParsedIncluded; | |
366 | } | |
367 | 367 | } |
368 | 368 | |
369 | 369 | //*************************************************************************** |
348 | 348 | Fill(Stream_General, 0, General_FrameRate, FrameRate); |
349 | 349 | Fill(Stream_Text, 0, Text_FrameRate, FrameRate); |
350 | 350 | } |
351 | if (FrameRate_Int && FrameRateMultiplier_Den!=1) | |
351 | if (FrameRate_Int && FrameRateMultiplier_Num && FrameRateMultiplier_Den) | |
352 | 352 | { |
353 | 353 | Fill(Stream_Text, 0, Text_FrameRate_Num, FrameRate_Int*FrameRateMultiplier_Num, 10, true); |
354 | 354 | Fill(Stream_Text, 0, Text_FrameRate_Den, FrameRateMultiplier_Den, 10, true); |
62 | 62 | size_t const pos; |
63 | 63 | }; |
64 | 64 | |
65 | constexpr14 bitset8() : stored(0) {} | |
66 | constexpr14 bitset8(int8u val) : stored(val) {} | |
67 | ||
65 | 68 | constexpr14 bitset8& reset() noexcept |
66 | 69 | { |
67 | 70 | stored=0; |
98 | 101 | constexpr14 bool operator[](size_t pos) const noexcept |
99 | 102 | { |
100 | 103 | 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; | |
101 | 114 | } |
102 | 115 | |
103 | 116 | private: |
104 | 117 | int8u stored=0; |
105 | 118 | }; |
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 | ||
106 | 131 | |
107 | 132 | //*************************************************************************** |
108 | 133 | // Class TimeCode |
970 | 970 | TemporalReferences_Offset=0; |
971 | 971 | TemporalReferences_Offset_pic_order_cnt_lsb_Last=0; |
972 | 972 | TemporalReferences_pic_order_cnt_Min=0; |
973 | pic_order_cnt_DTS_Ref=(int64u)-1; | |
973 | 974 | |
974 | 975 | //Text |
975 | 976 | #if defined(MEDIAINFO_DTVCCTRANSPORT_YES) |
3001 | 3002 | FrameRate=0; |
3002 | 3003 | if (first_slice_segment_in_pic_flag && pic_order_cnt_DTS_Ref!=(int64u)-1 && FrameInfo.PTS!=(int64u)-1 && FrameRate && TemporalReferences_Reserved) |
3003 | 3004 | { |
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 | { | |
3004 | 3011 | //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); | |
3006 | 3013 | if (pic_order_cnt<TemporalReferences_pic_order_cnt_Min) |
3007 | 3014 | { |
3008 | 3015 | if (pic_order_cnt<0) |
123 | 123 | #endif //MEDIAINFODLL_NAME |
124 | 124 | #else //_UNICODE |
125 | 125 | #ifndef MEDIAINFODLL_NAME |
126 | #define MEDIAINFODLL_NAME L"MediaInfo.dll" | |
126 | #define MEDIAINFODLL_NAME "MediaInfo.dll" | |
127 | 127 | #endif //MEDIAINFODLL_NAME |
128 | 128 | #endif //_UNICODE |
129 | 129 | #elif defined(__APPLE__) && defined(__MACH__) |
0 | 0 | #include <winresrc.h> |
1 | 1 | |
2 | 2 | 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 | |
5 | 5 | FILEFLAGSMASK 0x3fL |
6 | 6 | #ifdef _DEBUG |
7 | 7 | FILEFLAGS 0x1L |
18 | 18 | BEGIN |
19 | 19 | VALUE "CompanyName", "MediaArea.net" |
20 | 20 | 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" | |
22 | 22 | VALUE "LegalCopyright", "Copyright (C) 2002-2020 MediaArea.net SARL" |
23 | 23 | VALUE "ProductName", "MediaInfo" |
24 | VALUE "ProductVersion", "22.06.0.0" | |
24 | VALUE "ProductVersion", "22.09.0.0" | |
25 | 25 | END |
26 | 26 | END |
27 | 27 | BLOCK "VarFileInfo" |
149 | 149 | : ;: |
150 | 150 | 3D;3D |
151 | 151 | 3DType;3D Type |
152 | 5.1.2ch;5.1.2 | |
153 | 5.1.4ch;5.1.4 | |
154 | 5.1ch;5.1 | |
152 | 155 | 608_Mode;EIA-608 conversion mode |
156 | 7.1.2ch;7.1.2 | |
157 | 7.1ch;7.1 | |
153 | 158 | About;About |
154 | 159 | About_Hint;How to contact me and find last version |
155 | 160 | Accompaniment;Accompaniment |
197 | 202 | AudioSceneInfoID;Audio scene info ID |
198 | 203 | AudioTrackLayout;Audio Track Layout |
199 | 204 | Author;Author |
205 | Back4ToBack2;Four backs to two backs | |
206 | Balance_FrontBackListener;Front/back listener balance | |
200 | 207 | Balance_FrontBackOverheadFloor;Front/back overhead/floor balance |
201 | Balance_FrontBackListener;Front/back listener balance | |
202 | 208 | BarCode;BarCode |
203 | 209 | Basic;Basic |
204 | 210 | Basic_Note;Note : for more information about this file, you must select a different view (Sheet, Tree...) |
223 | 229 | Channel(s);Channel(s) |
224 | 230 | ChannelCoded;Channel coded |
225 | 231 | ChannelConfiguration;Channel configuration |
232 | ChannelFormat;Channel format | |
226 | 233 | ChannelLayout;Channel layout |
227 | 234 | ChannelMode;Channel mode |
228 | 235 | ChannelPositions;Channel positions |
279 | 286 | Comment;Comment |
280 | 287 | CommissionedBy;Commissioned by |
281 | 288 | Compilation;Compilation |
289 | ComplementaryObject;Complementary object | |
282 | 290 | CompleteName;Complete name |
283 | 291 | CompletionDate;Completion Date |
284 | 292 | ComplexityIndex;Complexity index |
289 | 297 | Compression_Ratio;Compression ratio |
290 | 298 | Conductor;Conductor |
291 | 299 | ConformanceCheck;Conformance check |
300 | ConformanceErrors;Conformance errors | |
301 | ConformanceWarnings;Conformance warnings | |
302 | ConformanceInfos;Conformance information | |
292 | 303 | ContactEmail;Contact Email |
293 | 304 | ContactTelephoneNumber;Contact Telephone Number |
294 | 305 | Container and general information;Container and general information |
306 | Content;Content | |
295 | 307 | ContentType;ContentType |
296 | 308 | CoProducer;Coproducer |
297 | 309 | Copyright;Copyright |
306 | 318 | Cover_Type;Cover type |
307 | 319 | Cropped;Crop dimensions |
308 | 320 | Custom;Custom |
321 | CustomDownmixTargets;Custom downmix targets | |
309 | 322 | Customize;Customize |
310 | 323 | Date;Date |
311 | 324 | Debug;Debug |
331 | 344 | DisplayAspectRatio_Original;Original display aspect ratio |
332 | 345 | DistributedBy;Distributed by |
333 | 346 | Distributor;Distributor |
347 | Dolby_Atmos_Metadata;Dolby Atmos metadata | |
334 | 348 | DolbyAtmos;Dolby Atmos |
335 | Dolby_Atmos_Metadata;Dolby Atmos metadata | |
336 | 349 | Donate;Donate |
337 | 350 | DotsPerInch;Dots per inch |
338 | 351 | Downmix;Downmix |
352 | Downmix_5.1.x;5.1 and 5.1.x downmix | |
339 | 353 | Downmix_5to2;5.1 to 2.0 downmix |
340 | Downmix_5.1.x;5.1 and 5.1.x downmix | |
341 | 354 | DrcSets_Count;DRC set count |
342 | 355 | DrcSets_Effects;DRC effect type(s) |
343 | 356 | Duration;Duration |
346 | 359 | Duration_Start;Start time |
347 | 360 | Duration_Start_Command;Start time (commands) |
348 | 361 | Duration_Start2End;Duration of the visible content |
362 | DynamicObject;Dynamic object | |
349 | 363 | DynamicRangeControl;Dynamic Range Control |
350 | 364 | Eac3DrcProfile;E-AC-3 DRC profile |
351 | 365 | Edit;Edit |
352 | 366 | EditedBy;Edited by |
353 | 367 | EditorialClassification;Editorial classification |
368 | ElementaryStream;Elementary stream | |
354 | 369 | ElementCount;Count of elements |
355 | 370 | EMail;E-Mail |
356 | 371 | Encoded_Application;Writing application |
400 | 415 | Format;Format |
401 | 416 | Format_Commercial;Commercial name |
402 | 417 | Format_Commercial_IfAny;Commercial name |
418 | Format_Compression;Compression | |
403 | 419 | Format_Description;Format description |
404 | 420 | Format_Info;Details for format |
405 | 421 | Format_Level;Format level |
433 | 449 | Format_Tier;Format tier |
434 | 450 | Format_Url;Weblink for format |
435 | 451 | Format_Version;Format version |
452 | FormatDefinition;Format definition | |
436 | 453 | FpaManufacturer;FPA Manufacturer |
437 | 454 | FpaPass;FPA Pass |
438 | 455 | FpaVersion;FPA Version |
532 | 549 | Genre_081;Folk-Rock |
533 | 550 | Genre_082;National Folk |
534 | 551 | Genre_083;Swing |
535 | Genre_084;Fast-Fusion | |
552 | Genre_084;Fast Fusion | |
536 | 553 | Genre_085;Bebop |
537 | 554 | Genre_086;Latin |
538 | 555 | Genre_087;Revival |
672 | 689 | ImmersiveStereo;Immersive stereo |
673 | 690 | Info;Info |
674 | 691 | Instruments;Instruments |
692 | IntegratedLoudness;Integrated loudness | |
675 | 693 | IntegratedLoudness_Level;Integrated loudness (level gated) |
676 | 694 | IntegratedLoudness_Speech;Integrated loudness (speech gated) |
677 | 695 | InteractivityEnabled;Interactivity enabled |
905 | 923 | LineUpStart;Line Up Start |
906 | 924 | LinkedTo_Bed_Pos;Bed #s |
907 | 925 | LinkedTo_ChannelFormat_Pos;Channel format #s |
926 | LinkedTo_ComplementaryObject_Pos;Complementary object #s | |
908 | 927 | LinkedTo_Content_Pos;Content #s |
909 | 928 | LinkedTo_Group_Pos;Group #s |
910 | 929 | LinkedTo_Object_Pos;Object #s |
911 | 930 | LinkedTo_PackFormat_Pos;Pack format #s |
912 | 931 | LinkedTo_SignalGroup_Pos;Signal group #s |
932 | LinkedTo_StreamFormat_Pos;Stream format #s | |
913 | 933 | LinkedTo_Substream_Pos;Substream #s |
914 | 934 | LinkedTo_TrackFormat_Pos;Track format #s |
915 | 935 | LinkedTo_TrackUID_Pos;Track UID #s |
992 | 1012 | NumberOfPackFormats;Number of pack formats |
993 | 1013 | NumberOfPresentations;Number of presentations |
994 | 1014 | NumberOfProgrammes;Number of programmes |
1015 | NumberOfStreamFormats;Number of stream formats | |
995 | 1016 | NumberOfSubstreams;Number of substreams |
1017 | NumberOfTrackFormats;Number of track formats | |
996 | 1018 | NumberOfTrackUIDs;Number of track UIDs |
997 | NumberOfTrackFormats;Number of track formats | |
998 | NumberOfStreamFormats;Number of stream formats | |
999 | 1019 | NumColors;Number of colors |
1020 | Object;Object | |
1000 | 1021 | ObjectCount;Object Count |
1001 | 1022 | OK;OK |
1002 | 1023 | One output file per input file;One output file per input file |
1059 | 1080 | OverallBitRate_Mode;Overall bit rate mode |
1060 | 1081 | OverallBitRate_Nominal;Nominal Overall bit rate |
1061 | 1082 | PackageName;Package name |
1083 | PackFormat;Pack format | |
1062 | 1084 | Part;Part |
1063 | 1085 | Part_Count;Total count |
1064 | 1086 | PartNumber;Part Number |
1088 | 1110 | PreferredDownmix;Preferred downmix |
1089 | 1111 | PreselectionLabel;Preselection label |
1090 | 1112 | Presentation;Presentation |
1113 | Presentation;Presentation | |
1091 | 1114 | PresentationConfig;Presentation config |
1092 | 1115 | PresentationConfig_ContentClassifier;Presentation config from content classifiers |
1093 | 1116 | PresentationID;Presentation ID |
1099 | 1122 | ProductionNumber;Production Number |
1100 | 1123 | ProductionStudio;Production studio |
1101 | 1124 | ProductPlacement;Product Placement |
1125 | Programme;Programme | |
1102 | 1126 | ProgrammeHasText;Programme Has Text |
1103 | 1127 | ProgrammeTextLanguage;Programme Text Language |
1104 | 1128 | ProgrammeTitle;Programme Title |
1132 | 1156 | ScanType_Original;Original scan type |
1133 | 1157 | ScanType_StoreMethod;Scan type, store method |
1134 | 1158 | ScreenplayBy;Screenplay by |
1159 | ScreenToCenter;Screen to center | |
1160 | ScreenToFront;Screen to front | |
1135 | 1161 | Season;Season |
1136 | 1162 | SecondaryAudioLanguage;Secondary Audio Language |
1137 | 1163 | see below;see below |
1178 | 1204 | Stream;Stream |
1179 | 1205 | Stream_MoreInfo;More information about the stream |
1180 | 1206 | StreamCount;Count of stream of this kind |
1207 | StreamFormat;Stream format | |
1181 | 1208 | StreamID;Stream ID |
1182 | 1209 | streamIdentifier;Stream identifier |
1183 | 1210 | StreamKind;Kind of stream |
1188 | 1215 | StreamSize_Encoded;Encoded stream size |
1189 | 1216 | StreamSize_Proportion;Proportion of this stream |
1190 | 1217 | Subject;Subject |
1218 | Substream;Substream | |
1191 | 1219 | Substream;Substream |
1192 | 1220 | SubTrack;SubTrack |
1193 | 1221 | SubtstreamIdChannel;Substream start ID & channel index |
1225 | 1253 | TimeCode_MaxFrameNumber_Theory;Theoritical maximum frame number in time codes |
1226 | 1254 | TimeCode_Settings;Time code settings |
1227 | 1255 | TimeCode_Source;Time code source |
1228 | TimeCode_Striped;Time code, striped | |
1256 | TimeCode_Stripped;Time code, stripped | |
1229 | 1257 | TimeStamp;Time stamp |
1230 | 1258 | TimeZone;Timezone |
1231 | 1259 | Title;Title |
1232 | 1260 | 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 | |
1233 | 1267 | Total;Total |
1234 | 1268 | TotalNumberOfParts;Total Number Of Parts |
1235 | 1269 | TotalProgrammeDuration;Total Programme Duration |
1236 | 1270 | Track;Track name |
1237 | 1271 | Track_Count;Track count |
1272 | TrackFormat;Track format | |
1238 | 1273 | TrackIndex;Track index |
1239 | TrackUID;TrackUID | |
1274 | TrackUID;Track UID | |
1240 | 1275 | transfer_characteristics;Transfer characteristics |
1241 | 1276 | Translator;Translator |
1242 | 1277 | Transport;Transport |
1258 | 1293 | TruePeakLevel;True peak level |
1259 | 1294 | TruePeakLevel_Album;True peak level (album) |
1260 | 1295 | Type;Type |
1261 | TypeDefinition;TypeDefinition | |
1296 | TypeDefinition;Type definition | |
1262 | 1297 | UniqueID;Unique ID |
1263 | 1298 | UniversalAdID;Universal Ad ID |
1264 | 1299 | UniversalAdID_Registry;Universal Ad ID registry |
0 | 0 | General;[%Format/String%][ (%Format_Profile%)][ (%Format_Commercial_IfAny%)]$if(%Format/String%,$: $)%FileSize/String%[, %Duration/String%] |
1 | 1 | 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\\)) | |
3 | 3 | Text;[%Language/String%, ][%Format/String%][ (%Format_Commercial_IfAny%)]$if(%MuxingMode%, \\(%MuxingMode%\\)) |
4 | 4 | Image;[%Language/String%, ][%Width%*][%Height%][ (%DisplayAspectRatio/String%)][, %Format/String%] |
5 | 5 | Chapters;[%Language/String%, ]%Total% chapters[, %Format/String%][ (%Format_Commercial_IfAny%)] |
128 | 128 | 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 |
129 | 129 | TimeCode_DropFrame;;;N NT;;;Delay drop frame; |
130 | 130 | 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) | |
133 | 133 | TimeCode_Source;;;Y YTY;;;Time code source (Container, Stream, SystemScheme1, SDTI, ANC...) |
134 | 134 | StreamSize;; byte;N YIY;;;Streamsize in bytes;; |
135 | 135 | StreamSize/String;;;Y NT;;;Streamsize in with percentage value;; |
141 | 141 | DisplayAspectRatio_Original/String;;;Y NT;;;Original (in the raw stream) Display Aspect ratio |
142 | 142 | FrameRate_Mode;;;N YTY;;;Frame rate mode (CFR, VFR) |
143 | 143 | 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) | |
144 | 146 | FrameRate;; fps;N YFY;;;Frames per second |
145 | 147 | FrameRate/String;;;Y NT;;;Frames per second (with measurement) |
146 | 148 | FrameRate_Num;;;N NIN;;;Frames per second, numerator |
151 | 153 | FrameRate_Nominal/String;;;N NT;;;Nominal Frames per second (with measurement) |
152 | 154 | FrameRate_Maximum;; fps;N YFY;;;Maximum Frames per second |
153 | 155 | 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 | |
156 | 160 | FrameCount;;;N NIY;;;Number of frames |
157 | 161 | ElementCount;;;Y NIY;;;Number of displayed elements |
158 | 162 | Source_FrameCount;;;N NIY;;;Source Number of frames |