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

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnderground78 <underground78@users.sourceforge.net>2015-06-01 00:15:05 +0300
committerUnderground78 <underground78@users.sourceforge.net>2015-06-01 00:15:05 +0300
commit846eff07c13899dd7d3bf38251886b5263d41213 (patch)
tree9451569d7d9f03251eb2e385040af74d4a508ab2 /src/thirdparty
parent6fcba1bead7608fb480ab943ab9689bc66f4e009 (diff)
parente3f50f602e94794e29a17407e46b64b1ebb32232 (diff)
Merge branch 'release-1.7.9'1.7.9
Diffstat (limited to 'src/thirdparty')
-rw-r--r--src/thirdparty/DoctorDump/CrashRpt.h592
-rw-r--r--src/thirdparty/DoctorDump/DoctorDump.filters17
-rw-r--r--src/thirdparty/DoctorDump/DoctorDump.vcxproj63
-rw-r--r--src/thirdparty/DoctorDump/deploy.bat49
-rw-r--r--src/thirdparty/LAVFilters/GCCInfo.c32
-rwxr-xr-xsrc/thirdparty/LAVFilters/build_ffmpeg.sh100
-rwxr-xr-xsrc/thirdparty/LAVFilters/build_lavfilters.bat107
m---------src/thirdparty/LAVFilters/src0
-rw-r--r--src/thirdparty/MediaInfo/License.html4
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Audio/File_Ac3.cpp10
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Audio/File_Caf.cpp288
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Audio/File_Caf.h55
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Audio/File_Dts.cpp16
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Audio/File_Pcm.cpp5
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Export/Export_EbuCore.cpp722
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Export/Export_EbuCore.h7
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Export/Export_Mpeg7.cpp6
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Export/Export_PBCore.cpp11
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Export/Export_PBCore2.cpp14
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/File_Other.cpp27
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/File__Analyse_Automatic.h38
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/File__Analyze.cpp67
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/File__Analyze.h21
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/File__Analyze_Buffer.cpp42
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/File__Analyze_Buffer_MinimizeSize.cpp37
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/File__Analyze_MinimizeSize.h12
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/File__Analyze_Streams.cpp324
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/File__Analyze_Streams_Finish.cpp107
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/File__Base.cpp2
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/File__Base.h1
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/File__MultipleParsing.cpp12
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Image/File_Bmp.cpp2
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Image/File_Bpg.cpp152
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Image/File_Bpg.h41
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Image/File_Dds.cpp3
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Image/File_Dpx.cpp153
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Image/File_Dpx.h17
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Image/File_Exr.cpp1
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Image/File_Jpeg.cpp37
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Image/File_Jpeg.h1
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Image/File_Png.cpp3
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Image/File_Tiff.cpp2
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/MediaInfo.cpp10
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Config.cpp103
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Config_Automatic.cpp146
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Config_MediaInfo.cpp218
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Config_MediaInfo.h34
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/MediaInfo_File.cpp18
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Inform.cpp121
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Internal.cpp53
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Internal.h1
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Aaf.cpp8
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ancillary.cpp47
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ancillary.h3
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_DashMpd.cpp71
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_DcpAm.cpp9
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_DcpCpl.cpp124
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_DcpPkl.cpp16
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Dxw.cpp30
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Flv.cpp16
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Gxf.cpp4
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_HdsF4m.cpp10
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Hls.cpp18
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ibi.cpp65
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ibi.h16
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ibi_Creation.cpp8
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ism.cpp20
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mk.cpp4
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4.cpp64
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4.h2
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4_Elements.cpp103
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_MpegPs.cpp66
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_MpegTs.cpp111
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg_Descriptors.h8
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg_Psi.cpp8
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mxf.cpp1223
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mxf.h108
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_P2_Clip.cpp40
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ptx.cpp64
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Riff.cpp10
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Riff_Elements.cpp2
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_SequenceInfo.cpp15
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Wm_Elements.cpp8
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper.cpp899
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper.h125
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Common.h74
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Resource.cpp93
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Resource.h61
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Sequence.cpp130
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Sequence.h86
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Sequence_Common.h71
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Reader/Reader_File.cpp30
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Reader/Reader_libcurl.cpp8
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Setup.h53
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Tag/File_Id3v2.cpp2
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Tag/File_VorbisCom.cpp6
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Text/File_Cdp.cpp9
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Text/File_DtvccTransport.cpp9
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Text/File_Eia708.cpp21
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Text/File_Sdp.cpp29
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Text/File_Ttml.cpp9
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Text/File_Ttml.h2
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Video/File_Avc.cpp188
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Video/File_Avc.h9
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Video/File_Hevc.cpp30
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Video/File_Hevc.h5
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Video/File_Mpeg4v.cpp8
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Video/File_Mpegv.cpp22
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Video/File_Mpegv.h4
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Video/File_Vc1.cpp8
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Video/File_Vc3.cpp233
-rw-r--r--src/thirdparty/MediaInfo/MediaInfo/Video/File_Vc3.h4
-rw-r--r--src/thirdparty/MediaInfo/MediaInfoLib.vcxproj18
-rw-r--r--src/thirdparty/MediaInfo/MediaInfoLib.vcxproj.filters30
-rw-r--r--src/thirdparty/SoundTouch/include/STTypes.h7
-rw-r--r--src/thirdparty/SoundTouch/include/SoundTouch.h8
-rw-r--r--src/thirdparty/SoundTouch/source/BPMDetect.cpp5
-rw-r--r--src/thirdparty/SoundTouch/source/FIRFilter.cpp65
-rw-r--r--src/thirdparty/SoundTouch/source/FIRFilter.h8
-rw-r--r--src/thirdparty/SoundTouch/source/PeakFinder.cpp20
-rw-r--r--src/thirdparty/SoundTouch/source/TDStretch.cpp39
-rw-r--r--src/thirdparty/SoundTouch/source/mmx_optimized.cpp5
-rw-r--r--src/thirdparty/SoundTouch/source/sse_optimized.cpp18
-rw-r--r--src/thirdparty/ZenLib/ZenLib/Conf.h6
-rw-r--r--src/thirdparty/ZenLib/ZenLib/Dir.cpp264
-rw-r--r--src/thirdparty/ZenLib/ZenLib/Dir.h19
-rw-r--r--src/thirdparty/ZenLib/ZenLib/File.cpp183
-rw-r--r--src/thirdparty/ZenLib/ZenLib/MemoryUtils.h4
-rw-r--r--src/thirdparty/ZenLib/ZenLib/Utils.cpp4
-rw-r--r--src/thirdparty/ZenLib/ZenLib/int128s.h6
m---------src/thirdparty/lcms2/library0
-rw-r--r--src/thirdparty/sizecbar/scbarg.cpp24
-rw-r--r--src/thirdparty/sizecbar/sizecbar.cpp41
-rw-r--r--src/thirdparty/unrar/archive.cpp2
-rw-r--r--src/thirdparty/unrar/archive.hpp4
-rw-r--r--src/thirdparty/unrar/arcread.cpp17
-rw-r--r--src/thirdparty/unrar/cmddata.cpp11
-rw-r--r--src/thirdparty/unrar/cmddata.hpp3
-rw-r--r--src/thirdparty/unrar/dll.rc10
-rw-r--r--src/thirdparty/unrar/extinfo.cpp35
-rw-r--r--src/thirdparty/unrar/extinfo.hpp1
-rw-r--r--src/thirdparty/unrar/extract.cpp51
-rw-r--r--src/thirdparty/unrar/filcreat.cpp1
-rw-r--r--src/thirdparty/unrar/file.cpp8
-rw-r--r--src/thirdparty/unrar/file.hpp2
-rw-r--r--src/thirdparty/unrar/filestr.cpp16
-rw-r--r--src/thirdparty/unrar/loclang.hpp2
-rw-r--r--src/thirdparty/unrar/options.hpp1
-rw-r--r--src/thirdparty/unrar/os.hpp2
-rw-r--r--src/thirdparty/unrar/pathfn.cpp8
-rw-r--r--src/thirdparty/unrar/pathfn.hpp1
-rw-r--r--src/thirdparty/unrar/strfn.cpp2
-rw-r--r--src/thirdparty/unrar/timefn.cpp2
-rw-r--r--src/thirdparty/unrar/uicommon.cpp7
-rw-r--r--src/thirdparty/unrar/uiconsole.cpp15
-rw-r--r--src/thirdparty/unrar/ulinks.cpp16
-rw-r--r--src/thirdparty/unrar/unpack50.cpp8
-rw-r--r--src/thirdparty/unrar/unpack50mt.cpp13
-rw-r--r--src/thirdparty/unrar/version.hpp8
-rw-r--r--src/thirdparty/unrar/win32lnk.cpp37
-rw-r--r--src/thirdparty/versions.txt14
161 files changed, 7228 insertions, 2276 deletions
diff --git a/src/thirdparty/DoctorDump/CrashRpt.h b/src/thirdparty/DoctorDump/CrashRpt.h
new file mode 100644
index 000000000..cb71f7c1c
--- /dev/null
+++ b/src/thirdparty/DoctorDump/CrashRpt.h
@@ -0,0 +1,592 @@
+// Copyright (c) 2014, Idol Software, Inc.
+// All rights reserved.
+//
+// This file is part of Doctor Dump SDK.
+//
+// Redistribution and use in source and binary forms without modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer
+// in the documentation and/or other materials provided with the distribution.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+// HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+//
+// Project web site http://drdump.com
+
+#ifndef __CRASH_RPT_H__
+#define __CRASH_RPT_H__
+
+#include <windows.h>
+
+/** @file */
+
+#if !(defined CRASHRPT_ENABLE_RELEASE_ASSERTS)
+//! To redefine C \b assert macro behavior define macro \b CRASHRPT_ENABLE_RELEASE_ASSERTS as \b 1 and include CrashRpt.h
+//! in each translation unit as soon as possible (precompiled header is the best place for that).
+//! \code
+//! #define CRASHRPT_ENABLE_RELEASE_ASSERTS 1
+//! #include <CrashRpt.h>
+//! \endcode
+//! When \b _DEBUG define is not defined (it is Release configuration) \b assert macro evaluates an expression and, when the result is false,
+//! sends report and continues execution.
+//! When \b _DEBUG define is defined (it is Debug configuration) \b assert macro works as standard assert macro from assert.h header.
+//! \note All assert calls before CrashRpt.h inclusion would work as standard asserts.
+//! \sa crash_rpt::CrashRpt::ExceptionAssertionViolated crash_rpt::CrashRpt::SkipDoctorDump_SendAssertionViolated
+# define CRASHRPT_ENABLE_RELEASE_ASSERTS 1
+# undef CRASHRPT_ENABLE_RELEASE_ASSERTS // this is to make doxygen document CRASHRPT_ENABLE_RELEASE_ASSERTS macro
+#elif CRASHRPT_ENABLE_RELEASE_ASSERTS == 1
+# include <assert.h>
+# ifndef _DEBUG
+# undef assert
+# define assert(expr) ((void) (!(expr) && (crash_rpt::SkipDoctorDump_ReportAssertionViolation<__COUNTER__>(__FUNCTION__ ": "#expr " is false" ), true)))
+# endif // !_DEBUG
+#endif // CRASHRPT_ENABLE_RELEASE_ASSERTS
+
+namespace crash_rpt {
+
+namespace {
+
+ // This template should be in anonymous namespace since __COUNTER__ is unique only for a single translation unit (as anonymous namespace items)
+ template<unsigned uniqueAssertId>
+ __forceinline static void SkipDoctorDump_ReportAssertionViolation(LPCSTR dumpGroup)
+ {
+ static LONG volatile isAlreadyReported = FALSE;
+ if (TRUE == InterlockedCompareExchange(&isAlreadyReported, TRUE, FALSE))
+ return;
+ ::RaiseException(CrashRpt::ExceptionAssertionViolated, 0, 1, reinterpret_cast<ULONG_PTR*>(&dumpGroup));
+ }
+
+} // namespace {
+
+//! Information about exception being processed.
+struct ExceptionInfo
+{
+ DWORD ExceptionInfoSize; //!< Size of this structure. Should be set to sizeof(ExceptionInfo).
+ BOOL FromSendReport; //!< Indicates is exception processed using CrashRpt::SendReport() call.
+ PEXCEPTION_POINTERS ExceptionPointers; //!< Exception pointers. ExceptionPointers->ExceptionRecord->ExceptionCode contains SEH code or ExceptionAssertionViolated or other Exception* constants for C/C++ special handlers.
+ DWORD ThreadId; //!< Thread identifier of the crashed thread.
+};
+
+//! Stages when crash processing callback called.
+enum CrashProcessingCallbackStage
+{
+ BeforeSendReport, //!< Callback is called before report send.
+ AfterSendReport //!< Callback is called after the report has been sent.
+};
+
+//! Result code for crash processing callback.
+enum CrashProcessingCallbackResult
+{
+ DoDefaultActions, //!< Default result. Crash handler continues its default processing.
+ SkipSendReportReturnDefaultResult, //!< Crash handler doesn't send the report and returns its default result.
+ ContinueExecution, //!< Explicitly force crash handler to return EXCEPTION_CONTINUE_EXECUTION.
+ ContinueSearch, //!< Explicitly force crash handler to return EXCEPTION_CONTINUE_SEARCH.
+ ExecuteHandler //!< Explicitly force crash handler to return EXCEPTION_EXECUTE_HANDLER.
+};
+
+//! Client crash callback function prototype.
+typedef CrashProcessingCallbackResult (CALLBACK *PFNCRASHPROCESSINGCALLBACK)(
+ CrashProcessingCallbackStage stage, //!< Current crash processing stage.
+ ExceptionInfo* exceptionInfo, //!< Information about exception being processed.
+ LPVOID userData //!< Pointer to user-defined data.
+ );
+
+//! Contains data that identifies your application.
+struct ApplicationInfo
+{
+ DWORD ApplicationInfoSize; //!< Size of this structure. Should be set to sizeof(ApplicationInfo).
+ LPCSTR ApplicationGUID; //!< GUID assigned to this application in form 00000000-0000-0000-0000-000000000000.
+ LPCSTR Prefix; //!< Prefix that will be used with the dump name: YourPrefix_v1.v2.v3.v4_YYYYMMDD_HHMMSS.mini.dmp.
+ LPCWSTR AppName; //!< Application name that will be shown in message box.
+ LPCWSTR Company; //!< Company name that will be shown in message box.
+ USHORT V[4]; //!< Version of this application.
+ USHORT Hotfix; //!< Version of hotfix for this application (reserved for future use, should be 0).
+ LPCWSTR PrivacyPolicyUrl; //!< URL to privacy policy. If NULL default privacy policy is used.
+};
+
+//! \brief Contains crash handling behavior customization parameters.
+//!
+//! Default values for all parameters is 0/FALSE.
+struct HandlerSettings
+{
+ DWORD HandlerSettingsSize; //!< Size of this structure. Should be set to sizeof(HandlerSettings).
+ BOOL LeaveDumpFilesInTempFolder; //!< To leave error reports in temp folder you should set this member to TRUE. Your support or test lab teams can use that reports later.
+ BOOL OpenProblemInBrowser; //!< To open Web-page belonging to the uploaded report after it was uploaded set this member to TRUE. It is useful for test lab to track the bug or write some comments.
+ BOOL UseWER; //!< To continue use Microsoft Windows Error Reporting (WER) set this member to TRUE. In that case after Doctor Dump send report dialog Microsoft send report dialog also will be shown. This can be necessary in case of Windows Logo program.
+ DWORD SubmitterID; //!< Doctor Dump user ID. Uploaded report will be marked as uploaded by this user. This is useful for Doctor Dump and bug tracking system integration. Set to \b 0 if user using this application is anonymous.
+ BOOL SendAdditionalDataWithoutApproval; //!< To automatically accepted the question "Do you want to send more information about the problem?" set this member to TRUE .
+ BOOL OverrideDefaultFullDumpType;//!< To override default type of data gathered by the library set this member to TRUE and set required type of data in \a FullDumpType.
+ DWORD FullDumpType; //!< The type of information to be generated when full dump is requested by Doctor Dump. This parameter can be one or more of the values from the MINIDUMP_TYPE enumeration.
+ LPCWSTR LangFilePath; //!< To customize localization set this member to the path to the language file (including file name).
+ LPCWSTR SendRptPath; //!< Set this member to NULL to use default behavior when SendRpt is named sendrpt.exe and exist in same folder with crashrpt.dll. Set to filename if sendrpt.exe has another name but it is in same folder as crashrpt.dll. Set to full path in other cases.
+ LPCWSTR DbgHelpPath; //!< Set this member to NULL to use default behavior when DbgHelp is named dbghelp.dll and exist in same folder with crashrpt.dll. Set to filename if dbghelp.dll has another name but it is in same folder as crashrpt.dll. Set to full path in other cases.
+ //!< \note You should use dbghelp.dll that distributed with crashrpt.dll and not the %SystemRoot%\System32\dbghelp.dll, because only that dll supports all required functionality. See <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms679294(v=vs.85).aspx">DbgHelp Versions</a> for more information.
+ PFNCRASHPROCESSINGCALLBACK CrashProcessingCallback; //!< Callback function that will be called when crash reporting occurs. Set to NULL if no special processing needed.
+ LPVOID CrashProcessingCallbackUserData; //!< User defined parameter for CrashProcessingCallback. Optional.
+};
+
+//! \brief To enable crash processing you should create an instance of this class.
+//!
+//! It should be created as global static object and correctly initialized.
+//! Also you may instantiate it in your main() or WinMain() function as soon as possible.
+class CrashRpt
+{
+public:
+ //! \example Sample.cpp
+ //! This is an example of how to use the CrashRpt class.
+
+ //! CrashRpt constructor. Loads crashrpt.dll and initializes crash handling.
+ //! \note The crashrpt.dll is allowed to be missing. In that case there will be no crash handling.
+ CrashRpt(
+ LPCSTR applicationGUID, //!< [in] GUID assigned to this application.
+ LPCWSTR appName, //!< [in] Application name that will be shown in message box.
+ LPCWSTR company //!< [in] Company name that will be shown in message box.
+ ) throw()
+ {
+ if (!LoadDll())
+ return;
+
+ InitCrashRpt(applicationGUID, NULL, appName, company, TRUE);
+ }
+
+ //! CrashRpt constructor. Loads crashrpt.dll and initializes crash handling.
+ //! \note The crashrpt.dll is allowed to be missing. In that case there will be no crash handling.
+ CrashRpt(
+ LPCSTR applicationGUID, //!< [in] GUID assigned to this application.
+ LPCSTR prefix, //!< [in] Prefix that will be used with the dump name: YourPrefix_v1.v2.v3.v4_YYYYMMDD_HHMMSS.mini.dmp.
+ LPCWSTR appName, //!< [in] Application name that will be shown in message box.
+ LPCWSTR company, //!< [in] Company name that will be shown in message box.
+ BOOL ownProcess = TRUE //!< [in] If you own the process your code running in set this option to \b TRUE. If don't (for example you write
+ //!< a plugin to some external application) set this option to \b FALSE. In that case you need to explicitly
+ //!< catch exceptions. See \ref SendReport for more information.
+ ) throw()
+ {
+ if (!LoadDll())
+ return;
+
+ InitCrashRpt(applicationGUID, prefix, appName, company, ownProcess);
+ }
+
+ //! CrashRpt constructor. Loads crashrpt.dll and initializes crash handling.
+ //! \note The crashrpt.dll is allowed to be missing. In that case there will be no crash handling.
+ CrashRpt(
+ LPCWSTR crashrptPath, //!< [in] Path to crashrpt.dll file. File may be renamed.
+ LPCSTR applicationGUID, //!< [in] GUID assigned to this application.
+ LPCSTR prefix, //!< [in] Prefix that will be used with the dump name: YourPrefix_v1.v2.v3.v4_YYYYMMDD_HHMMSS.mini.dmp.
+ LPCWSTR appName, //!< [in] Application name that will be shown in message box.
+ LPCWSTR company, //!< [in] Company name that will be shown in message box.
+ BOOL ownProcess = TRUE //!< [in] If you own the process your code running in set this option to \b TRUE. If don't (for example you write
+ //!< a plugin to some external application) set this option to \b FALSE. In that case you need to explicitly
+ //!< catch exceptions. See \ref SendReport for more information.
+ ) throw()
+ {
+ if (!LoadDll(crashrptPath))
+ return;
+
+ InitCrashRpt(applicationGUID, prefix, appName, company, ownProcess);
+ }
+
+ //! CrashRpt constructor. Loads crashrpt.dll and initializes crash handling.
+ //! \note The crashrpt.dll is allowed to be missing. In that case there will be no crash handling.
+ CrashRpt(
+ ApplicationInfo* applicationInfo, //!< [in] Pointer to the ApplicationInfo structure that identifies your application.
+ HandlerSettings* handlerSettings, //!< [in] Pointer to the HandlerSettings structure that customizes crash handling behavior. This parameter can be \b NULL.
+ BOOL ownProcess = TRUE //!< [in] If you own the process your code running in set this option to \b TRUE. If don't (for example you write
+ //!< a plugin to some external application) set this option to \b FALSE. In that case you need to explicitly
+ //!< catch exceptions. See \ref SendReport for more information.
+ ) throw()
+ {
+ if (!LoadDll())
+ return;
+
+ InitCrashRpt(applicationInfo, handlerSettings, ownProcess);
+ }
+
+ //! CrashRpt constructor. Loads crashrpt.dll and initializes crash handling.
+ //! \note The crashrpt.dll is allowed to be missing. In that case there will be no crash handling.
+ CrashRpt(
+ LPCWSTR crashrptPath, //!< [in] Path to crashrpt.dll file. File may be renamed.
+ ApplicationInfo* applicationInfo, //!< [in] Pointer to the ApplicationInfo structure that identifies your application.
+ HandlerSettings* handlerSettings, //!< [in] Pointer to the HandlerSettings structure that customizes crash handling behavior. This parameter can be \b NULL.
+ BOOL ownProcess = TRUE //!< [in] If you own the process your code running in set this option to \b TRUE. If don't (for example you write
+ //!< a plugin to some external application) set this option to \b FALSE. In that case you need to explicitly
+ //!< catch exceptions. See \ref SendReport for more information.
+ ) throw()
+ {
+ if (!LoadDll(crashrptPath))
+ return;
+
+ InitCrashRpt(applicationInfo, handlerSettings, ownProcess);
+ }
+
+
+ //! CrashRpt constructor. Loads crashrpt.dll. You should call \ref InitCrashRpt to turn on crash handling.
+ //! \note The crashrpt.dll is allowed to be missing. In that case there will be no crash handling.
+ CrashRpt(
+ LPCWSTR crashrptPath = NULL //!< [in] Path to crashrpt.dll file. File may be renamed.
+ ) throw()
+ {
+ LoadDll(crashrptPath);
+ }
+
+ //! CrashRpt destructor.
+ //! \note It doesn't unload crashrpt.dll and doesn't disable crash handling since crash may appear on very late phase of application exit.
+ //! For example destructor of some static variable that is called after return from main() may crash.
+ ~CrashRpt()
+ {
+ if (!m_IsReadyToExit)
+ return;
+
+ // If crash has happen not in main thread we should wait here until report will be sent
+ // or else program will be terminated after return from main() and report sending will be halted.
+ while (!m_IsReadyToExit())
+ ::Sleep(100);
+
+#if _WIN32_WINNT >= 0x0501 /*_WIN32_WINNT_WINXP*/
+ if (m_bSkipAssertsAdded)
+ RemoveVectoredExceptionHandler(SkipAsserts);
+#endif
+ }
+
+ //! Checks that crash handling was enabled.
+ //! \return Return \b true if crash handling was enabled.
+ bool IsCrashHandlingEnabled() const
+ {
+ return m_bWorking;
+ }
+
+ //! Initializes crash handler.
+ //! \note You may call this function multiple times if some data has changed.
+ //! \return Return \b true if crash handling was enabled.
+ bool InitCrashRpt(
+ ApplicationInfo* applicationInfo, //!< [in] Pointer to the ApplicationInfo structure that identifies your application.
+ HandlerSettings* handlerSettings, //!< [in] Pointer to the HandlerSettings structure that customizes crash handling behavior. This parameter can be \b NULL.
+ BOOL ownProcess = TRUE //!< [in] If you own the process your code running in set this option to \b TRUE. If don't (for example you write
+ //!< a plugin to some external application) set this option to \b FALSE. In that case you need to explicitly
+ //!< catch exceptions. See \ref SendReport for more information.
+ ) throw()
+ {
+ if (!m_InitCrashRpt)
+ return false;
+
+ m_bWorking = m_InitCrashRpt(applicationInfo, handlerSettings, ownProcess) != FALSE;
+
+ return m_bWorking;
+ }
+
+ //! Initializes crash handler.
+ //! \return Return \b true if crash handling was enabled.
+ //! \warning This method is deprecated. Use \ref InitCrashRpt instead.
+ __declspec(deprecated)
+ bool InitCrashHandler(
+ ApplicationInfo* applicationInfo, //!< [in] Pointer to the ApplicationInfo structure that identifies your application.
+ HandlerSettings* handlerSettings, //!< [in] Pointer to the HandlerSettings structure that customizes crash handling behavior. This parameter can be \b NULL.
+ BOOL ownProcess = TRUE //!< [in] If you own the process your code running in set this option to \b TRUE. If don't (for example you write
+ //!< a plugin to some external application) set this option to \b FALSE. In that case you need to explicitly
+ //!< catch exceptions. See \ref SendReport for more information.
+ ) throw()
+ {
+ return InitCrashRpt(applicationInfo, handlerSettings, ownProcess);
+ }
+
+
+ //! Initializes crash handler.
+ //! \note You may call this function multiple times if some data has changed.
+ //! \return Return \b true if crash handling was enabled.
+ bool InitCrashRpt(
+ LPCSTR applicationGUID, //!< [in] GUID assigned to this application.
+ LPCSTR prefix, //!< [in] Prefix that will be used with the dump name: YourPrefix_v1.v2.v3.v4_YYYYMMDD_HHMMSS.mini.dmp.
+ LPCWSTR appName, //!< [in] Application name that will be shown in message box.
+ LPCWSTR company, //!< [in] Company name that will be shown in message box.
+ BOOL ownProcess = TRUE //!< [in] If you own the process your code running in set this option to \b TRUE. If don't (for example you write
+ //!< a plugin to some external application) set this option to \b FALSE. In that case you need to explicitly
+ //!< catch exceptions. See \ref SendReport for more information.
+ ) throw()
+ {
+ if (!m_GetVersionFromApp)
+ return false;
+
+ ApplicationInfo appInfo;
+ memset(&appInfo, 0, sizeof(appInfo));
+ appInfo.ApplicationInfoSize = sizeof(appInfo);
+ appInfo.ApplicationGUID = applicationGUID;
+ appInfo.Prefix = prefix;
+ appInfo.AppName = appName;
+ appInfo.Company = company;
+ if (!m_GetVersionFromApp(&appInfo))
+ appInfo.V[0] = 1;
+
+ HandlerSettings handlerSettings;
+ memset(&handlerSettings, 0, sizeof(handlerSettings));
+ handlerSettings.HandlerSettingsSize = sizeof(handlerSettings);
+ handlerSettings.OpenProblemInBrowser = TRUE;
+
+ return InitCrashRpt(&appInfo, &handlerSettings, ownProcess);
+ }
+
+ //! \note This function is experimental and may not be available and may not be support by Doctor Dump in the future.
+ //! You may set custom information for your possible report.
+ //! This text will be available on Doctor Dump dumps page.
+ //! The text should not contain private information.
+ //! \return If the function succeeds, the return value is \b true.
+ bool SetCustomInfo(
+ LPCWSTR text //!< [in] custom info for the report. The text will be cut to 100 characters.
+ )
+ {
+ if (!m_SetCustomInfo)
+ return false;
+ m_SetCustomInfo(text);
+ return true;
+ }
+
+ //! You may add any key/value pair to crash report.
+ //! \return If the function succeeds, the return value is \b true.
+ //! \note This function is thread safe.
+ bool AddUserInfoToReport(
+ LPCWSTR key, //!< [in] key string that will be added to the report.
+ LPCWSTR value //!< [in] value for the key.
+ ) throw()
+ {
+ if (!m_AddUserInfoToReport)
+ return false;
+ m_AddUserInfoToReport(key, value);
+ return true;
+ }
+
+ //! You may remove any key that was added previously to crash report by \a AddUserInfoToReport.
+ //! \return If the function succeeds, the return value is \b true.
+ //! \note This function is thread safe.
+ bool RemoveUserInfoFromReport(
+ LPCWSTR key //!< [in] key string that will be removed from the report.
+ )
+ {
+ if (!m_RemoveUserInfoFromReport)
+ return false;
+ m_RemoveUserInfoFromReport(key);
+ return true;
+ }
+
+ //! You may add any file to crash report. This file will be read when crash appears and will be sent within the report.
+ //! Multiple files may be added. Filename of the file in the report may be changed to any name.
+ //! \return If the function succeeds, the return value is \b true.
+ //! \note This function is thread safe.
+ bool AddFileToReport(
+ LPCWSTR path, //!< [in] Path to the file, that will be added to the report.
+ LPCWSTR reportFileName /* = NULL */ //!< [in] Filename that will be used in report for this file. If parameter is \b NULL, original name from path will be used.
+ ) throw()
+ {
+ if (!m_AddFileToReport)
+ return false;
+ m_AddFileToReport(path, reportFileName);
+ return true;
+ }
+
+ //! Remove from report the file that was registered earlier to be sent within report.
+ //! \return If the function succeeds, the return value is \b true.
+ //! \note This function is thread safe.
+ bool RemoveFileFromReport(
+ LPCWSTR path //!< [in] Path to the file, that will be removed from the report.
+ ) throw()
+ {
+ if (!m_RemoveFileFromReport)
+ return false;
+ m_RemoveFileFromReport(path);
+ return true;
+ }
+
+ //! Fills version field (V) of ApplicationInfo with product version
+ //! found in the executable file of the current process.
+ //! \return If the function succeeds, the return value is \b true.
+ bool GetVersionFromApp(
+ ApplicationInfo* appInfo //!< [out] Pointer to ApplicationInfo structure. Its version field (V) will be set to product version.
+ ) throw()
+ {
+ if (!m_GetVersionFromApp)
+ return false;
+ return m_GetVersionFromApp(appInfo) != FALSE;
+ }
+
+ //! Fill version field (V) of ApplicationInfo with product version found in the file specified.
+ //! \return If the function succeeds, the return value is \b true.
+ bool GetVersionFromFile(
+ LPCWSTR path, //!< [in] Path to the file product version will be extracted from.
+ ApplicationInfo* appInfo //!< [out] Pointer to ApplicationInfo structure. Its version field (V) will be set to product version.
+ ) throw()
+ {
+ if (!m_GetVersionFromFile)
+ return false;
+ return m_GetVersionFromFile(path, appInfo) != FALSE;
+ }
+
+ //! If you do not own the process your code running in (for example you write a plugin to some
+ //! external application) you need to properly initialize CrashRpt using \b ownProcess option.
+ //! Also you need to explicitly catch all exceptions in all entry points to your code and in all
+ //! threads you create. To do so use this construction:
+ //! \code
+ //! bool SomeEntryPoint(PARAM p)
+ //! {
+ //! __try
+ //! {
+ //! return YouCode(p);
+ //! }
+ //! __except (CrashRpt::SendReport(GetExceptionInformation()))
+ //! {
+ //! ::ExitProcess(0); // It is better to stop the process here or else corrupted data may incomprehensibly crash it later.
+ //! return false;
+ //! }
+ //! }
+ //! \endcode
+ LONG SendReport(
+ EXCEPTION_POINTERS* exceptionPointers //!< [in] Pointer to EXCEPTION_POINTERS structure. You should get it using GetExceptionInformation()
+ //!< function inside __except keyword.
+ )
+ {
+ if (!m_SendReport)
+ {
+ // There is no crash handler but asserts should not crash application anyway, so let's continue
+ if (exceptionPointers->ExceptionRecord->ExceptionCode == ExceptionAssertionViolated)
+ return EXCEPTION_CONTINUE_EXECUTION;
+ return EXCEPTION_CONTINUE_SEARCH;
+ }
+ return m_SendReport(exceptionPointers);
+ }
+
+ //! To send a report about violated assertion you can throw exception with this exception code
+ //! using: \code RaiseException(CrashRpt::ExceptionAssertionViolated, 0, 0, NULL); \endcode
+ //! Execution will continue after report will be sent (EXCEPTION_CONTINUE_EXECUTION would be used).
+ //! You may pass grouping string as first parameter (see \a SkipDoctorDump_SendAssertionViolated).
+ //! \note If you called CrashRpt constructor and crashrpt.dll was missing you still may using this exception.
+ //! It will be caught, ignored and execution will continue. \ref SendReport function also works safely
+ //! when crashrpt.dll was missing.
+ //! \sa CRASHRPT_ENABLE_RELEASE_ASSERTS SkipDoctorDump_SendAssertionViolated
+ static const DWORD ExceptionAssertionViolated = ((DWORD)0xCCE17000);
+
+ //! Exception code for Terminate()/SIGABRT call in crash callback.
+ static const DWORD ExceptionCppTerminate = ((DWORD)0xCCE17001);
+
+ //! Exception code for pure virtual call in crash callback.
+ static const DWORD ExceptionPureCall = ((DWORD)0xCCE17002);
+
+ //! Exception code for CRT invalid parameter call in crash callback.
+ static const DWORD ExceptionInvalidParameter = ((DWORD)0xCCE17003);
+
+ //! Sends assertion violation report from this point and continue execution.
+ //! \sa ExceptionAssertionViolated
+ //! \note Functions containing "SkipDoctorDump" will be ignored in stack parsing.
+ //! \sa CRASHRPT_ENABLE_RELEASE_ASSERTS ExceptionAssertionViolated
+ void SkipDoctorDump_SendAssertionViolated(
+ LPCSTR dumpGroup = NULL //!< [in] All dumps with that group will be separated from dumps with same stack but another group. Set parameter to \b NULL if no grouping is required.
+ ) const
+ {
+ if (!m_bWorking)
+ return;
+ if (dumpGroup)
+ ::RaiseException(CrashRpt::ExceptionAssertionViolated, 0, 1, reinterpret_cast<ULONG_PTR*>(&dumpGroup));
+ else
+ ::RaiseException(CrashRpt::ExceptionAssertionViolated, 0, 0, NULL);
+ }
+
+private:
+ bool LoadDll(LPCWSTR crashrptPath = NULL) throw()
+ {
+ m_bLoaded = false;
+ m_bWorking = false;
+ m_bSkipAssertsAdded = false;
+ m_InitCrashRpt = NULL;
+ m_SendReport = NULL;
+ m_IsReadyToExit = NULL;
+ m_SetCustomInfo = NULL;
+ m_AddUserInfoToReport = NULL;
+ m_RemoveUserInfoFromReport = NULL;
+ m_AddFileToReport = NULL;
+ m_RemoveFileFromReport = NULL;
+ m_GetVersionFromApp = NULL;
+ m_GetVersionFromFile = NULL;
+
+ // hCrashrptDll should not be unloaded, crash may appear even after return from main().
+ // So hCrashrptDll is not saved after construction.
+ HMODULE hCrashrptDll = ::LoadLibraryW(crashrptPath ? crashrptPath : L"crashrpt.dll");
+ if (hCrashrptDll != NULL)
+ {
+ m_InitCrashRpt = (pfnInitCrashRpt) GetProcAddress(hCrashrptDll, "InitCrashRpt");
+ m_SendReport = (pfnSendReport) GetProcAddress(hCrashrptDll, "SendReport");
+ m_IsReadyToExit = (pfnIsReadyToExit) GetProcAddress(hCrashrptDll, "IsReadyToExit");
+ m_SetCustomInfo = (pfnSetCustomInfo) GetProcAddress(hCrashrptDll, "SetCustomInfo");
+ m_AddUserInfoToReport = (pfnAddUserInfoToReport) GetProcAddress(hCrashrptDll, "AddUserInfoToReport");
+ m_RemoveUserInfoFromReport = (pfnRemoveUserInfoFromReport) GetProcAddress(hCrashrptDll, "RemoveUserInfoFromReport");
+ m_AddFileToReport = (pfnAddFileToReport) GetProcAddress(hCrashrptDll, "AddFileToReport");
+ m_RemoveFileFromReport = (pfnRemoveFileFromReport) GetProcAddress(hCrashrptDll, "RemoveFileFromReport");
+ m_GetVersionFromApp = (pfnGetVersionFromApp) GetProcAddress(hCrashrptDll, "GetVersionFromApp");
+ m_GetVersionFromFile = (pfnGetVersionFromFile) GetProcAddress(hCrashrptDll, "GetVersionFromFile");
+
+ m_bLoaded = m_InitCrashRpt
+ && m_SendReport
+ && m_IsReadyToExit
+ && m_SetCustomInfo
+ && m_AddUserInfoToReport
+ && m_RemoveUserInfoFromReport
+ && m_AddFileToReport
+ && m_RemoveFileFromReport
+ && m_GetVersionFromApp
+ && m_GetVersionFromFile;
+ }
+
+#if _WIN32_WINNT >= 0x0501 /*_WIN32_WINNT_WINXP*/
+ // if no crash processing was started, we need to ignore ExceptionAssertionViolated exceptions.
+ if (!m_bLoaded)
+ {
+ ::AddVectoredExceptionHandler(TRUE, SkipAsserts);
+ m_bSkipAssertsAdded = true;
+ }
+#endif
+
+ return m_bLoaded;
+ }
+
+ static LONG CALLBACK SkipAsserts(EXCEPTION_POINTERS* pExceptionInfo)
+ {
+ if (pExceptionInfo->ExceptionRecord->ExceptionCode == ExceptionAssertionViolated)
+ return EXCEPTION_CONTINUE_EXECUTION;
+ return EXCEPTION_CONTINUE_SEARCH;
+ }
+
+ bool m_bLoaded;
+ bool m_bWorking;
+ bool m_bSkipAssertsAdded;
+
+ typedef BOOL (*pfnInitCrashRpt)(ApplicationInfo* applicationInfo, HandlerSettings* handlerSettings, BOOL ownProcess);
+ typedef LONG (*pfnSendReport)(EXCEPTION_POINTERS* exceptionPointers);
+ typedef BOOL (*pfnIsReadyToExit)();
+ typedef void (*pfnSetCustomInfo)(LPCWSTR text);
+ typedef void (*pfnAddUserInfoToReport)(LPCWSTR key, LPCWSTR value);
+ typedef void (*pfnRemoveUserInfoFromReport)(LPCWSTR key);
+ typedef void (*pfnAddFileToReport)(LPCWSTR path, LPCWSTR reportFileName /* = NULL */);
+ typedef void (*pfnRemoveFileFromReport)(LPCWSTR path);
+ typedef BOOL (*pfnGetVersionFromApp)(ApplicationInfo* appInfo);
+ typedef BOOL (*pfnGetVersionFromFile)(LPCWSTR path, ApplicationInfo* appInfo);
+
+ pfnInitCrashRpt m_InitCrashRpt;
+ pfnSendReport m_SendReport;
+ pfnIsReadyToExit m_IsReadyToExit;
+ pfnSetCustomInfo m_SetCustomInfo;
+ pfnAddUserInfoToReport m_AddUserInfoToReport;
+ pfnRemoveUserInfoFromReport m_RemoveUserInfoFromReport;
+ pfnAddFileToReport m_AddFileToReport;
+ pfnRemoveFileFromReport m_RemoveFileFromReport;
+ pfnGetVersionFromApp m_GetVersionFromApp;
+ pfnGetVersionFromFile m_GetVersionFromFile;
+};
+
+} // namespace crash_rpt
+
+__declspec(deprecated) typedef crash_rpt::CrashRpt CrashHandler; //!< Deprecated. Use crash_rpt::CrashRpt class instead.
+__declspec(deprecated) typedef crash_rpt::ApplicationInfo ApplicationInfo; //!< Deprecated. Use crash_rpt::ApplicationInfo class instead.
+__declspec(deprecated) typedef crash_rpt::HandlerSettings HandlerSettings; //!< Deprecated. Use crash_rpt::HandlerSettings class instead.
+
+#endif // __CRASH_RPT_H__ \ No newline at end of file
diff --git a/src/thirdparty/DoctorDump/DoctorDump.filters b/src/thirdparty/DoctorDump/DoctorDump.filters
new file mode 100644
index 000000000..c2f3e01d1
--- /dev/null
+++ b/src/thirdparty/DoctorDump/DoctorDump.filters
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
+ <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
+ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
+ </Filter>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/src/thirdparty/DoctorDump/DoctorDump.vcxproj b/src/thirdparty/DoctorDump/DoctorDump.vcxproj
new file mode 100644
index 000000000..2988a1d1c
--- /dev/null
+++ b/src/thirdparty/DoctorDump/DoctorDump.vcxproj
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Release Lite|Win32">
+ <Configuration>Release Lite</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release Lite|x64">
+ <Configuration>Release Lite</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{BECEAFF9-CDCA-45EC-A1CF-658FA51818E6}</ProjectGuid>
+ <RootNamespace>DoctorDump</RootNamespace>
+ <Keyword>DoctorDump</Keyword>
+ <ProjectName>DoctorDump</ProjectName>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <Import Project="..\..\platform.props" />
+ <PropertyGroup Label="Configuration">
+ <ConfigurationType>Makefile</ConfigurationType>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="..\..\common.props" />
+ <Import Project="..\..\common-3rd-party.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)bin\mpc-hc_x86\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Lite|Win32'">
+ <OutDir>$(SolutionDir)bin\mpc-hc_x86 Lite\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)bin\mpc-hc_x64\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Lite|x64'">
+ <OutDir>$(SolutionDir)bin\mpc-hc_x64 Lite\</OutDir>
+ </PropertyGroup>
+ <PropertyGroup>
+ <NMakeBuildCommandLine>$(ProjectDir)deploy.bat $(Platform) "$(OutDir)"</NMakeBuildCommandLine>
+ <NMakeReBuildCommandLine>$(ProjectDir)deploy.bat $(Platform) "$(OutDir)"</NMakeReBuildCommandLine>
+ </PropertyGroup>
+ <ItemGroup>
+ <ClInclude Include="CrashRpt.h" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/src/thirdparty/DoctorDump/deploy.bat b/src/thirdparty/DoctorDump/deploy.bat
new file mode 100644
index 000000000..02e2f1df1
--- /dev/null
+++ b/src/thirdparty/DoctorDump/deploy.bat
@@ -0,0 +1,49 @@
+@ECHO OFF
+REM (C) 2015 see Authors.txt
+REM
+REM This file is part of MPC-HC.
+REM
+REM MPC-HC is free software; you can redistribute it and/or modify
+REM it under the terms of the GNU General Public License as published by
+REM the Free Software Foundation; either version 3 of the License, or
+REM (at your option) any later version.
+REM
+REM MPC-HC is distributed in the hope that it will be useful,
+REM but WITHOUT ANY WARRANTY; without even the implied warranty of
+REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+REM GNU General Public License for more details.
+REM
+REM You should have received a copy of the GNU General Public License
+REM along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+SETLOCAL
+SET "FILE_DIR=%~dp0"
+PUSHD "%FILE_DIR%"
+
+SET ROOT_DIR=..\..\..
+SET "COMMON=%FILE_DIR%%ROOT_DIR%\common.bat"
+CALL "%COMMON%" :SubPreBuild
+
+IF "%1" == "" CALL "%COMMON%" :SubMsg "ERROR" "%~nx0, No argument was provided." & EXIT /B
+
+SET "SRCFOLDER=%MPCHC_DOCTORDUMP%\bin"
+IF /I "%~1" == "x64" (
+ SET "SRCFOLDER=%SRCFOLDER%\x64"
+)
+
+SET "DESTFOLDER=%~2CrashReporter"
+
+IF EXIST "%MPCHC_DOCTORDUMP%" (
+ IF NOT EXIST "%DESTFOLDER%" MD "%DESTFOLDER%"
+ COPY /Y /V "%SRCFOLDER%\crashrpt.dll" "%DESTFOLDER%"
+ COPY /Y /V "%SRCFOLDER%\dbghelp.dll" "%DESTFOLDER%"
+ COPY /Y /V "%SRCFOLDER%\sendrpt.exe" "%DESTFOLDER%"
+) ELSE IF DEFINED MPCHC_DOCTORDUMP (
+ CALL "%COMMON%" :SubMsg "WARNING" "Invalid path to Doctor Dump SDK, files were not copied"
+)
+
+:End
+POPD
+ENDLOCAL
+EXIT /B
diff --git a/src/thirdparty/LAVFilters/GCCInfo.c b/src/thirdparty/LAVFilters/GCCInfo.c
deleted file mode 100644
index a954ea636..000000000
--- a/src/thirdparty/LAVFilters/GCCInfo.c
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * (C) 2008-2013 see Authors.txt
- *
- * This file is part of MPC-HC.
- *
- * MPC-HC is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * MPC-HC is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#include <_mingw.h>
-
-#define str(s) xstr(s)
-#define xstr(s) #s
-
-#ifdef __MINGW64_VERSION_MAJOR
-#define MINGW "MinGW-w64"
-#else
-#define MINGW "MinGW"
-#endif
-
-char g_Gcc_Compiler[] = MINGW " GCC " str(__GNUC__) "." str(__GNUC_MINOR__) "." str(__GNUC_PATCHLEVEL__);
diff --git a/src/thirdparty/LAVFilters/build_ffmpeg.sh b/src/thirdparty/LAVFilters/build_ffmpeg.sh
index 5d49520f8..071e2e0bc 100755
--- a/src/thirdparty/LAVFilters/build_ffmpeg.sh
+++ b/src/thirdparty/LAVFilters/build_ffmpeg.sh
@@ -1,43 +1,58 @@
#!/bin/sh
+echo "$(pwd)" | grep -q '[[:blank:]]' &&
+ echo "Out of tree builds are impossible with whitespace in source path." && exit 1
+
if [ "${1}" == "x64" ]; then
arch=x86_64
archdir=x64
+ cross_prefix=x86_64-w64-mingw32-
+ lav_folder=LAVFilters64
+ mpc_hc_folder=mpc-hc_x64
else
arch=x86
archdir=Win32
+ cross_prefix=
+ lav_folder=LAVFilters
+ mpc_hc_folder=mpc-hc_x86
fi
-make_dirs() {
- if [ ! -d bin_${archdir}/lib ]; then
- mkdir -p bin_${archdir}/lib
- fi
+if [ "${2}" == "Debug" ]; then
+ FFMPEG_DLL_PATH=$(readlink -f ../../..)/bin/${mpc_hc_folder}_Debug/${lav_folder}
+ BASEDIR=$(pwd)/src/bin_${archdir}d
+else
+ FFMPEG_DLL_PATH=$(readlink -f ../../..)/bin/${mpc_hc_folder}/${lav_folder}
+ BASEDIR=$(pwd)/src/bin_${archdir}
+fi
- if [ ! -d bin_${archdir}d/lib ]; then
- mkdir -p bin_${archdir}d/lib
- fi
-}
+THIRDPARTYPREFIX=${BASEDIR}/thirdparty
+FFMPEG_BUILD_PATH=${THIRDPARTYPREFIX}/ffmpeg
+FFMPEG_LIB_PATH=${BASEDIR}/lib
+DCADEC_SOURCE_PATH=$(pwd)/src/thirdparty/dcadec
+DCADEC_BUILD_PATH=${THIRDPARTYPREFIX}/dcadec
+export PKG_CONFIG_PATH="${DCADEC_BUILD_PATH}"
-strip_libs() {
- if [ "${arch}" == "x86_64" ]; then
- x86_64-w64-mingw32-strip lib*/*-lav-*.dll
- else
- strip lib*/*-lav-*.dll
- fi
+make_dirs() {
+ mkdir -p ${FFMPEG_LIB_PATH}
+ mkdir -p ${FFMPEG_BUILD_PATH}
+ mkdir -p ${DCADEC_BUILD_PATH}
+ mkdir -p ${FFMPEG_DLL_PATH}
}
copy_libs() {
- cp lib*/*-lav-*.dll ../../bin_${archdir}
- cp lib*/*.lib ../../bin_${archdir}/lib
- cp lib*/*-lav-*.dll ../../bin_${archdir}d
- cp lib*/*.lib ../../bin_${archdir}d/lib
+ # install -s --strip-program=${cross_prefix}strip lib*/*-lav-*.dll ${FFMPEG_DLL_PATH}
+ cp lib*/*-lav-*.dll ${FFMPEG_DLL_PATH}
+ ${cross_prefix}strip ${FFMPEG_DLL_PATH}/*-lav-*.dll
+ cp -u lib*/*.lib ${FFMPEG_LIB_PATH}
}
clean() {
+ cd ${FFMPEG_BUILD_PATH}
echo Cleaning...
if [ -f config.mak ]; then
make distclean > /dev/null 2>&1
fi
+ cd ${BASEDIR}
}
configure() {
@@ -68,6 +83,8 @@ configure() {
--enable-hwaccel=vc1_dxva2 \
--enable-hwaccel=wmv3_dxva2 \
--enable-hwaccel=mpeg2_dxva2 \
+ --disable-decoder=dca \
+ --enable-libdcadec \
--enable-libspeex \
--enable-libopencore-amrnb \
--enable-libopencore-amrwb \
@@ -85,30 +102,32 @@ configure() {
--build-suffix=-lav \
--arch=${arch}"
- EXTRA_CFLAGS="-D_WIN32_WINNT=0x0502 -DWINVER=0x0502 -I../../thirdparty/include"
+ EXTRA_CFLAGS="-D_WIN32_WINNT=0x0502 -DWINVER=0x0502 -I../../../thirdparty/include"
EXTRA_LDFLAGS=""
if [ "${arch}" == "x86_64" ]; then
- OPTIONS="${OPTIONS} --enable-cross-compile --cross-prefix=x86_64-w64-mingw32- --target-os=mingw32"
- EXTRA_LDFLAGS="${EXTRA_LDFLAGS} -L../../thirdparty/lib64"
+ OPTIONS="${OPTIONS} --enable-cross-compile --cross-prefix=${cross_prefix} --target-os=mingw32 --pkg-config=pkg-config"
+ EXTRA_LDFLAGS="${EXTRA_LDFLAGS} -L../../../thirdparty/lib64"
else
OPTIONS="${OPTIONS} --cpu=i686"
EXTRA_CFLAGS="${EXTRA_CFLAGS} -mmmx -msse -mfpmath=sse"
- EXTRA_LDFLAGS="${EXTRA_LDFLAGS} -L../../thirdparty/lib32"
+ EXTRA_LDFLAGS="${EXTRA_LDFLAGS} -L../../../thirdparty/lib32"
fi
- sh ../../ffmpeg/configure --extra-ldflags="${EXTRA_LDFLAGS}" --extra-cflags="${EXTRA_CFLAGS}" ${OPTIONS}
+ sh ../../../ffmpeg/configure --extra-ldflags="${EXTRA_LDFLAGS}" --extra-cflags="${EXTRA_CFLAGS}" ${OPTIONS}
}
build() {
echo Building...
- make -j$(($NUMBER_OF_PROCESSORS+1)) 2>&1 | tee make.log
+ make -j$NUMBER_OF_PROCESSORS 2>&1 | tee make.log
## Check the return status and the log to detect possible errors
[ ${PIPESTATUS[0]} -eq 0 ] && ! grep -q -F "rerun configure" make.log
}
configureAndBuild() {
+ cd ${FFMPEG_BUILD_PATH}
## Don't run configure again if it was previously run
- if [ -f config.mak ]; then
+ if [ ../../../ffmpeg/configure -ot config.mak ] &&
+ [ ../../../../build_ffmpeg.sh -ot config.mak ]; then
echo Skipping configure...
else
echo Configuring...
@@ -124,27 +143,33 @@ configureAndBuild() {
## Only if configure succeeded, actually build
if [ ${CONFIGRETVAL} -eq 0 ]; then
build &&
- strip_libs &&
copy_libs
CONFIGRETVAL=$?
fi
+ cd ${BASEDIR}
}
-echo Building ffmpeg in GCC ${arch} Release config...
+build_dcadec() {
+ cd ${DCADEC_BUILD_PATH}
+ make -f "${DCADEC_SOURCE_PATH}/Makefile" -j$NUMBER_OF_PROCESSORS CONFIG_WINDOWS=1 CONFIG_SMALL=1 CC=${cross_prefix}gcc AR=${cross_prefix}ar lib
+ make -f "${DCADEC_SOURCE_PATH}/Makefile" PREFIX="${THIRDPARTYPREFIX}" LIBDIR="${DCADEC_BUILD_PATH}/libdcadec" INCLUDEDIR="${DCADEC_SOURCE_PATH}" dcadec.pc
+ cd ${BASEDIR}
+}
-cd src
+clean_dcadec() {
+ cd ${DCADEC_BUILD_PATH}
+ make -f "${DCADEC_SOURCE_PATH}/Makefile" CONFIG_WINDOWS=1 clean
+ cd ${BASEDIR}
+}
-make_dirs
+echo Building ffmpeg in GCC ${arch} Release config...
-out_dir=bin_${archdir}/ffmpeg
-if [ ! -d ${out_dir} ]; then
- mkdir -p ${out_dir}
-fi
-cd ${out_dir}
+make_dirs
CONFIGRETVAL=0
-if [ "${2}" == "Clean" ]; then
+if [ "${3}" == "Clean" ]; then
+ clean_dcadec
clean
CONFIGRETVAL=$?
else
@@ -155,16 +180,17 @@ else
CLEANBUILD=1
fi
+ build_dcadec
+
configureAndBuild
## In case of error and only if we didn't start with a clean build,
## we try to rebuild from scratch including a full reconfigure
if [ ! ${CONFIGRETVAL} -eq 0 ] && [ ${CLEANBUILD} -eq 0 ]; then
echo Trying again with forced reconfigure...
+ clean_dcadec && build_dcadec
clean && configureAndBuild
fi
fi
-cd ../../..
-
exit ${CONFIGRETVAL}
diff --git a/src/thirdparty/LAVFilters/build_lavfilters.bat b/src/thirdparty/LAVFilters/build_lavfilters.bat
index 44528289e..87c2c411a 100755
--- a/src/thirdparty/LAVFilters/build_lavfilters.bat
+++ b/src/thirdparty/LAVFilters/build_lavfilters.bat
@@ -18,25 +18,16 @@ REM along with this program. If not, see <http://www.gnu.org/licenses/>.
SETLOCAL
-PUSHD %~dp0
+SET "FILE_DIR=%~dp0"
+PUSHD "%FILE_DIR%"
SET ROOT_DIR=..\..\..
+SET "COMMON=%FILE_DIR%%ROOT_DIR%\common.bat"
-IF EXIST "%ROOT_DIR%\build.user.bat" (
- CALL "%ROOT_DIR%\build.user.bat"
-) ELSE (
- IF DEFINED MINGW32 (SET MPCHC_MINGW32=%MINGW32%) ELSE (GOTO MissingVar)
- IF DEFINED MINGW64 (SET MPCHC_MINGW64=%MINGW64%) ELSE (GOTO MissingVar)
- IF DEFINED MSYS (SET MPCHC_MSYS=%MSYS%) ELSE (GOTO MissingVar)
-)
-
-IF NOT EXIST "%MPCHC_MINGW32%" GOTO MissingVar
-IF NOT EXIST "%MPCHC_MINGW64%" GOTO MissingVar
-IF NOT EXIST "%MPCHC_MSYS%" GOTO MissingVar
-
-SET PATH=%MPCHC_MSYS%\bin;%MPCHC_MINGW32%\bin;%PATH%
-FOR %%G IN (gcc.exe) DO (SET FOUND=%%~$PATH:G)
-IF NOT DEFINED FOUND GOTO MissingVar
+CALL "%COMMON%" :SubSetPath
+IF %ERRORLEVEL% NEQ 0 EXIT /B 1
+CALL "%COMMON%" :SubDoesExist gcc.exe
+IF %ERRORLEVEL% NEQ 0 EXIT /B 1
SET ARG=/%*
SET ARG=%ARG:/=%
@@ -117,8 +108,8 @@ EXIT /B
IF %ERRORLEVEL% NEQ 0 EXIT /B
TITLE Compiling LAV Filters %COMPILER% [FINISHED]
SET END_TIME=%TIME%
-CALL :SubGetDuration
-CALL :SubMsg "INFO" "LAV Filters compilation started on %START_DATE%-%START_TIME% and completed on %DATE%-%END_TIME% [%DURATION%]"
+CALL "%COMMON%" :SubGetDuration
+CALL "%COMMON%" :SubMsg "INFO" "LAV Filters compilation started on %START_DATE%-%START_TIME% and completed on %DATE%-%END_TIME% [%DURATION%]"
POPD
ENDLOCAL
EXIT /B
@@ -130,9 +121,9 @@ IF %ERRORLEVEL% NEQ 0 EXIT /B
IF /I "%ARCH%" == "x86" (SET "ARCHVS=Win32") ELSE (SET "ARCHVS=x64")
REM Build FFmpeg
-sh build_ffmpeg.sh %ARCH% %BUILDTYPE%
+sh build_ffmpeg.sh %ARCH% %RELEASETYPE% %BUILDTYPE%
IF %ERRORLEVEL% NEQ 0 (
- CALL :SubMsg "ERROR" "'sh build_ffmpeg.sh %ARCH% %BUILDTYPE%' failed!"
+ CALL "%COMMON%" :SubMsg "ERROR" "'sh build_ffmpeg.sh %ARCH% %RELEASETYPE% %BUILDTYPE%' failed!"
EXIT /B
)
@@ -143,7 +134,7 @@ IF /I "%ARCH%" == "x86" (SET "ARCHVS=Win32") ELSE (SET "ARCHVS=x64")
MSBuild.exe LAVFilters.sln /nologo /consoleloggerparameters:Verbosity=minimal /nodeReuse:true /m /t:%BUILDTYPE% /property:Configuration=%RELEASETYPE%;Platform=%ARCHVS%
IF %ERRORLEVEL% NEQ 0 (
- CALL :SubMsg "ERROR" "'MSBuild.exe LAVFilters.sln /nologo /consoleloggerparameters:Verbosity=minimal /nodeReuse:true /m /t:%BUILDTYPE% /property:Configuration=%RELEASETYPE%;Platform=%ARCHVS%' failed!"
+ CALL "%COMMON%" :SubMsg "ERROR" "'MSBuild.exe LAVFilters.sln /nologo /consoleloggerparameters:Verbosity=minimal /nodeReuse:true /m /t:%BUILDTYPE% /property:Configuration=%RELEASETYPE%;Platform=%ARCHVS%' failed!"
EXIT /B
)
@@ -163,16 +154,11 @@ IF /I "%RELEASETYPE%" == "Debug" (
IF /I "%ARCH%" == "x64" (
SET "DESTFOLDER=%DESTFOLDER%\LAVFilters64"
- SET "GCC_PREFIX=x86_64-w64-mingw32-"
) ELSE (
SET "DESTFOLDER=%DESTFOLDER%\LAVFilters"
)
IF /I "%BUILDTYPE%" == "Build" (
- REM Build GCCInfo
- %GCC_PREFIX%gcc -c -O2 GCCInfo.c -o src\bin_%ARCHVS%\ffmpeg\GCCInfo.o
- REM ERRORLEVEL can't be checked because the variable is updated only when exiting the IF
-
REM Copy LAVFilters files to MPC-HC output directory
IF NOT EXIST %DESTFOLDER% MD %DESTFOLDER%
@@ -200,7 +186,7 @@ EXIT /B
ECHO Not all build dependencies were found.
ECHO.
ECHO See "%ROOT_DIR%\docs\Compilation.txt" for more information.
-CALL :SubMsg "ERROR" "LAV Filters compilation failed!" & EXIT /B 1
+CALL "%COMMON%" :SubMsg "ERROR" "LAV Filters compilation failed!" & EXIT /B 1
:UnsupportedSwitch
@@ -210,7 +196,7 @@ ECHO.
ECHO "%~nx0 %*"
ECHO.
ECHO Run "%~nx0 help" for details about the commandline switches.
-CALL :SubMsg "ERROR" "LAV Filters compilation failed!" & EXIT /B 1
+CALL "%COMMON%" :SubMsg "ERROR" "LAV Filters compilation failed!" & EXIT /B 1
:ShowHelp
@@ -228,68 +214,3 @@ ECHO.
POPD
ENDLOCAL
EXIT /B
-
-
-:SubMsg
-ECHO. & ECHO ------------------------------
-IF /I "%~1" == "ERROR" (
- CALL :SubColorText "0C" "[%~1]" "%~2"
-) ELSE IF /I "%~1" == "INFO" (
- CALL :SubColorText "0A" "[%~1]" "%~2"
-) ELSE IF /I "%~1" == "WARNING" (
- CALL :SubColorText "0E" "[%~1]" "%~2"
-)
-ECHO ------------------------------ & ECHO.
-IF /I "%~1" == "ERROR" (
- IF NOT DEFINED SILENT (
- ECHO Press any key to exit...
- PAUSE >NUL
- )
- POPD
- ENDLOCAL
- EXIT /B 1
-) ELSE (
- EXIT /B
-)
-
-
-:SubColorText
-IF DEFINED NOCOLORS ECHO %~2 %~3 & EXIT /B
-FOR /F "tokens=1,2 delims=#" %%G IN (
- '"PROMPT #$H#$E# & ECHO ON & FOR %%H IN (1) DO REM"') DO (
- SET "DEL=%%G")
-<NUL SET /p ".=%DEL%" > "%~2"
-FINDSTR /v /a:%1 /R ".18" "%~2" NUL
-DEL "%~2" > NUL 2>&1
-REM The space in the following ECHO is intentional
-ECHO %~3
-EXIT /B
-
-
-:SubGetDuration
-SET START_TIME=%START_TIME: =%
-SET END_TIME=%END_TIME: =%
-
-FOR /F "tokens=1-4 delims=:.," %%G IN ("%START_TIME%") DO (
- SET /A "STARTTIME=(100%%G %% 100) * 360000 + (100%%H %% 100) * 6000 + (100%%I %% 100) * 100 + (100%%J %% 100)"
-)
-
-FOR /F "tokens=1-4 delims=:.," %%G IN ("%END_TIME%") DO (
- SET /A "ENDTIME=(100%%G %% 100) * 360000 + (100%%H %% 100) * 6000 + (100%%I %% 100) * 100 + (100%%J %% 100)"
-)
-
-SET /A DURATION=%ENDTIME%-%STARTTIME%
-IF %ENDTIME% LSS %STARTTIME% SET /A "DURATION+=24 * 360000"
-
-SET /A DURATIONH=%DURATION% / 360000
-SET /A DURATIONM=(%DURATION% - %DURATIONH%*360000) / 6000
-SET /A DURATIONS=(%DURATION% - %DURATIONH%*360000 - %DURATIONM%*6000) / 100
-SET /A DURATIONHS=(%DURATION% - %DURATIONH%*360000 - %DURATIONM%*6000 - %DURATIONS%*100)*10
-
-IF %DURATIONH% EQU 0 (SET DURATIONH=) ELSE (SET DURATIONH=%DURATIONH%h )
-IF %DURATIONM% EQU 0 (SET DURATIONM=) ELSE (SET DURATIONM=%DURATIONM%m )
-IF %DURATIONS% EQU 0 (SET DURATIONS=) ELSE (SET DURATIONS=%DURATIONS%s )
-IF %DURATIONHS% EQU 0 (SET DURATIONHS=) ELSE (SET DURATIONHS=%DURATIONHS%ms)
-
-SET "DURATION=%DURATIONH%%DURATIONM%%DURATIONS%%DURATIONHS%"
-EXIT /B
diff --git a/src/thirdparty/LAVFilters/src b/src/thirdparty/LAVFilters/src
-Subproject 5f45b5782b3e785ab34338cf84f544e1eb089ff
+Subproject 79ba86d3acb1b53a50a8aae51d4670a8943e1e4
diff --git a/src/thirdparty/MediaInfo/License.html b/src/thirdparty/MediaInfo/License.html
index 7b94ee7b3..85c5f7bee 100644
--- a/src/thirdparty/MediaInfo/License.html
+++ b/src/thirdparty/MediaInfo/License.html
@@ -9,7 +9,7 @@
<div>
<h3 style="text-align: center">MediaInfo(Lib) License</h3>
<p>
- Copyright (c) 2002-2014 <a href="mailto:Info@MediaArea.net">MediaArea.net SARL</a>. All rights reserved.
+ Copyright (c) 2002-2015 <a href="mailto:Info@MediaArea.net">MediaArea.net SARL</a>. All rights reserved.
</p>
<p>
Redistribution and use in source and binary forms, with or without modification,
@@ -39,7 +39,7 @@
<div>
<p>Alternate license for redistributions of the library in binary form:<br/>
Redistributions in binary form must reproduce the following sentence (including the link to the website) in the documentation and/or other materials provided with the distribution.<br/>
-This product uses <a href="http://mediaarea.net/MediaInfo">MediaInfo</a> library, Copyright (c) 2002-2014 <a href="mailto:Info@MediaArea.net">MediaArea.net SARL</a>.</p>
+This product uses <a href="http://mediaarea.net/MediaInfo">MediaInfo</a> library, Copyright (c) 2002-2015 <a href="mailto:Info@MediaArea.net">MediaArea.net SARL</a>.</p>
</div>
<hr/>
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Audio/File_Ac3.cpp b/src/thirdparty/MediaInfo/MediaInfo/Audio/File_Ac3.cpp
index 94830c68d..02c42ca80 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Audio/File_Ac3.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Audio/File_Ac3.cpp
@@ -2285,6 +2285,8 @@ bool File_Ac3::FrameSynchPoint_Test()
{
int16u frmsiz=LittleEndian2int16u(Buffer+Buffer_Offset+2)&0x07FF;
Size=2+frmsiz*2;
+
+ //TODO: case with multiple substreams
}
if (Size>=6)
{
@@ -2451,15 +2453,21 @@ size_t File_Ac3::Core_Size_Get()
if (substreamid!=substreams_Count_Dependant)
break; //Problem
+ int8u strmtyp = Buffer[Buffer_Offset + Size + 2] >> 6;
+ if (substreamid==0 && strmtyp==0)
+ break; //Next block
+
frmsiz =((int16u)(Buffer[(size_t)(Buffer_Offset+Size+2)]&0x07)<<8)
| ( Buffer[(size_t)(Buffer_Offset+Size+3)] );
//Filling
Size+=2+frmsiz*2;
- int8u strmtyp = Buffer[Buffer_Offset + Size + 2] >> 6;
if (strmtyp == 0)
+ {
substreams_Count_Independant++;
+ substreams_Count_Dependant=0;
+ }
else
substreams_Count_Dependant++;
substreams_Count++;
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Audio/File_Caf.cpp b/src/thirdparty/MediaInfo/MediaInfo/Audio/File_Caf.cpp
new file mode 100644
index 000000000..ae1dac706
--- /dev/null
+++ b/src/thirdparty/MediaInfo/MediaInfo/Audio/File_Caf.cpp
@@ -0,0 +1,288 @@
+/* Copyright (c) MediaArea.net SARL. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can
+ * be found in the License.html file in the root of the source tree.
+ */
+
+//---------------------------------------------------------------------------
+// Pre-compilation
+#include "MediaInfo/PreComp.h"
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+#include "MediaInfo/Setup.h"
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+#if defined(MEDIAINFO_CAF_YES)
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+#include "MediaInfo/Audio/File_Caf.h"
+//---------------------------------------------------------------------------
+
+namespace MediaInfoLib
+{
+
+//***************************************************************************
+// Infos
+//***************************************************************************
+
+//***************************************************************************
+// Constants
+//***************************************************************************
+
+//---------------------------------------------------------------------------
+namespace Elements
+{
+ const int64u data=0x64617461;
+ const int64u desc=0x64657363;
+ const int64u free=0x66726565;
+ const int64u info=0x696E666F;
+ const int64u kuki=0x6B756B69;
+ const int64u pakt=0x70616B74;
+ const int64u uuid=0x75756964;
+}
+
+//***************************************************************************
+// Constructor/Destructor
+//***************************************************************************
+
+//---------------------------------------------------------------------------
+File_Caf::File_Caf()
+:File__Analyze()
+{
+ DataMustAlwaysBeComplete=false;
+}
+
+//***************************************************************************
+// Buffer - File header
+//***************************************************************************
+
+//---------------------------------------------------------------------------
+bool File_Caf::FileHeader_Begin()
+{
+ //Synchro
+ if (3>Buffer_Size)
+ return false;
+ if (Buffer[0]!=0x63 //"caff"
+ || Buffer[1]!=0x61
+ || Buffer[2]!=0x66
+ || Buffer[3]!=0x66)
+ {
+ Reject();
+ return false;
+ }
+ if (8>Buffer_Size)
+ return false;
+
+ return true;
+}
+
+//***************************************************************************
+// Buffer - Global
+//***************************************************************************
+
+//---------------------------------------------------------------------------
+void File_Caf::FileHeader_Parse()
+{
+ //Parsing
+ int16u FileVersion;
+ Skip_C4( "FileType");
+ Get_B2 (FileVersion, "FileVersion");
+ Skip_B2( "FileFlags");
+
+ FILLING_BEGIN();
+ Accept();
+ Fill(Stream_General, 0, General_Format, "CAF");
+ Fill(Stream_General, 0, General_Format_Version, __T("Version ")+Ztring::ToZtring(FileVersion));
+ Stream_Prepare(Stream_Audio);
+
+ if (FileVersion!=1)
+ Finish(); //Version 0 or 2+ are not supported
+ FILLING_END();
+}
+
+//***************************************************************************
+// Buffer
+//***************************************************************************
+
+//---------------------------------------------------------------------------
+void File_Caf::Header_Parse()
+{
+ //Parsing
+ int64u ChunkSize;
+ int32u ChunkType;
+ Get_B4 (ChunkType, "ChunkType");
+ Get_B8(ChunkSize, "ChunkSize");
+
+ //Filling
+ Header_Fill_Code2(ChunkType, Ztring().From_CC4(ChunkType));
+ Header_Fill_Size(12+ChunkSize);
+}
+
+//---------------------------------------------------------------------------
+void File_Caf::Data_Parse()
+{
+ if (Element_Code!=Elements::data && !Element_IsComplete_Get())
+ {
+ Element_WaitForMoreData();
+ return;
+ }
+
+ #define ELEMENT_CASE(_NAME, _DETAIL) \
+ case Elements::_NAME : Element_Name(_DETAIL); _NAME(); break;
+
+ //Parsing
+ switch (Element_Code)
+ {
+ ELEMENT_CASE(data, "Audio Data");
+ ELEMENT_CASE(desc, "Audio Description");
+ ELEMENT_CASE(free, "Free");
+ ELEMENT_CASE(info, "Information");
+ ELEMENT_CASE(kuki, "Magic Cookie");
+ ELEMENT_CASE(pakt, "Packet Table");
+ ELEMENT_CASE(uuid, "User-Defined Chunk");
+ default :
+ Skip_XX(Element_Size, "Data");
+ }
+}
+
+//***************************************************************************
+// Elements
+//***************************************************************************
+
+//---------------------------------------------------------------------------
+void File_Caf::data()
+{
+ //Parsing
+ Skip_XX(Element_Size, "Data");
+
+ Fill(Stream_Audio, 0, Retrieve(Stream_Audio, 0, Audio_Source_Duration).empty()?Audio_StreamSize:Audio_Source_StreamSize, Element_Size);
+
+ //TODO: put this code in the common section Streams_Finish_StreamOnly()
+ int64u BitRate=Retrieve(Stream_Audio, 0, "BitRate").To_int64u();
+ if (BitRate && Element_Size && Retrieve(Stream_Audio, 0, Audio_Source_Duration).empty() && Retrieve(Stream_Audio, 0, Audio_Duration).empty())
+ Fill(Stream_Audio, 0, Audio_Duration, Element_Size*8*1000/BitRate);
+}
+
+//---------------------------------------------------------------------------
+void File_Caf::desc()
+{
+ //Parsing
+ float64 SampleRate;
+ int32u FormatID, FormatFlags, BytesPerPacket, FramesPerPacket, ChannelsPerFrame, BitsPerChannel;
+ Get_BF8(SampleRate, "SampleRate");
+ Get_C4 (FormatID, "FormatID");
+ Get_B4 (FormatFlags, "FormatFlags");
+ Get_B4 (BytesPerPacket, "BytesPerPacket");
+ Get_B4 (FramesPerPacket, "FramesPerPacket");
+ Get_B4 (ChannelsPerFrame, "ChannelsPerFrame");
+ Get_B4 (BitsPerChannel, "BitsPerChannel");
+
+ FILLING_BEGIN();
+ if (SampleRate)
+ Fill(Stream_Audio, 0, Audio_SamplingRate, SampleRate);
+ CodecID_Fill(Ztring().From_CC4(FormatID), Stream_Audio, 0, InfoCodecID_Format_Mpeg4);
+ if (ChannelsPerFrame)
+ Fill(Stream_Audio, 0, Audio_Channel_s_, ChannelsPerFrame);
+ if (BitsPerChannel)
+ Fill(Stream_Audio, 0, Audio_BitDepth, BitsPerChannel);
+ if (BytesPerPacket && SampleRate && FramesPerPacket)
+ Fill(Stream_Audio, 0, Audio_BitRate, SampleRate*BytesPerPacket*8/FramesPerPacket);
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+void File_Caf::free()
+{
+ //Parsing
+ Skip_XX(Element_Size, "Junk");
+}
+
+//---------------------------------------------------------------------------
+void File_Caf::info()
+{
+ if (Element_Size<4)
+ return;
+
+ //Parsing
+ int32u NumEntries;
+ Get_B4 (NumEntries, "NumEntries");
+ ZtringList List;
+ std::map<Ztring, Ztring> ListList;
+ const int8u* Buffer_Max = Buffer+(size_t)(Buffer_Offset+Element_Size);
+ while (Element_Offset<Element_Size)
+ {
+ const int8u* Buffer_Begin = Buffer+(size_t)(Buffer_Offset+Element_Offset);
+ const int8u* Buffer_Middle = Buffer_Begin;
+ while (Buffer_Middle<Buffer_Max && *Buffer_Middle)
+ ++Buffer_Middle;
+ const int8u* Buffer_End = Buffer_Middle + 1;
+ while (Buffer_End<Buffer_Max && *Buffer_End)
+ ++Buffer_End;
+
+ Ztring Key, Value;
+ Get_UTF8(Buffer_Middle-Buffer_Begin, Key, "Key");
+ Skip_B1 ( "Zero");
+ Get_UTF8(Buffer_End-(Buffer_Middle+1), Value, "Value");
+ if (Buffer_End!=Buffer_Max)
+ Skip_B1 ( "Zero");
+
+ ListList[Key]=Value;
+ }
+
+ if (ListList.size()!=NumEntries)
+ return;
+
+ for (std::map<Ztring, Ztring>::iterator Item=ListList.begin(); Item!=ListList.end(); ++Item)
+ Fill(Stream_General, 0, Item->first.To_UTF8().c_str(), Item->second);
+}
+
+//---------------------------------------------------------------------------
+void File_Caf::kuki()
+{
+ //Parsing
+ Skip_XX(Element_Size, "Data");
+}
+
+//---------------------------------------------------------------------------
+void File_Caf::pakt()
+{
+ //Parsing
+ int64u NumberPackets, NumberValidFrames;
+ int32u PrimingFrames, RemainderFrames;
+ Get_B8 (NumberPackets, "NumberPackets");
+ Get_B8 (NumberValidFrames, "NumberValidFrames");
+ Get_B4 (PrimingFrames, "PrimingFrames");
+ Get_B4 (RemainderFrames, "RemainderFrames");
+ Skip_XX(Element_Size-Element_Offset, "Packet sizes");
+
+ FILLING_BEGIN();
+ float64 SampleRate=Retrieve(Stream_Audio, 0, Audio_SamplingRate).To_float64();
+ Fill(Stream_Audio, 0, Audio_FrameCount, NumberPackets);
+ Fill(Stream_Audio, 0, Audio_Duration, NumberValidFrames/SampleRate*1000, 0);
+ if (PrimingFrames && RemainderFrames)
+ Fill(Stream_Audio, 0, Audio_Source_Duration, (PrimingFrames+NumberValidFrames+RemainderFrames)/SampleRate*1000, 0);
+ Fill(Stream_Audio, 0, Audio_Delay, PrimingFrames/SampleRate*1000, 0);
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+void File_Caf::uuid()
+{
+ //Parsing
+ Skip_UUID( "UUID");
+ Skip_XX(Element_Size-Element_Offset, "Data");
+}
+
+//***************************************************************************
+// C++
+//***************************************************************************
+
+} //NameSpace
+
+#endif //MEDIAINFO_CAF_YES
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Audio/File_Caf.h b/src/thirdparty/MediaInfo/MediaInfo/Audio/File_Caf.h
new file mode 100644
index 000000000..124f9aa33
--- /dev/null
+++ b/src/thirdparty/MediaInfo/MediaInfo/Audio/File_Caf.h
@@ -0,0 +1,55 @@
+/* Copyright (c) MediaArea.net SARL. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can
+ * be found in the License.html file in the root of the source tree.
+ */
+
+//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+//
+// Information about Core Audio Format files
+//
+//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+//---------------------------------------------------------------------------
+#ifndef MediaInfo_File_CafH
+#define MediaInfo_File_CafH
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+#include "MediaInfo/File__Analyze.h"
+//---------------------------------------------------------------------------
+
+namespace MediaInfoLib
+{
+
+//***************************************************************************
+// Class File_Au
+//***************************************************************************
+
+class File_Caf : public File__Analyze
+{
+public :
+ File_Caf();
+
+protected :
+ //Buffer - File header
+ bool FileHeader_Begin();
+ void FileHeader_Parse ();
+
+ //Buffer
+ void Header_Parse();
+ void Data_Parse();
+
+ //Elements
+ void data();
+ void desc();
+ void free();
+ void info();
+ void kuki();
+ void pakt();
+ void uuid();
+};
+
+} //NameSpace
+
+#endif
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Audio/File_Dts.cpp b/src/thirdparty/MediaInfo/MediaInfo/Audio/File_Dts.cpp
index 355a3e2e9..b608d12f3 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Audio/File_Dts.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Audio/File_Dts.cpp
@@ -1375,15 +1375,15 @@ bool File_Dts::FrameSynchPoint_Test()
{
int64u Value;
if (BigEndian)
- Value =(((int64u)( BigEndian2int16u(Buffer+Pos )&0x3FFF))<<42)
- | (((int64u)( BigEndian2int16u(Buffer+Pos+2)&0x3FFF))<<28)
- | (((int64u)( BigEndian2int16u(Buffer+Pos+4)&0x3FFF))<<14)
- | (((int64u)( BigEndian2int16u(Buffer+Pos+6)&0x3FFF)) );
+ Value =(((int64u)( BigEndian2int16u(Buffer+Buffer_Offset+Pos )&0x3FFF))<<42)
+ | (((int64u)( BigEndian2int16u(Buffer+Buffer_Offset+Pos+2)&0x3FFF))<<28)
+ | (((int64u)( BigEndian2int16u(Buffer+Buffer_Offset+Pos+4)&0x3FFF))<<14)
+ | (((int64u)( BigEndian2int16u(Buffer+Buffer_Offset+Pos+6)&0x3FFF)) );
else
- Value =(((int64u)(LittleEndian2int16u(Buffer+Pos )&0x3FFF))<<42)
- | (((int64u)(LittleEndian2int16u(Buffer+Pos+2)&0x3FFF))<<28)
- | (((int64u)(LittleEndian2int16u(Buffer+Pos+4)&0x3FFF))<<14)
- | (((int64u)(LittleEndian2int16u(Buffer+Pos+6)&0x3FFF)) );
+ Value =(((int64u)(LittleEndian2int16u(Buffer+Buffer_Offset+Pos )&0x3FFF))<<42)
+ | (((int64u)(LittleEndian2int16u(Buffer+Buffer_Offset+Pos+2)&0x3FFF))<<28)
+ | (((int64u)(LittleEndian2int16u(Buffer+Buffer_Offset+Pos+4)&0x3FFF))<<14)
+ | (((int64u)(LittleEndian2int16u(Buffer+Buffer_Offset+Pos+6)&0x3FFF)) );
int56u2BigEndian(Dest+Pos*14/16, Value);
}
Save_Buffer=Dest;
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Audio/File_Pcm.cpp b/src/thirdparty/MediaInfo/MediaInfo/Audio/File_Pcm.cpp
index e42326b41..24dda17d2 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Audio/File_Pcm.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Audio/File_Pcm.cpp
@@ -407,7 +407,10 @@ void File_Pcm::Data_Parse()
Frame_Count_NotParsedIncluded++;
if (FrameInfo.DTS!=(int64u)-1 && FrameInfo.DUR!=(int64u)-1)
{
- FrameInfo.DTS+=FrameInfo.DUR;
+ if (BitDepth && Channels && SamplingRate)
+ FrameInfo.DTS+=Element_Size*1000000000*8/BitDepth/Channels/SamplingRate;
+ else
+ FrameInfo.DTS+=FrameInfo.DUR;
FrameInfo.PTS=FrameInfo.DTS;
}
if ((!Status[IsAccepted] && Frame_Count>=Frame_Count_Valid) || File_Offset+Buffer_Size>=File_Size)
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Export/Export_EbuCore.cpp b/src/thirdparty/MediaInfo/MediaInfo/Export/Export_EbuCore.cpp
index fd5a6861d..f36e03893 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Export/Export_EbuCore.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Export/Export_EbuCore.cpp
@@ -17,9 +17,14 @@
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
+#if defined(MEDIAINFO_EBUCORE_YES)
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
#include "MediaInfo/Export/Export_EbuCore.h"
#include "MediaInfo/File__Analyse_Automatic.h"
#include <ctime>
+#include <cmath>
using namespace std;
//---------------------------------------------------------------------------
@@ -35,6 +40,26 @@ extern MediaInfo_Config Config;
//***************************************************************************
//---------------------------------------------------------------------------
+Ztring XML_Encode (const Ztring& Data)
+{
+ Ztring Result;
+ wstring::size_type Pos;
+ for (Pos=0; Pos<Data.size(); Pos++)
+ {
+ switch (Data[Pos])
+ {
+ case __T('"'): Result+=__T("&quot;"); break;
+ case __T('&'): Result+=__T("&amp;"); break;
+ case __T('\''): Result+=__T("&apos;"); break;
+ case __T('<'): Result+=__T("&lt;"); break;
+ case __T('>'): Result+=__T("&lg;"); break;
+ default: Result+=Data[Pos];
+ }
+ }
+ return Result;
+}
+
+//---------------------------------------------------------------------------
int32u EbuCore_VideoCompressionCodeCS_termID(MediaInfo_Internal &MI, size_t StreamPos)
{
const Ztring &Format=MI.Get(Stream_Video, StreamPos, Video_Format);
@@ -619,8 +644,15 @@ Export_EbuCore::~Export_EbuCore ()
//***************************************************************************
//---------------------------------------------------------------------------
-Ztring EbuCore_Transform_Video(Ztring &ToReturn, MediaInfo_Internal &MI, size_t StreamPos)
+Ztring EbuCore_Transform_Video(Ztring &ToReturn, MediaInfo_Internal &MI, size_t StreamPos, Export_EbuCore::version Version)
{
+ size_t As11_UkDpp_Pos=(size_t)-1;
+ for (size_t StreamPos_Temp=0; StreamPos_Temp<MI.Count_Get(Stream_Other); StreamPos_Temp++)
+ {
+ if (MI.Get(Stream_Other, StreamPos_Temp, Other_Format)==__T("AS-11 UKDPP"))
+ As11_UkDpp_Pos=StreamPos_Temp;
+ }
+
ToReturn+=__T("\t\t\t<ebucore:videoFormat");
//if (!MI.Get(Stream_Video, StreamPos, Video_ID).empty())
// ToReturn+=__T(" videoFormatId=\"")+MI.Get(Stream_Video, StreamPos, Video_ID)+__T("\"");
@@ -699,15 +731,25 @@ Ztring EbuCore_Transform_Video(Ztring &ToReturn, MediaInfo_Internal &MI, size_t
factorNumerator=AspectRatioString.substr(0, AspectRatioString_Pos);
factorDenominator=AspectRatioString.substr(AspectRatioString_Pos+1);
}
- if (factorNumerator.empty())
- ToReturn+=__T("\t\t\t\t<ebucore:aspectRatio typeLabel=\"display\">")+MI.Get(Stream_Video, StreamPos, Video_DisplayAspectRatio)+__T("</ebucore:aspectRatio>\n");
else
{
- ToReturn+=__T("\t\t\t\t<ebucore:aspectRatio typeLabel=\"display\">\n");
- ToReturn+=__T("\t\t\t\t\t<ebucore:factorNumerator>")+factorNumerator+__T("</ebucore:factorNumerator>\n");
- ToReturn+=__T("\t\t\t\t\t<ebucore:factorDenominator>")+factorDenominator+__T("</ebucore:factorDenominator>\n");
- ToReturn+=__T("\t\t\t\t</ebucore:aspectRatio>\n");
+ AspectRatioString_Pos=AspectRatioString.find(__T('.'));
+ if (AspectRatioString_Pos!=(size_t)-1)
+ {
+ int64s Denominator=float64_int64s(pow((double)10, (int)(AspectRatioString.size()-AspectRatioString_Pos+1))); //Computing the right denomintor compared to the count of decimals in the value e.g. 1.778 will have a denominator of 1000 (3 digits after the comma)
+ factorNumerator=Ztring::ToZtring(AspectRatioString.To_float32()*Denominator, 0);
+ factorDenominator=Ztring::ToZtring(Denominator);
+ }
+ else
+ {
+ factorNumerator=AspectRatioString; //No decimal
+ factorDenominator=__T("1");
+ }
}
+ ToReturn+=__T("\t\t\t\t<ebucore:aspectRatio typeLabel=\"display\">\n");
+ ToReturn+=__T("\t\t\t\t\t<ebucore:factorNumerator>")+factorNumerator+__T("</ebucore:factorNumerator>\n");
+ ToReturn+=__T("\t\t\t\t\t<ebucore:factorDenominator>")+factorDenominator+__T("</ebucore:factorDenominator>\n");
+ ToReturn+=__T("\t\t\t\t</ebucore:aspectRatio>\n");
}
//videoEncoding
@@ -776,7 +818,7 @@ Ztring EbuCore_Transform_Video(Ztring &ToReturn, MediaInfo_Internal &MI, size_t
//scanningFormat
if (!MI.Get(Stream_Video, StreamPos, Video_ScanType).empty())
{
- Ztring ScanType=MI.Get(Stream_Video, 0, Video_ScanType);
+ Ztring ScanType=MI.Get(Stream_Video, StreamPos, Video_ScanType);
if (ScanType==__T("MBAFF"))
ScanType=__T("Interlaced");
ScanType.MakeLowerCase();
@@ -786,7 +828,7 @@ Ztring EbuCore_Transform_Video(Ztring &ToReturn, MediaInfo_Internal &MI, size_t
//scanningOrder
if (!MI.Get(Stream_Video, StreamPos, Video_ScanOrder).empty())
{
- Ztring ScanOrder=MI.Get(Stream_Video, 0, Video_ScanOrder);
+ Ztring ScanOrder=MI.Get(Stream_Video, StreamPos, Video_ScanOrder);
if (ScanOrder==__T("TFF"))
ScanOrder=__T("top");
if (ScanOrder==__T("BFF"))
@@ -794,7 +836,7 @@ Ztring EbuCore_Transform_Video(Ztring &ToReturn, MediaInfo_Internal &MI, size_t
if (ScanOrder.find(__T("Pulldown"))!=string::npos)
ScanOrder=__T("pulldown");
ToReturn+=__T("\t\t\t\t<ebucore:scanningOrder>")+ScanOrder+__T("</ebucore:scanningOrder>\n");
- }
+ }
//videoTrack
if (!MI.Get(Stream_Video, StreamPos, Video_ID).empty() || !MI.Get(Stream_Video, StreamPos, Video_Title).empty())
@@ -811,14 +853,119 @@ Ztring EbuCore_Transform_Video(Ztring &ToReturn, MediaInfo_Internal &MI, size_t
if (!MI.Get(Stream_Video, StreamPos, Video_MultiView_Count).empty())
ToReturn+=__T("\t\t\t\t<ebucore:flag_3D>true</ebucore:flag_3D>\n");
- ToReturn+=__T("\t\t\t</ebucore:videoFormat>\n");
+ //technicalAttributeString - ActiveFormatDescription
+ if (!MI.Get(Stream_Video, StreamPos, Video_ActiveFormatDescription).empty())
+ ToReturn+=__T("\t\t\t\t<ebucore:technicalAttributeString typeLabel=\"ActiveFormatDescription\">")+MI.Get(Stream_Video, StreamPos, Video_ActiveFormatDescription)+__T("</ebucore:technicalAttributeString>\n");
+
+ //technicalAttributeString - Standard
+ if (!MI.Get(Stream_Video, StreamPos, Video_Standard).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:technicalAttributeString typeLabel=\"Standard\">")+MI.Get(Stream_Video, StreamPos, Video_Standard)+__T("</ebucore:technicalAttributeString>\n");
+ }
+
+ //technicalAttributeString - ColorSpace
+ if (!MI.Get(Stream_Video, StreamPos, Video_ColorSpace).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:technicalAttributeString typeLabel=\"ColorSpace\">")+MI.Get(Stream_Video, StreamPos, Video_ColorSpace)+__T("</ebucore:technicalAttributeString>\n");
+ }
+
+ //technicalAttributeString - ChromaSubsampling
+ if (!MI.Get(Stream_Video, StreamPos, Video_ChromaSubsampling).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:technicalAttributeString typeLabel=\"ChromaSubsampling\">")+MI.Get(Stream_Video, StreamPos, Video_ChromaSubsampling)+__T("</ebucore:technicalAttributeString>\n");
+ }
+
+ //technicalAttributeString - colour_primaries
+ if (!MI.Get(Stream_Video, StreamPos, __T("colour_primaries")).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:technicalAttributeString typeLabel=\"colour_primaries\">")+MI.Get(Stream_Video, StreamPos, __T("colour_primaries"))+__T("</ebucore:technicalAttributeString>\n");
+ }
+
+ //technicalAttributeString - transfer_characteristics
+ if (!MI.Get(Stream_Video, StreamPos, __T("transfer_characteristics")).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:technicalAttributeString typeLabel=\"transfer_characteristics\">")+MI.Get(Stream_Video, StreamPos, __T("transfer_characteristics"))+__T("</ebucore:technicalAttributeString>\n");
+ }
+
+ //technicalAttributeString - matrix_coefficients
+ if (!MI.Get(Stream_Video, StreamPos, __T("matrix_coefficients")).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:technicalAttributeString typeLabel=\"matrix_coefficients\">")+MI.Get(Stream_Video, StreamPos, __T("matrix_coefficients"))+__T("</ebucore:technicalAttributeString>\n");
+ }
+
+ //technicalAttributeString - colour_range
+ if (!MI.Get(Stream_Video, StreamPos, __T("colour_range")).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:technicalAttributeString typeLabel=\"colour_range\">")+MI.Get(Stream_Video, StreamPos, __T("colour_range"))+__T("</ebucore:technicalAttributeString>\n");
+ }
+
+ //technicalAttributeString - StreamSize
+ if (!MI.Get(Stream_Video, StreamPos, Video_StreamSize).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:technicalAttributeInteger typeLabel=\"StreamSize\"")+(Version>=Export_EbuCore::Version_1_6?Ztring(__T(" unit=\"byte\"")):Ztring())+__T(">")+MI.Get(Stream_Video, StreamPos, Video_StreamSize)+__T("</ebucore:technicalAttributeInteger>\n");
+ }
+
+ //technicalAttributeString - BitDepth
+ if (!MI.Get(Stream_Video, StreamPos, Video_BitDepth).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:technicalAttributeInteger typeLabel=\"BitDepth\"")+(Version>=Export_EbuCore::Version_1_6?Ztring(__T(" unit=\"bit\"")):Ztring())+__T(">")+MI.Get(Stream_Video, StreamPos, Video_BitDepth)+__T("</ebucore:technicalAttributeInteger>\n");
+ }
+
+ //technicalAttributeString
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("FpaManufacturer")).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:technicalAttributeString typeLabel=\"FPAManufacturer\">")+MI.Get(Stream_Other, As11_UkDpp_Pos, __T("FpaManufacturer"))+__T("</ebucore:technicalAttributeString>\n");
+ }
+
+ //technicalAttributeString
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("FpaVersion")).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:technicalAttributeString typeLabel=\"FPAVersion\">")+MI.Get(Stream_Other, As11_UkDpp_Pos, __T("FpaVersion"))+__T("</ebucore:technicalAttributeString>\n");
+ }
+
+ //technicalAttributeBoolean - Format_Settings_CABAC
+ if (MI.Get(Stream_Video, StreamPos, Video_Format)==__T("AVC") && !MI.Get(Stream_Video, StreamPos, Video_Format_Settings_CABAC).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:technicalAttributeBoolean typeLabel=\"CABAC\">")+Ztring(MI.Get(Stream_Video, StreamPos, Video_Format_Settings_CABAC)==__T("Yes")?__T("true"):__T("false"))+__T("</ebucore:technicalAttributeBoolean>\n");
+ }
+
+ //technicalAttributeBoolean - Format_Settings_MBAFF
+ if (MI.Get(Stream_Video, StreamPos, Video_Format)==__T("AVC") && !MI.Get(Stream_Video, StreamPos, Video_ScanType).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:technicalAttributeBoolean typeLabel=\"MBAFF\">")+Ztring(MI.Get(Stream_Video, StreamPos, Video_ScanType)==__T("MBAFF")?__T("true"):__T("false"))+__T("</ebucore:technicalAttributeBoolean>\n");
+ }
+
+ //technicalAttributeBoolean - FpaPass
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("FpaPass")).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:technicalAttributeBoolean typeLabel=\"MBAFF\">")+Ztring(MI.Get(Stream_Other, As11_UkDpp_Pos, __T("FpaPass"))==__T("Yes")?__T("true"):__T("false"))+__T("</ebucore:technicalAttributeBoolean>\n");
+ }
+
+ //technicalAttributeString
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("VideoComments")).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:comment typeLabel=\"VideoComments\">")+MI.Get(Stream_Other, As11_UkDpp_Pos, __T("VideoComments"))+__T("</ebucore:comment>\n");
+ }
+
+ ToReturn+=__T("\t\t\t</ebucore:videoFormat>\n");
return ToReturn;
}
//---------------------------------------------------------------------------
-Ztring EbuCore_Transform_Audio(Ztring &ToReturn, MediaInfo_Internal &MI, size_t StreamPos)
+Ztring EbuCore_Transform_Audio(Ztring &ToReturn, MediaInfo_Internal &MI, size_t StreamPos, Export_EbuCore::version Version)
{
+
+ size_t As11_Core_Pos=(size_t)-1;
+ size_t As11_UkDpp_Pos=(size_t)-1;
+ for (size_t StreamPos_Temp=0; StreamPos_Temp<MI.Count_Get(Stream_Other); StreamPos_Temp++)
+ {
+ if (MI.Get(Stream_Other, StreamPos_Temp, Other_Format)==__T("AS-11 Core"))
+ As11_Core_Pos=StreamPos_Temp;
+ if (MI.Get(Stream_Other, StreamPos_Temp, Other_Format)==__T("AS-11 UKDPP"))
+ As11_UkDpp_Pos=StreamPos_Temp;
+ }
+
ToReturn+=__T("\t\t\t<ebucore:audioFormat");
//if (!MI.Get(Stream_Audio, StreamPos, Audio_ID).empty())
// ToReturn+=__T(" audioFormatId=\"")+MI.Get(Stream_Audio, StreamPos, Audio_ID)+__T("\"");
@@ -872,11 +1019,10 @@ Ztring EbuCore_Transform_Audio(Ztring &ToReturn, MediaInfo_Internal &MI, size_t
ToReturn+=__T("\t\t\t\t</ebucore:codec>\n");
}
- //audioTrackConfiguration //TODO
- if (!MI.Get(Stream_Audio, StreamPos, Audio_ChannelPositions).empty())
+ //audioTrackConfiguration
+ if (As11_Core_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_Core_Pos, __T("AudioTrackLayout")).empty())
{
- Ztring ChannelPositions=MI.Get(Stream_Audio, StreamPos, Audio_ChannelPositions);
- ToReturn+=__T("\t\t\t\t<ebucore:audioTrackConfiguration typeLabel=\"")+ChannelPositions+__T("\"/>\n");
+ ToReturn+=__T("\t\t\t\t<ebucore:audioTrackConfiguration typeLabel=\"")+MI.Get(Stream_Other, As11_Core_Pos, __T("AudioTrackLayout"))+__T("\"/>\n");
}
//samplingRate
@@ -927,6 +1073,42 @@ Ztring EbuCore_Transform_Audio(Ztring &ToReturn, MediaInfo_Internal &MI, size_t
if (!MI.Get(Stream_Audio, StreamPos, Audio_Channel_s_).empty())
ToReturn+=__T("\t\t\t\t<ebucore:channels>")+MI.Get(Stream_Audio, StreamPos, Audio_Channel_s_)+__T("</ebucore:channels>\n");
+ //format - technicalAttributeString - ChannelPositions
+ if (!MI.Get(Stream_Audio, StreamPos, Audio_ChannelPositions).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:technicalAttributeString typeLabel=\"ChannelPositions\">")+MI.Get(Stream_Audio, StreamPos, Audio_ChannelPositions)+__T("</ebucore:technicalAttributeString>\n");
+ }
+
+ //format - technicalAttributeString - ChannelLayout
+ if (!MI.Get(Stream_Audio, StreamPos, Audio_ChannelLayout).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:technicalAttributeString typeLabel=\"ChannelLayout\">")+MI.Get(Stream_Audio, StreamPos, Audio_ChannelLayout)+__T("</ebucore:technicalAttributeString>\n");
+ }
+
+ //technicalAttributeString - Format_Settings_Endianness
+ if (!MI.Get(Stream_Audio, StreamPos, Audio_Format_Settings_Endianness).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:technicalAttributeString typeLabel=\"Endianness\">")+MI.Get(Stream_Audio, StreamPos, Audio_Format_Settings_Endianness)+__T("</ebucore:technicalAttributeString>\n");
+ }
+
+ //technicalAttributeString - Format_Settings_Wrapping
+ if (!MI.Get(Stream_Audio, StreamPos, Audio_Format_Settings_Wrapping).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:technicalAttributeString typeLabel=\"Wrapping\">")+MI.Get(Stream_Audio, StreamPos, Audio_Format_Settings_Wrapping)+__T("</ebucore:technicalAttributeString>\n");
+ }
+
+ //technicalAttributeString - StreamSize
+ if (!MI.Get(Stream_Audio, StreamPos, Audio_StreamSize).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:technicalAttributeInteger typeLabel=\"StreamSize\"")+(Version>=Export_EbuCore::Version_1_6?Ztring(__T(" unit=\"byte\"")):Ztring())+__T(">")+MI.Get(Stream_Audio, StreamPos, Audio_StreamSize)+__T("</ebucore:technicalAttributeInteger>\n");
+ }
+
+ //technicalAttributeString
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("AudioComments")).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:comment typeLabel=\"AudioComments\">")+MI.Get(Stream_Other, As11_UkDpp_Pos, __T("AudioComments"))+__T("</ebucore:comment>\n");
+ }
+
ToReturn+=__T("\t\t\t</ebucore:audioFormat>\n");
return ToReturn;
@@ -979,7 +1161,85 @@ Ztring EbuCore_Transform_Text(Ztring &ToReturn, MediaInfo_Internal &MI, size_t S
}
//---------------------------------------------------------------------------
-Ztring Export_EbuCore::Transform(MediaInfo_Internal &MI)
+Ztring EbuCore_Transform_TimeCode(Ztring &ToReturn, MediaInfo_Internal &MI, size_t StreamPos, bool Is1_5)
+{
+ if (Is1_5)
+ ToReturn+=__T("\t\t\t<!-- (timecodeFormat not in XSD)\n");
+
+ ToReturn+=__T("\t\t\t<ebucore:timecodeFormat");
+ if (!MI.Get(Stream_Other, StreamPos, Other_Format).empty())
+ ToReturn+=__T(" timecodeFormatName=\"")+MI.Get(Stream_Other, StreamPos, Other_Format)+__T("\"");
+ ToReturn+=__T(">\n");
+
+ //start
+ {
+ if (MI.Get(Stream_Other, StreamPos, Other_ID).find(__T("-Material"))!=string::npos)
+ ToReturn+=__T("\t\t\t\t<ebucore:timecodeStart typeLabel=\"Material\">\n");
+ else if (MI.Get(Stream_Other, StreamPos, Other_ID).find(__T("-Source"))!=string::npos)
+ ToReturn+=__T("\t\t\t\t<ebucore:timecodeStart typeLabel=\"Source\">\n");
+ else
+ ToReturn+=__T("\t\t\t\t<ebucore:timecodeStart>\n");
+ ToReturn+=__T("\t\t\t\t\t<ebucore:timecode>")+MI.Get(Stream_Other, StreamPos, Other_TimeCode_FirstFrame)+__T("</ebucore:timecode>\n");
+ ToReturn+=__T("\t\t\t\t</ebucore:timecodeStart>\n");
+ }
+
+ if (!MI.Get(Stream_Other, StreamPos, Other_ID).empty() || !MI.Get(Stream_Other, StreamPos, Other_Title).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:timecodeTrack");
+ if (!MI.Get(Stream_Other, StreamPos, Other_ID).empty())
+ {
+ Ztring ID=MI.Get(Stream_Other, StreamPos, Other_ID);
+ ID.FindAndReplace(__T("-Material"), Ztring());
+ ID.FindAndReplace(__T("-Source"), Ztring());
+ ToReturn+=__T(" trackId=\"")+ID+__T("\"");
+ }
+ if (!MI.Get(Stream_Other, StreamPos, Other_Title).empty())
+ ToReturn+=__T(" trackName=\"")+MI.Get(Stream_Other, StreamPos, Other_Title)+__T("\"");
+ ToReturn+=__T("/>\n");
+ }
+
+ if (!MI.Get(Stream_Other, StreamPos, Other_ID).empty())
+ ToReturn+=__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");
+
+ ToReturn+=__T("\t\t\t</ebucore:timecodeFormat>\n");
+
+ if (Is1_5)
+ ToReturn+=__T("\t\t\t-->\n");
+
+ return ToReturn;
+}
+
+//---------------------------------------------------------------------------
+Ztring EbuCore_Transform_Metadata(Ztring &ToReturn, MediaInfo_Internal &MI, size_t StreamPos, bool Is1_5)
+{
+ if (Is1_5)
+ ToReturn+=__T("\t\t\t<!-- (metadataFormat not in XSD)\n");
+
+ ToReturn+=__T("\t\t\t<ebucore:metadataFormat");
+ if (!MI.Get(Stream_Other, StreamPos, Other_Format).empty())
+ ToReturn+=__T(" metadataFormatName=\"")+MI.Get(Stream_Other, StreamPos, Other_Format)+__T("\"");
+ ToReturn+=__T(">\n");
+
+ if (!MI.Get(Stream_Other, StreamPos, Other_ID).empty() || !MI.Get(Stream_Other, StreamPos, Other_Title).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:metadataTrack");
+ if (!MI.Get(Stream_Other, StreamPos, Other_ID).empty())
+ ToReturn+=__T(" trackId=\"")+MI.Get(Stream_Other, StreamPos, Other_ID)+__T("\"");
+ if (!MI.Get(Stream_Other, StreamPos, Other_Title).empty())
+ ToReturn+=__T(" trackName=\"")+MI.Get(Stream_Other, StreamPos, Other_Title)+__T("\"");
+ ToReturn+=__T("/>\n");
+ }
+
+ ToReturn+=__T("\t\t\t</ebucore:metadataFormat>\n");
+
+ if (Is1_5)
+ ToReturn+=__T("\t\t\t-->\n");
+
+ return ToReturn;
+}
+
+//---------------------------------------------------------------------------
+Ztring Export_EbuCore::Transform(MediaInfo_Internal &MI, version Version)
{
//Current date/time is ISO format
time_t Seconds=time(NULL);
@@ -989,106 +1249,274 @@ Ztring Export_EbuCore::Transform(MediaInfo_Internal &MI)
Ztring Date=DateTime.substr(0, 10);
Ztring Time=DateTime.substr(11, 8);
+ size_t As11_Core_Pos=(size_t)-1;
+ size_t As11_Segmentation_Pos=(size_t)-1;
+ size_t As11_UkDpp_Pos=(size_t)-1;
+ for (size_t StreamPos_Temp=0; StreamPos_Temp<MI.Count_Get(Stream_Other); StreamPos_Temp++)
+ {
+ if (MI.Get(Stream_Other, StreamPos_Temp, Other_Format)==__T("AS-11 Core"))
+ As11_Core_Pos=StreamPos_Temp;
+ if (MI.Get(Stream_Other, StreamPos_Temp, Other_Format)==__T("AS-11 Segmentation"))
+ As11_Segmentation_Pos=StreamPos_Temp;
+ if (MI.Get(Stream_Other, StreamPos_Temp, Other_Format)==__T("AS-11 UKDPP"))
+ As11_UkDpp_Pos=StreamPos_Temp;
+ }
+
Ztring ToReturn;
//ebuCoreMain
ToReturn+=__T("<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
ToReturn+=__T("<!-- Generated by ")+MediaInfoLib::Config.Info_Version_Get()+__T(" -->\n");
- ToReturn+=__T("<ebucore:ebuCoreMain xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:ebucore=\"urn:ebu:metadata-schema:ebuCore_2014\" xmlns:xalan=\"http://xml.apache.org/xalan\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"urn:ebu:metadata-schema:ebuCore_2014 http://www.ebu.ch/metadata/schemas/EBUCore/20140318/EBU_CORE_20140318.xsd\" version=\"1.5\" dateLastModified=\"")+Date+__T("\" timeLastModified=\"")+Time+__T("Z\">\n");
+ if (Version==Version_1_5)
+ ToReturn+=__T("<ebucore:ebuCoreMain xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:ebucore=\"urn:ebu:metadata-schema:ebuCore_2014\"\n xmlns:xalan=\"http://xml.apache.org/xalan\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"urn:ebu:metadata-schema:ebuCore_2014 http://www.ebu.ch/metadata/schemas/EBUCore/20140318/EBU_CORE_20140318.xsd\" version=\"1.5\" dateLastModified=\"")+Date+__T("\" timeLastModified=\"")+Time+__T("Z\">\n");
+ else
+ ToReturn+=__T("<ebucore:ebuCoreMain xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:ebucore=\"urn:ebu:metadata-schema:ebuCore_2015\"\n xmlns:xalan=\"http://xml.apache.org/xalan\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"urn:ebu:metadata-schema:ebuCore_2014 http://www.ebu.ch/metadata/schemas/EBUCore/20141231/EBU_CORE_20141231_draft16.xsd\" version=\"1.6\" dateLastModified=\"")+Date+__T("\" timeLastModified=\"")+Time+__T("Z\">\n");
//coreMetadata
ToReturn+=__T("\t<ebucore:coreMetadata>\n");
+ //title
+ if (As11_Core_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_Core_Pos, __T("ProgrammeTitle")).empty())
+ {
+ ToReturn+=__T("\t\t<ebucore:title typeLabel=\"PROGRAMME TITLE\">\n");
+ ToReturn+=__T("\t\t\t<dc:title>")+MI.Get(Stream_Other, As11_Core_Pos, __T("ProgrammeTitle"))+__T("</dc:title>\n");
+ ToReturn+=__T("\t\t</ebucore:title>\n");
+ }
+ else if (As11_Core_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_Core_Pos, __T("EpisodeTitleNumber")).empty())
+ {
+ ToReturn+=__T("\t\t<ebucore:title typeLabel=\"EPISODE TITLE NUMBER\">\n");
+ ToReturn+=__T("\t\t\t<dc:title>")+MI.Get(Stream_Other, As11_Core_Pos, __T("EpisodeTitleNumber"))+__T("</dc:title>\n");
+ ToReturn+=__T("\t\t</ebucore:title>\n");
+ }
+
+ //alternativeTitle
+ if (As11_Core_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_Core_Pos, __T("SeriesTitle")).empty())
+ {
+ ToReturn+=__T("\t\t<ebucore:alternativeTitle typeLabel=\"SERIES TITLE\">\n");
+ ToReturn+=__T("\t\t\t<dc:title>")+MI.Get(Stream_Other, As11_Core_Pos, __T("SeriesTitle"))+__T("</dc:title>\n");
+ ToReturn+=__T("\t\t</ebucore:alternativeTitle>\n");
+ }
+ if (As11_Core_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_Core_Pos, __T("EpisodeTitleNumber")).empty() && !MI.Get(Stream_Other, As11_Core_Pos, __T("ProgrammeTitle")).empty())
+ {
+ ToReturn+=__T("\t\t<ebucore:alternativeTitle typeLabel=\"EPISODE TITLE NUMBER\">\n");
+ ToReturn+=__T("\t\t\t<dc:title>")+MI.Get(Stream_Other, As11_Core_Pos, __T("EpisodeTitleNumber"))+__T("</dc:title>\n");
+ ToReturn+=__T("\t\t</ebucore:alternativeTitle>\n");
+ }
+
+ //description
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("Synopsis")).empty())
+ {
+ ToReturn+=__T("\t\t<ebucore:description typeLabel=\"SYNOPSIS\">\n");
+ ToReturn+=__T("\t\t\t<dc:description>")+MI.Get(Stream_Other, As11_UkDpp_Pos, __T("Synopsis"))+__T("</dc:description>\n");
+ ToReturn+=__T("\t\t</ebucore:description>\n");
+ }
+
+ //ProductPlacement
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("ProductPlacement")).empty())
+ {
+ ToReturn+=__T("\t\t<ebucore:description typeLabel=\"PRODUCT PLACEMENT\">\n");
+ ToReturn+=__T("\t\t\t<dc:description>")+Ztring(MI.Get(Stream_Other, As11_UkDpp_Pos, __T("ProductPlacement"))==__T("Yes")?__T("true"):__T("false"))+__T("</dc:description>\n");
+ ToReturn+=__T("\t\t</ebucore:description>\n");
+ }
+
+ //ContactEmail / ContactTelephoneNumber
+ if (As11_UkDpp_Pos!=(size_t)-1 && (!MI.Get(Stream_Other, As11_UkDpp_Pos, __T("ContactEmail")).empty() || !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("ContactTelephoneNumber")).empty()))
+ {
+ ToReturn+=__T("\t\t<ebucore:contributor>\n");
+ ToReturn+=__T("\t\t\t<ebucore:contactDetails>\n");
+ ToReturn+=__T("\t\t\t\t<ebucore:details>\n");
+ if (!MI.Get(Stream_Other, As11_UkDpp_Pos, __T("ContactEmail")).empty())
+ ToReturn+=__T("\t\t\t\t\t<ebucore:emailAddress>")+XML_Encode(MI.Get(Stream_Other, As11_UkDpp_Pos, __T("ContactEmail")))+__T("</ebucore:emailAddress>\n");
+ if (!MI.Get(Stream_Other, As11_UkDpp_Pos, __T("ContactTelephoneNumber")).empty())
+ ToReturn+=__T("\t\t\t\t\t<ebucore:telephoneNumber>")+XML_Encode(MI.Get(Stream_Other, As11_UkDpp_Pos, __T("ContactTelephoneNumber")))+__T("</ebucore:telephoneNumber>\n");
+ ToReturn+=__T("\t\t\t\t</ebucore:details>\n");
+ ToReturn+=__T("\t\t\t</ebucore:contactDetails>\n");
+ ToReturn+=__T("\t\t\t<ebucore:role typeLabel=\"contact\"/>\n");
+ ToReturn+=__T("\t\t</ebucore:contributor>\n");
+ }
+
+ //Originator
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("Originator")).empty())
+ {
+ ToReturn+=__T("\t\t<ebucore:contributor>\n");
+ ToReturn+=__T("\t\t\t<ebucore:organisationDetails>\n");
+ ToReturn+=__T("\t\t\t\t<ebucore:organisationName>")+XML_Encode(MI.Get(Stream_Other, As11_UkDpp_Pos, __T("Originator")))+__T("</ebucore:organisationName>\n");
+ ToReturn+=__T("\t\t\t</ebucore:organisationDetails>\n");
+ ToReturn+=__T("\t\t\t<ebucore:role typeLabel=\"originator\"/>\n");
+ ToReturn+=__T("\t\t</ebucore:contributor>\n");
+ }
+
+ //Distributor
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("Distributor")).empty())
+ {
+ ToReturn+=__T("\t\t<ebucore:contributor>\n");
+ ToReturn+=__T("\t\t\t<ebucore:organisationDetails>\n");
+ ToReturn+=__T("\t\t\t\t<ebucore:organisationName>")+MI.Get(Stream_Other, As11_UkDpp_Pos, __T("Distributor"))+__T("</ebucore:organisationName>\n");
+ ToReturn+=__T("\t\t\t</ebucore:organisationDetails>\n");
+ ToReturn+=__T("\t\t\t<ebucore:role typeLabel=\"distributor\"/>\n");
+ ToReturn+=__T("\t\t</ebucore:contributor>\n");
+ }
+
+ //date
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("CopyrightYear")).empty())
+ {
+ ToReturn+=__T("\t\t<ebucore:date>\n");
+ ToReturn+=__T("\t\t\t<ebucore:copyrighted startYear=\"")+MI.Get(Stream_Other, As11_UkDpp_Pos, __T("CopyrightYear"))+__T("\"/>\n");
+ ToReturn+=__T("\t\t</ebucore:date>\n");
+ }
+
+ //type
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("Genre")).empty())
+ {
+ ToReturn+=__T("\t\t<ebucore:type>\n");
+ ToReturn+=__T("\t\t\t<ebucore:genre typeDefinition=\"")+MI.Get(Stream_Other, As11_UkDpp_Pos, __T("Genre"))+__T("\"/>\n");
+ ToReturn+=__T("\t\t</ebucore:type>\n");
+ }
+
//format
ToReturn+=__T("\t\t<ebucore:format>\n");
//format - videoFormat
for (size_t Pos=0; Pos<MI.Count_Get(Stream_Video); Pos++)
- EbuCore_Transform_Video(ToReturn, MI, Pos);
+ EbuCore_Transform_Video(ToReturn, MI, Pos, Version);
//format - audioFormat
for (size_t Pos=0; Pos<MI.Count_Get(Stream_Audio); Pos++)
- EbuCore_Transform_Audio(ToReturn, MI, Pos);
+ EbuCore_Transform_Audio(ToReturn, MI, Pos, Version);
//format - containerFormat
ToReturn+=__T("\t\t\t<ebucore:containerFormat");
if (!MI.Get(Stream_General, 0, General_Format).empty())
- ToReturn+=__T(" formatLabel=\"")+MI.Get(Stream_General, 0, General_Format)+__T("\"");
+ ToReturn+=(Version>=Version_1_6?__T(" containerFormatName=\""):__T(" formatLabel=\""))+MI.Get(Stream_General, 0, General_Format)+__T("\"");
if (!MI.Get(Stream_General, 0, General_ID).empty())
ToReturn+=__T(" containerFormatId=\"")+MI.Get(Stream_General, 0, General_ID)+__T("\"");
- if (!MI.Get(Stream_General, 0, General_CodecID).empty() || !MI.Get(Stream_General, 0, General_Format_Commercial_IfAny).empty())
+ ToReturn+=__T(">\n");
+ if (!MI.Get(Stream_General, 0, General_CodecID).empty() || (!MI.Get(Stream_General, 0, General_Format_Commercial_IfAny).empty()))
{
- ToReturn+=__T(">\n");
- if (!MI.Get(Stream_General, 0, General_CodecID).empty() || (!MI.Get(Stream_General, 0, General_Format_Commercial_IfAny).empty()))
+ ToReturn+=__T("\t\t\t\t<ebucore:codec>\n");
+ if (!MI.Get(Stream_General, 0, General_CodecID).empty())
{
- ToReturn+=__T("\t\t\t\t<ebucore:codec>\n");
- if (!MI.Get(Stream_General, 0, General_CodecID).empty())
- {
- ToReturn+=__T("\t\t\t\t\t<ebucore:codecIdentifier>\n");
- ToReturn+=__T("\t\t\t\t\t\t<dc:identifier>")+MI.Get(Stream_General, 0, General_CodecID)+__T("</dc:identifier>\n");
- ToReturn+=__T("\t\t\t\t\t</ebucore:codecIdentifier>\n");
- }
- if (!MI.Get(Stream_General, 0, General_Format_Commercial_IfAny).empty())
- ToReturn+=__T("\t\t\t\t\t<ebucore:name>")+MI.Get(Stream_General, 0, General_Format_Commercial_IfAny)+__T("</ebucore:name>\n");
- ToReturn+=__T("\t\t\t\t</ebucore:codec>\n");
+ ToReturn+=__T("\t\t\t\t\t<ebucore:codecIdentifier>\n");
+ ToReturn+=__T("\t\t\t\t\t\t<dc:identifier>")+MI.Get(Stream_General, 0, General_CodecID)+__T("</dc:identifier>\n");
+ ToReturn+=__T("\t\t\t\t\t</ebucore:codecIdentifier>\n");
}
- ToReturn+=__T("\t\t\t</ebucore:containerFormat>\n");
+ if (!MI.Get(Stream_General, 0, General_Format_Commercial_IfAny).empty())
+ ToReturn+=__T("\t\t\t\t\t<ebucore:name>")+MI.Get(Stream_General, 0, General_Format_Commercial_IfAny)+__T("</ebucore:name>\n");
+ ToReturn+=__T("\t\t\t\t</ebucore:codec>\n");
}
- else
+ if (Version>=Version_1_6)
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:containerEncoding");
+ if (!MI.Get(Stream_General, 0, General_Format).empty())
+ ToReturn+=__T(" formatLabel=\"")+MI.Get(Stream_General, 0, General_Format)+__T("\"");
+ //if (Version>=Version_1_6 && !MI.Get(Stream_General, 0, General_Format_Profile).empty())
+ // ToReturn+=__T(" containeFormatProfile=\"")+MI.Get(Stream_General, 0, General_Format_Profile)+__T("\"");
ToReturn+=__T("/>\n");
+ }
+ //format - containerFormat - technicalAttributeString - AS11ShimName
+ if (As11_Core_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_Core_Pos, __T("ShimName")).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:")+Ztring(Version>=Version_1_6?__T("technicalAttributeString"):__T("comment"))+__T(" typeLabel=\"AS11ShimName\">")+MI.Get(Stream_Other, As11_Core_Pos, __T("ShimName"))+__T("</ebucore:")+Ztring(Version>=Version_1_6?__T("technicalAttributeString"):__T("comment"))+__T(">\n");
+ }
+
+ //format - containerFormat - technicalAttributeString - AS11ShimVersion
+ if (As11_Core_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_Core_Pos, __T("ShimVersion")).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:")+Ztring(Version>=Version_1_6?__T("technicalAttributeString"):__T("comment"))+__T(" typeLabel=\"AS11ShimVersion\">")+MI.Get(Stream_Other, As11_Core_Pos, __T("ShimVersion"))+__T("</ebucore:")+Ztring(Version>=Version_1_6?__T("technicalAttributeString"):__T("comment"))+__T(">\n");
+ }
+
+ //format - containerFormat - technicalAttributeString - Format_Profile
+ if (!MI.Get(Stream_General, 0, __T("Format_Profile")).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:")+Ztring(Version>=Version_1_6?__T("technicalAttributeString"):__T("comment"))+__T(" typeLabel=\"FormatProfile\">")+MI.Get(Stream_General, 0, __T("Format_Profile"))+__T("</ebucore:")+Ztring(Version>=Version_1_6?__T("technicalAttributeString"):__T("comment"))+__T(">\n");
+ }
+
+ //format - containerFormat - technicalAttributeString - Format_Settings
+ if (!MI.Get(Stream_General, 0, __T("Format_Profile")).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:")+Ztring(Version>=Version_1_6?__T("technicalAttributeString"):__T("comment"))+__T(" typeLabel=\"FormatSettings\">")+MI.Get(Stream_General, 0, __T("Format_Settings"))+__T("</ebucore:")+Ztring(Version>=Version_1_6?__T("technicalAttributeString"):__T("comment"))+__T(">\n");
+ }
+
+ //format - containerFormat - technicalAttributeString - Encoded_Application
+ if (!MI.Get(Stream_General, 0, __T("Encoded_Application")).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:")+Ztring(Version>=Version_1_6?__T("technicalAttributeString"):__T("comment"))+__T(" typeLabel=\"WrittingApplication\">")+MI.Get(Stream_General, 0, __T("Encoded_Application"))+__T("</ebucore:")+Ztring(Version>=Version_1_6?__T("technicalAttributeString"):__T("comment"))+__T(">\n");
+ }
+
+ //format - containerFormat - technicalAttributeString - Encoded_Library
+ if (!MI.Get(Stream_General, 0, __T("Encoded_Library/String")).empty())
+ {
+ ToReturn+=__T("\t\t\t\t<ebucore:")+Ztring(Version>=Version_1_6?__T("technicalAttributeString"):__T("comment"))+__T(" typeLabel=\"WrittingLibrary\">")+MI.Get(Stream_General, 0, __T("Encoded_Library/String"))+__T("</ebucore:")+Ztring(Version>=Version_1_6?__T("technicalAttributeString"):__T("comment"))+__T(">\n");
+ }
+
+ ToReturn+=__T("\t\t\t</ebucore:containerFormat>\n");
+
+ //format - SigningPresent
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("SigningPresent")).empty())
+ {
+ if (Version==Version_1_5)
+ ToReturn+=__T("\t\t\t<!-- (signingPresenceFlag not in XSD)\n");
+ //ToReturn+=__T("\t\t\t<ebucore:dataFormat>\n");
+ ToReturn+=__T("\t\t\t<ebucore:signingFormat signingPresenceFlag=\"")+Ztring(MI.Get(Stream_Other, As11_UkDpp_Pos, __T("SigningPresent"))==__T("Yes")?__T("true"):__T("false"))+__T("\"/>\n");
+ //ToReturn+=__T("\t\t\t</ebucore:dataFormat>\n");
+ if (Version==Version_1_5)
+ ToReturn+=__T("\t\t\t-->\n");
+ }
//format - dataFormat
for (size_t Pos=0; Pos<MI.Count_Get(Stream_Text); Pos++)
EbuCore_Transform_Text(ToReturn, MI, Pos);
- //format - start
- bool startCount=false;
- for (size_t StreamPos=0; StreamPos<MI.Count_Get(Stream_Other); ++StreamPos)
+ //format - ClosedCaptionsPresent
+ if (As11_Core_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_Core_Pos, __T("ClosedCaptionsPresent")).empty())
{
- if (MI.Get(Stream_Other, StreamPos, Other_Type)==__T("Time code"))
- {
- if (startCount)
- ToReturn+=__T("\t\t\t<!-- (Not in XSD)\n");
- if (!(!MI.Get(Stream_Video, StreamPos, Video_ID).empty() || !MI.Get(Stream_Video, StreamPos, Video_Title).empty())) //No extra out of spec fields
- ToReturn+=__T("\t\t\t<ebucore:start>\n");
- else if (startCount) //No out of spec in all cases
- {
- ToReturn+=__T("\t\t\t<ebucore:start");
- if (!MI.Get(Stream_Video, StreamPos, Video_ID).empty() || !MI.Get(Stream_Video, StreamPos, Video_Title).empty())
- {
- if (!MI.Get(Stream_Video, StreamPos, Video_ID).empty())
- ToReturn+=__T(" trackId=\"")+MI.Get(Stream_Video, StreamPos, Video_ID)+__T("\"");
- if (!MI.Get(Stream_Video, StreamPos, Video_Title).empty())
- ToReturn+=__T(" trackName=\"")+MI.Get(Stream_Video, StreamPos, Video_Title)+__T("\"");
- }
- ToReturn+=__T(">\n");
- }
- else //Extra out of spec fields
- {
- ToReturn+=__T("\t\t\t<ebucore:start><!-- (Not in XSD)");
- if (!MI.Get(Stream_Video, StreamPos, Video_ID).empty())
- ToReturn+=__T(" trackId=\"")+MI.Get(Stream_Video, StreamPos, Video_ID)+__T("\"");
- if (!MI.Get(Stream_Video, StreamPos, Video_Title).empty())
- ToReturn+=__T(" trackName=\"")+MI.Get(Stream_Video, StreamPos, Video_Title)+__T("\"");
- ToReturn+=__T("-->\n");
- }
- ToReturn+=__T("\t\t\t\t<ebucore:timecode>")+MI.Get(Stream_Other, StreamPos, Other_TimeCode_FirstFrame)+__T("</ebucore:timecode>\n");
- if (!MI.Get(Stream_Other, 0, Other_MuxingMode).empty())
- {
- if (!startCount)
- ToReturn+=__T("\t\t\t\t<!-- (Not in XSD)\n");
- ToReturn+=__T("\t\t\t\t<ebucore:source>")+MI.Get(Stream_Other, StreamPos, Other_MuxingMode)+__T("</ebucore:source>\n");
- if (!startCount)
- ToReturn+=__T("\t\t\t\t-->\n");
- }
- ToReturn+=__T("\t\t\t</ebucore:start>\n");
- if (startCount)
- ToReturn+=__T("\t\t\t-->\n");
- startCount=true;
- }
+ ToReturn+=__T("\t\t\t<ebucore:dataFormat>\n");
+ ToReturn+=__T("\t\t\t\t<ebucore:captioningFormat captioningPresenceFlag=\"")+Ztring(MI.Get(Stream_Other, As11_Core_Pos, __T("OpenCaptionsPresent"))==__T("Yes")?__T("true"):__T("false"))+__T("\" closed=\"true\"/>\n");
+ ToReturn+=__T("\t\t\t</ebucore:dataFormat>\n");
+ }
+
+ //format - OpenCaptionsPresent
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("OpenCaptionsPresent")).empty())
+ {
+ ToReturn+=__T("\t\t\t<ebucore:dataFormat>\n");
+ ToReturn+=__T("\t\t\t\t<ebucore:captioningFormat captioningPresenceFlag=\"")+Ztring(MI.Get(Stream_Other, As11_UkDpp_Pos, __T("OpenCaptionsPresent"))==__T("Yes")?__T("true"):__T("false"))+__T("\" closed=\"false\"/>\n");
+ ToReturn+=__T("\t\t\t</ebucore:dataFormat>\n");
+ }
+
+ //format - time codes
+ for (size_t Pos=0; Pos<MI.Count_Get(Stream_Other); Pos++)
+ if (MI.Get(Stream_Other, Pos, Other_Type)==__T("Time code"))
+ EbuCore_Transform_TimeCode(ToReturn, MI, Pos, Version==Version_1_5);
+
+ //format - Metadata
+ for (size_t Pos=0; Pos<MI.Count_Get(Stream_Other); Pos++)
+ if (MI.Get(Stream_Other, Pos, Other_Type)==__T("Metadata"))
+ EbuCore_Transform_Metadata(ToReturn, MI, Pos, Version==Version_1_5);
+
+ //format - technicalAttributeString - LineUpStart
+ bool startDone=false;
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("LineUpStart")).empty())
+ {
+ ToReturn+=__T("\t\t\t<ebucore:start typeLabel=\"LineUpStart\">\n");
+ ToReturn+=__T("\t\t\t\t<ebucore:timecode>")+MI.Get(Stream_Other, As11_UkDpp_Pos, __T("LineUpStart"))+__T("</ebucore:timecode>\n");
+ ToReturn+=__T("\t\t\t</ebucore:start>\n");
+ startDone=true;
+ }
+
+ //format - technicalAttributeString - IdentClockStart
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("IdentClockStart")).empty())
+ {
+ if (Version==Version_1_5 && startDone)
+ ToReturn+=__T("\t\t\t<!-- Not valid in XSD\n");
+ ToReturn+=__T("\t\t\t<ebucore:start typeLabel=\"IdentClockStart\">\n");
+ ToReturn+=__T("\t\t\t\t<ebucore:timecode>")+MI.Get(Stream_Other, As11_UkDpp_Pos, __T("IdentClockStart"))+__T("</ebucore:timecode>\n");
+ ToReturn+=__T("\t\t\t</ebucore:start>\n");
+ if (Version==Version_1_5 && startDone)
+ ToReturn+=__T("\t\t\t-->\n");
}
//format - duration
+ bool durationDone=false;
if (!MI.Get(Stream_General, 0, General_Duration).empty())
{
float64 DurationS=MI.Get(Stream_General, 0, General_Duration).To_float64()/1000;
@@ -1105,6 +1533,19 @@ Ztring Export_EbuCore::Transform(MediaInfo_Internal &MI)
ToReturn+=__T("\t\t\t<ebucore:duration>\n");
ToReturn+=__T("\t\t\t\t<ebucore:normalPlayTime>PT")+Duration+__T("</ebucore:normalPlayTime>\n");
ToReturn+=__T("\t\t\t</ebucore:duration>\n");
+ durationDone=true;
+ }
+
+ //format - duration
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("TotalProgrammeDuration")).empty())
+ {
+ if (Version==Version_1_5 && durationDone)
+ ToReturn+=__T("\t\t\t<!-- Not valid in XSD\n");
+ ToReturn+=__T("\t\t\t<ebucore:duration typeLabel=\"TotalProgrammeDuration\">\n");
+ ToReturn+=__T("\t\t\t\t<ebucore:timecode>")+MI.Get(Stream_Other, As11_UkDpp_Pos, __T("IdentClockStart"))+__T("</ebucore:timecode>\n");
+ ToReturn+=__T("\t\t\t</ebucore:duration>\n");
+ if (Version==Version_1_5 && durationDone)
+ ToReturn+=__T("\t\t\t-->\n");
}
//format - fileSize
@@ -1120,30 +1561,43 @@ Ztring Export_EbuCore::Transform(MediaInfo_Internal &MI)
Name+=__T('.');
Name+=MI.Get(Stream_General, 0, General_FileExtension);
}
- Name.FindAndReplace(__T("&"), __T("&amp;"), 0, Ztring_Recursive);
- Name.FindAndReplace(__T("<"), __T("&lt;"), 0, Ztring_Recursive);
- Name.FindAndReplace(__T(">"), __T("&gt;"), 0, Ztring_Recursive);
- Name.FindAndReplace(__T("\""), __T("&quot;"), 0, Ztring_Recursive);
- Name.FindAndReplace(__T("'"), __T("&apos;"), 0, Ztring_Recursive);
- ToReturn+=__T("\t\t\t<ebucore:fileName>")+Name+__T("</ebucore:fileName>\n");
+ ToReturn+=__T("\t\t\t<ebucore:fileName>")+XML_Encode(Name)+__T("</ebucore:fileName>\n");
}
//format - locator
if (!MI.Get(Stream_General, 0, General_CompleteName).empty())
{
- Ztring Name=MI.Get(Stream_General, 0, General_CompleteName);
- Name.FindAndReplace(__T("&"), __T("&amp;"), 0, Ztring_Recursive);
- Name.FindAndReplace(__T("<"), __T("&lt;"), 0, Ztring_Recursive);
- Name.FindAndReplace(__T(">"), __T("&gt;"), 0, Ztring_Recursive);
- Name.FindAndReplace(__T("\""), __T("&quot;"), 0, Ztring_Recursive);
- Name.FindAndReplace(__T("'"), __T("&apos;"), 0, Ztring_Recursive);
- ToReturn+=__T("\t\t\t<ebucore:locator>")+Name+__T("</ebucore:locator>\n");
+ ToReturn+=__T("\t\t\t<ebucore:locator>")+XML_Encode(MI.Get(Stream_General, 0, General_CompleteName))+__T("</ebucore:locator>\n");
+ }
+
+ //format - technicalAttributeString - AudioLoudnessStandard
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("AudioLoudnessStandard")).empty())
+ {
+ ToReturn+=__T("\t\t\t<ebucore:technicalAttributeString typeLabel=\"AudioLoudnessStandard\">")+MI.Get(Stream_Other, As11_UkDpp_Pos, __T("AudioLoudnessStandard"))+__T("</ebucore:technicalAttributeString>\n");
+ }
+
+ //format - technicalAttributeString - AudioDescriptionType
+ if (!MI.Get(Stream_Other, As11_UkDpp_Pos, __T("AudioDescriptionType")).empty())
+ {
+ ToReturn+=__T("\t\t\t<ebucore:technicalAttributeString typeLabel=\"AudioDescriptionType\">")+MI.Get(Stream_Other, As11_UkDpp_Pos, __T("AudioDescriptionType"))+__T("</ebucore:technicalAttributeString>\n");
}
//format - technicalAttributeString - overallBitRate
if (!MI.Get(Stream_General, 0, General_OverallBitRate).empty())
{
- ToReturn+=__T("\t\t\t<ebucore:technicalAttributeString typeLabel=\"overallBitRate\">")+MI.Get(Stream_General, 0, General_OverallBitRate)+__T("</ebucore:technicalAttributeString>\n");
+ ToReturn+=__T("\t\t\t<ebucore:technicalAttributeInteger typeLabel=\"OverallBitRate\"")+(Version>=Version_1_6?Ztring(__T(" unit=\"bps\"")):Ztring())+__T(">")+MI.Get(Stream_General, 0, General_OverallBitRate)+__T("</ebucore:technicalAttributeInteger>\n");
+ }
+
+ //format - technicalAttributeString - ProgrammeHasText
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_Core_Pos, __T("ProgrammeHasText")).empty())
+ {
+ ToReturn+=__T("\t\t\t<ebucore:technicalAttributeBoolean typeLabel=\"ProgrammeHasText\">")+Ztring(MI.Get(Stream_Other, As11_UkDpp_Pos, __T("ProgrammeHasText"))==__T("Yes")?__T("true"):__T("false"))+__T("</ebucore:technicalAttributeBoolean>\n");
+ }
+
+ //format - technicalAttributeString - AudioDescriptionPresent
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_Core_Pos, __T("AudioDescriptionPresent")).empty())
+ {
+ ToReturn+=__T("\t\t\t<ebucore:technicalAttributeBoolean typeLabel=\"AudioDescriptionPresent\">")+Ztring(MI.Get(Stream_Other, As11_UkDpp_Pos, __T("AudioDescriptionPresent"))==__T("Yes")?__T("true"):__T("false"))+__T("</ebucore:technicalAttributeBoolean>\n");
}
//format - dateCreated
@@ -1173,6 +1627,84 @@ Ztring Export_EbuCore::Transform(MediaInfo_Internal &MI)
//format
ToReturn+=__T("\t\t</ebucore:format>\n");
+ //identifier
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("ProductionNumber")).empty())
+ {
+ ToReturn+=__T("\t\t<ebucore:identifier typeLabel=\"PRODUCTION NUMBER\">\n");
+ ToReturn+=__T("\t\t\t<dc:identifier>")+MI.Get(Stream_Other, As11_UkDpp_Pos, __T("ProductionNumber"))+__T("</dc:identifier>\n");
+ ToReturn+=__T("\t\t</ebucore:identifier>\n");
+ }
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("OtherIdentifier")).empty())
+ {
+ ToReturn+=__T("\t\t<ebucore:identifier typeLabel=\"INTERNAL IDENTIFIER\">\n");
+ ToReturn+=__T("\t\t\t<dc:identifier>")+MI.Get(Stream_Other, As11_UkDpp_Pos, __T("OtherIdentifier"))+__T("</dc:identifier>\n");
+ ToReturn+=__T("\t\t</ebucore:identifier>\n");
+ }
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("OtherIdentifierType")).empty())
+ {
+ ToReturn+=__T("\t\t<ebucore:identifier typeLabel=\"INTERNAL IDENTIFIER TYPE\">\n");
+ ToReturn+=__T("\t\t\t<dc:identifier>")+MI.Get(Stream_Other, As11_UkDpp_Pos, __T("OtherIdentifierType"))+__T("</dc:identifier>\n");
+ ToReturn+=__T("\t\t</ebucore:identifier>\n");
+ }
+
+ //format - PrimaryAudioLanguage
+ if (As11_Core_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_Core_Pos, __T("PrimaryAudioLanguage")).empty())
+ {
+ ToReturn+=__T("\t\t<ebucore:language typeLabel=\"PrimaryAudioLanguage\">\n");
+ ToReturn+=__T("\t\t\t<dc:language>")+MI.Get(Stream_Other, As11_Core_Pos, __T("PrimaryAudioLanguage"))+__T("</dc:language>\n");
+ ToReturn+=__T("\t\t</ebucore:language>\n");
+ }
+
+ //format - SecondaryAudioLanguage
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("SecondaryAudioLanguage")).empty())
+ {
+ ToReturn+=__T("\t\t<ebucore:language typeLabel=\"SecondaryAudioLanguage\">\n");
+ ToReturn+=__T("\t\t\t<dc:language>")+MI.Get(Stream_Other, As11_UkDpp_Pos, __T("SecondaryAudioLanguage"))+__T("</dc:language>\n");
+ ToReturn+=__T("\t\t</ebucore:language>\n");
+ }
+
+ //format - TertiaryAudioLanguage
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("TertiaryAudioLanguage")).empty())
+ {
+ ToReturn+=__T("\t\t<ebucore:language typeLabel=\"TertiaryAudioLanguage\">\n");
+ ToReturn+=__T("\t\t\t<dc:language>")+MI.Get(Stream_Other, As11_UkDpp_Pos, __T("TertiaryAudioLanguage"))+__T("</dc:language>\n");
+ ToReturn+=__T("\t\t</ebucore:language>\n");
+ }
+
+ //language
+ if (As11_UkDpp_Pos!=(size_t)-1 && !MI.Get(Stream_Other, As11_UkDpp_Pos, __T("ProgrammeTextLanguage")).empty())
+ {
+ ToReturn+=__T("\t\t<ebucore:language typeLabel=\"ProgrammeTextLanguage\">\n");
+ ToReturn+=__T("\t\t\t<dc:language>")+MI.Get(Stream_Other, As11_UkDpp_Pos, __T("ProgrammeTextLanguage"))+__T("</dc:language>\n");
+ ToReturn+=__T("\t\t</ebucore:language>\n");
+ }
+
+ //part
+ if (As11_Segmentation_Pos!=(size_t)-1)
+ {
+ size_t Pos=1;
+ for (;;)
+ {
+ Ztring Content=MI.Get(Stream_Other, As11_Segmentation_Pos, Ztring::ToZtring(Pos));
+ if (Content.empty())
+ break;
+
+ Ztring Begin=Content.SubString(Ztring(), __T(" + "));
+ Ztring Duration=Content.SubString(__T(" + "), __T(" = "));
+
+ ToReturn+=__T("\t\t<ebucore:part partNumber=\"")+Ztring::ToZtring(Pos)+__T("\" partTotalNumber=\"")+MI.Get(Stream_Other, As11_Segmentation_Pos, __T("PartTotal"))+__T("\">\n");
+ ToReturn+=__T("\t\t\t<ebucore:partStartTime>\n");
+ ToReturn+=__T("\t\t\t\t<ebucore:timecode>")+Begin+__T("</ebucore:timecode>\n");
+ ToReturn+=__T("\t\t\t</ebucore:partStartTime>\n");
+ ToReturn+=__T("\t\t\t<ebucore:partDuration>\n");
+ ToReturn+=__T("\t\t\t\t<ebucore:timecode>")+Duration+__T("</ebucore:timecode>\n");
+ ToReturn+=__T("\t\t\t</ebucore:partDuration>\n");
+ ToReturn+=__T("\t\t</ebucore:part>\n");
+
+ Pos++;
+ }
+ }
+
//coreMetadata
ToReturn+=__T("\t</ebucore:coreMetadata>\n");
@@ -1190,3 +1722,5 @@ Ztring Export_EbuCore::Transform(MediaInfo_Internal &MI)
//***************************************************************************
} //NameSpace
+
+#endif
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Export/Export_EbuCore.h b/src/thirdparty/MediaInfo/MediaInfo/Export/Export_EbuCore.h
index 27a0b1d21..3317a09cc 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Export/Export_EbuCore.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/Export/Export_EbuCore.h
@@ -28,7 +28,12 @@ public :
~Export_EbuCore ();
//Input
- Ztring Transform(MediaInfo_Internal &MI);
+ enum version
+ {
+ Version_1_5,
+ Version_1_6,
+ };
+ Ztring Transform(MediaInfo_Internal &MI, version Version=Version_1_5);
};
} //NameSpace
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Export/Export_Mpeg7.cpp b/src/thirdparty/MediaInfo/MediaInfo/Export/Export_Mpeg7.cpp
index 1df5605eb..a884183ab 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Export/Export_Mpeg7.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Export/Export_Mpeg7.cpp
@@ -17,6 +17,10 @@
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
+#if defined(MEDIAINFO_MPEG7_YES)
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
#include "MediaInfo/Export/Export_Mpeg7.h"
#include "MediaInfo/File__Analyse_Automatic.h"
#include <ctime>
@@ -1546,3 +1550,5 @@ Ztring Export_Mpeg7::Transform(MediaInfo_Internal &MI)
//***************************************************************************
} //NameSpace
+
+#endif \ No newline at end of file
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Export/Export_PBCore.cpp b/src/thirdparty/MediaInfo/MediaInfo/Export/Export_PBCore.cpp
index 5f28e3e43..239582345 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Export/Export_PBCore.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Export/Export_PBCore.cpp
@@ -17,6 +17,10 @@
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
+#if defined(MEDIAINFO_PBCORE_YES)
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
#include "MediaInfo/Export/Export_PBCore.h"
#include "MediaInfo/File__Analyse_Automatic.h"
#include <ctime>
@@ -74,8 +78,6 @@ void PBCore_Transform(Ztring &ToReturn, MediaInfo_Internal &MI, stream_t StreamK
if (StreamKind==Stream_Menu && MI.Get(Stream_Menu, StreamPos, Menu_Format)!=__T("TimeCode"))
return;
- ToReturn+=__T("\t\t<pbcoreEssenceTrack>\n");
-
//essenceTrackType
Ztring essenceTrackType;
switch (StreamKind)
@@ -105,6 +107,9 @@ void PBCore_Transform(Ztring &ToReturn, MediaInfo_Internal &MI, stream_t StreamK
return; //Not supported
default: return; //Not supported
}
+
+ ToReturn+=__T("\t\t<pbcoreEssenceTrack>\n");
+
ToReturn+=__T("\t\t\t<essenceTrackType>")+essenceTrackType+__T("</essenceTrackType>\n");
//essenceTrackIdentifier
@@ -334,3 +339,5 @@ Ztring Export_PBCore::Transform(MediaInfo_Internal &MI)
//***************************************************************************
} //NameSpace
+
+#endif
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Export/Export_PBCore2.cpp b/src/thirdparty/MediaInfo/MediaInfo/Export/Export_PBCore2.cpp
index 6758949af..24e5e15f8 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Export/Export_PBCore2.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Export/Export_PBCore2.cpp
@@ -23,6 +23,10 @@
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
+#if defined(MEDIAINFO_PBCORE_YES)
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
#include "MediaInfo/Export/Export_PBCore2.h"
#include "MediaInfo/File__Analyse_Automatic.h"
#include <ctime>
@@ -80,8 +84,6 @@ void PBCore2_Transform(Ztring &ToReturn, MediaInfo_Internal &MI, stream_t Stream
if (StreamKind==Stream_Menu && MI.Get(Stream_Menu, StreamPos, Menu_Format)!=__T("TimeCode"))
return;
- ToReturn+=__T("\t<instantiationEssenceTrack>\n");
-
//essenceTrackType
Ztring essenceTrackType;
switch (StreamKind)
@@ -114,6 +116,9 @@ void PBCore2_Transform(Ztring &ToReturn, MediaInfo_Internal &MI, stream_t Stream
return; //Not supported
default: return; //Not supported
}
+
+ ToReturn+=__T("\t<instantiationEssenceTrack>\n");
+
ToReturn+=__T("\t\t<essenceTrackType>");
ToReturn+=essenceTrackType;
ToReturn+=__T("</essenceTrackType>\n");
@@ -158,7 +163,8 @@ void PBCore2_Transform(Ztring &ToReturn, MediaInfo_Internal &MI, stream_t Stream
ToReturn+=__T("\t\t<essenceTrackEncoding");
if (!MI.Get(StreamKind, StreamPos, __T("CodecID")).empty())
{
- ToReturn+=__T(" ref=\"codecid:");
+ ToReturn+=__T(" source=\"codecid\"");
+ ToReturn+=__T(" ref=\"");
ToReturn+=MI.Get(StreamKind, StreamPos, __T("CodecID"));
ToReturn+=__T("\"");
}
@@ -574,3 +580,5 @@ Ztring Export_PBCore2::Transform(MediaInfo_Internal &MI)
//***************************************************************************
} //NameSpace
+
+#endif \ No newline at end of file
diff --git a/src/thirdparty/MediaInfo/MediaInfo/File_Other.cpp b/src/thirdparty/MediaInfo/MediaInfo/File_Other.cpp
index 75ad3f03f..d5ea6a42d 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/File_Other.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/File_Other.cpp
@@ -44,6 +44,33 @@ void File_Other::Read_Buffer_Continue()
}
Ztring Format;
+ if (Buffer[0]==0xEA
+ && Buffer[1]==0x22
+ && Buffer[2]<=0x03)
+ {
+ Accept();
+
+ Stream_Prepare(Stream_Text);
+ Fill(Stream_Text, 0, Text_Format, "Cheetah");
+
+ Finish();
+ return;
+ }
+ if (Buffer[0]==0x4C
+ && Buffer[1]==0x61
+ && Buffer[2]==0x6D
+ && Buffer[3]==0x62
+ && Buffer[4]==0x64
+ && Buffer[5]==0x61)
+ {
+ Accept();
+
+ Stream_Prepare(Stream_Text);
+ Fill(Stream_Text, 0, Text_Format, "Lambda");
+
+ Finish();
+ return;
+ }
if (CC4(Buffer)==0xC5C6CBC3) {Format=__T("RISC OS Chunk data");}
else if (CC4(Buffer)==0x110000EF) {Format=__T("RISC OS AIF executable");}
else if (CC4(Buffer)==CC4("Draw")) {Format=__T("RISC OS Draw");}
diff --git a/src/thirdparty/MediaInfo/MediaInfo/File__Analyse_Automatic.h b/src/thirdparty/MediaInfo/MediaInfo/File__Analyse_Automatic.h
index cc28ad3cb..db0918c07 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/File__Analyse_Automatic.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/File__Analyse_Automatic.h
@@ -397,13 +397,19 @@ enum general
General_Written_Location,
General_Archival_Location,
General_Encoded_Application,
+ General_Encoded_Application_String,
+ General_Encoded_Application_CompanyName,
+ General_Encoded_Application_Name,
+ General_Encoded_Application_Version,
General_Encoded_Application_Url,
General_Encoded_Library,
General_Encoded_Library_String,
+ General_Encoded_Library_CompanyName,
General_Encoded_Library_Name,
General_Encoded_Library_Version,
General_Encoded_Library_Date,
General_Encoded_Library_Settings,
+ General_Encoded_OperatingSystem,
General_Cropped,
General_Dimensions,
General_DotsPerInch,
@@ -588,20 +594,28 @@ enum video
Video_Width_Offset_String,
Video_Width_Original,
Video_Width_Original_String,
+ Video_Width_CleanAperture,
+ Video_Width_CleanAperture_String,
Video_Height,
Video_Height_String,
Video_Height_Offset,
Video_Height_Offset_String,
Video_Height_Original,
Video_Height_Original_String,
+ Video_Height_CleanAperture,
+ Video_Height_CleanAperture_String,
Video_PixelAspectRatio,
Video_PixelAspectRatio_String,
Video_PixelAspectRatio_Original,
Video_PixelAspectRatio_Original_String,
+ Video_PixelAspectRatio_CleanAperture,
+ Video_PixelAspectRatio_CleanAperture_String,
Video_DisplayAspectRatio,
Video_DisplayAspectRatio_String,
Video_DisplayAspectRatio_Original,
Video_DisplayAspectRatio_Original_String,
+ Video_DisplayAspectRatio_CleanAperture,
+ Video_DisplayAspectRatio_CleanAperture_String,
Video_ActiveFormatDescription,
Video_ActiveFormatDescription_String,
Video_ActiveFormatDescription_MuxingMode,
@@ -722,13 +736,19 @@ enum video
Video_Alignment_String,
Video_Title,
Video_Encoded_Application,
+ Video_Encoded_Application_String,
+ Video_Encoded_Application_CompanyName,
+ Video_Encoded_Application_Name,
+ Video_Encoded_Application_Version,
Video_Encoded_Application_Url,
Video_Encoded_Library,
Video_Encoded_Library_String,
+ Video_Encoded_Library_CompanyName,
Video_Encoded_Library_Name,
Video_Encoded_Library_Version,
Video_Encoded_Library_Date,
Video_Encoded_Library_Settings,
+ Video_Encoded_OperatingSystem,
Video_Language,
Video_Language_String,
Video_Language_String1,
@@ -744,11 +764,11 @@ enum video
Video_Tagged_Date,
Video_Encryption,
Video_BufferSize,
+ Video_colour_range,
Video_colour_description_present,
Video_colour_primaries,
Video_transfer_characteristics,
Video_matrix_coefficients,
- Video_colour_range,
Video_colour_description_present_Original,
Video_colour_primaries_Original,
Video_transfer_characteristics_Original,
@@ -984,12 +1004,20 @@ enum audio
Audio_Interleave_Preload,
Audio_Interleave_Preload_String,
Audio_Title,
+ Audio_Encoded_Application,
+ Audio_Encoded_Application_String,
+ Audio_Encoded_Application_CompanyName,
+ Audio_Encoded_Application_Name,
+ Audio_Encoded_Application_Version,
+ Audio_Encoded_Application_Url,
Audio_Encoded_Library,
Audio_Encoded_Library_String,
+ Audio_Encoded_Library_CompanyName,
Audio_Encoded_Library_Name,
Audio_Encoded_Library_Version,
Audio_Encoded_Library_Date,
Audio_Encoded_Library_Settings,
+ Audio_Encoded_OperatingSystem,
Audio_Language,
Audio_Language_String,
Audio_Language_String1,
@@ -1198,12 +1226,20 @@ enum text
Text_Source_StreamSize_Encoded_String5,
Text_Source_StreamSize_Encoded_Proportion,
Text_Title,
+ Text_Encoded_Application,
+ Text_Encoded_Application_String,
+ Text_Encoded_Application_CompanyName,
+ Text_Encoded_Application_Name,
+ Text_Encoded_Application_Version,
+ Text_Encoded_Application_Url,
Text_Encoded_Library,
Text_Encoded_Library_String,
+ Text_Encoded_Library_CompanyName,
Text_Encoded_Library_Name,
Text_Encoded_Library_Version,
Text_Encoded_Library_Date,
Text_Encoded_Library_Settings,
+ Text_Encoded_OperatingSystem,
Text_Language,
Text_Language_String,
Text_Language_String1,
diff --git a/src/thirdparty/MediaInfo/MediaInfo/File__Analyze.cpp b/src/thirdparty/MediaInfo/MediaInfo/File__Analyze.cpp
index 20753f7e5..f90bde87d 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/File__Analyze.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/File__Analyze.cpp
@@ -20,12 +20,12 @@
#include "MediaInfo/File__Analyze.h"
#include "MediaInfo/MediaInfo_Config_MediaInfo.h"
#include "MediaInfo/MediaInfo_Config.h"
-#if MEDIAINFO_IBI
- #if MEDIAINFO_SEEK
- #include "MediaInfo/Multiple/File_Ibi.h"
- #endif //MEDIAINFO_SEEK
+#if MEDIAINFO_IBIUSAGE && MEDIAINFO_SEEK
+ #include "MediaInfo/Multiple/File_Ibi.h"
+#endif //MEDIAINFO_IBIUSAGE && MEDIAINFO_SEEK
+#if MEDIAINFO_IBIUSAGE
#include "MediaInfo/Multiple/File_Ibi_Creation.h"
-#endif //MEDIAINFO_IBI
+#endif //MEDIAINFO_IBIUSAGE
#include <cstring>
using namespace std;
using namespace tinyxml2;
@@ -216,12 +216,14 @@ File__Analyze::File__Analyze ()
#endif //MEDIAINFO_MD5
Unsynch_Frame_Count=(int64u)-1;
- #if MEDIAINFO_IBI
- Config_Ibi_Create=false;
+ #if MEDIAINFO_IBIUSAGE
Ibi_SynchronizationOffset_Current=0;
Ibi_SynchronizationOffset_BeginOfFrame=0;
+ #endif //MEDIAINFO_IBIUSAGE
+ #if MEDIAINFO_IBIUSAGE
+ Config_Ibi_Create=false;
IbiStream=NULL;
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
}
//---------------------------------------------------------------------------
@@ -247,10 +249,10 @@ File__Analyze::~File__Analyze ()
delete MD5; //MD5=NULL;
#endif //MEDIAINFO_MD5
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
if (!IsSub)
delete IbiStream; //IbiStream=NULL;
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
}
//***************************************************************************
@@ -318,11 +320,11 @@ void File__Analyze::Open_Buffer_Init (int64u File_Size_)
}
}
#endif //MEDIAINFO_EVENTS
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
Config_Ibi_Create=Config->Ibi_Create_Get() && Config->ParseSpeed==1.0;
if (Config_Ibi_Create && !IsSub && IbiStream==NULL)
IbiStream=new ibi::stream;
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
}
void File__Analyze::Open_Buffer_Init (File__Analyze* Sub)
@@ -333,7 +335,11 @@ void File__Analyze::Open_Buffer_Init (File__Analyze* Sub)
void File__Analyze::Open_Buffer_Init (File__Analyze* Sub, int64u File_Size_)
{
//Integrity
- if (Sub==NULL)
+ if (Sub==NULL
+ #if MEDIAINFO_EVENTS
+ || StreamIDs_Size==0
+ #endif
+ )
return;
//Parsing
@@ -565,8 +571,7 @@ void File__Analyze::Open_Buffer_Continue (const int8u* ToAdd, size_t ToAdd_Size)
#endif //MEDIAINFO_DEMUX
)
{
- if (!BookMark_Code.empty())
- BookMark_Get();
+ BookMark_Get();
if (File_GoTo>=File_Size)
{
@@ -1300,11 +1305,13 @@ void File__Analyze::Read_Buffer_Unsynched_OneFramePerFile()
}
#if MEDIAINFO_DEMUX
- if (Config->Demux_Rate_Get())
+ if (!IsSub && Config->Demux_Rate_Get()) //TODO: remove !IsSub when time code delay is removed from PTS
{
FrameInfo.DTS=float64_int64s(Frame_Count_NotParsedIncluded*((float64)1000000000)/Config->Demux_Rate_Get());
FrameInfo.PTS=FrameInfo.DTS;
}
+ else
+ FrameInfo.PTS=FrameInfo.DTS=(int64u)-1;
#endif //MEDIAINFO_DEMUX
}
@@ -3003,8 +3010,7 @@ void File__Analyze::GoTo (int64u GoTo, const char* ParserName)
if (GoTo==File_Size)
{
- if (!BookMark_Code.empty())
- BookMark_Get();
+ BookMark_Get();
if (File_GoTo==(int64u)-1)
ForceFinish();
return;
@@ -3070,8 +3076,7 @@ void File__Analyze::GoTo (int64u GoTo)
if (GoTo==File_Size)
{
- if (!BookMark_Code.empty())
- BookMark_Get();
+ BookMark_Get();
if (File_GoTo==(int64u)-1)
ForceFinish();
return;
@@ -3316,13 +3321,17 @@ void File__Analyze::BookMark_Get ()
Element_WantNextLevel=true;
}
- for (size_t Pos=0; Pos<=Element_Level; Pos++)
+ if (!BookMark_Code.empty())
{
- Element[Pos].Code=BookMark_Code[Pos];
- Element[Pos].Next=BookMark_Next[Pos];
+ for (size_t Pos=0; Pos<=BookMark_Element_Level; Pos++)
+ {
+ Element[Pos].Code=BookMark_Code[Pos];
+ Element[Pos].Next=BookMark_Next[Pos];
+ }
+ BookMark_Code.clear();
+ BookMark_Next.clear();
+ BookMark_Element_Level=0;
}
- BookMark_Code.clear();
- BookMark_Next.clear();
if (File_GoTo==(int64u)-1)
{
#if MEDIAINFO_MD5
@@ -3518,7 +3527,7 @@ void File__Analyze::Demux_UnpacketizeContainer_Demux_Clear ()
//***************************************************************************
// IBI
//***************************************************************************
-#if MEDIAINFO_IBI
+#if MEDIAINFO_IBIUSAGE
void File__Analyze::Ibi_Read_Buffer_Unsynched ()
{
Ibi_SynchronizationOffset_Current=(int64u)-1;
@@ -3538,6 +3547,7 @@ void File__Analyze::Ibi_Read_Buffer_Unsynched ()
}
}
+#if MEDIAINFO_SEEK
size_t File__Analyze::Ibi_Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
{
if (IbiStream==NULL)
@@ -3720,7 +3730,10 @@ size_t File__Analyze::Ibi_Read_Buffer_Seek (size_t Method, int64u Value, int64u
default : return (size_t)-1; //Not supported
}
}
+#endif //MEDIAINFO_SEEK
+#endif //MEDIAINFO_IBIUSAGE
+#if MEDIAINFO_IBIUSAGE
void File__Analyze::Ibi_Stream_Finish ()
{
if (IsSub)
@@ -3823,6 +3836,6 @@ void File__Analyze::Ibi_Add ()
Frame_Count_NotParsedIncluded=IbiStream->Infos[IbiStream->Infos_Pos-1].FrameNumber;
}
-#endif //MEDIAINFO_IBI
+#endif //MEDIAINFO_IBCREATION
} //NameSpace
diff --git a/src/thirdparty/MediaInfo/MediaInfo/File__Analyze.h b/src/thirdparty/MediaInfo/MediaInfo/File__Analyze.h
index e11db3bae..e455437b4 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/File__Analyze.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/File__Analyze.h
@@ -14,9 +14,9 @@
#include "MediaInfo/File__Analyse_Automatic.h"
#include "ZenLib/BitStream_Fast.h"
#include "ZenLib/BitStream_LE.h"
-#if MEDIAINFO_IBI
+#if MEDIAINFO_IBIUSAGE
#include "MediaInfo/Multiple/File_Ibi_Creation.h"
-#endif //MEDIAINFO_IBI
+#endif //MEDIAINFO_IBIUSAGE
#include "tinyxml2.h"
#if MEDIAINFO_AES
#include <aescpp.h>
@@ -425,6 +425,7 @@ public :
void Get_B7 (int64u &Info, const char* Name);
void Get_B8 (int64u &Info, const char* Name);
void Get_B16 (int128u &Info, const char* Name);
+ void Get_BF2 (float32 &Info, const char* Name);
void Get_BF4 (float32 &Info, const char* Name);
void Get_BF8 (float64 &Info, const char* Name);
void Get_BF10 (float80 &Info, const char* Name);
@@ -464,6 +465,7 @@ public :
#define Info_B7(_INFO, _NAME) int64u _INFO; Get_B7 (_INFO, _NAME)
#define Info_B8(_INFO, _NAME) int64u _INFO; Get_B8 (_INFO, _NAME)
#define Info_B16(_INFO, _NAME) int128u _INFO; Get_B16 (_INFO, _NAME)
+ #define Info_BF2(_INFO, _NAME) float32 _INFO; Get_BF2 (_INFO, _NAME)
#define Info_BF4(_INFO, _NAME) float32 _INFO; Get_BF4 (_INFO, _NAME)
#define Info_BF8(_INFO, _NAME) float64 _INFO; Get_BF8 (_INFO, _NAME)
#define Info_BF10(_INFO, _NAME) float80 _INFO; Get_BF10(_INFO, _NAME)
@@ -982,7 +984,7 @@ public :
#endif //SIZE_T_IS_LONG
ZtringListList Fill_Temp;
void Fill_Flush ();
- size_t Fill_Parameter(stream_t StreamKind, generic StreamPos);
+ static size_t Fill_Parameter(stream_t StreamKind, generic StreamPos);
const Ztring &Retrieve_Const (stream_t StreamKind, size_t StreamPos, size_t Parameter, info_t KindOfInfo=Info_Text);
Ztring Retrieve (stream_t StreamKind, size_t StreamPos, size_t Parameter, info_t KindOfInfo=Info_Text);
@@ -1042,6 +1044,8 @@ public :
size_t Merge(File__Analyze &ToAdd, stream_t StreamKind, size_t StreamPos_From, size_t StreamPos_To, bool Erase=true); //Merge 2 streams
void CodecID_Fill (const Ztring &Value, stream_t StreamKind, size_t StreamPos, infocodecid_format_t Format, stream_t StreamKind_CodecID=Stream_Max);
+ void PixelAspectRatio_Fill (const Ztring &Value, stream_t StreamKind, size_t StreamPos, size_t Parameter_Width, size_t Parameter_Height, size_t Parameter_PixelAspectRatio, size_t Parameter_DisplayAspectRatio);
+ void DisplayAspectRatio_Fill(const Ztring &Value, stream_t StreamKind, size_t StreamPos, size_t Parameter_Width, size_t Parameter_Height, size_t Parameter_PixelAspectRatio, size_t Parameter_DisplayAspectRatio);
//***************************************************************************
// Finalize
@@ -1306,11 +1310,14 @@ public :
bool Seek_Duration_Detected;
#endif //MEDIAINFO_SEEK
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
public:
- bool Config_Ibi_Create;
int64u Ibi_SynchronizationOffset_Current;
int64u Ibi_SynchronizationOffset_BeginOfFrame;
+ #endif //MEDIAINFO_IBIUSAGE
+ #if MEDIAINFO_IBIUSAGE
+ public:
+ bool Config_Ibi_Create;
ibi Ibi; //If Main only
ibi::stream* IbiStream; //If sub only
size_t Ibi_Read_Buffer_Seek (size_t Method, int64u Value, int64u ID);
@@ -1318,13 +1325,13 @@ public :
void Ibi_Stream_Finish ();
void Ibi_Stream_Finish (int64u Numerator, int64u Denominator); //Partial
void Ibi_Add ();
- #else //MEDIAINFO_IBI
+ #else //MEDIAINFO_IBIUSAGE
size_t Ibi_Read_Buffer_Seek (size_t, int64u, int64u) {return (size_t)-1;}
void Ibi_Read_Buffer_Unsynched () {}
void Ibi_Stream_Finish () {}
void Ibi_Stream_Finish (int64u, int64u) {}
void Ibi_Add () {}
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
};
//Helpers
diff --git a/src/thirdparty/MediaInfo/MediaInfo/File__Analyze_Buffer.cpp b/src/thirdparty/MediaInfo/MediaInfo/File__Analyze_Buffer.cpp
index dc009cfc4..e1434b27e 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/File__Analyze_Buffer.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/File__Analyze_Buffer.cpp
@@ -233,6 +233,44 @@ void File__Analyze::Get_B16(int128u &Info, const char* Name)
}
//---------------------------------------------------------------------------
+// Big Endian - float 16 bits
+// TODO: remove it when Linux version of ZenLib is updated
+float32 BigEndian2float16corrected(const char* Liste)
+{
+ //sign 1 bit
+ //exponent 5 bit
+ //significand 10 bit
+
+ //Retrieving data
+ int16u Integer=BigEndian2int16u(Liste);
+
+ //Retrieving elements
+ bool Sign =(Integer&0x8000)?true:false;
+ int32u Exponent=(Integer>>10)&0xFF;
+ int32u Mantissa= Integer&0x03FF;
+
+ //Some computing
+ if (Exponent==0 || Exponent==0xFF)
+ return 0; //These are denormalised numbers, NANs, and other horrible things
+ Exponent-=0x0F; //Bias
+ float64 Answer=(((float64)Mantissa)/8388608+1.0)*std::pow((float64)2, (int)Exponent); //(1+Mantissa) * 2^Exponent
+ if (Sign)
+ Answer=-Answer;
+
+ return (float32)Answer;
+}
+inline float32 BigEndian2float16corrected (const int8u* List) {return BigEndian2float16corrected ((const char*)List);}
+
+//---------------------------------------------------------------------------
+void File__Analyze::Get_BF2(float32 &Info, const char* Name)
+{
+ INTEGRITY_SIZE_ATLEAST_INT(2);
+ Info=BigEndian2float16corrected(Buffer+Buffer_Offset+(size_t)Element_Offset);
+ if (Trace_Activated) Param(Name, Info);
+ Element_Offset+=2;
+}
+
+//---------------------------------------------------------------------------
void File__Analyze::Get_BF4(float32 &Info, const char* Name)
{
INTEGRITY_SIZE_ATLEAST_INT(4);
@@ -1471,8 +1509,8 @@ void File__Analyze::Get_VL_Prepare(vlc_fast &Vlc)
if (Vlc.Vlc[Pos].bit_increment==255)
break;
Increment+=Vlc.Vlc[Pos].bit_increment;
- size_t Value=Vlc.Vlc[Pos].value<<(Vlc.Size-Increment);
- size_t ToFill_Size=1<<(Vlc.Size-Increment);
+ size_t Value=((size_t)Vlc.Vlc[Pos].value)<<(Vlc.Size-Increment);
+ size_t ToFill_Size=((size_t)1)<<(Vlc.Size-Increment);
for (size_t ToFill_Pos=0; ToFill_Pos<ToFill_Size; ToFill_Pos++)
{
Vlc.Array[Value+ToFill_Pos]=Pos;
diff --git a/src/thirdparty/MediaInfo/MediaInfo/File__Analyze_Buffer_MinimizeSize.cpp b/src/thirdparty/MediaInfo/MediaInfo/File__Analyze_Buffer_MinimizeSize.cpp
index a434ba068..2f10737b4 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/File__Analyze_Buffer_MinimizeSize.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/File__Analyze_Buffer_MinimizeSize.cpp
@@ -216,6 +216,43 @@ void File__Analyze::Get_B16_(int128u &Info)
}
//---------------------------------------------------------------------------
+// Big Endian - float 16 bits
+// TODO: remove it when Linux version of ZenLib is updated
+float32 BigEndian2float16corrected(const char* Liste)
+{
+ //sign 1 bit
+ //exponent 5 bit
+ //significand 10 bit
+
+ //Retrieving data
+ int16u Integer=BigEndian2int16u(Liste);
+
+ //Retrieving elements
+ bool Sign =(Integer&0x8000)?true:false;
+ int32u Exponent=(Integer>>10)&0xFF;
+ int32u Mantissa= Integer&0x03FF;
+
+ //Some computing
+ if (Exponent==0 || Exponent==0xFF)
+ return 0; //These are denormalised numbers, NANs, and other horrible things
+ Exponent-=0x0F; //Bias
+ float64 Answer=(((float64)Mantissa)/8388608+1.0)*std::pow((float64)2, (int)Exponent); //(1+Mantissa) * 2^Exponent
+ if (Sign)
+ Answer=-Answer;
+
+ return (float32)Answer;
+}
+inline float32 BigEndian2float16corrected (const int8u* List) {return BigEndian2float16corrected ((const char*)List);}
+
+//---------------------------------------------------------------------------
+void File__Analyze::Get_BF2_(float32 &Info)
+{
+ INTEGRITY_SIZE_ATLEAST_INT(4);
+ Info=BigEndian2float16corrected(Buffer+Buffer_Offset+(size_t)Element_Offset);
+ Element_Offset+=4;
+}
+
+//---------------------------------------------------------------------------
void File__Analyze::Get_BF4_(float32 &Info)
{
INTEGRITY_SIZE_ATLEAST_INT(4);
diff --git a/src/thirdparty/MediaInfo/MediaInfo/File__Analyze_MinimizeSize.h b/src/thirdparty/MediaInfo/MediaInfo/File__Analyze_MinimizeSize.h
index 57baace89..36f28c885 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/File__Analyze_MinimizeSize.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/File__Analyze_MinimizeSize.h
@@ -325,6 +325,7 @@ public :
void Get_B7_ (int64u &Info);
void Get_B8_ (int64u &Info);
void Get_B16_ (int128u &Info);
+ void Get_BF2_ (float32 &Info);
void Get_BF4_ (float32 &Info);
void Get_BF8_ (float64 &Info);
void Get_BF10_ (float80 &Info);
@@ -338,6 +339,7 @@ public :
#define Get_B7(Info, Name) Get_B7_(Info)
#define Get_B8(Info, Name) Get_B8_(Info)
#define Get_B16(Info, Name) Get_B16_(Info)
+ #define Get_BF2(Info, Name) Get_BF2_(Info)
#define Get_BF4(Info, Name) Get_BF4_(Info)
#define Get_BF8(Info, Name) Get_BF8_(Info)
#define Get_BF10(Info, Name) Get_BF10_(Info)
@@ -1006,7 +1008,7 @@ public :
#endif //SIZE_T_IS_LONG
ZtringListList Fill_Temp;
void Fill_Flush ();
- size_t Fill_Parameter(stream_t StreamKind, generic StreamPos);
+ static size_t Fill_Parameter(stream_t StreamKind, generic StreamPos);
const Ztring &Retrieve_Const (stream_t StreamKind, size_t StreamPos, size_t Parameter, info_t KindOfInfo=Info_Text);
Ztring Retrieve (stream_t StreamKind, size_t StreamPos, size_t Parameter, info_t KindOfInfo=Info_Text);
@@ -1075,6 +1077,8 @@ public :
size_t Merge(File__Analyze &ToAdd, stream_t StreamKind, size_t StreamPos_From, size_t StreamPos_To, bool Erase=true); //Merge 2 streams
void CodecID_Fill (const Ztring &Value, stream_t StreamKind, size_t StreamPos, infocodecid_format_t Format, stream_t StreamKind_CodecID=Stream_Max);
+ void PixelAspectRatio_Fill (const Ztring &Value, stream_t StreamKind, size_t StreamPos, size_t Parameter_Width, size_t Parameter_Height, size_t Parameter_PixelAspectRatio, size_t Parameter_DisplayAspectRatio);
+ void DisplayAspectRatio_Fill(const Ztring &Value, stream_t StreamKind, size_t StreamPos, size_t Parameter_Width, size_t Parameter_Height, size_t Parameter_PixelAspectRatio, size_t Parameter_DisplayAspectRatio);
//***************************************************************************
// Finalize
@@ -1317,7 +1321,7 @@ public :
bool Seek_Duration_Detected;
#endif //MEDIAINFO_SEEK
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
public:
bool Config_Ibi_Create;
int64u Ibi_SynchronizationOffset_Current;
@@ -1329,13 +1333,13 @@ public :
void Ibi_Stream_Finish ();
void Ibi_Stream_Finish (int64u Numerator, int64u Denominator); //Partial
void Ibi_Add ();
- #else //MEDIAINFO_IBI
+ #else //MEDIAINFO_IBIUSAGE
size_t Ibi_Read_Buffer_Seek (size_t, int64u, int64u) {return (size_t)-1;}
void Ibi_Read_Buffer_Unsynched () {}
void Ibi_Stream_Finish () {}
void Ibi_Stream_Finish (int64u, int64u) {}
void Ibi_Add () {}
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
};
//Helpers
diff --git a/src/thirdparty/MediaInfo/MediaInfo/File__Analyze_Streams.cpp b/src/thirdparty/MediaInfo/MediaInfo/File__Analyze_Streams.cpp
index 3a1656328..3993fc17f 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/File__Analyze_Streams.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/File__Analyze_Streams.cpp
@@ -301,116 +301,28 @@ void File__Analyze::Fill (stream_t StreamKind, size_t StreamPos, size_t Paramete
if (StreamKind==Stream_Video && Parameter==Video_Colorimetry)
Fill(Stream_Video, StreamPos, Video_ChromaSubsampling, Value, Replace);
- if (StreamKind==Stream_Video && Parameter==Video_DisplayAspectRatio && !Value.empty() && Retrieve(Stream_Video, StreamPos, Video_PixelAspectRatio).empty())
- {
- float DAR =Retrieve(Stream_Video, StreamPos, Video_DisplayAspectRatio).To_float32();
- float Width =Retrieve(Stream_Video, StreamPos, Video_Width ).To_float32();
- float Height=Retrieve(Stream_Video, StreamPos, Video_Height ).To_float32();
- if (DAR && Height && Width)
- {
- if (Retrieve(Stream_Video, StreamPos, Video_DisplayAspectRatio)==__T("1.778"))
- DAR=((float)16)/9; //More exact value
- if (Retrieve(Stream_Video, StreamPos, Video_DisplayAspectRatio)==__T("1.333"))
- DAR=((float)4)/3; //More exact value
- Fill(Stream_Video, StreamPos, Video_PixelAspectRatio, DAR/(((float32)Width)/Height));
- }
- }
-
- if (StreamKind==Stream_Video && Parameter==Video_PixelAspectRatio && !Value.empty() && Retrieve(Stream_Video, StreamPos, Video_DisplayAspectRatio).empty())
- {
- float32 PAR =Retrieve(Stream_Video, StreamPos, Video_PixelAspectRatio ).To_float32();
- if (PAR>(float32)12/(float32)11*0.999 && PAR<(float32)12/(float32)11*1.001)
- PAR=(float32)12/(float32)11;
- if (PAR>(float32)10/(float32)11*0.999 && PAR<(float32)10/(float32)11*1.001)
- PAR=(float32)10/(float32)11;
- if (PAR>(float32)16/(float32)11*0.999 && PAR<(float32)16/(float32)11*1.001)
- PAR=(float32)16/(float32)11;
- if (PAR>(float32)40/(float32)33*0.999 && PAR<(float32)40/(float32)33*1.001)
- PAR=(float32)40/(float32)33;
- if (PAR>(float32)24/(float32)11*0.999 && PAR<(float32)24/(float32)11*1.001)
- PAR=(float32)24/(float32)11;
- if (PAR>(float32)20/(float32)11*0.999 && PAR<(float32)20/(float32)11*1.001)
- PAR=(float32)20/(float32)11;
- if (PAR>(float32)32/(float32)11*0.999 && PAR<(float32)32/(float32)11*1.001)
- PAR=(float32)32/(float32)11;
- if (PAR>(float32)80/(float32)33*0.999 && PAR<(float32)80/(float32)33*1.001)
- PAR=(float32)80/(float32)33;
- if (PAR>(float32)18/(float32)11*0.999 && PAR<(float32)18/(float32)11*1.001)
- PAR=(float32)18/(float32)11;
- if (PAR>(float32)15/(float32)11*0.999 && PAR<(float32)15/(float32)11*1.001)
- PAR=(float32)15/(float32)11;
- if (PAR>(float32)64/(float32)33*0.999 && PAR<(float32)64/(float32)33*1.001)
- PAR=(float32)64/(float32)33;
- if (PAR>(float32)160/(float32)99*0.999 && PAR<(float32)160/(float32)99*1.001)
- PAR=(float32)160/(float32)99;
- if (PAR>(float32)4/(float32)3*0.999 && PAR<(float32)4/(float32)3*1.01)
- PAR=(float32)4/(float32)3;
- if (PAR>(float32)3/(float32)2*0.999 && PAR<(float32)3/(float32)2*1.001)
- PAR=(float32)3/(float32)2;
- if (PAR>(float32)2/(float32)1*0.999 && PAR<(float32)2/(float32)1*1.001)
- PAR=(float32)2;
- if (PAR>(float32)59/(float32)54*0.999 && PAR<(float32)59/(float32)54*1.001)
- PAR=(float32)59/(float32)54;
- float32 Width =Retrieve(Stream_Video, StreamPos, Video_Width ).To_float32();
- float32 Height=Retrieve(Stream_Video, StreamPos, Video_Height ).To_float32();
- if (PAR && Height && Width)
- Fill(Stream_Video, StreamPos, Video_DisplayAspectRatio, ((float32)Width)/Height*PAR);
- }
-
- if (StreamKind==Stream_Image && Parameter==Image_DisplayAspectRatio && !Value.empty() && Retrieve(Stream_Image, StreamPos, Image_PixelAspectRatio).empty())
- {
- float DAR =Retrieve(Stream_Image, StreamPos, Image_DisplayAspectRatio).To_float32();
- float Width =Retrieve(Stream_Image, StreamPos, Image_Width ).To_float32();
- float Height=Retrieve(Stream_Image, StreamPos, Image_Height ).To_float32();
- if (DAR && Height && Width)
- {
- if (Retrieve(Stream_Image, StreamPos, Image_DisplayAspectRatio)==__T("1.778"))
- DAR=((float)16)/9; //More exact value
- if (Retrieve(Stream_Image, StreamPos, Image_DisplayAspectRatio)==__T("1.333"))
- DAR=((float)4)/3; //More exact value
- Fill(Stream_Image, StreamPos, Image_PixelAspectRatio, DAR/(((float32)Width)/Height));
- }
- }
-
- if (StreamKind==Stream_Image && Parameter==Image_PixelAspectRatio && !Value.empty() && Retrieve(Stream_Image, StreamPos, Image_DisplayAspectRatio).empty())
+ switch (StreamKind)
{
- float32 PAR =Retrieve(Stream_Image, StreamPos, Image_PixelAspectRatio ).To_float32();
- if (PAR>(float32)12/(float32)11*0.999 && PAR<(float32)12/(float32)11*1.001)
- PAR=(float32)12/(float32)11;
- if (PAR>(float32)10/(float32)11*0.999 && PAR<(float32)10/(float32)11*1.001)
- PAR=(float32)10/(float32)11;
- if (PAR>(float32)16/(float32)11*0.999 && PAR<(float32)16/(float32)11*1.001)
- PAR=(float32)16/(float32)11;
- if (PAR>(float32)40/(float32)33*0.999 && PAR<(float32)40/(float32)33*1.001)
- PAR=(float32)40/(float32)33;
- if (PAR>(float32)24/(float32)11*0.999 && PAR<(float32)24/(float32)11*1.001)
- PAR=(float32)24/(float32)11;
- if (PAR>(float32)20/(float32)11*0.999 && PAR<(float32)20/(float32)11*1.001)
- PAR=(float32)20/(float32)11;
- if (PAR>(float32)32/(float32)11*0.999 && PAR<(float32)32/(float32)11*1.001)
- PAR=(float32)32/(float32)11;
- if (PAR>(float32)80/(float32)33*0.999 && PAR<(float32)80/(float32)33*1.001)
- PAR=(float32)80/(float32)33;
- if (PAR>(float32)18/(float32)11*0.999 && PAR<(float32)18/(float32)11*1.001)
- PAR=(float32)18/(float32)11;
- if (PAR>(float32)15/(float32)11*0.999 && PAR<(float32)15/(float32)11*1.001)
- PAR=(float32)15/(float32)11;
- if (PAR>(float32)64/(float32)33*0.999 && PAR<(float32)64/(float32)33*1.001)
- PAR=(float32)64/(float32)33;
- if (PAR>(float32)160/(float32)99*0.999 && PAR<(float32)160/(float32)99*1.001)
- PAR=(float32)160/(float32)99;
- if (PAR>(float32)4/(float32)3*0.999 && PAR<(float32)4/(float32)3*1.01)
- PAR=(float32)4/(float32)3;
- if (PAR>(float32)3/(float32)2*0.999 && PAR<(float32)3/(float32)2*1.001)
- PAR=(float32)3/(float32)2;
- if (PAR>(float32)2/(float32)1*0.999 && PAR<(float32)2/(float32)1*1.001)
- PAR=(float32)2;
- if (PAR>(float32)59/(float32)54*0.999 && PAR<(float32)59/(float32)54*1.001)
- PAR=(float32)59/(float32)54;
- float32 Width =Retrieve(Stream_Image, StreamPos, Image_Width ).To_float32();
- float32 Height=Retrieve(Stream_Image, StreamPos, Image_Height ).To_float32();
- if (PAR && Height && Width)
- Fill(Stream_Image, StreamPos, Image_DisplayAspectRatio, ((float32)Width)/Height*PAR);
+ case Stream_Video:
+ switch (Parameter)
+ {
+ case Video_DisplayAspectRatio: DisplayAspectRatio_Fill(Value, Stream_Video, StreamPos, Video_Width, Video_Height, Video_PixelAspectRatio, Video_DisplayAspectRatio); break;
+ case Video_PixelAspectRatio: PixelAspectRatio_Fill(Value, Stream_Video, StreamPos, Video_Width, Video_Height, Video_PixelAspectRatio, Video_DisplayAspectRatio); break;
+ case Video_DisplayAspectRatio_CleanAperture: DisplayAspectRatio_Fill(Value, Stream_Video, StreamPos, Video_Width_CleanAperture, Video_Height_CleanAperture, Video_PixelAspectRatio_CleanAperture, Video_DisplayAspectRatio_CleanAperture); break;
+ case Video_PixelAspectRatio_CleanAperture: PixelAspectRatio_Fill(Value, Stream_Video, StreamPos, Video_Width_CleanAperture, Video_Height_CleanAperture, Video_PixelAspectRatio_CleanAperture, Video_DisplayAspectRatio_CleanAperture); break;
+ case Video_DisplayAspectRatio_Original: DisplayAspectRatio_Fill(Value, Stream_Video, StreamPos, Video_Width_Original, Video_Height_Original, Video_PixelAspectRatio_Original, Video_DisplayAspectRatio_Original); break;
+ case Video_PixelAspectRatio_Original: PixelAspectRatio_Fill(Value, Stream_Video, StreamPos, Video_Width_Original, Video_Height_Original, Video_PixelAspectRatio_Original, Video_DisplayAspectRatio_Original); break;
+ }
+ break;
+ case Stream_Image:
+ switch (Parameter)
+ {
+ case Image_DisplayAspectRatio: DisplayAspectRatio_Fill(Value, Stream_Image, StreamPos, Image_Width, Image_Height, Image_PixelAspectRatio, Image_DisplayAspectRatio); break;
+ case Image_PixelAspectRatio: PixelAspectRatio_Fill(Value, Stream_Image, StreamPos, Image_Width, Image_Height, Image_PixelAspectRatio, Image_DisplayAspectRatio); break;
+ case Image_DisplayAspectRatio_Original: DisplayAspectRatio_Fill(Value, Stream_Image, StreamPos, Image_Width_Original, Image_Height_Original, Image_PixelAspectRatio_Original, Image_DisplayAspectRatio_Original); break;
+ case Image_PixelAspectRatio_Original: PixelAspectRatio_Fill(Value, Stream_Image, StreamPos, Image_Width_Original, Image_Height_Original, Image_PixelAspectRatio_Original, Image_DisplayAspectRatio_Original); break;
+ }
+ break;
}
//Commercial name
@@ -528,8 +440,12 @@ void File__Analyze::Fill (stream_t StreamKind, size_t StreamPos, size_t Paramete
Clear(StreamKind, StreamPos, Fill_Parameter(StreamKind, Generic_CodecID_Description));
//BitRate from BitRate_Nominal
- if (Parameter==Fill_Parameter(StreamKind, Generic_BitRate)
- || Parameter==Fill_Parameter(StreamKind, Generic_BitRate_Nominal))
+ if ((Parameter==Fill_Parameter(StreamKind, Generic_BitRate)
+ || Parameter==Fill_Parameter(StreamKind, Generic_BitRate_Nominal))
+ #if MEDIAINFO_ADVANCED
+ && Config->File_MergeBitRateInfo_Get()
+ #endif //MEDIAINFO_ADVANCED
+ )
{
float32 BitRate=Retrieve(StreamKind, StreamPos, "BitRate").To_float32();
float32 BitRate_Nominal=Retrieve(StreamKind, StreamPos, "BitRate_Nominal").To_float32();
@@ -542,8 +458,12 @@ void File__Analyze::Fill (stream_t StreamKind, size_t StreamPos, size_t Paramete
}
//BitRate from BitRate_Maximum
- if (Parameter==Fill_Parameter(StreamKind, Generic_BitRate)
- || Parameter==Fill_Parameter(StreamKind, Generic_BitRate_Maximum))
+ if ((Parameter==Fill_Parameter(StreamKind, Generic_BitRate)
+ || Parameter==Fill_Parameter(StreamKind, Generic_BitRate_Maximum))
+ #if MEDIAINFO_ADVANCED
+ && Config->File_MergeBitRateInfo_Get()
+ #endif //MEDIAINFO_ADVANCED
+ )
{
float32 BitRate=Retrieve(StreamKind, StreamPos, "BitRate").To_float32();
float32 BitRate_Maximum=Retrieve(StreamKind, StreamPos, "BitRate_Maximum").To_float32();
@@ -816,94 +736,6 @@ void File__Analyze::Fill (stream_t StreamKind, size_t StreamPos, size_t Paramete
Clear(Stream_Video, StreamPos, Video_FrameRate_Original);
}
- //Display Aspect Ratio and Pixel Aspect Ratio
- if (StreamKind==Stream_Video && Parameter==Video_DisplayAspectRatio && !Value.empty())
- {
- float F1=Retrieve(Stream_Video, StreamPos, Video_DisplayAspectRatio).To_float32();
- Ztring C1;
- if (F1>=(float)1.23 && F1<(float)1.27) C1=__T("5:4");
- else if (F1>=(float)1.30 && F1<(float)1.37) C1=__T("4:3");
- else if (F1>=(float)1.45 && F1<(float)1.55) C1=__T("3:2");
- else if (F1>=(float)1.55 && F1<(float)1.65) C1=__T("16:10");
- else if (F1>=(float)1.74 && F1<(float)1.82) C1=__T("16:9");
- else if (F1>=(float)1.82 && F1<(float)1.88) C1=__T("1.85:1");
- else if (F1>=(float)2.15 && F1<(float)2.22) C1=__T("2.2:1");
- else if (F1>=(float)2.23 && F1<(float)2.30) C1=__T("2.25:1");
- else if (F1>=(float)2.30 && F1<(float)2.37) C1=__T("2.35:1");
- else if (F1>=(float)2.37 && F1<(float)2.45) C1=__T("2.40:1");
- else C1.From_Number(F1);
- C1.FindAndReplace(__T("."), MediaInfoLib::Config.Language_Get(__T(" Config_Text_FloatSeparator")));
- if (MediaInfoLib::Config.Language_Get(__T(" Language_ISO639"))==__T("fr") && C1.find(__T(":1"))==string::npos)
- C1.FindAndReplace(__T(":"), __T("/"));
- Fill(Stream_Video, StreamPos, Video_DisplayAspectRatio_String, C1, true);
- }
-
- //Original Display Aspect Ratio and Original Pixel Aspect Ratio
- if (StreamKind==Stream_Video && Parameter==Video_DisplayAspectRatio_Original)
- {
- float F1=Retrieve(Stream_Video, StreamPos, Video_DisplayAspectRatio_Original).To_float32();
- Ztring C1;
- if (F1>=(float)1.23 && F1<(float)1.27) C1=__T("5:4");
- else if (F1>=(float)1.30 && F1<(float)1.37) C1=__T("4:3");
- else if (F1>=(float)1.45 && F1<(float)1.55) C1=__T("3:2");
- else if (F1>=(float)1.55 && F1<(float)1.65) C1=__T("16:10");
- else if (F1>=(float)1.74 && F1<(float)1.82) C1=__T("16:9");
- else if (F1>=(float)1.82 && F1<(float)1.88) C1=__T("1.85:1");
- else if (F1>=(float)2.15 && F1<(float)2.22) C1=__T("2.2:1");
- else if (F1>=(float)2.23 && F1<(float)2.30) C1=__T("2.25:1");
- else if (F1>=(float)2.30 && F1<(float)2.37) C1=__T("2.35:1");
- else if (F1>=(float)2.37 && F1<(float)2.45) C1=__T("2.40:1");
- else C1.From_Number(F1);
- C1.FindAndReplace(__T("."), MediaInfoLib::Config.Language_Get(__T(" Config_Text_FloatSeparator")));
- if (MediaInfoLib::Config.Language_Get(__T(" Language_ISO639"))==__T("fr") && C1.find(__T(":1"))==string::npos)
- C1.FindAndReplace(__T(":"), __T("/"));
- Fill(Stream_Video, StreamPos, Video_DisplayAspectRatio_Original_String, C1, true);
- }
-
- //Display Aspect Ratio and Pixel Aspect Ratio
- if (StreamKind==Stream_Image && Parameter==Image_DisplayAspectRatio && !Value.empty())
- {
- float F1=Retrieve(Stream_Image, StreamPos, Image_DisplayAspectRatio).To_float32();
- Ztring C1;
- if (F1>=(float)1.23 && F1<(float)1.27) C1=__T("5:4");
- else if (F1>=(float)1.30 && F1<(float)1.37) C1=__T("4:3");
- else if (F1>=(float)1.45 && F1<(float)1.55) C1=__T("3:2");
- else if (F1>=(float)1.55 && F1<(float)1.65) C1=__T("16:10");
- else if (F1>=(float)1.74 && F1<(float)1.82) C1=__T("16:9");
- else if (F1>=(float)1.82 && F1<(float)1.88) C1=__T("1.85:1");
- else if (F1>=(float)2.15 && F1<(float)2.22) C1=__T("2.2:1");
- else if (F1>=(float)2.23 && F1<(float)2.30) C1=__T("2.25:1");
- else if (F1>=(float)2.30 && F1<(float)2.37) C1=__T("2.35:1");
- else if (F1>=(float)2.37 && F1<(float)2.45) C1=__T("2.40:1");
- else C1.From_Number(F1);
- C1.FindAndReplace(__T("."), MediaInfoLib::Config.Language_Get(__T(" Config_Text_FloatSeparator")));
- if (MediaInfoLib::Config.Language_Get(__T(" Language_ISO639"))==__T("fr") && C1.find(__T(":1"))==string::npos)
- C1.FindAndReplace(__T(":"), __T("/"));
- Fill(Stream_Image, StreamPos, Image_DisplayAspectRatio_String, C1, true);
- }
-
- //Original Display Aspect Ratio and Original Pixel Aspect Ratio
- if (StreamKind==Stream_Image && Parameter==Image_DisplayAspectRatio_Original)
- {
- float F1=Retrieve(Stream_Image, StreamPos, Image_DisplayAspectRatio_Original).To_float32();
- Ztring C1;
- if (F1>=(float)1.23 && F1<(float)1.27) C1=__T("5:4");
- else if (F1>=(float)1.30 && F1<(float)1.37) C1=__T("4:3");
- else if (F1>=(float)1.45 && F1<(float)1.55) C1=__T("3:2");
- else if (F1>=(float)1.55 && F1<(float)1.65) C1=__T("16:10");
- else if (F1>=(float)1.74 && F1<(float)1.82) C1=__T("16:9");
- else if (F1>=(float)1.82 && F1<(float)1.88) C1=__T("1.85:1");
- else if (F1>=(float)2.15 && F1<(float)2.22) C1=__T("2.2:1");
- else if (F1>=(float)2.23 && F1<(float)2.30) C1=__T("2.25:1");
- else if (F1>=(float)2.30 && F1<(float)2.37) C1=__T("2.35:1");
- else if (F1>=(float)2.37 && F1<(float)2.45) C1=__T("2.40:1");
- else C1.From_Number(F1);
- C1.FindAndReplace(__T("."), MediaInfoLib::Config.Language_Get(__T(" Config_Text_FloatSeparator")));
- if (MediaInfoLib::Config.Language_Get(__T(" Language_ISO639"))==__T("fr") && C1.find(__T(":1"))==string::npos)
- C1.FindAndReplace(__T(":"), __T("/"));
- Fill(Stream_Image, StreamPos, Image_DisplayAspectRatio_Original_String, C1, true);
- }
-
//Bits/(Pixel*Frame)
if (StreamKind==Stream_Video && (Parameter==Video_BitRate || Parameter==Video_BitRate_Nominal || Parameter==Video_Width || Parameter==Video_Height || Parameter==Video_FrameRate))
{
@@ -2238,6 +2070,96 @@ void File__Analyze::CodecID_Fill(const Ztring &Value, stream_t StreamKind, size_
}
//---------------------------------------------------------------------------
+void File__Analyze::PixelAspectRatio_Fill(const Ztring &Value, stream_t StreamKind, size_t StreamPos, size_t Parameter_Width, size_t Parameter_Height, size_t Parameter_PixelAspectRatio, size_t Parameter_DisplayAspectRatio)
+{
+ if (Value.empty() || !Retrieve(StreamKind, StreamPos, Parameter_DisplayAspectRatio).empty())
+ return;
+
+ if (Retrieve(StreamKind, StreamPos, Parameter_DisplayAspectRatio).empty())
+ {
+ float32 PAR=Value.To_float32();
+ if (PAR>(float32)12/(float32)11*0.999 && PAR<(float32)12/(float32)11*1.001)
+ PAR=(float32)12/(float32)11;
+ if (PAR>(float32)10/(float32)11*0.999 && PAR<(float32)10/(float32)11*1.001)
+ PAR=(float32)10/(float32)11;
+ if (PAR>(float32)16/(float32)11*0.999 && PAR<(float32)16/(float32)11*1.001)
+ PAR=(float32)16/(float32)11;
+ if (PAR>(float32)40/(float32)33*0.999 && PAR<(float32)40/(float32)33*1.001)
+ PAR=(float32)40/(float32)33;
+ if (PAR>(float32)24/(float32)11*0.999 && PAR<(float32)24/(float32)11*1.001)
+ PAR=(float32)24/(float32)11;
+ if (PAR>(float32)20/(float32)11*0.999 && PAR<(float32)20/(float32)11*1.001)
+ PAR=(float32)20/(float32)11;
+ if (PAR>(float32)32/(float32)11*0.999 && PAR<(float32)32/(float32)11*1.001)
+ PAR=(float32)32/(float32)11;
+ if (PAR>(float32)80/(float32)33*0.999 && PAR<(float32)80/(float32)33*1.001)
+ PAR=(float32)80/(float32)33;
+ if (PAR>(float32)18/(float32)11*0.999 && PAR<(float32)18/(float32)11*1.001)
+ PAR=(float32)18/(float32)11;
+ if (PAR>(float32)15/(float32)11*0.999 && PAR<(float32)15/(float32)11*1.001)
+ PAR=(float32)15/(float32)11;
+ if (PAR>(float32)64/(float32)33*0.999 && PAR<(float32)64/(float32)33*1.001)
+ PAR=(float32)64/(float32)33;
+ if (PAR>(float32)160/(float32)99*0.999 && PAR<(float32)160/(float32)99*1.001)
+ PAR=(float32)160/(float32)99;
+ if (PAR>(float32)4/(float32)3*0.999 && PAR<(float32)4/(float32)3*1.01)
+ PAR=(float32)4/(float32)3;
+ if (PAR>(float32)3/(float32)2*0.999 && PAR<(float32)3/(float32)2*1.001)
+ PAR=(float32)3/(float32)2;
+ if (PAR>(float32)2/(float32)1*0.999 && PAR<(float32)2/(float32)1*1.001)
+ PAR=(float32)2;
+ if (PAR>(float32)59/(float32)54*0.999 && PAR<(float32)59/(float32)54*1.001)
+ PAR=(float32)59/(float32)54;
+ float32 Width =Retrieve(StreamKind, StreamPos, Parameter_Width ).To_float32();
+ float32 Height=Retrieve(StreamKind, StreamPos, Parameter_Height ).To_float32();
+ if (PAR && Height && Width)
+ Fill(StreamKind, StreamPos, Parameter_DisplayAspectRatio, ((float32)Width)/Height*PAR);
+ }
+}
+
+//---------------------------------------------------------------------------
+void File__Analyze::DisplayAspectRatio_Fill(const Ztring &Value, stream_t StreamKind, size_t StreamPos, size_t Parameter_Width, size_t Parameter_Height, size_t Parameter_PixelAspectRatio, size_t Parameter_DisplayAspectRatio)
+{
+ if (Value.empty())
+ return;
+
+ float DAR=Value.To_float32();
+
+ if (Retrieve(StreamKind, StreamPos, Parameter_PixelAspectRatio).empty())
+ {
+ float Width =Retrieve(StreamKind, StreamPos, Parameter_Width).To_float32();
+ float Height=Retrieve(StreamKind, StreamPos, Parameter_Height).To_float32();
+ if (DAR && Height && Width)
+ {
+ if (Value==__T("1.778"))
+ DAR=((float)16)/9; //More exact value
+ if (Value==__T("1.333"))
+ DAR=((float)4)/3; //More exact value
+ Fill(StreamKind, StreamPos, Parameter_PixelAspectRatio, DAR/(((float32)Width)/Height));
+ }
+ }
+
+ // /String version
+ Ztring DARS;
+ if (DAR>=(float)1.23 && DAR<(float)1.27) DARS=__T("5:4");
+ else if (DAR>=(float)1.30 && DAR<(float)1.37) DARS=__T("4:3");
+ else if (DAR>=(float)1.45 && DAR<(float)1.55) DARS=__T("3:2");
+ else if (DAR>=(float)1.55 && DAR<(float)1.65) DARS=__T("16:10");
+ else if (DAR>=(float)1.65 && DAR<(float)1.70) DARS=__T("5:3");
+ else if (DAR>=(float)1.74 && DAR<(float)1.82) DARS=__T("16:9");
+ else if (DAR>=(float)1.82 && DAR<(float)1.88) DARS=__T("1.85:1");
+ else if (DAR>=(float)2.15 && DAR<(float)2.22) DARS=__T("2.2:1");
+ else if (DAR>=(float)2.23 && DAR<(float)2.30) DARS=__T("2.25:1");
+ else if (DAR>=(float)2.30 && DAR<(float)2.37) DARS=__T("2.35:1");
+ else if (DAR>=(float)2.37 && DAR<(float)2.45) DARS=__T("2.40:1");
+ else DARS.From_Number(DAR);
+ DARS.FindAndReplace(__T("."), MediaInfoLib::Config.Language_Get(__T(" Config_Text_FloatSeparator")));
+ if (MediaInfoLib::Config.Language_Get(__T(" Language_ISO639"))==__T("fr") && DARS.find(__T(":1"))==string::npos)
+ DARS.FindAndReplace(__T(":"), __T("/"));
+ Fill(StreamKind, StreamPos, Parameter_DisplayAspectRatio+1, DARS, true);
+}
+
+//---------------------------------------------------------------------------
size_t File__Analyze::Fill_Parameter(stream_t StreamKind, generic StreamPos)
{
switch (StreamKind)
diff --git a/src/thirdparty/MediaInfo/MediaInfo/File__Analyze_Streams_Finish.cpp b/src/thirdparty/MediaInfo/MediaInfo/File__Analyze_Streams_Finish.cpp
index ad2deb5d1..bb4d2aa8e 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/File__Analyze_Streams_Finish.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/File__Analyze_Streams_Finish.cpp
@@ -60,7 +60,7 @@ void File__Analyze::Streams_Finish_Global()
Fill(Stream_Video, 0, Video_FrameCount, Frame_Count_NotParsedIncluded);
else if (Config->File_Names.size()>1)
Fill(Stream_Video, 0, Video_FrameCount, Config->File_Names.size());
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
else
{
//External IBI
@@ -83,7 +83,7 @@ void File__Analyze::Streams_Finish_Global()
if (IbiStream && !IbiStream->Infos.empty() && IbiStream->Infos[IbiStream->Infos.size()-1].IsContinuous && IbiStream->Infos[IbiStream->Infos.size()-1].FrameNumber!=(int64u)-1)
Fill(Stream_Video, 0, Video_FrameCount, IbiStream->Infos[IbiStream->Infos.size()-1].FrameNumber);
}
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
}
Streams_Finish_StreamOnly();
@@ -110,6 +110,7 @@ void File__Analyze::TestContinuousFileNames(size_t CountOfFiles, Ztring FileExte
return;
//Trying to detect continuous file names (e.g. video stream as an image or HLS)
+ size_t Pos_Base = (size_t)-1;
bool AlreadyPresent=Config->File_Names.size()==1?true:false;
FileName FileToTest(Config->File_Names.Read(Config->File_Names.size()-1));
Ztring FileToTest_Name=FileToTest.Name_Get();
@@ -144,10 +145,35 @@ void File__Analyze::TestContinuousFileNames(size_t CountOfFiles, Ztring FileExte
//Detecting with a smarter algo (but missing frames are not detected)
Ztring FileToTest_Name_Begin=FileToTest.Path_Get()+PathSeparator+FileToTest_Name;
Ztring FileToTest_Name_End=FileToTest_Name_After+__T('.')+(FileExtension.empty()?FileToTest.Extension_Get():FileExtension);
- size_t Pos_Base = (size_t)Pos;
+ Pos_Base = (size_t)Pos;
size_t Pos_Add_Max = 1;
#if MEDIAINFO_ADVANCED
bool File_IgnoreSequenceFileSize=Config->File_IgnoreSequenceFilesCount_Get(); //TODO: double check if it is expected
+
+ size_t SequenceFileSkipFrames=Config->File_SequenceFilesSkipFrames_Get();
+ if (SequenceFileSkipFrames)
+ {
+ for (;;)
+ {
+ size_t Pos_Add_Max_Old=Pos_Add_Max;
+ for (size_t TempPos=Pos_Add_Max; TempPos<=Pos_Add_Max+SequenceFileSkipFrames; TempPos++)
+ {
+ Ztring Pos_Ztring; Pos_Ztring.From_Number(Pos_Base+TempPos);
+ if (Numbers_Size>Pos_Ztring.size())
+ Pos_Ztring.insert(0, Numbers_Size-Pos_Ztring.size(), __T('0'));
+ Ztring Next=FileToTest_Name_Begin+Pos_Ztring+FileToTest_Name_End;
+ if (File::Exists(Next))
+ {
+ Pos_Add_Max=TempPos+1;
+ break;
+ }
+ }
+ if (Pos_Add_Max==Pos_Add_Max_Old)
+ break;
+ }
+ }
+ else
+ {
#endif //MEDIAINFO_ADVANCED
for (;;)
{
@@ -177,6 +203,10 @@ void File__Analyze::TestContinuousFileNames(size_t CountOfFiles, Ztring FileExte
Pos_Add_Max=Pos_Add_Middle;
}
+ #if MEDIAINFO_ADVANCED
+ } //SequenceFileSkipFrames
+ #endif //MEDIAINFO_ADVANCED
+
size_t Pos_Max = Pos_Base + Pos_Add_Max;
Config->File_Names.reserve(Pos_Add_Max);
for (Pos=Pos_Base+1; Pos<Pos_Max; ++Pos)
@@ -194,6 +224,15 @@ void File__Analyze::TestContinuousFileNames(size_t CountOfFiles, Ztring FileExte
if (Config->File_Names.size()==Pos)
return;
+ Config->File_IsImageSequence=true;
+ Frame_Count_NotParsedIncluded=Pos_Base;
+ #if MEDIAINFO_DEMUX
+ float64 Demux_Rate=Config->Demux_Rate_Get();
+ if (!Demux_Rate)
+ Demux_Rate=24;
+ Fill(Stream_Video, 0, Video_Delay, float64_int64s(Frame_Count_NotParsedIncluded*1000/Demux_Rate));
+ #endif //MEDIAINFO_DEMUX
+
#if MEDIAINFO_ADVANCED
if (!Config->File_IgnoreSequenceFileSize_Get() || Config->File_Names.size()<=1)
#endif //MEDIAINFO_ADVANCED
@@ -952,19 +991,65 @@ void File__Analyze::Streams_Finish_HumanReadable_PerStream(stream_t StreamKind,
Fill(StreamKind, StreamPos, StreamKind==Stream_General?"OverallBitRate_Mode/String":"BitRate_Mode/String", Translated.find(__T("BitRate_Mode_"))?Translated:Value);
}
+ //Encoded_Application
+ if (( ParameterName==__T("Encoded_Application")
+ || ParameterName==__T("Encoded_Application_CompanyName")
+ || ParameterName==__T("Encoded_Application_Name")
+ || ParameterName==__T("Encoded_Application_Version")
+ || ParameterName==__T("Encoded_Application_Date"))
+ && Retrieve(StreamKind, StreamPos, "Encoded_Application/String").empty())
+ {
+ Ztring CompanyName=Retrieve(StreamKind, StreamPos, "Encoded_Application_CompanyName");
+ Ztring Name=Retrieve(StreamKind, StreamPos, "Encoded_Application_Name");
+ Ztring Version=Retrieve(StreamKind, StreamPos, "Encoded_Application_Version");
+ Ztring Date=Retrieve(StreamKind, StreamPos, "Encoded_Application_Date");
+ if (!Name.empty())
+ {
+ Ztring String;
+ if (!CompanyName.empty())
+ {
+ String+=CompanyName;
+ String+=__T(" ");
+ }
+ String+=Name;
+ if (!Version.empty())
+ {
+ String+=__T(" ");
+ String+=Version;
+ }
+ if (!Date.empty())
+ {
+ String+=__T(" (");
+ String+=Date;
+ String+=__T(")");
+ }
+ Fill(StreamKind, StreamPos, "Encoded_Application/String", String, true);
+ }
+ else
+ Fill(StreamKind, StreamPos, "Encoded_Application/String", Retrieve(StreamKind, StreamPos, "Encoded_Application"), true);
+ }
+
//Encoded_Library
- if ((ParameterName==__T("Encoded_Library")
- || ParameterName==__T("Encoded_Library/Name")
- || ParameterName==__T("Encoded_Library/Version")
- || ParameterName==__T("Encoded_Library/Date"))
+ if (( ParameterName==__T("Encoded_Library")
+ || ParameterName==__T("Encoded_Library_CompanyName")
+ || ParameterName==__T("Encoded_Library_Name")
+ || ParameterName==__T("Encoded_Library_Version")
+ || ParameterName==__T("Encoded_Library_Date"))
&& Retrieve(StreamKind, StreamPos, "Encoded_Library/String").empty())
{
- Ztring Name=Retrieve(StreamKind, StreamPos, "Encoded_Library/Name");
- Ztring Version=Retrieve(StreamKind, StreamPos, "Encoded_Library/Version");
- Ztring Date=Retrieve(StreamKind, StreamPos, "Encoded_Library/Date");
+ Ztring CompanyName=Retrieve(StreamKind, StreamPos, "Encoded_Library_CompanyName");
+ Ztring Name=Retrieve(StreamKind, StreamPos, "Encoded_Library_Name");
+ Ztring Version=Retrieve(StreamKind, StreamPos, "Encoded_Library_Version");
+ Ztring Date=Retrieve(StreamKind, StreamPos, "Encoded_Library_Date");
if (!Name.empty())
{
- Ztring String=Name;
+ Ztring String;
+ if (!CompanyName.empty())
+ {
+ String+=CompanyName;
+ String+=__T(" ");
+ }
+ String+=Name;
if (!Version.empty())
{
String+=__T(" ");
diff --git a/src/thirdparty/MediaInfo/MediaInfo/File__Base.cpp b/src/thirdparty/MediaInfo/MediaInfo/File__Base.cpp
index 62d640b9d..f3adb2b02 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/File__Base.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/File__Base.cpp
@@ -132,7 +132,7 @@ size_t File__Base::Count_Get (stream_t StreamKind, size_t Pos) const
const Ztring &File__Base::Get (stream_t StreamKind, size_t StreamNumber, size_t Parameter, info_t KindOfInfo)
{
//Check integrity
- if (StreamKind>=Stream_Max || StreamNumber>=(*Stream)[StreamKind].size() || Parameter>=MediaInfoLib::Config.Info_Get(StreamKind).size()+(*Stream_More)[StreamKind][StreamNumber].size() || KindOfInfo>=Info_Max)
+ if (StreamKind>=Stream_Max || StreamNumber>=(*Stream)[StreamKind].size() || Parameter>=MediaInfoLib::Config.Info_Get(StreamKind).size()+(StreamNumber>=(*Stream_More)[StreamKind].size()?0:(*Stream_More)[StreamKind][StreamNumber].size()) || KindOfInfo>=Info_Max)
return MediaInfoLib::Config.EmptyString_Get(); //Parameter is unknown
else if (Parameter<MediaInfoLib::Config.Info_Get(StreamKind).size())
diff --git a/src/thirdparty/MediaInfo/MediaInfo/File__Base.h b/src/thirdparty/MediaInfo/MediaInfo/File__Base.h
index 75090ba2d..2eddfaa5d 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/File__Base.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/File__Base.h
@@ -112,6 +112,7 @@ public : //A virer
friend class File__Analyze;
friend class File__MultipleParsing;
friend class File__ReferenceFilesHelper;
+ friend class resource;
};
} //NameSpace
diff --git a/src/thirdparty/MediaInfo/MediaInfo/File__MultipleParsing.cpp b/src/thirdparty/MediaInfo/MediaInfo/File__MultipleParsing.cpp
index ed6ef8f00..746d22526 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/File__MultipleParsing.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/File__MultipleParsing.cpp
@@ -191,6 +191,9 @@
#if defined(MEDIAINFO_AU_YES)
#include "MediaInfo/Audio/File_Au.h"
#endif
+#if defined(MEDIAINFO_CAF_YES)
+ #include "MediaInfo/Audio/File_Caf.h"
+#endif
#if defined(MEDIAINFO_DTS_YES)
#include "MediaInfo/Audio/File_Dts.h"
#endif
@@ -281,6 +284,9 @@
#if defined(MEDIAINFO_BMP_YES)
#include "MediaInfo/Image/File_Bmp.h"
#endif
+#if defined(MEDIAINFO_BPG_YES)
+ #include "MediaInfo/Image/File_Bpg.h"
+#endif
#if defined(MEDIAINFO_DDS_YES)
#include "MediaInfo/Image/File_Dds.h"
#endif
@@ -565,6 +571,9 @@ File__MultipleParsing::File__MultipleParsing()
#if defined(MEDIAINFO_AU_YES)
Parser.push_back(new File_Au());
#endif
+ #if defined(MEDIAINFO_CAF_YES)
+ Parser.push_back(new File_Caf());
+ #endif
#if defined(MEDIAINFO_DTS_YES)
Parser.push_back(new File_Dts());
#endif
@@ -652,6 +661,9 @@ File__MultipleParsing::File__MultipleParsing()
#if defined(MEDIAINFO_BMP_YES)
Parser.push_back(new File_Bmp());
#endif
+ #if defined(MEDIAINFO_BPG_YES)
+ Parser.push_back(new File_Bpg());
+ #endif
#if defined(MEDIAINFO_DDS_YES)
Parser.push_back(new File_Dds());
#endif
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Image/File_Bmp.cpp b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Bmp.cpp
index 726aef006..9ce3bdd7d 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Image/File_Bmp.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Bmp.cpp
@@ -94,7 +94,7 @@ void File_Bmp::Read_Buffer_Continue()
Element_End0();
FILLING_BEGIN();
- if (Size!=File_Size)
+ if (Size!=(int32u)-1 && Size!=File_Size)
{
Reject("BMP");
return;
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Image/File_Bpg.cpp b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Bpg.cpp
new file mode 100644
index 000000000..3d2e5ab04
--- /dev/null
+++ b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Bpg.cpp
@@ -0,0 +1,152 @@
+/* Copyright (c) MediaArea.net SARL. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can
+ * be found in the License.html file in the root of the source tree.
+ */
+
+//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+//
+// From http://bellard.org/bpg/bpg_spec.txt
+//
+//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+//---------------------------------------------------------------------------
+// Pre-compilation
+#include "MediaInfo/PreComp.h"
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+#include "MediaInfo/Setup.h"
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+#if defined(MEDIAINFO_BPG_YES)
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+#include "MediaInfo/Image/File_Bpg.h"
+#include <cmath>
+using namespace std;
+//---------------------------------------------------------------------------
+
+namespace MediaInfoLib
+{
+
+//---------------------------------------------------------------------------
+const char* Bpg_ColorSpace(int8u ColorSpace)
+{
+ switch (ColorSpace)
+ {
+ case 0:
+ case 3:
+ case 4: return "YUV";
+ case 1: return "RGB";
+ case 2: return "YCgCo";
+ default: return "";
+ }
+};
+
+//---------------------------------------------------------------------------
+const char* Bpg_colour_primaries(int8u ColorSpace)
+{
+ switch (ColorSpace)
+ {
+ case 0: return "BT.601";
+ case 3: return "BT.701";
+ case 4: return "BT.2020";
+ default: return "";
+ }
+};
+
+//---------------------------------------------------------------------------
+const char* Bpg_Pixel_format(int8u PixelFormat)
+{
+ switch (PixelFormat)
+ {
+ case 0 : return "Grayscale";
+ case 1 :
+ case 4 : return "4:2:0";
+ case 2 :
+ case 5 : return "4:2:2";
+ case 3 : return "4:4:4";
+ default: return "";
+ }
+
+};
+
+//***************************************************************************
+// Static stuff
+//***************************************************************************
+
+//---------------------------------------------------------------------------
+bool File_Bpg::FileHeader_Begin()
+{
+ //Element_Size
+ if (Buffer_Size<4)
+ return false; //Must wait for more data
+
+ if (CC4(Buffer) != 0x425047FB) //"BPG"
+ {
+ Reject("BPG");
+ return false;
+ }
+
+ //All should be OK...
+ return true;
+}
+
+//***************************************************************************
+// Buffer - Global
+//***************************************************************************
+
+//---------------------------------------------------------------------------
+void File_Bpg::Read_Buffer_Continue()
+{
+ //Parsing
+ Ztring Version;
+ int64u Width, Height;
+ int8u pixelformat, BitsDepth, ColorSpace;
+ bool Alpha1_flag, Alpha2_flag, ReservedZeros, limited_range_flag, ExtensionPresentFlag;
+ Element_Begin1("File header");
+ Skip_C4( "Magic"); // File Magic
+ BS_Begin();
+ Get_S1 (3, pixelformat, "pixel_format"); Param_Info1(Bpg_Pixel_format(pixelformat));
+ Get_SB (Alpha1_flag, "Alpha1 Present Flag");
+ Get_S1 (4, BitsDepth, "bit_depth_minus_8");
+
+ Get_S1(4, ColorSpace, "color_space"); Param_Info1(Bpg_ColorSpace(ColorSpace)); Param_Info1(Bpg_colour_primaries(ColorSpace));
+ Get_SB (ExtensionPresentFlag, "Extension Present Flag");
+ Get_SB (Alpha2_flag, "Alpha2 Present Flag");
+ Get_SB (limited_range_flag, "limited_range_flag");
+ Get_SB (ReservedZeros, "Reserved");
+ BS_End();
+
+ Get_VS(Width, "Picture Width");
+ Get_VS(Height, "Picture Height");
+
+
+ Element_End0();
+
+ FILLING_BEGIN();
+ Accept("BPG");
+
+ Stream_Prepare(Stream_Image);
+ Fill(Stream_Image, 0, Image_Width, Width);
+ Fill(Stream_Image, 0, Image_Height, Height);
+ Fill(Stream_Image, 0, Image_Format, __T("BPG"));
+ Fill(Stream_Image, 0, Image_ChromaSubsampling, Bpg_Pixel_format(pixelformat));
+ Fill(Stream_Image, 0, Image_ColorSpace, Bpg_ColorSpace(ColorSpace));
+ Fill(Stream_Image, 0, Image_colour_primaries, Bpg_colour_primaries(ColorSpace));
+ Fill(Stream_Image, 0, Image_BitDepth, BitsDepth + 8);
+ Fill(Stream_Image, 0, Image_Codec, __T("BPG"));
+ FILLING_END();
+
+ Finish("BPG");
+}
+
+} //NameSpace
+
+#endif
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Image/File_Bpg.h b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Bpg.h
new file mode 100644
index 000000000..5eec138ae
--- /dev/null
+++ b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Bpg.h
@@ -0,0 +1,41 @@
+/* Copyright (c) MediaArea.net SARL. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can
+ * be found in the License.html file in the root of the source tree.
+ */
+
+//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+//
+// Information about BPG files
+//
+//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+//---------------------------------------------------------------------------
+#ifndef MediaInfo_File_BpgH
+#define MediaInfo_File_BpgH
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+#include "MediaInfo/File__Analyze.h"
+//---------------------------------------------------------------------------
+
+namespace MediaInfoLib
+{
+
+//***************************************************************************
+// Class File_Bpg
+//***************************************************************************
+
+class File_Bpg : public File__Analyze
+{
+protected :
+ //Buffer - File header
+ bool FileHeader_Begin();
+
+ //Buffer - Global
+ void Read_Buffer_Continue ();
+};
+
+} //NameSpace
+
+#endif
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Image/File_Dds.cpp b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Dds.cpp
index 67e896938..f257fdce6 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Image/File_Dds.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Dds.cpp
@@ -78,9 +78,6 @@ void File_Dds::Streams_Accept()
}
else
Stream_Prepare(StreamKind_Last);
-
- //Configuration
- Frame_Count_NotParsedIncluded=0;
}
//***************************************************************************
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Image/File_Dpx.cpp b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Dpx.cpp
index 554958b1d..6b9b66b84 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Image/File_Dpx.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Dpx.cpp
@@ -284,9 +284,6 @@ File_Dpx::File_Dpx()
//---------------------------------------------------------------------------
void File_Dpx::Streams_Accept()
{
- Fill(Stream_General, 0, General_Format, "DPX");
- Fill(Stream_General, 0, General_Format_Version, Version==1?"Version 1":"Version 2");
-
if (!IsSub)
{
TestContinuousFileNames();
@@ -302,7 +299,6 @@ void File_Dpx::Streams_Accept()
//Configuration
Buffer_MaximumSize=64*1024*1024; //Some big frames are possible (e.g YUV 4:2:2 10 bits 1080p)
- Frame_Count_NotParsedIncluded=0;
}
//***************************************************************************
@@ -319,10 +315,10 @@ bool File_Dpx::FileHeader_Begin()
int32u Magic=CC4(Buffer);
switch (Magic)
{
- case 0x802A5FD7 : // (v1 Big)
- case 0xD75F2A80 : // (v1 Little)
- case 0x53445058 : //"SPDX" (v2 Big)
- case 0x58504453 : //"XDPS" (v2 Little)
+ case 0x802A5FD7 : // (Cineon Big)
+ case 0xD75F2A80 : // (Cineon Little)
+ case 0x53445058 : //"SPDX" (Dpx Big)
+ case 0x58504453 : //"XDPS" (Dpx Little)
break;
default :
Reject();
@@ -335,24 +331,24 @@ bool File_Dpx::FileHeader_Begin()
Sizes_Pos=Pos_GenericSection;
switch (Magic)
{
- case 0x802A5FD7 : // (v1 Big)
- case 0xD75F2A80 : // (v1 Little)
- Version=1;
+ case 0x802A5FD7 : // (Cineon Big)
+ case 0xD75F2A80 : // (Cineon Little)
+ IsDpx=false;
break;
- case 0x58504453 : //"XDPS" (v2 Little)
- case 0x53445058 : //"SPDX" (v2 Big)
- Version=2;
+ case 0x58504453 : //"XDPS" (Dpx Little)
+ case 0x53445058 : //"SPDX" (Dpx Big)
+ IsDpx=true;
break;
default : ;
}
switch (Magic)
{
- case 0xD75F2A80 : // (v1 Little)
- case 0x58504453 : //"XDPS" (v2 Little)
+ case 0xD75F2A80 : // (Cineon Little)
+ case 0x58504453 : //"XDPS" (Dpx Little)
LittleEndian=true;
break;
- case 0x802A5FD7 : // (v1 Big)
- case 0x53445058 : //"SPDX" (v2 Big)
+ case 0x802A5FD7 : // (Cineon Big)
+ case 0x53445058 : //"SPDX" (Dpx Big)
LittleEndian=false;
break;
default : ;
@@ -392,13 +388,13 @@ void File_Dpx::Header_Parse()
//---------------------------------------------------------------------------
void File_Dpx::Data_Parse()
{
- if (Version==1)
+ if (!IsDpx) // Is Cineon
{
switch (Element_Code)
{
- case Pos_GenericSection : GenericSectionHeader_v1(); break;
- case Pos_IndustrySpecific : IndustrySpecificHeader_v1(); break;
- case Pos_UserDefined : UserDefinedHeader_v1(); break;
+ case Pos_GenericSection : GenericSectionHeader_Cineon(); break;
+ case Pos_IndustrySpecific : IndustrySpecificHeader_Cineon(); break;
+ case Pos_UserDefined : UserDefinedHeader_Cineon(); break;
case Pos_Padding : Padding(); break;
case Pos_ImageData : ImageData(); break;
default : ;
@@ -408,9 +404,9 @@ void File_Dpx::Data_Parse()
{
switch (Element_Code)
{
- case Pos_GenericSection : GenericSectionHeader_v2(); break;
- case Pos_IndustrySpecific : IndustrySpecificHeader_v2(); break;
- case Pos_UserDefined : UserDefinedHeader_v2(); break;
+ case Pos_GenericSection : GenericSectionHeader_Dpx(); break;
+ case Pos_IndustrySpecific : IndustrySpecificHeader_Dpx(); break;
+ case Pos_UserDefined : UserDefinedHeader_Dpx(); break;
case Pos_Padding : Padding(); break;
case Pos_ImageData : ImageData(); break;
default : ;
@@ -437,13 +433,14 @@ void File_Dpx::Data_Parse()
//***************************************************************************
//---------------------------------------------------------------------------
-void File_Dpx::GenericSectionHeader_v1()
+void File_Dpx::GenericSectionHeader_Cineon()
{
Element_Name("Generic section header");
//Parsing
Element_Begin1("File information");
Ztring CreationDate, CreationTime;
+ string Version;
int32u Size_Header, Size_Total, Size_Generic, Size_Industry, Size_User;
Skip_B4( "Magic number");
Get_X4 (Size_Header, "Offset to image data");
@@ -451,7 +448,7 @@ void File_Dpx::GenericSectionHeader_v1()
Get_X4 (Size_Industry, "Industry specific header length");
Get_X4 (Size_User, "User-defined header length");
Get_X4 (Size_Total, "Total image file size");
- Skip_String(8, "Version number of header format");
+ Get_String(8, Version, "Version number of header format");
Skip_UTF8 (100, "FileName");
Get_UTF8 (12, CreationDate, "Creation Date");
Get_UTF8 (12, CreationTime, "Creation Time");
@@ -466,17 +463,17 @@ void File_Dpx::GenericSectionHeader_v1()
if (ImageElements>8)
ImageElements=8;
for(int8u ImageElement=0; ImageElement<ImageElements; ImageElement++)
- GenericSectionHeader_v1_ImageElement();
+ GenericSectionHeader_Cineon_ImageElement();
if (ImageElements!=8)
Skip_XX((8-ImageElements)*28, "Padding");
- Skip_BFP4(9, "White point - x");
- Skip_BFP4(9, "White point - y");
- Skip_BFP4(9, "Red primary chromaticity - x");
- Skip_BFP4(9, "Red primary chromaticity - u");
- Skip_BFP4(9, "Green primary chromaticity - x");
- Skip_BFP4(9, "Green primary chromaticity - y");
- Skip_BFP4(9, "Blue primary chromaticity - x");
- Skip_BFP4(9, "Blue primary chromaticity - y");
+ Skip_BF4( "White point - x");
+ Skip_BF4( "White point - y");
+ Skip_BF4( "Red primary chromaticity - x");
+ Skip_BF4( "Red primary chromaticity - u");
+ Skip_BF4( "Green primary chromaticity - x");
+ Skip_BF4( "Green primary chromaticity - y");
+ Skip_BF4( "Blue primary chromaticity - x");
+ Skip_BF4( "Blue primary chromaticity - y");
Skip_UTF8(200, "Label text");
Skip_XX(28, "Reserved for future use");
Element_End0();
@@ -499,9 +496,9 @@ void File_Dpx::GenericSectionHeader_v1()
Skip_UTF8(64, "Input device");
Skip_UTF8(32, "Input device model number");
Skip_UTF8(32, "Input device serial number");
- Skip_BFP4(9, "X input device pitch");
- Skip_BFP4(9, "Y input device pitch");
- Skip_BFP4(9, "Image gamma of capture device");
+ Skip_BF4( "X input device pitch");
+ Skip_BF4( "Y input device pitch");
+ Skip_BF4( "Image gamma of capture device");
Skip_XX(40, "Reserved for future use");
Element_End0();
@@ -527,12 +524,17 @@ void File_Dpx::GenericSectionHeader_v1()
{
Fill(Stream_General, 0, General_Encoded_Date, CreationDate+__T(' ')+CreationTime); //ToDo: transform it in UTC
Fill(StreamKind_Last, StreamPos_Last, "Encoded_Date", CreationDate+__T(' ')+CreationTime); //ToDo: transform it in UTC
+ Fill(StreamKind_Last, StreamPos_Last, "Format", "Cineom");
+ if (Version.size()>2 && Version[0]=='V' && Version[1]>='0' && Version[2]<='9')
+ Version.insert(1, "ersion ");
+ Fill(StreamKind_Last, StreamPos_Last, "Format_Version", Version);
+ Fill(Stream_General, 0, General_Format_Version, Version);
}
FILLING_END();
}
//---------------------------------------------------------------------------
-void File_Dpx::GenericSectionHeader_v1_ImageElement()
+void File_Dpx::GenericSectionHeader_Cineon_ImageElement()
{
Element_Begin1("image element");
int32u Width, Height;
@@ -542,17 +544,15 @@ void File_Dpx::GenericSectionHeader_v1_ImageElement()
Skip_B1( "Unused");
Get_X4 (Width, "Pixels per line");
Get_X4 (Height, "Lines per image element");
- Skip_BFP4(9, "Minimum data value");
- Skip_BFP4(9, "Minimum quantity represented");
- Skip_BFP4(9, "Maximum data value");
- Skip_BFP4(9, "Maximum quantity represented");
+ Skip_BF4( "Minimum data value");
+ Skip_BF4( "Minimum quantity represented");
+ Skip_BF4( "Maximum data value");
+ Skip_BF4( "Maximum quantity represented");
Element_End0();
FILLING_BEGIN();
if (Frame_Count==0)
{
- Fill(StreamKind_Last, StreamPos_Last, "Format", "DPX");
- Fill(StreamKind_Last, StreamPos_Last, "Format_Version", "Version 1");
Fill(StreamKind_Last, StreamPos_Last, "Width", Width);
Fill(StreamKind_Last, StreamPos_Last, "Height", Height);
}
@@ -560,17 +560,17 @@ void File_Dpx::GenericSectionHeader_v1_ImageElement()
}
//---------------------------------------------------------------------------
-void File_Dpx::GenericSectionHeader_v2()
+void File_Dpx::GenericSectionHeader_Dpx()
{
Element_Name("Generic section header");
//Parsing
Element_Begin1("File information");
- std::string CreationDate, Creator, Project, Copyright;
+ std::string Version, CreationDate, Creator, Project, Copyright;
int32u Size_Header, Size_Total, Size_Generic, Size_Industry, Size_User;
Skip_String(4, "Magic number");
Get_X4 (Size_Header, "Offset to image data");
- Skip_String(8, "Version number of header format");
+ Get_String(8, Version, "Version number of header format");
Get_X4 (Size_Total, "Total image file size");
Skip_B4( "Ditto Key");
Get_X4 (Size_Generic, "Generic section header length");
@@ -595,7 +595,7 @@ void File_Dpx::GenericSectionHeader_v2()
Get_X4 (Width, "Pixels per line");
Get_X4 (Height, "Lines per image element");
for(int16u ImageElement=0; ImageElement<ImageElements; ImageElement++)
- GenericSectionHeader_v2_ImageElement();
+ GenericSectionHeader_Dpx_ImageElement();
if (ImageElements!=8)
Skip_XX((8-ImageElements)*72, "Padding");
Skip_XX(52, "Reserved for future use");
@@ -604,8 +604,8 @@ void File_Dpx::GenericSectionHeader_v2()
Element_Begin1("Image source information");
Skip_B4( "X Offset");
Skip_B4( "Y Offset");
- Skip_BFP4(9, "X center");
- Skip_BFP4(9, "Y center");
+ Skip_BF4( "X center");
+ Skip_BF4( "Y center");
Skip_B4( "X original size");
Skip_B4( "Y original size");
Skip_UTF8(100, "Source image filename");
@@ -622,8 +622,8 @@ void File_Dpx::GenericSectionHeader_v2()
Get_X4 (PAR_V, "Pixel ratio : vertical");
Element_Begin1("Additional source image information");
- Skip_BFP4(9, "X scanned size");
- Skip_BFP4(9, "Y scanned size");
+ Skip_BF4( "X scanned size");
+ Skip_BF4( "Y scanned size");
Skip_XX(20, "Reserved for future use");
Element_End0();
@@ -659,6 +659,11 @@ void File_Dpx::GenericSectionHeader_v2()
Fill(StreamKind_Last, StreamPos_Last, "Encoded_Library", Creator);
Fill(Stream_General, 0, "Project", Project); //ToDo: map to a MediaInfo field (which one?)
Fill(Stream_General, 0, General_Copyright, Copyright);
+ Fill(StreamKind_Last, StreamPos_Last, "Format", "DPX");
+ if (Version.size()>2 && Version[0]=='V' && Version[1]>='0' && Version[2]<='9')
+ Version.insert(1, "ersion ");
+ Fill(StreamKind_Last, StreamPos_Last, "Format_Version", Version);
+ Fill(Stream_General, 0, General_Format_Version, Version);
Fill(StreamKind_Last, StreamPos_Last, "Width", Width);
Fill(StreamKind_Last, StreamPos_Last, "Height", Height);
@@ -671,15 +676,15 @@ void File_Dpx::GenericSectionHeader_v2()
}
//---------------------------------------------------------------------------
-void File_Dpx::GenericSectionHeader_v2_ImageElement()
+void File_Dpx::GenericSectionHeader_Dpx_ImageElement()
{
Element_Begin1("image element");
int8u TransferCharacteristic, ColorimetricSpecification, BitDephs;
Info_B4(DataSign, "Data sign");Param_Info1((DataSign==0?"unsigned":"signed"));
Skip_B4( "Reference low data code value");
- Skip_BFP4(9, "Reference low quantity represented");
+ Skip_BF4( "Reference low quantity represented");
Skip_B4( "Reference high data code value");
- Skip_BFP4(9, "Reference high quantity represented");
+ Skip_BF4( "Reference high quantity represented");
Info_B1(Descriptor, "Descriptor");Param_Info1(DPX_Descriptors(Descriptor));
Get_B1 (TransferCharacteristic, "Transfer characteristic");Param_Info1(DPX_TransferCharacteristic(TransferCharacteristic));
Get_B1 (ColorimetricSpecification, "Colorimetric specification");Param_Info1(DPX_ColorimetricSpecification(ColorimetricSpecification));
@@ -695,8 +700,6 @@ void File_Dpx::GenericSectionHeader_v2_ImageElement()
FILLING_BEGIN();
if (Frame_Count==0)
{
- Fill(StreamKind_Last, StreamPos_Last, "Format", "DPX");
- Fill(StreamKind_Last, StreamPos_Last, "Format_Version", "Version 2");
Fill(StreamKind_Last, StreamPos_Last, "BitDepth", BitDephs);
Fill(StreamKind_Last, StreamPos_Last, "colour_description_present", "Yes");
Fill(StreamKind_Last, StreamPos_Last, "colour_primaries", DPX_TransferCharacteristic(TransferCharacteristic));
@@ -706,7 +709,7 @@ void File_Dpx::GenericSectionHeader_v2_ImageElement()
}
//---------------------------------------------------------------------------
-void File_Dpx::IndustrySpecificHeader_v1()
+void File_Dpx::IndustrySpecificHeader_Cineon()
{
Element_Name("Motion picture industry specific header");
@@ -728,7 +731,7 @@ void File_Dpx::IndustrySpecificHeader_v1()
}
//---------------------------------------------------------------------------
-void File_Dpx::IndustrySpecificHeader_v2()
+void File_Dpx::IndustrySpecificHeader_Dpx()
{
Element_Name("Industry specific header");
@@ -743,8 +746,8 @@ void File_Dpx::IndustrySpecificHeader_v2()
Skip_B4( "Frame position in sequence");
Skip_B4( "Sequence length (frames)");
Skip_B4( "Held count (1 = default)");
- Skip_BFP4(9, "Frame rate of original (frames/s)");
- Skip_BFP4(9, "Shutter angle of camera in degrees");
+ Skip_BF4( "Frame rate of original (frames/s)");
+ Skip_BF4( "Shutter angle of camera in degrees");
Skip_UTF8(32, "Frame identification - e.g. keyframe");
Skip_UTF8(100, "Slate information");
Skip_XX(56, "Reserved for future use");
@@ -757,22 +760,22 @@ void File_Dpx::IndustrySpecificHeader_v2()
Skip_B1( "Field number");
Info_B1(VideoSignalStandard, "Video signal standard");Param_Info1(DPX_VideoSignalStandard(VideoSignalStandard));
Skip_B1( "Zero");
- Skip_BFP4(9, "Horizontal sampling rate (Hz)");
- Skip_BFP4(9, "Vertical sampling rate (Hz)");
- Skip_BFP4(9, "Temporal sampling rate or frame rate (Hz)");
- Skip_BFP4(9, "Time offset from sync to first pixel (ms)");
- Skip_BFP4(9, "Gamma");
- Skip_BFP4(9, "Black level code value");
- Skip_BFP4(9, "Black gain");
- Skip_BFP4(9, "Breakpoint");
- Skip_BFP4(9, "Reference white level code value");
- Skip_BFP4(9, "Integration time (s)");
+ Skip_BF4( "Horizontal sampling rate (Hz)");
+ Skip_BF4( "Vertical sampling rate (Hz)");
+ Skip_BF4( "Temporal sampling rate or frame rate (Hz)");
+ Skip_BF4( "Time offset from sync to first pixel (ms)");
+ Skip_BF4( "Gamma");
+ Skip_BF4( "Black level code value");
+ Skip_BF4( "Black gain");
+ Skip_BF4( "Breakpoint");
+ Skip_BF4( "Reference white level code value");
+ Skip_BF4( "Integration time (s)");
Skip_XX(76, "Reserved for future use");
Element_End0();
}
//---------------------------------------------------------------------------
-void File_Dpx::UserDefinedHeader_v1()
+void File_Dpx::UserDefinedHeader_Cineon()
{
Element_Name("User defined header");
@@ -781,7 +784,7 @@ void File_Dpx::UserDefinedHeader_v1()
}
//---------------------------------------------------------------------------
-void File_Dpx::UserDefinedHeader_v2()
+void File_Dpx::UserDefinedHeader_Dpx()
{
Element_Name("User defined header");
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Image/File_Dpx.h b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Dpx.h
index 784ddf5b5..66cc33147 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Image/File_Dpx.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Dpx.h
@@ -55,14 +55,14 @@ private :
void Data_Parse();
//Elements
- void GenericSectionHeader_v1();
- void GenericSectionHeader_v2();
- void GenericSectionHeader_v1_ImageElement();
- void GenericSectionHeader_v2_ImageElement();
- void IndustrySpecificHeader_v1();
- void IndustrySpecificHeader_v2();
- void UserDefinedHeader_v1();
- void UserDefinedHeader_v2();
+ void GenericSectionHeader_Cineon();
+ void GenericSectionHeader_Dpx();
+ void GenericSectionHeader_Cineon_ImageElement();
+ void GenericSectionHeader_Dpx_ImageElement();
+ void IndustrySpecificHeader_Cineon();
+ void IndustrySpecificHeader_Dpx();
+ void UserDefinedHeader_Cineon();
+ void UserDefinedHeader_Dpx();
void Padding();
void ImageData();
@@ -70,6 +70,7 @@ private :
std::vector<int32u> Sizes;
size_t Sizes_Pos;
int8u Version;
+ bool IsDpx;
bool LittleEndian;
//Helpers
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Image/File_Exr.cpp b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Exr.cpp
index 85f32d03d..9e2f88d25 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Image/File_Exr.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Exr.cpp
@@ -82,7 +82,6 @@ void File_Exr::Streams_Accept()
//Configuration
Buffer_MaximumSize=64*1024*1024; //Some big frames are possible (e.g YUV 4:2:2 10 bits 1080p)
- Frame_Count_NotParsedIncluded=0;
}
//***************************************************************************
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Image/File_Jpeg.cpp b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Jpeg.cpp
index e016f4c21..9c0f41bd2 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Image/File_Jpeg.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Jpeg.cpp
@@ -61,6 +61,7 @@ namespace Elements
const int16u QCD =0xFF5C; //JPEG 2000
const int16u QCC =0xFF5D; //JPEG 2000
const int16u RGN =0xFF5E; //JPEG 2000
+ const int16u POC =0xFF5F; //JPEG 2000
const int16u PPM =0xFF60; //JPEG 2000
const int16u PPT =0xFF61; //JPEG 2000
const int16u CME =0xFF64; //JPEG 2000
@@ -142,6 +143,31 @@ struct Jpeg_samplingfactor
int8u Vi;
};
+//---------------------------------------------------------------------------
+string Jpeg2000_Rsiz(int16u Rsiz)
+{
+ switch (Rsiz)
+ {
+ case 0x0000: return "No restrictions";
+ case 0x0001: return "Profile-0";
+ case 0x0002: return "Profile-1";
+ case 0x0003: return "D-Cinema 2k";
+ case 0x0004: return "D-Cinema 4k";
+ case 0x0005: return "D-Cinema 2k Scalable";
+ case 0x0006: return "D-Cinema 4k Scalable";
+ case 0x0007: return "Long-term storage";
+ case 0x0101: return "BCS@L1"; //Broadcast Contribution Single Tile
+ case 0x0102: return "BCS@L2"; //Broadcast Contribution Single Tile
+ case 0x0103: return "BCS@L3"; //Broadcast Contribution Single Tile
+ case 0x0104: return "BCS@L4"; //Broadcast Contribution Single Tile
+ case 0x0105: return "BCS@L5"; //Broadcast Contribution Single Tile
+ case 0x0205: return "BCM@L5"; //Broadcast Contribution Multi-tile
+ case 0x0306: return "BCMR@L6"; //Broadcast Contribution Multi-tile Reversible
+ case 0x0307: return "BCMR@L7"; //Broadcast Contribution Multi-tile Reversible
+ default: return Ztring::ToZtring(Rsiz, 16).To_UTF8();
+ }
+}
+
//***************************************************************************
// Constructor/Destructor
//***************************************************************************
@@ -190,7 +216,6 @@ void File_Jpeg::Streams_Accept()
//Configuration
Buffer_MaximumSize=64*1024*1024; //Some big frames are possible (e.g YUV 4:2:2 10 bits 1080p)
- Frame_Count_NotParsedIncluded=0;
}
//---------------------------------------------------------------------------
@@ -524,6 +549,7 @@ void File_Jpeg::Data_Parse()
CASE_INFO(QCD , "Quantization default"); //JPEG 2000
CASE_INFO(QCC , "Quantization component "); //JPEG 2000
CASE_INFO(RGN , "Region-of-interest"); //JPEG 2000
+ CASE_INFO(POC , "Progression order change"); //JPEG 2000
CASE_INFO(PPM , "Packed packet headers, main header"); //JPEG 2000
CASE_INFO(PPT , "Packed packet headers, tile-part header"); //JPEG 2000
CASE_INFO(CME , "Comment and extension"); //JPEG 2000
@@ -611,8 +637,8 @@ void File_Jpeg::SIZ()
vector<int8u> BitDepths;
int8u SamplingFactors_Max=0;
int32u Xsiz, Ysiz;
- int16u Count;
- Skip_B2( "Rsiz - Capability of the codestream");
+ int16u Rsiz, Count;
+ Get_B2 (Rsiz, "Rsiz - Capability of the codestream");
Get_B4 (Xsiz, "Xsiz - Image size X");
Get_B4 (Ysiz, "Ysiz - Image size Y");
Skip_B4( "XOsiz - Image offset X");
@@ -656,6 +682,7 @@ void File_Jpeg::SIZ()
Stream_Prepare(StreamKind_Last);
Fill(StreamKind_Last, 0, Fill_Parameter(StreamKind_Last, Generic_Format), "JPEG 2000");
Fill(StreamKind_Last, 0, Fill_Parameter(StreamKind_Last, Generic_Codec), "JPEG 2000");
+ Fill(StreamKind_Last, 0, "Format_Profile", Jpeg2000_Rsiz(Rsiz));
if (StreamKind_Last==Stream_Image)
Fill(Stream_Image, 0, Image_Codec_String, "JPEG 2000", Unlimited, true, true); //To Avoid automatic filling
Fill(StreamKind_Last, 0, StreamKind_Last==Stream_Image?(size_t)Image_Width:(size_t)Video_Width, Xsiz);
@@ -683,7 +710,9 @@ void File_Jpeg::SIZ()
Fill(StreamKind_Last, 0, "ChromaSubsampling", ChromaSubsampling);
//Not for sure
- if (!IsSub)
+ if (ChromaSubsampling==__T("4:4:4") && (Retrieve(StreamKind_Last, 0, "Format_Profile")==__T("D-Cinema 2k") || Retrieve(StreamKind_Last, 0, "Format_Profile")==__T("D-Cinema 4k")))
+ Fill(StreamKind_Last, 0, "ColorSpace", "XYZ");
+ else if (!IsSub)
{
if (ChromaSubsampling==__T("4:2:0") || ChromaSubsampling==__T("4:2:2"))
Fill(StreamKind_Last, 0, "ColorSpace", "YUV");
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Image/File_Jpeg.h b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Jpeg.h
index 824f05391..80de45e4d 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Image/File_Jpeg.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Jpeg.h
@@ -81,6 +81,7 @@ private :
void QCD ();
void QCC () {Skip_XX(Element_Size, "Data");}
void RGN () {Skip_XX(Element_Size, "Data");}
+ void POC () {Skip_XX(Element_Size, "Data");}
void PPM () {Skip_XX(Element_Size, "Data");}
void PPT () {Skip_XX(Element_Size, "Data");}
void CME () {Skip_XX(Element_Size, "Data");}
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Image/File_Png.cpp b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Png.cpp
index 7169d645e..51f855d2a 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Image/File_Png.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Png.cpp
@@ -103,9 +103,6 @@ void File_Png::Streams_Accept()
}
else
Stream_Prepare(StreamKind_Last);
-
- //Configuration
- Frame_Count_NotParsedIncluded=0;
}
//***************************************************************************
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Image/File_Tiff.cpp b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Tiff.cpp
index 9ffe5362b..949a9f841 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Image/File_Tiff.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Image/File_Tiff.cpp
@@ -70,7 +70,7 @@ const char* Tiff_Tag_Name(int32u Tag)
case Tiff_Tag::ImageDescription : return "ImageDescription";
case Tiff_Tag::SamplesPerPixel : return "SamplesPerPixel";
case Tiff_Tag::ExtraSamples : return "ExtraSamples";
- default : return "Unknown";
+ default : return "";
}
}
diff --git a/src/thirdparty/MediaInfo/MediaInfo/MediaInfo.cpp b/src/thirdparty/MediaInfo/MediaInfo/MediaInfo.cpp
index 175c0b46a..c269b6fc7 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/MediaInfo.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/MediaInfo.cpp
@@ -16,6 +16,9 @@
//---------------------------------------------------------------------------
#include "MediaInfo/MediaInfo.h"
#include "MediaInfo/MediaInfo_Internal.h"
+#if defined(_MSC_VER) && _MSC_VER >= 1800 && _MSC_VER < 1900 && defined(_M_X64)
+ #include <math.h> // needed for _set_FMA3_enable()
+#endif
using namespace ZenLib;
//---------------------------------------------------------------------------
@@ -60,6 +63,13 @@ using namespace MediaInfo_Debug_MediaInfo;
MediaInfo::MediaInfo()
{
Internal=new MediaInfo_Internal();
+
+ // FMA3 support in the 2013 CRT is broken on Vista and Windows 7 RTM (fixed in SP1).
+ // See https://connect.microsoft.com/VisualStudio/feedback/details/987093/x64-log-function-uses-vpsrlq-avx-instruction-without-regard-to-operating-system-so-it-crashes-on-vista-x64
+ // Hotfix: we disable it for MSVC2013.
+ #if defined(_MSC_VER) && _MSC_VER >= 1800 && _MSC_VER < 1900 && defined(_M_X64)
+ _set_FMA3_enable(0);
+ #endif
}
//---------------------------------------------------------------------------
diff --git a/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Config.cpp b/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Config.cpp
index 9674ff7e4..6e2007c28 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Config.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Config.cpp
@@ -19,6 +19,97 @@
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
+// Debug
+#ifdef MEDIAINFO_DEBUG
+ #include <stdio.h>
+ #include <windows.h>
+ namespace MediaInfo_Config_Debug
+ {
+ FILE* F;
+ std::string Debug;
+ SYSTEMTIME st_In;
+
+ void Debug_Open(bool Out)
+ {
+ F=fopen("C:\\Temp\\MediaInfo_Debug.txt", "a+t");
+ Debug.clear();
+ SYSTEMTIME st;
+ GetLocalTime( &st );
+
+ char Duration[100];
+ if (Out)
+ {
+ FILETIME ft_In;
+ if (SystemTimeToFileTime(&st_In, &ft_In))
+ {
+ FILETIME ft_Out;
+ if (SystemTimeToFileTime(&st, &ft_Out))
+ {
+ ULARGE_INTEGER UI_In;
+ UI_In.HighPart=ft_In.dwHighDateTime;
+ UI_In.LowPart=ft_In.dwLowDateTime;
+
+ ULARGE_INTEGER UI_Out;
+ UI_Out.HighPart=ft_Out.dwHighDateTime;
+ UI_Out.LowPart=ft_Out.dwLowDateTime;
+
+ ULARGE_INTEGER UI_Diff;
+ UI_Diff.QuadPart=UI_Out.QuadPart-UI_In.QuadPart;
+
+ FILETIME ft_Diff;
+ ft_Diff.dwHighDateTime=UI_Diff.HighPart;
+ ft_Diff.dwLowDateTime=UI_Diff.LowPart;
+
+ SYSTEMTIME st_Diff;
+ if (FileTimeToSystemTime(&ft_Diff, &st_Diff))
+ {
+ sprintf(Duration, "%02hd:%02hd:%02hd.%03hd", st_Diff.wHour, st_Diff.wMinute, st_Diff.wSecond, st_Diff.wMilliseconds);
+ }
+ else
+ strcpy(Duration, " ");
+ }
+ else
+ strcpy(Duration, " ");
+
+ }
+ else
+ strcpy(Duration, " ");
+ }
+ else
+ {
+ st_In=st;
+ strcpy(Duration, " ");
+ }
+
+ fprintf(F," %02hd:%02hd:%02hd.%03hd %s", st.wHour, st.wMinute, st.wSecond, st.wMilliseconds, Duration);
+ }
+
+ void Debug_Close()
+ {
+ Debug += "\r\n";
+ fwrite(Debug.c_str(), Debug.size(), 1, F); \
+ fclose(F);
+ }
+ }
+ using namespace MediaInfo_Config_Debug;
+
+ #define MEDIAINFO_DEBUG1(_NAME,_TOAPPEND) \
+ Debug_Open(false); \
+ Debug+=", ";Debug+=_NAME; \
+ _TOAPPEND; \
+ Debug_Close();
+
+ #define MEDIAINFO_DEBUG2(_NAME,_TOAPPEND) \
+ Debug_Open(true); \
+ Debug+=", ";Debug+=_NAME; \
+ _TOAPPEND; \
+ Debug_Close();
+#else // MEDIAINFO_DEBUG
+ #define MEDIAINFO_DEBUG1(_NAME,__TOAPPEND)
+ #define MEDIAINFO_DEBUG2(_NAME,__TOAPPEND)
+#endif // MEDIAINFO_DEBUG
+
+//---------------------------------------------------------------------------
#include "MediaInfo/Setup.h"
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
@@ -34,7 +125,7 @@ namespace MediaInfoLib
{
//---------------------------------------------------------------------------
-const Char* MediaInfo_Version=__T("MediaInfoLib - v0.7.71");
+const Char* MediaInfo_Version=__T("MediaInfoLib - v0.7.73");
const Char* MediaInfo_Url=__T("http://MediaArea.net/MediaInfo");
Ztring EmptyZtring; //Use it when we can't return a reference to a true Ztring
const Ztring EmptyZtring_Const; //Use it when we can't return a reference to a true Ztring, const version
@@ -158,7 +249,9 @@ void MediaInfo_Config::Init()
Ztring MediaInfo_Config::Option (const String &Option, const String &Value_Raw)
{
+ CS.Enter();
SubFile_Config(Option)=Value_Raw;
+ CS.Leave();
String Option_Lower(Option);
size_t Egal_Pos=Option_Lower.find(__T('='));
@@ -2156,7 +2249,15 @@ void MediaInfo_Config::Event_Send (const int8u* Data_Content, size_t Data_Size,
CriticalSectionLocker CSL(CS);
if (Event_CallBackFunction)
+ {
+ MEDIAINFO_DEBUG1( "Event",
+ Debug+=", EventID=";Debug+=Ztring::ToZtring(LittleEndian2int32u(Data_Content), 16).To_UTF8();)
+
Event_CallBackFunction ((unsigned char*)Data_Content, Data_Size, Event_UserHandler);
+
+ MEDIAINFO_DEBUG2( "Event",
+ )
+ }
}
#endif //MEDIAINFO_EVENTS
diff --git a/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Config_Automatic.cpp b/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Config_Automatic.cpp
index 32e5581da..b639cef37 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Config_Automatic.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Config_Automatic.cpp
@@ -322,6 +322,7 @@ void MediaInfo_Config_DefaultLanguage (Translation &Info)
"Director;Director\n"
"DirectorOfPhotography;Director of photography\n"
"DisplayAspectRatio;Display aspect ratio\n"
+ "DisplayAspectRatio_CleanAperture;Clean aperture display aspect ratio\n"
"DisplayAspectRatio_Original;Original display aspect ratio\n"
"DistributedBy;Distributed by\n"
"Distributor;Distributor\n"
@@ -616,6 +617,7 @@ void MediaInfo_Config_DefaultLanguage (Translation &Info)
"h;h\n"
"Header file;Create a header file\n"
"Height;Height\n"
+ "Height_CleanAperture;Clean aperture height\n"
"Height_Original;Original height\n"
"Help;Help\n"
"Hint;Hint\n"
@@ -956,6 +958,7 @@ void MediaInfo_Config_DefaultLanguage (Translation &Info)
"Phone;Phone\n"
"PictureRatio;Picture Ratio\n"
"PixelAspectRatio;Pixel aspect ratio\n"
+ "PixelAspectRatio_CleanAperture;Clean aperture pixel aspect ratio\n"
"PixelAspectRatio_Original;Original pixel aspect ratio\n"
"PlayCounter;PlayCounter\n"
"Played_Count;Times played\n"
@@ -1005,7 +1008,7 @@ void MediaInfo_Config_DefaultLanguage (Translation &Info)
"Send HeaderFile;Please send me the Header file here : http://sourceforge.net/projects/mediainfo/ (Bug section)\n"
"Separator_Columns;columns separator\n"
"Separator_Lines;lines separator\n"
- "SerieTitle;Serie Title\n"
+ "SeriesTitle;Series Title\n"
"ServiceChannel;Service channel number\n"
"ServiceName;Service name\n"
"ServiceProvider;Service provider\n"
@@ -1119,6 +1122,7 @@ void MediaInfo_Config_DefaultLanguage (Translation &Info)
"WebSite_Video;Go to the web site of this video codec\n"
"WebSite_Video_More;Go to the web site (%Url%) to find this video codec\n"
"Width;Width\n"
+ "Width_CleanAperture;Clean aperture width\n"
"Width_Original;Original width\n"
"WriteMe;Write mail to author\n"
"WriteToTranslator;Write to translator\n"
@@ -1244,6 +1248,7 @@ void MediaInfo_Config_Format (InfoMap &Info)
"WavPack;;;A;Wvpk;;wv wvc;;http://www.wavpack.com\n"
"Arri Raw;;;I;ArriRaw;;ari;;\n"
"Bitmap;;;I;Bmp;;bmp;image/bmp;;Lossless\n"
+ "BPG;;;I;Bpg;Better Portable Graphics;bpg;image/bpg;http://bellard.org/bpg/\n"
"DDS;;;I;Dds;DirectDraw Surface;dds;;\n"
"DPX;;;I;Dpx;;dpx cin;;;Lossless\n"
"EXR;;;I;Exr;;exr;;;Lossless\n"
@@ -1403,12 +1408,13 @@ void MediaInfo_Config_CodecID_Video_Mpeg4 (InfoMap &Info)
"ac16;YUV;;;;;;YUV;4:2:2\n"
"ac32;YUV;;;;;;YUV;4:2:2\n"
"acBG;YUV;;;;;;YUV;4:2:2\n"
- "apch;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;High;;YUV;4:2:2\n"
- "apcn;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV;4:2:2\n"
- "apcs;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;LT;;YUV;4:2:2\n"
- "apco;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;Proxy;;YUV;4:2:2\n"
- "ap4c;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;;;;4:4:4\n"
- "ap4h;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;;;;4:4:4\n"
+ "apch;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;422 HQ;;YUV;4:2:2\n"
+ "apcn;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;422;;YUV;4:2:2\n"
+ "apcs;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;422 LT;;YUV;4:2:2\\n"
+ "apco;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;422 Proxy;;YUV;4:2:2\n"
+ "ap4c;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;4444;;;4:4:4\n"
+ "ap4h;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;4444;;;4:4:4\n"
+ "ap4x;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;4444 XQ;;;4:4:4\n"
"ai11;AVC;;Advanced Video Coding;http://ffdshow-tryout.sourceforge.net;;\n"
"ai12;AVC;;Advanced Video Coding;http://ffdshow-tryout.sourceforge.net;;\n"
"ai13;AVC;;Advanced Video Coding;http://ffdshow-tryout.sourceforge.net;;\n"
@@ -1422,7 +1428,7 @@ void MediaInfo_Config_CodecID_Video_Mpeg4 (InfoMap &Info)
"AVDJ;JPEG;;Avid\n"
"AVdv;DV;;Avid;http://www.apple.com/quicktime/download/standalone.html;;;YUV;4:2:2\n"
"AVd1;DV;;Avid;http://www.apple.com/quicktime/download/standalone.html;;\n"
- "AVdn;VC-3;DNxHD;Avid;http://www.apple.com/quicktime/download/standalone.html;;;YUV;4:2:2\n"
+ "AVdn;VC-3;DNxHD;Avid;http://www.apple.com/quicktime/download/standalone.html;;;\n"
"AVmp;MPEG Video;Avid IMX;;;;Version 2;;\n"
"avr ;JPEG;;;;;;\n"
"b16g;Gray;;;;;;Y;16\n"
@@ -1460,6 +1466,7 @@ void MediaInfo_Config_CodecID_Video_Mpeg4 (InfoMap &Info)
"DVTV;Digital Voodoo;;Digital Voodoo intermediate 2vuy;http://www.digitalvoodoo.net/;;;\n"
"DVVT;Digital Voodoo;;Digital Voodoo intermediate v210;http://www.digitalvoodoo.net/;;;\n"
"encv;(Encrypted);;;http://www.apple.com/quicktime/download/standalone.html;;;\n"
+ "FFV1;FFV1;;;;;;\n"
"gif ;M-GIF;;;;;;\n"
"Hap1;Hap;;Hap Video Codec;https://github.com/Vidvox/hap;;;\n"
"Hap5;Hap Alpha;;Hap Video Codec;https://github.com/Vidvox/hap;;;\n"
@@ -1527,6 +1534,7 @@ void MediaInfo_Config_CodecID_Video_Mpeg4 (InfoMap &Info)
"SVQ2;Sorenson 2;;Sorenson Media Video 2 (Apple QuickTime 4);http://www.apple.com/quicktime/download/standalone.html;;;\n"
"SVQ3;Sorenson 3;;Sorenson Media Video 3 (Apple QuickTime 5);http://www.apple.com/quicktime/download/standalone.html;;;\n"
"v210;YUV;AJA Video Systems Xena;;;;;YUV;4:2:2\n"
+ "V210;YUV;AJA Video Systems Xena;;;;;YUV;4:2:2\n"
"vc-1;VC-1;;SMPTE VC-1;http://www.smpte.org/;;;YUV\n"
"WMV3;VC-1;WMV3;Windows Media Video 9;http://www.microsoft.com/windows/windowsmedia/format/codecdownload.aspx;;;\n"
"WRLE;Bitmap;;Windows BMP image format;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n"
@@ -2364,6 +2372,7 @@ void MediaInfo_Config_CodecID_Audio_Mpeg4 (InfoMap &Info)
Info.Write(Ztring().From_UTF8(
".mp3;MPEG Audio;;;\n"
"A104;AMR;;;http://www.apple.com/quicktime/download/standalone.html;Wide band\n"
+ "aac ;AAC;;\n"
"ac-3;AC-3;;;\n"
"alac;ALAC;;Apple Lossless Audio Codec;http://www.apple.com/quicktime/download/standalone.html\n"
"alaw;ADPCM;;;http://www.apple.com/quicktime/download/standalone.html\n"
@@ -2692,8 +2701,9 @@ void MediaInfo_Config_CodecID_Text_Matroska (InfoMap &Info)
"S_TEXT/UTF8;UTF-8;;UTF-8 Plain Text\n"
"S_USF;USF;;Universal Subtitle Format\n"
"S_UTF8;UTF-8;;UTF-8 Plain Text\n"
- "S_VOBSUB;VobSub;;The same subtitle format used on DVDs\n"
- "S_HDMV/PGS;PGS;;The same subtitle format used on BDs/HD-DVDs\n"
+ "S_VOBSUB;VobSub;;Picture based subtitle format used on DVDs\n"
+ "S_HDMV/PGS;PGS;;Picture based subtitle format used on BDs/HD-DVDs\n"
+ "S_HDMV/TEXTST;TEXTST;;Text based subtitle format used on BDs\n"
));
Info.Separator_Set(0, ZenLib::EOL);
}
@@ -3820,7 +3830,9 @@ void MediaInfo_Config_Codec (InfoMap &Info)
"S_TEXT/ASS;ASS;Mk;T;;;Advanced Sub Station Alpha\n"
"S_TEXT/USF;USF;Mk;T;;;Universal Subtitle Format\n"
"S_IMAGE/BMP;Bitmap;Mk;T;;;Basic image based subtitle format\n"
- "S_VOBSUB;VobSub;Mk;T;;;The same subtitle format used on DVDs\n"
+ "S_VOBSUB;VobSub;Mk;T;;;Picture based subtitle format used on DVDs\n"
+ "S_HDMV/PGS;PGS;Mk;T;;;Picture based subtitle format used on BDs/HD-DVDs\n"
+ "S_HDMV/TEXTST;TEXTST;Mk;T;;;Text based subtitle format used on BDs\n"
));
Info.Separator_Set(0, ZenLib::EOL);
}
@@ -4208,14 +4220,20 @@ void MediaInfo_Config_General (ZtringListList &Info)
"Recorded_Location;;;Y YT;;;Location where track was recorded. (See COMPOSITION_LOCATION for format);;Spatial\n"
"Written_Location;;;Y YT;;;Location that the item was originaly designed/written. Information should be stored in the following format: country code, state/province, city where the coutry code is the same 2 octets as in Internet domains, or possibly ISO-3166. e.g. US, Texas, Austin or US, , Austin.;;Spatial\n"
"Archival_Location;;;Y YT;;;Location, where an item is archived, e.eg. Louvre,Paris,France;;Spatial\n"
- "Encoded_Application;;;Y YT;;;Name of the software package used to create the file, such as Microsoft WaveEdit.;;Technical\n"
- "Encoded_Application/Url;;;N YT;;;Name of the software package used to create the file, such as Microsoft WaveEdit.;;Technical\n"
+ "Encoded_Application;;;N YT;;;Name of the software package used to create the file, such as Microsoft WaveEdit;;Technical\n"
+ "Encoded_Application/String;;;Y NT;;;Name of the software package used to create the file, such as Microsoft WaveEdit, trying to have the format 'CompanyName ProductName (OperatingSystem) Version (Date)';;Technical\n"
+ "Encoded_Application_CompanyName;;;N YT;;;Name of the company;;Technical\n"
+ "Encoded_Application_Name;;;N YT;;;Name of the product;;Technical\n"
+ "Encoded_Application_Version;;;N YT;;;Version of the product;;Technical\n"
+ "Encoded_Application_Url;;;N YT;;;Name of the software package used to create the file, such as Microsoft WaveEdit.;;Technical\n"
"Encoded_Library;;;N YT;;;Software used to create the file;;Technical\n"
- "Encoded_Library/String;;;Y NT;;;Software used to create the file;;Technical\n"
- "Encoded_Library/Name;;;N NT;;;Name of the the encoding-software;;Technical\n"
- "Encoded_Library/Version;;;N NT;;;Version of encoding-software;;Technical\n"
- "Encoded_Library/Date;;;N NT;;;Release date of software;;Technical\n"
+ "Encoded_Library/String;;;Y NT;;;Software used to create the file, trying to have the format 'CompanyName ProductName (OperatingSystem) Version (Date)';;Technical\n"
+ "Encoded_Library_CompanyName;;;N YT;;;Name of the company;;Technical\n"
+ "Encoded_Library_Name;;;N NT;;;Name of the the encoding-software;;Technical\n"
+ "Encoded_Library_Version;;;N NT;;;Version of encoding-software;;Technical\n"
+ "Encoded_Library_Date;;;N NT;;;Release date of software;;Technical\n"
"Encoded_Library_Settings;;;Y YT;;;Parameters used by the software;;Technical\n"
+ "Encoded_OperatingSystem;;;N YT;;;Operating System of encoding-software;;Technical\n"
"Cropped;;;Y YT;;;Describes whether an image has been cropped and, if so, how it was cropped.;;Technical\n"
"Dimensions;;;Y YT;;;Specifies the size of the original subject of the file. eg 8.5 in h, 11 in w;;Technical\n"
"DotsPerInch;;;Y YT;;;Stores dots per inch setting of the digitizer used to produce the file;;Technical\n"
@@ -4400,24 +4418,32 @@ void MediaInfo_Config_Video (ZtringListList &Info)
"BitRate_Encoded/String;;;Y NT;;;Encoded (with forced padding) bit rate (with measurement), if some container padding is present\n"
"Width;; pixel;N YI;;;Width (aperture size if present) in pixel\n"
"Width/String;;;Y NT;;;Width (aperture size if present) with measurement (pixel)\n"
- "Width_Offset;; pixel;N YI;;;Offset between original width and displayed width (aperture size) in pixel\n"
- "Width_Offset/String;;;N NT;;;Offset between original width and displayed width (aperture size) in pixel\n"
+ "Width_Offset;; pixel;N YI;;;Offset between original width and displayed width in pixel\n"
+ "Width_Offset/String;;;N NT;;;Offset between original width and displayed width in pixel\n"
"Width_Original;; pixel;N YI;;;Original (in the raw stream) width in pixel\n"
"Width_Original/String;;;Y NT;;;Original (in the raw stream) width with measurement (pixel)\n"
- "Height;; pixel;N YI;;;Height (aperture size if present) in pixel\n"
- "Height/String;;;Y NT;;;Height (aperture size if present) with measurement (pixel)\n"
- "Height_Offset;; pixel;N YI;;;Offset between original height and displayed height (aperture size) in pixel\n"
- "Height_Offset/String;;;N NT;;;Offset between original height and displayed height (aperture size) in pixel\n"
+ "Width_CleanAperture;; pixel;N YI;;;Clean Aperture width in pixel\n"
+ "Width_CleanAperture/String;;;Y NT;;;Clean Aperture width with measurement (pixel)\n"
+ "Height;; pixel;N YI;;;Height in pixel\n"
+ "Height/String;;;Y NT;;;Height with measurement (pixel)\n"
+ "Height_Offset;; pixel;N YI;;;Offset between original height and displayed height in pixel\n"
+ "Height_Offset/String;;;N NT;;;Offset between original height and displayed height in pixel\n"
"Height_Original;; pixel;N YI;;;Original (in the raw stream) height in pixel\n"
"Height_Original/String;;;Y NT;;;Original (in the raw stream) height with measurement (pixel)\n"
+ "Height_CleanAperture;; pixel;N YI;;;Clean Aperture height in pixel\n"
+ "Height_CleanAperture/String;;;Y NT;;;Clean Aperture height with measurement (pixel)\n"
"PixelAspectRatio;;;N YF;;;Pixel Aspect ratio\n"
"PixelAspectRatio/String;;;N NT;;;Pixel Aspect ratio\n"
"PixelAspectRatio_Original;;;N YF;;;Original (in the raw stream) Pixel Aspect ratio\n"
"PixelAspectRatio_Original/String;;;N NT;;;Original (in the raw stream) Pixel Aspect ratio\n"
+ "PixelAspectRatio_CleanAperture;;;N YF;;;Clean Aperture Pixel Aspect ratio\n"
+ "PixelAspectRatio_CleanAperture/String;;;N NT;;;Clean Aperture Pixel Aspect ratio\n"
"DisplayAspectRatio;;;N YF;;;Display Aspect ratio\n"
"DisplayAspectRatio/String;;;Y NT;;;Display Aspect ratio\n"
"DisplayAspectRatio_Original;;;N YF;;;Original (in the raw stream) Display Aspect ratio\n"
"DisplayAspectRatio_Original/String;;;Y NT;;;Original (in the raw stream) Display Aspect ratio\n"
+ "DisplayAspectRatio_CleanAperture;;;N YF;;;Clean Aperture Display Aspect ratio\n"
+ "DisplayAspectRatio_CleanAperture/String;;;Y NT;;;Clean Aperture Display Aspect ratio\n"
"ActiveFormatDescription;;;N YN;;;Active Format Description (AFD value)\n"
"ActiveFormatDescription/String;;;Y NT;;;Active Format Description (text)\n"
"ActiveFormatDescription_MuxingMode;;;N YT;;;Active Format Description (AFD value) muxing mode (Ancillary or Raw stream)\n"
@@ -4500,8 +4526,8 @@ void MediaInfo_Config_Video (ZtringListList &Info)
"TimeCode_Source;;;Y YT;;;Time code source (Container, Stream, SystemScheme1, SDTI, ANC...)\n"
"Gop_OpenClosed;; ;N YT;;;Time code information about Open/Closed\n"
"Gop_OpenClosed/String;;;Y NT;;;Time code information about Open/Closed\n"
- "Gop_OpenClosed;; ;N YT;;;Time code information about Open/Closed of first frame if GOP is Open for the other GOPs\n"
- "Gop_OpenClosed/String;;;Y NT;;;Time code information about Open/Closed of first frame if GOP is Open for the other GOPs\n"
+ "Gop_OpenClosed_FirstFrame;; ;N YT;;;Time code information about Open/Closed of first frame if GOP is Open for the other GOPs\n"
+ "Gop_OpenClosed_FirstFrame/String;;;Y NT;;;Time code information about Open/Closed of first frame if GOP is Open for the other GOPs\n"
"StreamSize;; byte;N YI;;;Streamsize in bytes;\n"
"StreamSize/String;;;Y NT;;;Streamsize in with percentage value;\n"
"StreamSize/String1;;;N NT;;;;\n"
@@ -4537,14 +4563,20 @@ void MediaInfo_Config_Video (ZtringListList &Info)
"Alignment;;;Y NT;;;How this stream file is aligned in the container;\n"
"Alignment/String;;;N YT;;;;\n"
"Title;;;Y YI;;;Name of the track;\n"
- "Encoded_Application;;;Y YT;;;Software. Identifies the name of the software package used to create the file, such as Microsoft WaveEdit.;;Technical\n"
- "Encoded_Application/Url;;;N YT;;;Software. Identifies the name of the software package used to create the file, such as Microsoft WaveEdit.;;Technical\n"
- "Encoded_Library;;;N YT;;;Software used to create the file;\n"
- "Encoded_Library/String;;;Y NT;;;Software used to create the file;\n"
- "Encoded_Library/Name;;;N NT;;;Info from the software;\n"
- "Encoded_Library/Version;;;N NT;;;Version of software;\n"
- "Encoded_Library/Date;;;N NT;;;Release date of software;\n"
- "Encoded_Library_Settings;;;Y YT;;;Parameters used by the software;\n"
+ "Encoded_Application;;;N YT;;;Name of the software package used to create the file, such as Microsoft WaveEdit;;Technical\n"
+ "Encoded_Application/String;;;Y NT;;;Name of the software package used to create the file, such as Microsoft WaveEdit, trying to have the format 'CompanyName ProductName (OperatingSystem) Version (Date)';;Technical\n"
+ "Encoded_Application_CompanyName;;;N YT;;;Name of the company;;Technical\n"
+ "Encoded_Application_Name;;;N YT;;;Name of the product;;Technical\n"
+ "Encoded_Application_Version;;;N YT;;;Version of the product;;Technical\n"
+ "Encoded_Application_Url;;;N YT;;;Name of the software package used to create the file, such as Microsoft WaveEdit.;;Technical\n"
+ "Encoded_Library;;;N YT;;;Software used to create the file;;Technical\n"
+ "Encoded_Library/String;;;Y NT;;;Software used to create the file, trying to have the format 'CompanyName ProductName (OperatingSystem) Version (Date)';;Technical\n"
+ "Encoded_Library_CompanyName;;;N YT;;;Name of the company;;Technical\n"
+ "Encoded_Library_Name;;;N NT;;;Name of the the encoding-software;;Technical\n"
+ "Encoded_Library_Version;;;N NT;;;Version of encoding-software;;Technical\n"
+ "Encoded_Library_Date;;;N NT;;;Release date of software;;Technical\n"
+ "Encoded_Library_Settings;;;Y YT;;;Parameters used by the software;;Technical\n"
+ "Encoded_OperatingSystem;;;N YT;;;Operating System of encoding-software;;Technical\n"
"Language;;;N YT;;;Language (2-letter ISO 639-1 if exists, else 3-letter ISO 639-2, and with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn);\n"
"Language/String;;;Y NT;;;Language (full);\n"
"Language/String1;;;N NT;;;Language (full);\n"
@@ -4560,11 +4592,11 @@ void MediaInfo_Config_Video (ZtringListList &Info)
"Tagged_Date;;;Y YT;;;UTC time that the tags were done for this item.;;Temporal\n"
"Encryption;;;Y YT;;;;\n"
"BufferSize;;;N YT;;;Defines the size of the buffer needed to decode the sequence.\n"
+ "colour_range;;;Y YT;;;Colour range for YUV colour space\n"
"colour_description_present;;;N YT;;;Presence of colour description\n"
"colour_primaries;;;Y YT;;;Chromaticity coordinates of the source primaries\n"
"transfer_characteristics;;;Y YT;;;Opto-electronic transfer characteristic of the source picture\n"
"matrix_coefficients;;;Y YT;;;Matrix coefficients used in deriving luma and chroma signals from the green, blue, and red primaries\n"
- "colour_range;;;Y YT;;;Colour range for YUV colour space\n"
"colour_description_present_Original;;;N YT;;;Presence of colour description\n"
"colour_primaries_Original;;;Y YT;;;Chromaticity coordinates of the source primaries\n"
"transfer_characteristics_Original;;;Y YT;;;Opto-electronic transfer characteristic of the source picture\n"
@@ -4804,12 +4836,20 @@ void MediaInfo_Config_Audio (ZtringListList &Info)
"Interleave_Preload;;;N YI;;;How much time is buffered before the first video frame;\n"
"Interleave_Preload/String;;;Y NT;;;How much time is buffered before the first video frame (with measurement);\n"
"Title;;;Y YI;;;Name of the track;\n"
- "Encoded_Library;;;N YT;;;Software used to create the file;\n"
- "Encoded_Library/String;;;Y NT;;;Software used to create the file;\n"
- "Encoded_Library/Name;;;N NT;;;Info from the software;\n"
- "Encoded_Library/Version;;;N NT;;;Version of software;\n"
- "Encoded_Library/Date;;;N NT;;;Release date of software;\n"
- "Encoded_Library_Settings;;;Y YT;;;Parameters used by the software;\n"
+ "Encoded_Application;;;N YT;;;Name of the software package used to create the file, such as Microsoft WaveEdit;;Technical\n"
+ "Encoded_Application/String;;;Y NT;;;Name of the software package used to create the file, such as Microsoft WaveEdit, trying to have the format 'CompanyName ProductName (OperatingSystem) Version (Date)';;Technical\n"
+ "Encoded_Application_CompanyName;;;N YT;;;Name of the company;;Technical\n"
+ "Encoded_Application_Name;;;N YT;;;Name of the product;;Technical\n"
+ "Encoded_Application_Version;;;N YT;;;Version of the product;;Technical\n"
+ "Encoded_Application_Url;;;N YT;;;Name of the software package used to create the file, such as Microsoft WaveEdit.;;Technical\n"
+ "Encoded_Library;;;N YT;;;Software used to create the file;;Technical\n"
+ "Encoded_Library/String;;;Y NT;;;Software used to create the file, trying to have the format 'CompanyName ProductName (OperatingSystem) Version (Date)';;Technical\n"
+ "Encoded_Library_CompanyName;;;N YT;;;Name of the company;;Technical\n"
+ "Encoded_Library_Name;;;N NT;;;Name of the the encoding-software;;Technical\n"
+ "Encoded_Library_Version;;;N NT;;;Version of encoding-software;;Technical\n"
+ "Encoded_Library_Date;;;N NT;;;Release date of software;;Technical\n"
+ "Encoded_Library_Settings;;;Y YT;;;Parameters used by the software;;Technical\n"
+ "Encoded_OperatingSystem;;;N YT;;;Operating System of encoding-software;;Technical\n"
"Language;;;N YT;;;Language (2-letter ISO 639-1 if exists, else 3-letter ISO 639-2, and with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn);\n"
"Language/String;;;Y NT;;;Language (full);\n"
"Language/String1;;;N NT;;;Language (full);\n"
@@ -5022,12 +5062,20 @@ void MediaInfo_Config_Text (ZtringListList &Info)
"Source_StreamSize_Encoded/String5;;;N NT;;;Source Encoded Streamsize in with percentage value;\n"
"Source_StreamSize_Encoded_Proportion;;;N NT;;;Source Encoded Stream size divided by file size;\n"
"Title;;;Y YI;;;Name of the track\n"
- "Encoded_Library;;;N YT;;;Software used to create the file\n"
- "Encoded_Library/String;;;Y NT;;;Software used to create the file\n"
- "Encoded_Library/Name;;;N NT;;;Info from the software\n"
- "Encoded_Library/Version;;;N NT;;;Version of software\n"
- "Encoded_Library/Date;;;N NT;;;Release date of software\n"
- "Encoded_Library_Settings;;;Y YT;;;Parameters used by the software\n"
+ "Encoded_Application;;;N YT;;;Name of the software package used to create the file, such as Microsoft WaveEdit;;Technical\n"
+ "Encoded_Application/String;;;Y NT;;;Name of the software package used to create the file, such as Microsoft WaveEdit, trying to have the format 'CompanyName ProductName (OperatingSystem) Version (Date)';;Technical\n"
+ "Encoded_Application_CompanyName;;;N YT;;;Name of the company;;Technical\n"
+ "Encoded_Application_Name;;;N YT;;;Name of the product;;Technical\n"
+ "Encoded_Application_Version;;;N YT;;;Version of the product;;Technical\n"
+ "Encoded_Application_Url;;;N YT;;;Name of the software package used to create the file, such as Microsoft WaveEdit.;;Technical\n"
+ "Encoded_Library;;;N YT;;;Software used to create the file;;Technical\n"
+ "Encoded_Library/String;;;Y NT;;;Software used to create the file, trying to have the format 'CompanyName ProductName (OperatingSystem) Version (Date)';;Technical\n"
+ "Encoded_Library_CompanyName;;;N YT;;;Name of the company;;Technical\n"
+ "Encoded_Library_Name;;;N NT;;;Name of the the encoding-software;;Technical\n"
+ "Encoded_Library_Version;;;N NT;;;Version of encoding-software;;Technical\n"
+ "Encoded_Library_Date;;;N NT;;;Release date of software;;Technical\n"
+ "Encoded_Library_Settings;;;Y YT;;;Parameters used by the software;;Technical\n"
+ "Encoded_OperatingSystem;;;N YT;;;Operating System of encoding-software;;Technical\n"
"Language;;;N YT;;;Language (2-letter ISO 639-1 if exists, else 3-letter ISO 639-2, and with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn)\n"
"Language/String;;;Y NT;;;Language (full)\n"
"Language/String1;;;N NT;;;Language (full)\n"
@@ -5203,9 +5251,9 @@ void MediaInfo_Config_Image (ZtringListList &Info)
"StreamSize_Proportion;;;N NT;;;Stream size divided by file size;\n"
"Encoded_Library;;;N YT;;;Software used to create the file;\n"
"Encoded_Library/String;;;Y NT;;;Software used to create the file;\n"
- "Encoded_Library/Name;;;N NT;;;Info from the software;\n"
- "Encoded_Library/Version;;;N NT;;;Version of software;\n"
- "Encoded_Library/Date;;;N NT;;;Release date of software;\n"
+ "Encoded_Library_Name;;;N NT;;;Info from the software;\n"
+ "Encoded_Library_Version;;;N NT;;;Version of software;\n"
+ "Encoded_Library_Date;;;N NT;;;Release date of software;\n"
"Encoded_Library_Settings;;;Y YT;;;Parameters used by the software;\n"
"Language;;;N YT;;;Language (2-letter ISO 639-1 if exists, else 3-letter ISO 639-2, and with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn);\n"
"Language/String;;;Y NT;;;Language (full);\n"
diff --git a/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Config_MediaInfo.cpp b/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Config_MediaInfo.cpp
index b11f60877..c00de7885 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Config_MediaInfo.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Config_MediaInfo.cpp
@@ -33,6 +33,97 @@ using namespace ZenLib;
using namespace std;
//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------
+// Debug
+#ifdef MEDIAINFO_DEBUG
+ #include <stdio.h>
+ #include <windows.h>
+ namespace MediaInfo_Config_MediaInfo_Debug
+ {
+ FILE* F;
+ std::string Debug;
+ SYSTEMTIME st_In;
+
+ void Debug_Open(bool Out)
+ {
+ F=fopen("C:\\Temp\\MediaInfo_Debug.txt", "a+t");
+ Debug.clear();
+ SYSTEMTIME st;
+ GetLocalTime( &st );
+
+ char Duration[100];
+ if (Out)
+ {
+ FILETIME ft_In;
+ if (SystemTimeToFileTime(&st_In, &ft_In))
+ {
+ FILETIME ft_Out;
+ if (SystemTimeToFileTime(&st, &ft_Out))
+ {
+ ULARGE_INTEGER UI_In;
+ UI_In.HighPart=ft_In.dwHighDateTime;
+ UI_In.LowPart=ft_In.dwLowDateTime;
+
+ ULARGE_INTEGER UI_Out;
+ UI_Out.HighPart=ft_Out.dwHighDateTime;
+ UI_Out.LowPart=ft_Out.dwLowDateTime;
+
+ ULARGE_INTEGER UI_Diff;
+ UI_Diff.QuadPart=UI_Out.QuadPart-UI_In.QuadPart;
+
+ FILETIME ft_Diff;
+ ft_Diff.dwHighDateTime=UI_Diff.HighPart;
+ ft_Diff.dwLowDateTime=UI_Diff.LowPart;
+
+ SYSTEMTIME st_Diff;
+ if (FileTimeToSystemTime(&ft_Diff, &st_Diff))
+ {
+ sprintf(Duration, "%02hd:%02hd:%02hd.%03hd", st_Diff.wHour, st_Diff.wMinute, st_Diff.wSecond, st_Diff.wMilliseconds);
+ }
+ else
+ strcpy(Duration, " ");
+ }
+ else
+ strcpy(Duration, " ");
+
+ }
+ else
+ strcpy(Duration, " ");
+ }
+ else
+ {
+ st_In=st;
+ strcpy(Duration, " ");
+ }
+
+ fprintf(F," %02hd:%02hd:%02hd.%03hd %s", st.wHour, st.wMinute, st.wSecond, st.wMilliseconds, Duration);
+ }
+
+ void Debug_Close()
+ {
+ Debug += "\r\n";
+ fwrite(Debug.c_str(), Debug.size(), 1, F); \
+ fclose(F);
+ }
+ }
+ using namespace MediaInfo_Config_MediaInfo_Debug;
+
+ #define MEDIAINFO_DEBUG1(_NAME,_TOAPPEND) \
+ Debug_Open(false); \
+ Debug+=", ";Debug+=_NAME; \
+ _TOAPPEND; \
+ Debug_Close();
+
+ #define MEDIAINFO_DEBUG2(_NAME,_TOAPPEND) \
+ Debug_Open(true); \
+ Debug+=", ";Debug+=_NAME; \
+ _TOAPPEND; \
+ Debug_Close();
+#else // MEDIAINFO_DEBUG
+ #define MEDIAINFO_DEBUG1(_NAME,__TOAPPEND)
+ #define MEDIAINFO_DEBUG2(_NAME,__TOAPPEND)
+#endif // MEDIAINFO_DEBUG
+
namespace MediaInfoLib
{
@@ -58,9 +149,11 @@ MediaInfo_Config_MediaInfo::MediaInfo_Config_MediaInfo()
#if MEDIAINFO_ADVANCED
File_IgnoreSequenceFileSize=false;
File_IgnoreSequenceFilesCount=false;
+ File_SequenceFilesSkipFrames=0;
File_DefaultFrameRate=0;
File_Source_List=false;
File_RiskyBitRateEstimation=false;
+ File_MergeBitRateInfo=true;
#if MEDIAINFO_DEMUX
File_Demux_Unpacketize_StreamLayoutChange_Skip=false;
#endif //MEDIAINFO_DEMUX
@@ -105,10 +198,12 @@ MediaInfo_Config_MediaInfo::MediaInfo_Config_MediaInfo()
Demux_FirstFrameNumber=(int64u)-1;
Demux_InitData=0; //In Demux event
#endif //MEDIAINFO_DEMUX
- #if MEDIAINFO_IBI
- Ibi_Create=false;
+ #if MEDIAINFO_IBIUSAGE
Ibi_UseIbiInfoIfAvailable=false;
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
+ #if MEDIAINFO_IBIUSAGE
+ Ibi_Create=false;
+ #endif //MEDIAINFO_IBIUSAGE
//Specific
File_MpegTs_ForceMenu=false;
@@ -148,11 +243,12 @@ MediaInfo_Config_MediaInfo::MediaInfo_Config_MediaInfo()
File_Buffer_Repeat_IsSupported=false;
File_IsGrowing=false;
File_IsNotGrowingAnymore=false;
+ File_IsImageSequence=false;
File_Current_Offset=0;
File_Current_Size=(int64u)-1;
- File_IgnoreFramesBefore=0;
- File_IgnoreFramesAfter=(int64u)-1;
- File_IgnoreFramesRate=0;
+ File_IgnoreEditsBefore=0;
+ File_IgnoreEditsAfter=(int64u)-1;
+ File_EditRate=0;
File_Size=(int64u)-1;
ParseSpeed=MediaInfoLib::Config.ParseSpeed_Get();
#if MEDIAINFO_EVENTS
@@ -308,6 +404,15 @@ Ztring MediaInfo_Config_MediaInfo::Option (const String &Option, const String &V
return __T("Disabled due to compilation options");
#endif //MEDIAINFO_MD5
}
+ else if (Option_Lower==__T("file_sequencefilesskipframes") || Option_Lower==__T("file_sequencefileskipframes"))
+ {
+ #if MEDIAINFO_ADVANCED
+ File_SequenceFilesSkipFrames_Set(Ztring(Value).To_int64u());
+ return Ztring();
+ #else //MEDIAINFO_ADVANCED
+ return __T("Disabled due to compilation options");
+ #endif //MEDIAINFO_ADVANCED
+ }
else if (Option_Lower==__T("file_defaultframerate"))
{
#if MEDIAINFO_MD5
@@ -335,6 +440,15 @@ Ztring MediaInfo_Config_MediaInfo::Option (const String &Option, const String &V
return __T("Advanced features are disabled due to compilation options");
#endif //MEDIAINFO_ADVANCED
}
+ else if (Option_Lower==__T("file_mergebitrateinfo"))
+ {
+ #if MEDIAINFO_ADVANCED
+ File_MergeBitRateInfo_Set(!(Value==__T("0") || Value.empty()));
+ return Ztring();
+ #else //MEDIAINFO_ADVANCED
+ return __T("Advanced features are disabled due to compilation options");
+ #endif //MEDIAINFO_ADVANCED
+ }
else if (Option_Lower==__T("file_demux_unpacketize_streamlayoutchange_skip"))
{
#if MEDIAINFO_DEMUX
@@ -616,36 +730,36 @@ Ztring MediaInfo_Config_MediaInfo::Option (const String &Option, const String &V
}
else if (Option_Lower==__T("file_ibi"))
{
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
Ibi_Set(Value);
return Ztring();
- #else //MEDIAINFO_IBI
+ #else //MEDIAINFO_IBIUSAGE
return __T("IBI support is disabled due to compilation options");
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
}
else if (Option_Lower==__T("file_ibi_create"))
{
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
if (Ztring(Value).To_int64u()==0)
Ibi_Create_Set(false);
else
Ibi_Create_Set(true);
return Ztring();
- #else //MEDIAINFO_IBI
+ #else //MEDIAINFO_IBIUSAGE
return __T("IBI support is disabled due to compilation options");
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
}
else if (Option_Lower==__T("file_ibi_useibiinfoifavailable"))
{
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
if (Ztring(Value).To_int64u()==0)
Ibi_UseIbiInfoIfAvailable_Set(false);
else
Ibi_UseIbiInfoIfAvailable_Set(true);
return Ztring();
- #else //MEDIAINFO_IBI
+ #else //MEDIAINFO_IBIUSAGE
return __T("IBI support is disabled due to compilation options");
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
}
else if (Option_Lower==__T("file_encryption_format"))
{
@@ -1194,6 +1308,21 @@ bool MediaInfo_Config_MediaInfo::File_IgnoreSequenceFilesCount_Get ()
//---------------------------------------------------------------------------
#if MEDIAINFO_ADVANCED
+void MediaInfo_Config_MediaInfo::File_SequenceFilesSkipFrames_Set (int64u NewValue)
+{
+ CriticalSectionLocker CSL(CS);
+ File_SequenceFilesSkipFrames=NewValue;
+}
+
+int64u MediaInfo_Config_MediaInfo::File_SequenceFilesSkipFrames_Get ()
+{
+ CriticalSectionLocker CSL(CS);
+ return File_SequenceFilesSkipFrames;
+}
+#endif //MEDIAINFO_ADVANCED
+
+//---------------------------------------------------------------------------
+#if MEDIAINFO_ADVANCED
void MediaInfo_Config_MediaInfo::File_DefaultFrameRate_Set (float64 NewValue)
{
CriticalSectionLocker CSL(CS);
@@ -1241,6 +1370,21 @@ bool MediaInfo_Config_MediaInfo::File_RiskyBitRateEstimation_Get ()
#endif //MEDIAINFO_ADVANCED
//---------------------------------------------------------------------------
+#if MEDIAINFO_ADVANCED
+void MediaInfo_Config_MediaInfo::File_MergeBitRateInfo_Set (bool NewValue)
+{
+ CriticalSectionLocker CSL(CS);
+ File_MergeBitRateInfo=NewValue;
+}
+
+bool MediaInfo_Config_MediaInfo::File_MergeBitRateInfo_Get ()
+{
+ CriticalSectionLocker CSL(CS);
+ return File_MergeBitRateInfo;
+}
+#endif //MEDIAINFO_ADVANCED
+
+//---------------------------------------------------------------------------
#if MEDIAINFO_DEMUX
#if MEDIAINFO_ADVANCED
void MediaInfo_Config_MediaInfo::File_Demux_Unpacketize_StreamLayoutChange_Skip_Set (bool NewValue)
@@ -1675,7 +1819,7 @@ int8u MediaInfo_Config_MediaInfo::Demux_InitData_Get ()
// IBI support
//***************************************************************************
-#if MEDIAINFO_IBI
+#if MEDIAINFO_IBIUSAGE
//---------------------------------------------------------------------------
void MediaInfo_Config_MediaInfo::Ibi_Set (const Ztring &Value)
{
@@ -1692,31 +1836,33 @@ string MediaInfo_Config_MediaInfo::Ibi_Get ()
}
//---------------------------------------------------------------------------
-void MediaInfo_Config_MediaInfo::Ibi_Create_Set (bool NewValue)
+void MediaInfo_Config_MediaInfo::Ibi_UseIbiInfoIfAvailable_Set (bool NewValue)
{
CriticalSectionLocker CSL(CS);
- Ibi_Create=NewValue;
+ Ibi_UseIbiInfoIfAvailable=NewValue;
}
-bool MediaInfo_Config_MediaInfo::Ibi_Create_Get ()
+bool MediaInfo_Config_MediaInfo::Ibi_UseIbiInfoIfAvailable_Get ()
{
CriticalSectionLocker CSL(CS);
- return Ibi_Create;
+ return Ibi_UseIbiInfoIfAvailable;
}
+#endif //MEDIAINFO_IBIUSAGE
+#if MEDIAINFO_IBIUSAGE
//---------------------------------------------------------------------------
-void MediaInfo_Config_MediaInfo::Ibi_UseIbiInfoIfAvailable_Set (bool NewValue)
+void MediaInfo_Config_MediaInfo::Ibi_Create_Set (bool NewValue)
{
CriticalSectionLocker CSL(CS);
- Ibi_UseIbiInfoIfAvailable=NewValue;
+ Ibi_Create=NewValue;
}
-bool MediaInfo_Config_MediaInfo::Ibi_UseIbiInfoIfAvailable_Get ()
+bool MediaInfo_Config_MediaInfo::Ibi_Create_Get ()
{
CriticalSectionLocker CSL(CS);
- return Ibi_UseIbiInfoIfAvailable;
+ return Ibi_Create;
}
-#endif //MEDIAINFO_IBI
+#endif //MEDIAINFO_IBIUSAGE
//***************************************************************************
// Encryption
@@ -2087,20 +2233,20 @@ void MediaInfo_Config_MediaInfo::Event_Send (File__Analyze* Source, const int8u*
Temp->PTS-=Demux_Offset_DTS_FromStream;
}
}
- if (File_IgnoreFramesBefore)
+ if (File_IgnoreEditsBefore)
{
if (Temp->FrameNumber!=(int64u)-1)
{
- if (Temp->FrameNumber>File_IgnoreFramesBefore)
- Temp->FrameNumber-=File_IgnoreFramesBefore;
+ if (Temp->FrameNumber>File_IgnoreEditsBefore)
+ Temp->FrameNumber-=File_IgnoreEditsBefore;
else
Temp->FrameNumber=0;
}
if (Temp->DTS!=(int64u)-1)
{
- if (File_IgnoreFramesBefore && File_IgnoreFramesRate)
+ if (File_IgnoreEditsBefore && File_EditRate)
{
- int64u TimeOffset=float64_int64s(((float64)File_IgnoreFramesBefore)/File_IgnoreFramesRate*1000000000);
+ int64u TimeOffset=float64_int64s(((float64)File_IgnoreEditsBefore)/File_EditRate*1000000000);
if (Temp->DTS>TimeOffset)
Temp->DTS-=TimeOffset;
else
@@ -2109,9 +2255,9 @@ void MediaInfo_Config_MediaInfo::Event_Send (File__Analyze* Source, const int8u*
}
if (Temp->PTS!=(int64u)-1)
{
- if (File_IgnoreFramesBefore && File_IgnoreFramesRate)
+ if (File_IgnoreEditsBefore && File_EditRate)
{
- int64u TimeOffset=float64_int64s(((float64)File_IgnoreFramesBefore)/File_IgnoreFramesRate*1000000000);
+ int64u TimeOffset=float64_int64s(((float64)File_IgnoreEditsBefore)/File_EditRate*1000000000);
if (Temp->PTS>TimeOffset)
Temp->PTS-=TimeOffset;
else
@@ -2156,7 +2302,15 @@ void MediaInfo_Config_MediaInfo::Event_Send (File__Analyze* Source, const int8u*
}
}
else if (Event_CallBackFunction)
+ {
+ MEDIAINFO_DEBUG1( "CallBackFunction",
+ Debug+=", EventID=";Debug+=Ztring::ToZtring(LittleEndian2int32u(Data_Content), 16).To_UTF8();)
+
Event_CallBackFunction ((unsigned char*)Data_Content, Data_Size, Event_UserHandler);
+
+ MEDIAINFO_DEBUG2( "CallBackFunction",
+ )
+ }
else if (!File_Name.empty())
{
MediaInfo_Event_Generic* Event_Generic=(MediaInfo_Event_Generic*)Data_Content;
diff --git a/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Config_MediaInfo.h b/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Config_MediaInfo.h
index 4657c99e7..29c9b048b 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Config_MediaInfo.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Config_MediaInfo.h
@@ -121,6 +121,11 @@ public :
#endif //MEDIAINFO_ADVANCED
#if MEDIAINFO_ADVANCED
+ void File_SequenceFilesSkipFrames_Set (int64u NewValue);
+ int64u File_SequenceFilesSkipFrames_Get ();
+ #endif //MEDIAINFO_ADVANCED
+
+ #if MEDIAINFO_ADVANCED
void File_DefaultFrameRate_Set (float64 NewValue);
float64 File_DefaultFrameRate_Get ();
#endif //MEDIAINFO_ADVANCED
@@ -133,6 +138,8 @@ public :
#if MEDIAINFO_ADVANCED
void File_RiskyBitRateEstimation_Set (bool NewValue);
bool File_RiskyBitRateEstimation_Get ();
+ void File_MergeBitRateInfo_Set (bool NewValue);
+ bool File_MergeBitRateInfo_Get ();
#endif //MEDIAINFO_ADVANCED
#if MEDIAINFO_DEMUX
@@ -269,14 +276,16 @@ public :
int8u Demux_InitData_Get ();
#endif //MEDIAINFO_DEMUX
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
void Ibi_Set (const Ztring &NewValue);
std::string Ibi_Get ();
- void Ibi_Create_Set (bool NewValue);
- bool Ibi_Create_Get ();
void Ibi_UseIbiInfoIfAvailable_Set (bool NewValue);
bool Ibi_UseIbiInfoIfAvailable_Get ();
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
+ #if MEDIAINFO_IBIUSAGE
+ void Ibi_Create_Set (bool NewValue);
+ bool Ibi_Create_Get ();
+ #endif //MEDIAINFO_IBIUSAGE
//Specific
void File_MpegTs_ForceMenu_Set (bool NewValue);
@@ -341,11 +350,12 @@ public :
bool File_Buffer_Repeat_IsSupported;
bool File_IsGrowing;
bool File_IsNotGrowingAnymore;
+ bool File_IsImageSequence;
int64u File_Current_Offset;
int64u File_Current_Size;
- int64u File_IgnoreFramesBefore;
- int64u File_IgnoreFramesAfter;
- float64 File_IgnoreFramesRate;
+ int64u File_IgnoreEditsBefore;
+ int64u File_IgnoreEditsAfter;
+ float64 File_EditRate;
int64u File_Size;
float32 ParseSpeed;
#if MEDIAINFO_EVENTS
@@ -381,9 +391,11 @@ private :
#if MEDIAINFO_ADVANCED
bool File_IgnoreSequenceFileSize;
bool File_IgnoreSequenceFilesCount;
+ int64u File_SequenceFilesSkipFrames;
float64 File_DefaultFrameRate;
bool File_Source_List;
bool File_RiskyBitRateEstimation;
+ bool File_MergeBitRateInfo;
#if MEDIAINFO_DEMUX
bool File_Demux_Unpacketize_StreamLayoutChange_Skip;
#endif //MEDIAINFO_DEMUX
@@ -472,11 +484,13 @@ private :
int8u Demux_InitData;
#endif //MEDIAINFO_DEMUX
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
std::string Ibi;
- bool Ibi_Create;
bool Ibi_UseIbiInfoIfAvailable;
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
+ #if MEDIAINFO_IBIUSAGE
+ bool Ibi_Create;
+ #endif //MEDIAINFO_IBIUSAGE
//Specific
bool File_MpegTs_ForceMenu;
diff --git a/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_File.cpp b/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_File.cpp
index 4646d6fcc..59f97c423 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_File.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_File.cpp
@@ -200,6 +200,9 @@
#if defined(MEDIAINFO_AU_YES)
#include "MediaInfo/Audio/File_Au.h"
#endif
+#if defined(MEDIAINFO_CAF_YES)
+ #include "MediaInfo/Audio/File_Caf.h"
+#endif
#if defined(MEDIAINFO_DTS_YES)
#include "MediaInfo/Audio/File_Dts.h"
#endif
@@ -296,6 +299,9 @@
#if defined(MEDIAINFO_BMP_YES)
#include "MediaInfo/Image/File_Bmp.h"
#endif
+#if defined(MEDIAINFO_BPG_YES)
+ #include "MediaInfo/Image/File_Bpg.h"
+#endif
#if defined(MEDIAINFO_DDS_YES)
#include "MediaInfo/Image/File_Dds.h"
#endif
@@ -564,6 +570,9 @@ bool MediaInfo_Internal::SelectFromExtension (const String &Parser)
#if defined(MEDIAINFO_AU_YES)
else if (Parser==__T("Au")) Info=new File_Au();
#endif
+ #if defined(MEDIAINFO_CAF_YES)
+ else if (Parser==__T("Caf")) Info=new File_Caf();
+ #endif
#if defined(MEDIAINFO_DTS_YES)
else if (Parser==__T("Dts")) Info=new File_Dts();
#endif
@@ -657,6 +666,9 @@ bool MediaInfo_Internal::SelectFromExtension (const String &Parser)
#if defined(MEDIAINFO_BMP_YES)
else if (Parser==__T("Bmp")) Info=new File_Bmp();
#endif
+ #if defined(MEDIAINFO_BPG_YES)
+ else if (Parser==__T("Bpg")) Info=new File_Bpg();
+ #endif
#if defined(MEDIAINFO_DDS_YES)
else if (Parser==__T("Dds")) Info=new File_Dds();
#endif
@@ -918,6 +930,9 @@ int MediaInfo_Internal::ListFormats(const String &File_Name)
#if defined(MEDIAINFO_AU_YES)
delete Info; Info=new File_Au(); if (((Reader_File*)Reader)->Format_Test_PerParser(this, File_Name)>0) return 1;
#endif
+ #if defined(MEDIAINFO_CAF_YES)
+ delete Info; Info=new File_Caf(); if (((Reader_File*)Reader)->Format_Test_PerParser(this, File_Name)>0) return 1;
+ #endif
#if defined(MEDIAINFO_DTS_YES)
delete Info; Info=new File_Dts(); if (((Reader_File*)Reader)->Format_Test_PerParser(this, File_Name)>0) return 1;
#endif
@@ -1007,6 +1022,9 @@ int MediaInfo_Internal::ListFormats(const String &File_Name)
#if defined(MEDIAINFO_BMP_YES)
delete Info; Info=new File_Bmp(); if (((Reader_File*)Reader)->Format_Test_PerParser(this, File_Name)>0) return 1;
#endif
+ #if defined(MEDIAINFO_BPG_YES)
+ delete Info; Info=new File_Bpg(); if (((Reader_File*)Reader)->Format_Test_PerParser(this, File_Name)>0) return 1;
+ #endif
#if defined(MEDIAINFO_DDS_YES)
delete Info; Info=new File_Dds(); if (((Reader_File*)Reader)->Format_Test_PerParser(this, File_Name)>0) return 1;
#endif
diff --git a/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Inform.cpp b/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Inform.cpp
index 604fb2f02..5ee7305a2 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Inform.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Inform.cpp
@@ -24,11 +24,20 @@
//---------------------------------------------------------------------------
#include "ZenLib/Utils.h"
-#include "MediaInfo/Export/Export_EbuCore.h"
-#include "MediaInfo/Export/Export_Mpeg7.h"
-#include "MediaInfo/Export/Export_reVTMD.h"
-#include "MediaInfo/Export/Export_PBCore.h"
-#include "MediaInfo/Export/Export_PBCore2.h"
+#if defined(MEDIAINFO_EBUCORE_YES)
+ #include "MediaInfo/Export/Export_EbuCore.h"
+#endif //defined(MEDIAINFO_EBUCORE_YES)
+#if defined(MEDIAINFO_MPEG7_YES)
+ #include "MediaInfo/Export/Export_Mpeg7.h"
+#endif //defined(MEDIAINFO_MPEG7_YES)
+#if defined(MEDIAINFO_REVTMD_YES)
+ #include "MediaInfo/Export/Export_reVTMD.h"
+#endif //defined(MEDIAINFO_REVTMD_YES)
+#if defined(MEDIAINFO_PBCORE_YES)
+ #include "MediaInfo/Export/Export_PBCore.h"
+ #include "MediaInfo/Export/Export_PBCore2.h"
+#endif //defined(MEDIAINFO_PBCORE_YES)
+#include "MediaInfo/MediaInfo_Internal.h"
#include "MediaInfo/File__Analyze.h"
#include "base64.h"
//---------------------------------------------------------------------------
@@ -62,16 +71,28 @@ Ztring MediaInfo_Internal::Inform()
}
#endif //MEDIAINFO_TRACE
- if (MediaInfoLib::Config.Inform_Get()==__T("EBUCore") || MediaInfoLib::Config.Inform_Get()==__T("EBUCore_1.5"))
- return Export_EbuCore().Transform(*this);
- if (MediaInfoLib::Config.Inform_Get()==__T("MPEG-7"))
- return Export_Mpeg7().Transform(*this);
- if (MediaInfoLib::Config.Inform_Get()==__T("PBCore") || MediaInfoLib::Config.Inform_Get()==__T("PBCore_1.2"))
- return Export_PBCore().Transform(*this);
- if (MediaInfoLib::Config.Inform_Get()==__T("PBCore2") || MediaInfoLib::Config.Inform_Get()==__T("PBCore_2.0"))
- return Export_PBCore2().Transform(*this);
- if (MediaInfoLib::Config.Inform_Get()==__T("reVTMD"))
- return __T("reVTMD is disabled due to its non-free licensing."); //return Export_reVTMD().Transform(*this);
+ #if defined(MEDIAINFO_EBUCORE_YES)
+ if (MediaInfoLib::Config.Inform_Get()==__T("EBUCore_1.6"))
+ return Export_EbuCore().Transform(*this, Export_EbuCore::Version_1_6);
+ if (MediaInfoLib::Config.Inform_Get()==__T("EBUCore") || MediaInfoLib::Config.Inform_Get()==__T("EBUCore_1.5"))
+ return Export_EbuCore().Transform(*this);
+ #endif //defined(MEDIAINFO_EBUCORE_YES)
+ #if defined(MEDIAINFO_MPEG7_YES)
+ if (MediaInfoLib::Config.Inform_Get()==__T("MPEG-7"))
+ return Export_Mpeg7().Transform(*this);
+ #endif //defined(MEDIAINFO_MPEG7_YES)
+ #if defined(MEDIAINFO_PBCORE_YES)
+ if (MediaInfoLib::Config.Inform_Get()==__T("PBCore") || MediaInfoLib::Config.Inform_Get()==__T("PBCore_1.2"))
+ return Export_PBCore().Transform(*this);
+ if (MediaInfoLib::Config.Inform_Get()==__T("PBCore2") || MediaInfoLib::Config.Inform_Get()==__T("PBCore_2.0"))
+ return Export_PBCore2().Transform(*this);
+ #endif //defined(MEDIAINFO_PBCORE_YES)
+ #if defined(MEDIAINFO_REVTMD_YES)
+ if (MediaInfoLib::Config.Inform_Get()==__T("reVTMD"))
+ return __T("reVTMD is disabled due to its non-free licensing."); //return Export_reVTMD().Transform(*this);
+ #endif //defined(MEDIAINFO_REVTMD_YES)
+
+ #if defined(MEDIAINFO_CUSTOM_YES)
if (!(
MediaInfoLib::Config.Inform_Get(__T("General")).empty()
@@ -170,6 +191,9 @@ Ztring MediaInfo_Internal::Inform()
return Retour;
}
+ #endif //defined(MEDIAINFO_CUSTOM_YES)
+
+ #if defined(MEDIAINFO_TEXT_YES) || defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_CSV_YES)
//Informations
Ztring Retour;
@@ -248,9 +272,16 @@ Ztring MediaInfo_Internal::Inform()
Retour.FindAndReplace(__T("|SC9|"), __T("),"), 0, Ztring_Recursive);
return Retour;
+
+ #else //defined(MEDIAINFO_TEXT_YES) || defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_CSV_YES)
+
+ return Ztring(); //Disabled
+
+ #endif //defined(MEDIAINFO_TEXT_YES) || defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_CSV_YES)
}
//---------------------------------------------------------------------------
+#if defined(MEDIAINFO_TEXT_YES) || defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_CSV_YES) || defined(MEDIAINFO_CUSTOM_YES)
Ztring MediaInfo_Internal::Inform (stream_t StreamKind, size_t StreamPos, bool IsDirect)
{
//Integrity
@@ -266,15 +297,30 @@ Ztring MediaInfo_Internal::Inform (stream_t StreamKind, size_t StreamPos, bool I
&& MediaInfoLib::Config.Inform_Get(__T("Menu")).empty())
{
Ztring Retour;
- bool HTML=false;
- bool XML=false;
- bool CSV=false;
- if (MediaInfoLib::Config.Inform_Get()==__T("HTML"))
- HTML=true;
- if (MediaInfoLib::Config.Inform_Get()==__T("XML"))
- XML=true;
- if (MediaInfoLib::Config.Inform_Get()==__T("CSV"))
- CSV=true;
+ #if defined(MEDIAINFO_HTML_YES)
+ bool HTML=MediaInfoLib::Config.Inform_Get()==__T("HTML")?true:false;
+ #endif //defined(MEDIAINFO_HTML_YES)
+ #if defined(MEDIAINFO_XML_YES)
+ bool XML=MediaInfoLib::Config.Inform_Get()==__T("XML")?true:false;
+ #endif //defined(MEDIAINFO_XML_YES)
+ #if defined(MEDIAINFO_CSV_YES)
+ bool CSV=MediaInfoLib::Config.Inform_Get()==__T("CSV")?true:false;
+ #endif //defined(MEDIAINFO_CSV_YES)
+ #if defined(MEDIAINFO_TEXT_YES) && (defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_CSV_YES))
+ bool Text=true;
+ #if defined(MEDIAINFO_HTML_YES)
+ if (HTML)
+ Text=false;
+ #endif //defined(MEDIAINFO_HTML_YES)
+ #if defined(MEDIAINFO_XML_YES)
+ if (XML)
+ Text=false;
+ #endif //defined(MEDIAINFO_XML_YES)
+ #if defined(MEDIAINFO_CSV_YES)
+ if (CSV)
+ Text=false;
+ #endif //defined(MEDIAINFO_CSV_YES)
+ #endif //defined(MEDIAINFO_TEXT_YES) && (defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_CSV_YES))
size_t Size=Count_Get(StreamKind, StreamPos);
for (size_t Champ_Pos=0; Champ_Pos<Size; Champ_Pos++)
{
@@ -286,7 +332,9 @@ Ztring MediaInfo_Internal::Inform (stream_t StreamKind, size_t StreamPos, bool I
Ztring Nom=Get((stream_t)StreamKind, StreamPos, Champ_Pos, Info_Name_Text);
if (Nom.empty())
Nom=Get((stream_t)StreamKind, StreamPos, Champ_Pos, Info_Name); //Texte n'existe pas
- if (!HTML && !XML && !CSV)
+ #if defined(MEDIAINFO_TEXT_YES) && (defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_CSV_YES))
+ if (Text)
+ #endif //defined(MEDIAINFO_TEXT_YES) && (defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_CSV_YES))
{
int8u Nom_Size=MediaInfoLib::Config.Language_Get(__T(" Config_Text_ColumnSize")).To_int8u();
if (Nom_Size==0)
@@ -295,6 +343,7 @@ Ztring MediaInfo_Internal::Inform (stream_t StreamKind, size_t StreamPos, bool I
}
Ztring Valeur=Get((stream_t)StreamKind, StreamPos, Champ_Pos, Info_Text);
Valeur.FindAndReplace(__T("\\"), __T("|SC1|"), 0, Ztring_Recursive);
+ #if defined(MEDIAINFO_HTML_YES)
if (HTML)
{
Retour+=__T(" <tr>\n <td><i>");
@@ -303,7 +352,9 @@ Ztring MediaInfo_Internal::Inform (stream_t StreamKind, size_t StreamPos, bool I
Retour+=Valeur;
Retour+=__T("</td>\n </tr>");
}
- else if (XML)
+ #endif //defined(MEDIAINFO_HTML_YES)
+ #if defined(MEDIAINFO_XML_YES)
+ if (XML)
{
Nom=Xml_Name_Escape(Nom);
size_t Modified;
@@ -322,13 +373,18 @@ Ztring MediaInfo_Internal::Inform (stream_t StreamKind, size_t StreamPos, bool I
Retour+=Nom;
Retour+=__T(">");
}
- else if (CSV)
+ #endif //defined(MEDIAINFO_XML_YES)
+ #if defined(MEDIAINFO_CSV_YES)
+ if (CSV)
{
Retour+=Nom;
Retour+=__T(",");
Retour+=Valeur;
}
- else
+ #endif //defined(MEDIAINFO_CSV_YES)
+ #if defined(MEDIAINFO_TEXT_YES) && (defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_CSV_YES))
+ if (Text)
+ #endif //defined(MEDIAINFO_TEXT_YES) && (defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_CSV_YES))
Retour+=Nom + MediaInfoLib::Config.Language_Get(__T(" Config_Text_Separator")) + Valeur;
Retour+=MediaInfoLib::Config.LineSeparator_Get();
}
@@ -481,8 +537,10 @@ Ztring MediaInfo_Internal::Inform (stream_t StreamKind, size_t StreamPos, bool I
return Retour;
}
+#endif //defined(MEDIAINFO_TEXT_YES) || defined(MEDIAINFO_HTML_YES) || defined(MEDIAINFO_XML_YES) || defined(MEDIAINFO_CSV_YES) || defined(MEDIAINFO_CUSTOM_YES)
//---------------------------------------------------------------------------
+#if defined(MEDIAINFO_CUSTOM_YES)
void MediaInfo_Internal::Traiter(Ztring &C)
{
//$if(%a%,zezeze%a%,rrere)
@@ -509,8 +567,10 @@ void MediaInfo_Internal::Traiter(Ztring &C)
C.FindAndReplace(__T("|SC9|"), __T("),"), 0, Ztring_Recursive);
//C.FindAndReplace(__T("\\r\\n"), __T("\n"), 0, Ztring_Recursive);
}
+#endif //defined(MEDIAINFO_CUSTOM_YES)
//---------------------------------------------------------------------------
+#if defined(MEDIAINFO_XML_YES)
Ztring MediaInfo_Internal::Xml_Name_Escape (const Ztring &Name)
{
Ztring ToReturn(Name);
@@ -541,15 +601,19 @@ Ztring MediaInfo_Internal::Xml_Name_Escape (const Ztring &Name)
return ToReturn;
}
+#endif //defined(MEDIAINFO_XML_YES)
//---------------------------------------------------------------------------
+#if defined(MEDIAINFO_XML_YES)
Ztring MediaInfo_Internal::Xml_Content_Escape (const Ztring &Content, size_t &Modified)
{
Ztring ToReturn(Content);
return Xml_Content_Escape_Modifying(ToReturn, Modified);
}
+#endif //defined(MEDIAINFO_XML_YES)
//---------------------------------------------------------------------------
+#if defined(MEDIAINFO_XML_YES)
size_t Xml_Content_Escape_MustEscape(const Ztring &Content)
{
size_t Pos=0;
@@ -629,5 +693,6 @@ Ztring &MediaInfo_Internal::Xml_Content_Escape_Modifying (Ztring &Content, size_
return Content;
}
+#endif //defined(MEDIAINFO_XML_YES)
} //NameSpace
diff --git a/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Internal.cpp b/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Internal.cpp
index 6733cfc32..4c6f28398 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Internal.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Internal.cpp
@@ -327,7 +327,7 @@ size_t MediaInfo_Internal::Open(const String &File_Name_)
Close();
//External IBI
- #if defined(MEDIAINFO_IBI_YES)
+ #if MEDIAINFO_IBIUSAGE
if (Config.Ibi_UseIbiInfoIfAvailable_Get())
{
std::string IbiFile=Config.Ibi_Get();
@@ -345,7 +345,7 @@ size_t MediaInfo_Internal::Open(const String &File_Name_)
Close();
}
}
- #endif //MEDIAINFO_IBI_YES
+ #endif //MEDIAINFO_IBIUSAGE
CS.Enter();
MEDIAINFO_DEBUG_CONFIG_TEXT(Debug+=__T("Open, File=");Debug+=Ztring(File_Name_).c_str();)
@@ -472,6 +472,12 @@ void MediaInfo_Internal::Entry()
Ztring FileExtension=Test.Extension_Get();
FileExtension.MakeLowerCase();
+ if (FileExtension!=__T("cap"))
+ {
+ Test.Extension_Set(__T("cap"));
+ if (File::Exists(Test))
+ Dxw+=" <clip file=\""+Test.Name_Get().To_UTF8()+".cap\" />\r\n";
+ }
if (FileExtension!=__T("dfxp"))
{
Test.Extension_Set(__T("dfxp"));
@@ -702,21 +708,22 @@ size_t MediaInfo_Internal::Open_Buffer_Init (int64u File_Size_, const String &Fi
Info->File_Name=File_Name;
Info->Open_Buffer_Init(File_Size_);
- #if MEDIAINFO_EVENTS
- {
- string File_Name_Local=Ztring(File_Name).To_Local();
- wstring File_Name_Unicode=Ztring(File_Name).To_Unicode();
- struct MediaInfo_Event_General_Start_0 Event;
- memset(&Event, 0xFF, sizeof(struct MediaInfo_Event_Generic));
- Event.EventCode=MediaInfo_EventCode_Create(MediaInfo_Parser_None, MediaInfo_Event_General_Start, 0);
- Event.EventSize=sizeof(struct MediaInfo_Event_General_Start_0);
- Event.StreamIDs_Size=0;
- Event.Stream_Size=File_Size_;
- Event.FileName=File_Name_Local.c_str();
- Event.FileName_Unicode=File_Name_Unicode.c_str();
- Config.Event_Send(NULL, (const int8u*)&Event, sizeof(MediaInfo_Event_General_Start_0));
- }
- #endif //MEDIAINFO_EVENTS
+ if (File_Name.empty())
+ {
+ #if MEDIAINFO_EVENTS
+ {
+ struct MediaInfo_Event_General_Start_0 Event;
+ memset(&Event, 0xFF, sizeof(struct MediaInfo_Event_Generic));
+ Event.EventCode=MediaInfo_EventCode_Create(MediaInfo_Parser_None, MediaInfo_Event_General_Start, 0);
+ Event.EventSize=sizeof(struct MediaInfo_Event_General_Start_0);
+ Event.StreamIDs_Size=0;
+ Event.Stream_Size=File_Size_;
+ Event.FileName=NULL;
+ Event.FileName_Unicode=NULL;
+ Config.Event_Send(NULL, (const int8u*)&Event, sizeof(MediaInfo_Event_General_Start_0));
+ }
+ #endif //MEDIAINFO_EVENTS
+ }
return 1;
}
@@ -1076,6 +1083,10 @@ Ztring MediaInfo_Internal::Get(stream_t StreamKind, size_t StreamPos, const Stri
return Get(Stream_General, StreamPos, __T("OverallBitRate_Maximum/String"), KindOfInfo, KindOfSearch);
if (Parameter==__T("AFD"))
return Get(StreamKind, StreamPos, __T("ActiveFormatDescription"), KindOfInfo, KindOfSearch);
+ if (Parameter==__T("Encoded_Application") && Info && !Info->Retrieve(StreamKind, StreamPos, "Encoded_Application/String").empty())
+ return Get(StreamKind, StreamPos, __T("Encoded_Application/String"), KindOfInfo, KindOfSearch);
+ if (Parameter==__T("Encoded_Library") && Info && !Info->Retrieve(StreamKind, StreamPos, "Encoded_Library/String").empty())
+ return Get(StreamKind, StreamPos, __T("Encoded_Library/String"), KindOfInfo, KindOfSearch);
CS.Enter();
MEDIAINFO_DEBUG_CONFIG_TEXT(Debug+=__T("Get, StreamKind=");Debug+=Ztring::ToZtring((size_t)StreamKind);Debug+=__T(", StreamKind=");Debug+=Ztring::ToZtring(StreamPos);Debug+=__T(", Parameter=");Debug+=Ztring(Parameter);)
@@ -1297,15 +1308,15 @@ String MediaInfo_Internal::Option (const String &Option, const String &Value)
{
case 1 : return __T("");
case 2 : return __T("Invalid value");
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
case 3 : return __T("Feature not supported / IBI file not provided");
case 4 : return __T("Problem during IBI file parsing");
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
case 5 : return __T("Invalid ID");
case 6 : return __T("Internal error");
- #if !MEDIAINFO_IBI
+ #if !MEDIAINFO_IBIUSAGE
case (size_t)-2 : return __T("Feature not supported / IBI support disabled due to compilation options");
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
case (size_t)-1 : return __T("Feature not supported");
default : return __T("Unknown error");
}
diff --git a/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Internal.h b/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Internal.h
index d6f873ce4..10e062c0b 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Internal.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/MediaInfo_Internal.h
@@ -116,6 +116,7 @@ private :
friend class File_DcpCpl;//Theses classes need access to internal structure for optimization. There is recursivity with theses formats
friend class File_DcpPkl;//Theses classes need access to internal structure for optimization. There is recursivity with theses formats
friend class File__ReferenceFilesHelper; //Theses classes need access to internal structure for optimization. There is recursivity with theses formats
+ friend class resource;//Theses classes need access to internal structure for optimization. There is recursivity with theses formats
friend class Reader_File; //For Info member
//Parsing handles
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Aaf.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Aaf.cpp
index fec837e28..f88975057 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Aaf.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Aaf.cpp
@@ -112,7 +112,7 @@ size_t File_Aaf::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
if (ReferenceFiles==NULL)
return 0;
- return ReferenceFiles->Read_Buffer_Seek(Method, Value, ID);
+ return ReferenceFiles->Seek(Method, Value, ID);
}
#endif //MEDIAINFO_SEEK
@@ -644,9 +644,9 @@ void File_Aaf::NetworkLocator()
Ztring Data;
Get_UTF16L(xxxSize, Data, "Data");
- File__ReferenceFilesHelper::reference ReferenceFile;
- ReferenceFile.FileNames.push_back(Data);
- ReferenceFiles->References.push_back(ReferenceFile);
+ sequence* Sequence=new sequence;
+ Sequence->AddFileName(Data);
+ ReferenceFiles->AddSequence(Sequence);
//Locators[Streams[Streams_Pos]->Directory_Pos].EssenceLocator=Data;
}
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ancillary.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ancillary.cpp
index 6c7c221a3..3abb6d1ca 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ancillary.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ancillary.cpp
@@ -37,6 +37,9 @@
#if defined(MEDIAINFO_SDP_YES)
#include "MediaInfo/Text/File_Sdp.h"
#endif
+#if defined(MEDIAINFO_MXF_YES)
+ #include "MediaInfo/Multiple/File_Mxf.h"
+#endif
#include "MediaInfo/MediaInfo_Config_MediaInfo.h"
#include <cstring>
//---------------------------------------------------------------------------
@@ -52,6 +55,7 @@ namespace MediaInfoLib
const char* Ancillary_DataID(int8u DataID, int8u SecondaryDataID)
{
+ // TODO: check http://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.1364-2-201003-I!!PDF-E.pdf
switch (DataID)
{
case 0x00 : return "Undefined";
@@ -130,6 +134,13 @@ const char* Ancillary_DataID(int8u DataID, int8u SecondaryDataID)
default : return "(Reserved)";
}
break;
+ case 0x51 :
+ switch (SecondaryDataID)
+ {
+ case 0x01 : return "Film Transfer and Video Production Information"; //RP 215
+ default : return "(Reserved)";
+ }
+ break;
case 0x5F :
switch (SecondaryDataID&0xF0)
{
@@ -230,6 +241,9 @@ File_Ancillary::File_Ancillary()
#if defined(MEDIAINFO_SDP_YES)
Sdp_Parser=NULL;
#endif //defined(MEDIAINFO_SDP_YES)
+ #if defined(MEDIAINFO_MXF_YES)
+ Rdd18_Parser=NULL;
+ #endif //defined(MEDIAINFO_MXF_YES)
}
//---------------------------------------------------------------------------
@@ -250,6 +264,9 @@ File_Ancillary::~File_Ancillary()
#if defined(MEDIAINFO_SDP_YES)
delete Sdp_Parser; //Sdp_Parser=NULL;
#endif //defined(MEDIAINFO_SDP_YES)
+ #if defined(MEDIAINFO_MXF_YES)
+ delete Rdd18_Parser; //Rdd18_Parser=NULL;
+ #endif //defined(MEDIAINFO_MXF_YES)
}
//---------------------------------------------------------------------------
@@ -300,6 +317,19 @@ void File_Ancillary::Streams_Finish()
}
}
#endif //defined(MEDIAINFO_SDP_YES)
+
+ #if defined(MEDIAINFO_MXF_YES)
+ if (Rdd18_Parser && !Rdd18_Parser->Status[IsFinished] && Rdd18_Parser->Status[IsAccepted])
+ {
+ Finish(Rdd18_Parser);
+ for (size_t StreamPos=0; StreamPos<Rdd18_Parser->Count_Get(Stream_Other); StreamPos++)
+ {
+ Merge(*Rdd18_Parser, Stream_Other, StreamPos, StreamPos);
+ Fill(Stream_Other, StreamPos_Last, Other_Format, "Acquisition Metadata", Unlimited, true, true);
+ Fill(Stream_Other, StreamPos_Last, Other_MuxingMode, "Ancillary data / RDD 18");
+ }
+ }
+ #endif //defined(MEDIAINFO_MXF_YES)
}
//***************************************************************************
@@ -414,6 +444,10 @@ void File_Ancillary::Read_Buffer_Unsynched()
if (Sdp_Parser)
Sdp_Parser->Open_Buffer_Unsynch();
#endif //defined(MEDIAINFO_SDP_YES)
+ #if defined(MEDIAINFO_MXF_YES)
+ if (Rdd18_Parser)
+ Rdd18_Parser->Open_Buffer_Unsynch();
+ #endif //defined(MEDIAINFO_MXF_YES)
AspectRatio=0;
}
@@ -629,12 +663,25 @@ void File_Ancillary::Data_Parse()
}
break;
case 0x05 : //RDD 18
+ #if defined(MEDIAINFO_MXF_YES)
+ if (Rdd18_Parser==NULL)
+ {
+ Rdd18_Parser=new File_Mxf;
+ Open_Buffer_Init(Rdd18_Parser);
+ }
+ if (!Rdd18_Parser->Status[IsFinished])
+ Open_Buffer_Continue(Rdd18_Parser, Payload+1, (size_t)DataCount-1);
+ #endif //defined(MEDIAINFO_MXF_YES)
+
+ /*
if (Count_Get(Stream_Other)==0)
{
Stream_Prepare(Stream_Other);
Fill(Stream_Other, StreamPos_Last, Other_Format, "Acquisition Metadata");
Fill(Stream_Other, StreamPos_Last, Other_MuxingMode, "Ancillary data / RDD 18");
+ Merge(*Parser, Stream_Other, 0, StreamPos_Last);
}
+ */
break;
default :
if (Count_Get(Stream_Other)==0)
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ancillary.h b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ancillary.h
index 8ad35e751..ad9359feb 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ancillary.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ancillary.h
@@ -70,6 +70,9 @@ public :
#if defined(MEDIAINFO_SDP_YES)
File__Analyze* Sdp_Parser;
#endif //defined(MEDIAINFO_ARIBSTDB24B37_YES)
+ #if defined(MEDIAINFO_MXF_YES)
+ File__Analyze* Rdd18_Parser;
+ #endif //defined(MEDIAINFO_MXF_YES)
//Constructor/Destructor
File_Ancillary();
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_DashMpd.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_DashMpd.cpp
index 34df2d016..f855a0c6d 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_DashMpd.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_DashMpd.cpp
@@ -107,7 +107,7 @@ Ztring DashMpd_codecid_CodecID (const char* codecid)
else
{
CodecID=Codecs.substr(0, DotPos);
- //TODO per format, rfc 6381 //ReferenceFile.Infos["Format_Profile"]=;
+ //TODO per format, rfc 6381 //Sequence->Infos["Format_Profile"]=;
}
CodecID.FindAndReplace(__T("0x"), Ztring(), 0, Ztring_Recursive);
@@ -117,7 +117,7 @@ Ztring DashMpd_codecid_CodecID (const char* codecid)
//---------------------------------------------------------------------------
struct template_generic
{
- File__ReferenceFilesHelper::reference ReferenceFile;
+ sequence* Sequence;
Ztring SourceDir;
Ztring BaseURL;
Ztring initialization;
@@ -144,6 +144,7 @@ struct template_generic
template_generic(const Ztring &BaseURL=Ztring(), const Ztring &SourceDir=Ztring())
{
+ Sequence=new sequence;
template_generic::BaseURL=BaseURL;
template_generic::SourceDir=SourceDir;
duration=1;
@@ -152,6 +153,20 @@ struct template_generic
startNumber_Max=0;
}
+ template_generic(const template_generic &ToCopy)
+ {
+ Sequence=new sequence;
+ *Sequence=*ToCopy.Sequence;
+ template_generic::BaseURL=ToCopy.BaseURL;
+ template_generic::SourceDir=ToCopy.SourceDir;
+ initialization=ToCopy.initialization;
+ media=ToCopy.media;
+ duration=ToCopy.duration;
+ startNumber=ToCopy.duration;
+ duration_Max=ToCopy.duration_Max;
+ startNumber_Max=ToCopy.startNumber_Max;
+ }
+
void AdaptationSet_Attributes_Parse (XMLElement* Item);
void SegmentTemplate_Attributes_Parse (XMLElement* Item);
void SegmentTimeline_Attributes_Parse (XMLElement* Item);
@@ -167,17 +182,17 @@ void template_generic::AdaptationSet_Attributes_Parse (XMLElement* Item)
//Attributes - mineType
Attribute=Item->Attribute("mimeType");
if (Attribute)
- ReferenceFile.StreamKind=DashMpd_mimeType_StreamKind(Attribute);
+ Sequence->StreamKind=DashMpd_mimeType_StreamKind(Attribute);
//Attributes - codecs
Attribute=Item->Attribute("codecs");
if (Attribute)
- ReferenceFile.Infos["CodecID"]=DashMpd_codecid_CodecID(Attribute);
+ Sequence->Infos["CodecID"]=DashMpd_codecid_CodecID(Attribute);
//Attributes - lang
Attribute=Item->Attribute("lang");
if (Attribute)
- ReferenceFile.Infos["Language"].From_UTF8(Attribute);
+ Sequence->Infos["Language"].From_UTF8(Attribute);
}
void template_generic::SegmentTemplate_Attributes_Parse (XMLElement* Item)
@@ -256,42 +271,42 @@ void template_generic::Representation_Attributes_Parse (XMLElement* Item)
Attribute=Item->Attribute("id");
if (Attribute)
{
- ReferenceFile.StreamID=Ztring().From_UTF8(Attribute).To_int64u(16);
+ Sequence->StreamID=Ztring().From_UTF8(Attribute).To_int64u(16);
}
//Attributes - bandwidth
Attribute=Item->Attribute("bandwidth");
if (Attribute)
{
- ReferenceFile.Infos["BitRate"].From_UTF8(Attribute);
+ Sequence->Infos["BitRate"].From_UTF8(Attribute);
}
//Attributes - frame size
Attribute=Item->Attribute("width");
if (Attribute)
{
- ReferenceFile.Infos["Width"].From_UTF8(Attribute);
+ Sequence->Infos["Width"].From_UTF8(Attribute);
}
Attribute=Item->Attribute("height");
if (Attribute)
{
- ReferenceFile.Infos["Height"].From_UTF8(Attribute);
+ Sequence->Infos["Height"].From_UTF8(Attribute);
}
//Attributes - mineType
Attribute=Item->Attribute("mimeType");
if (Attribute)
- ReferenceFile.StreamKind=DashMpd_mimeType_StreamKind(Attribute);
+ Sequence->StreamKind=DashMpd_mimeType_StreamKind(Attribute);
//Attributes - codecs
Attribute=Item->Attribute("codecs");
if (Attribute)
- ReferenceFile.Infos["CodecID"]=DashMpd_codecid_CodecID(Attribute);
+ Sequence->Infos["CodecID"]=DashMpd_codecid_CodecID(Attribute);
//Attributes - lang
Attribute=Item->Attribute("lang");
if (Attribute)
- ReferenceFile.Infos["Language"].From_UTF8(Attribute);
+ Sequence->Infos["Language"].From_UTF8(Attribute);
//Attributes - Saving all attributes
for (const XMLAttribute* Attribute_Item=Item->FirstAttribute(); Attribute_Item; Attribute_Item=Attribute_Item->Next())
@@ -309,7 +324,7 @@ void template_generic::Decode()
if (!initialization.empty())
{
DashMpd_Transform(initialization, Attributes_ForMedia);
- ReferenceFile.FileNames.push_back(BaseURL+initialization);
+ Sequence->AddFileName(BaseURL+initialization);
}
//media - URL decoding, template adaptation and add it
@@ -367,7 +382,7 @@ void template_generic::Decode()
File_Name+=BaseURL+Media_Name_Temp;
if (!File::Exists(File_Name))
break;
- ReferenceFile.FileNames.push_back(File_Name);
+ Sequence->AddFileName(File_Name);
Index_Pos_Temp++;
}
}
@@ -396,7 +411,7 @@ void template_generic::Decode()
Media_Name_Temp.insert(Time_Pos_Temp, Time);
}
- ReferenceFile.FileNames.push_back(BaseURL+Media_Name_Temp);
+ Sequence->AddFileName(BaseURL+Media_Name_Temp);
SegmentTimeLines_duration+=SegmentTimeLines[SegmentTimeLines_Pos].d;
SegmentTimeLines_startNumber++;
}
@@ -404,7 +419,7 @@ void template_generic::Decode()
}
}
else
- ReferenceFile.FileNames.push_back(BaseURL+media);
+ Sequence->AddFileName(BaseURL+media);
}
}
@@ -455,7 +470,7 @@ size_t File_DashMpd::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
if (ReferenceFiles==NULL)
return 0;
- return ReferenceFiles->Read_Buffer_Seek(Method, Value, ID);
+ return ReferenceFiles->Seek(Method, Value, ID);
}
#endif //MEDIAINFO_SEEK
@@ -554,7 +569,7 @@ bool File_DashMpd::FileHeader_Begin()
//BaseURL
if (string(Representation_Item->Value())=="BaseURL")
{
- Template_Generic_PerRepresentation.ReferenceFile.FileNames.push_back(BaseURL+Ztring().From_UTF8(Representation_Item->GetText()));
+ Template_Generic_PerRepresentation.Sequence->AddFileName(BaseURL+Ztring().From_UTF8(Representation_Item->GetText()));
}
//SegmentTemplate
@@ -574,7 +589,7 @@ bool File_DashMpd::FileHeader_Begin()
{
Attribute=SegmentBase_Item->Attribute("sourceURL");
if (Attribute)
- Template_Generic_PerRepresentation.ReferenceFile.FileNames.insert(Template_Generic_PerRepresentation.ReferenceFile.FileNames.begin(), BaseURL+Ztring().From_UTF8(Attribute));
+ Template_Generic_PerRepresentation.Sequence->AddFileName(BaseURL+Ztring().From_UTF8(Attribute), 0);
}
}
}
@@ -601,14 +616,14 @@ bool File_DashMpd::FileHeader_Begin()
Attribute=SegmentBase_Item->Attribute("media");
if (Attribute && IsSupported)
- Template_Generic_PerRepresentation.ReferenceFile.FileNames.push_back(BaseURL+Ztring().From_UTF8(Attribute));
+ Template_Generic_PerRepresentation.Sequence->AddFileName(BaseURL+Ztring().From_UTF8(Attribute));
}
}
}
}
Template_Generic_PerRepresentation.Decode();
- ReferenceFiles->References.push_back(Template_Generic_PerRepresentation.ReferenceFile);
+ ReferenceFiles->AddSequence(Template_Generic_PerRepresentation.Sequence);
}
}
}
@@ -616,23 +631,23 @@ bool File_DashMpd::FileHeader_Begin()
//Representation (=a stream)
if (string(Period_Item->Value())=="Representation")
{
- File__ReferenceFilesHelper::reference ReferenceFile;
+ sequence* Sequence=new sequence;
int64u duration=1;
//Attributes - mineType
Attribute=Period_Item->Attribute("mimeType");
if (Attribute)
- ReferenceFile.StreamKind=DashMpd_mimeType_StreamKind(Attribute);
+ Sequence->StreamKind=DashMpd_mimeType_StreamKind(Attribute);
//Attributes - codecs
Attribute=Period_Item->Attribute("codecs");
if (Attribute)
- ReferenceFile.Infos["CodecID"]=DashMpd_codecid_CodecID(Attribute);
+ Sequence->Infos["CodecID"]=DashMpd_codecid_CodecID(Attribute);
//Attributes - lang
Attribute=Period_Item->Attribute("lang");
if (Attribute)
- ReferenceFile.Infos["Language"].From_UTF8(Attribute);
+ Sequence->Infos["Language"].From_UTF8(Attribute);
//Sub
for (XMLElement* AdaptationSet_Item=Period_Item->FirstChildElement(); AdaptationSet_Item; AdaptationSet_Item=AdaptationSet_Item->NextSiblingElement())
@@ -655,7 +670,7 @@ bool File_DashMpd::FileHeader_Begin()
{
Attribute=SegmentInfo_Item->Attribute("sourceURL");
if (Attribute)
- ReferenceFile.FileNames.insert(ReferenceFile.FileNames.begin(), BaseURL+Ztring().From_UTF8(Attribute));
+ Sequence->AddFileName(BaseURL+Ztring().From_UTF8(Attribute), 0);
}
//Url
@@ -663,11 +678,11 @@ bool File_DashMpd::FileHeader_Begin()
{
Attribute=SegmentInfo_Item->Attribute("sourceURL");
if (Attribute)
- ReferenceFile.FileNames.push_back(BaseURL+Ztring().From_UTF8(Attribute));
+ Sequence->AddFileName(BaseURL+Ztring().From_UTF8(Attribute));
}
}
- ReferenceFiles->References.push_back(ReferenceFile);
+ ReferenceFiles->AddSequence(Sequence);
}
}
}
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_DcpAm.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_DcpAm.cpp
index 7bf2f914e..a275afa76 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_DcpAm.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_DcpAm.cpp
@@ -100,7 +100,7 @@ size_t File_DcpAm::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
if (ReferenceFiles==NULL)
return 0;
- return ReferenceFiles->Read_Buffer_Seek(Method, Value, ID);
+ return ReferenceFiles->Seek(Method, Value, ID);
}
#endif //MEDIAINFO_SEEK
@@ -254,10 +254,11 @@ bool File_DcpAm::FileHeader_Begin()
for (File_DcpPkl::streams::iterator Stream=Streams.begin(); Stream!=Streams.end(); ++Stream)
if (Stream->StreamKind==(stream_t)(Stream_Max+1) && Stream->ChunkList.size()==1) // Means CPL
{
- File__ReferenceFilesHelper::reference ReferenceFile;
- ReferenceFile.FileNames.push_back(Ztring().From_UTF8(Stream->ChunkList[0].Path));
+ sequence* Sequence=new sequence;
+ Sequence->FileNames.push_back(Ztring().From_UTF8(Stream->ChunkList[0].Path));
- ReferenceFiles->References.push_back(ReferenceFile);
+ Sequence->StreamID=ReferenceFiles->Sequences_Size()+1;
+ ReferenceFiles->AddSequence(Sequence);
}
ReferenceFiles->FilesForStorage=true;
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_DcpCpl.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_DcpCpl.cpp
index 16e983342..1f0211352 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_DcpCpl.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_DcpCpl.cpp
@@ -38,16 +38,6 @@ namespace MediaInfoLib
{
//***************************************************************************
-// Infos
-//***************************************************************************
-
-struct DcpCpl_info
-{
- Ztring FileName;
- File__ReferenceFilesHelper::references::iterator Reference;
-};
-
-//***************************************************************************
// Constructor/Destructor
//***************************************************************************
@@ -94,10 +84,10 @@ void File_DcpCpl::Streams_Finish()
#if MEDIAINFO_SEEK
size_t File_DcpCpl::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
{
- if (Config->File_IsReferenced_Get() || ReferenceFiles==NULL)
+ if (ReferenceFiles==NULL)
return 0;
- return ReferenceFiles->Read_Buffer_Seek(Method, Value, ID);
+ return ReferenceFiles->Seek(Method, Value, ID);
}
#endif //MEDIAINFO_SEEK
@@ -153,11 +143,11 @@ bool File_DcpCpl::FileHeader_Begin()
//CompositionTimecode
if (IsImf && (!strcmp(CompositionPlaylist_Item->Value(), "CompositionTimecode") || !strcmp(CompositionPlaylist_Item->Value(), "cpl:CompositionTimecode")))
{
- File__ReferenceFilesHelper::reference ReferenceFile;
- ReferenceFile.StreamKind=Stream_Other;
- ReferenceFile.Infos["Type"]=__T("Time code");
- ReferenceFile.Infos["Format"]=__T("CPL TC");
- ReferenceFile.Infos["TimeCode_Striped"]=__T("Yes");
+ sequence* Sequence=new sequence;
+ Sequence->StreamKind=Stream_Other;
+ Sequence->Infos["Type"]=__T("Time code");
+ Sequence->Infos["Format"]=__T("CPL TC");
+ Sequence->Infos["TimeCode_Striped"]=__T("Yes");
bool IsDropFrame=false;
for (XMLElement* CompositionTimecode_Item=CompositionPlaylist_Item->FirstChildElement(); CompositionTimecode_Item; CompositionTimecode_Item=CompositionTimecode_Item->NextSiblingElement())
@@ -171,27 +161,27 @@ bool File_DcpCpl::FileHeader_Begin()
//TimecodeRate
if (!strcmp(CompositionTimecode_Item->Value(), "TimecodeRate") || !strcmp(CompositionTimecode_Item->Value(), "cpl:TimecodeRate"))
- ReferenceFile.Infos["FrameRate"].From_UTF8(CompositionTimecode_Item->GetText());
+ Sequence->Infos["FrameRate"].From_UTF8(CompositionTimecode_Item->GetText());
//TimecodeStartAddress
if (!strcmp(CompositionTimecode_Item->Value(), "TimecodeStartAddress") || !strcmp(CompositionTimecode_Item->Value(), "cpl:TimecodeStartAddress"))
- ReferenceFile.Infos["TimeCode_FirstFrame"].From_UTF8(CompositionTimecode_Item->GetText());
+ Sequence->Infos["TimeCode_FirstFrame"].From_UTF8(CompositionTimecode_Item->GetText());
}
//Adaptation
if (IsDropFrame)
{
- std::map<string, Ztring>::iterator Info=ReferenceFile.Infos.find("TimeCode_FirstFrame");
- if (Info!=ReferenceFile.Infos.end() && Info->second.size()>=11 && Info->second[8]!=__T(';'))
+ std::map<string, Ztring>::iterator Info=Sequence->Infos.find("TimeCode_FirstFrame");
+ if (Info!=Sequence->Infos.end() && Info->second.size()>=11 && Info->second[8]!=__T(';'))
Info->second[8]=__T(';');
}
- ReferenceFile.StreamID=ReferenceFiles->References.size()+1;
- ReferenceFiles->References.push_back(ReferenceFile);
+ Sequence->StreamID=ReferenceFiles->Sequences_Size()+1;
+ ReferenceFiles->AddSequence(Sequence);
Stream_Prepare(Stream_Other);
- Fill(Stream_Other, StreamPos_Last, Other_ID, ReferenceFile.StreamID);
- for (std::map<string, Ztring>::iterator Info=ReferenceFile.Infos.begin(); Info!=ReferenceFile.Infos.end(); ++Info)
+ Fill(Stream_Other, StreamPos_Last, Other_ID, Sequence->StreamID);
+ for (std::map<string, Ztring>::iterator Info=Sequence->Infos.begin(); Info!=Sequence->Infos.end(); ++Info)
Fill(Stream_Other, StreamPos_Last, Info->first.c_str(), Info->second);
}
@@ -217,15 +207,15 @@ bool File_DcpCpl::FileHeader_Begin()
//if ((IsDcp && (!strcmp(AssetList_Item->Value(), "MainPicture") || !strcmp(AssetList_Item->Value(), "MainSound")))
// || (IsImf && (!strcmp(AssetList_Item->Value(), "cc:MainImageSequence") || !strcmp(AssetList_Item->Value(), "cc:MainImage"))))
{
- File__ReferenceFilesHelper::reference ReferenceFile;
+ sequence* Sequence=new sequence;
Ztring Asset_Id;
if ((IsDcp && !strcmp(AssetList_Item->Value(), "MainPicture"))
|| (IsImf && !strcmp(AssetList_Item->Value(), "cc:MainImageSequence")))
- ReferenceFile.StreamKind=Stream_Video;
+ Sequence->StreamKind=Stream_Video;
if ((IsDcp && !strcmp(AssetList_Item->Value(), "MainSound"))
|| (IsImf && !strcmp(AssetList_Item->Value(), "cc:MainAudioSequence")))
- ReferenceFile.StreamKind=Stream_Audio;
+ Sequence->StreamKind=Stream_Audio;
for (XMLElement* File_Item=AssetList_Item->FirstChildElement(); File_Item; File_Item=File_Item->NextSiblingElement())
{
@@ -243,29 +233,29 @@ bool File_DcpCpl::FileHeader_Begin()
{
Ztring Resource_Id;
- File__ReferenceFilesHelper::reference::completeduration Resource;
+ resource* Resource=new resource;
for (XMLElement* Resource_Item=ResourceList_Item->FirstChildElement(); Resource_Item; Resource_Item=Resource_Item->NextSiblingElement())
{
//EditRate
if (!strcmp(Resource_Item->Value(), "EditRate"))
{
const char* EditRate=Resource_Item->GetText();
- Resource.IgnoreFramesRate=atof(EditRate);
+ Resource->EditRate=atof(EditRate);
const char* EditRate2=strchr(EditRate, ' ');
if (EditRate2!=NULL)
{
float64 EditRate2f=atof(EditRate2);
if (EditRate2f)
- Resource.IgnoreFramesRate/=EditRate2f;
+ Resource->EditRate/=EditRate2f;
}
}
//EntryPoint
if (!strcmp(Resource_Item->Value(), "EntryPoint"))
{
- Resource.IgnoreFramesBefore=atoi(Resource_Item->GetText());
- if (Resource.IgnoreFramesAfter!=(int64u)-1)
- Resource.IgnoreFramesAfter+=Resource.IgnoreFramesBefore;
+ Resource->IgnoreEditsBefore=atoi(Resource_Item->GetText());
+ if (Resource->IgnoreEditsAfter!=(int64u)-1)
+ Resource->IgnoreEditsAfter+=Resource->IgnoreEditsBefore;
}
//Id
@@ -274,29 +264,29 @@ bool File_DcpCpl::FileHeader_Begin()
//SourceDuration
if (!strcmp(Resource_Item->Value(), "SourceDuration"))
- Resource.IgnoreFramesAfter=Resource.IgnoreFramesBefore+atoi(Resource_Item->GetText());
+ Resource->IgnoreEditsAfter=Resource->IgnoreEditsBefore+atoi(Resource_Item->GetText());
//TrackFileId
if (!strcmp(Resource_Item->Value(), "TrackFileId"))
- Resource.FileName.From_UTF8(Resource_Item->GetText());
+ Resource->FileNames.push_back(Ztring().From_UTF8(Resource_Item->GetText()));
}
- if (Resource.FileName.empty())
- Resource.FileName=Resource_Id;
- ReferenceFile.CompleteDuration.push_back(Resource);
+ if (Resource->FileNames.empty())
+ Resource->FileNames.push_back(Resource_Id);
+ Sequence->AddResource(Resource);
}
}
}
}
- if (ReferenceFile.CompleteDuration.empty())
+ if (Sequence->Resources.empty())
{
- File__ReferenceFilesHelper::reference::completeduration Resource;
- Resource.FileName=Asset_Id;
- ReferenceFile.CompleteDuration.push_back(Resource);
+ resource* Resource=new resource;
+ Resource->FileNames.push_back(Asset_Id);
+ Sequence->AddResource(Resource);
}
- ReferenceFile.StreamID=ReferenceFiles->References.size()+1;
- ReferenceFiles->References.push_back(ReferenceFile);
+ Sequence->StreamID=ReferenceFiles->Sequences_Size()+1;
+ ReferenceFiles->AddSequence(Sequence);
}
}
}
@@ -353,49 +343,9 @@ bool File_DcpCpl::FileHeader_Begin()
//---------------------------------------------------------------------------
void File_DcpCpl::MergeFromAm (File_DcpPkl::streams &StreamsToMerge)
{
- map<Ztring, File_DcpPkl::streams::iterator> Map;
for (File_DcpPkl::streams::iterator StreamToMerge=StreamsToMerge.begin(); StreamToMerge!=StreamsToMerge.end(); ++StreamToMerge)
- Map[Ztring().From_UTF8(StreamToMerge->Id)]=StreamToMerge;
-
- for (size_t References_Pos=0; References_Pos<ReferenceFiles->References.size(); ++References_Pos)
- {
- for (size_t Pos=0; Pos<ReferenceFiles->References[References_Pos].FileNames.size(); ++Pos)
- {
- map<Ztring, File_DcpPkl::streams::iterator>::iterator Map_Item=Map.find(ReferenceFiles->References[References_Pos].FileNames[Pos]);
- if (Map_Item!=Map.end() && !Map_Item->second->ChunkList.empty()) // Note: ChunkLists with more than 1 file are not yet supported
- {
- ReferenceFiles->References[References_Pos].FileNames[Pos].From_UTF8(Map_Item->second->ChunkList[0].Path);
- ReferenceFiles->References[References_Pos].Infos["UniqueID"].From_UTF8(Map_Item->second->Id);
- }
- else
- {
- ReferenceFiles->References[References_Pos].FileNames.erase(ReferenceFiles->References[References_Pos].FileNames.begin()+Pos);
- Pos--;
- }
- }
-
- for (size_t Pos=0; Pos<ReferenceFiles->References[References_Pos].CompleteDuration.size(); ++Pos)
- {
- map<Ztring, File_DcpPkl::streams::iterator>::iterator Map_Item=Map.find(ReferenceFiles->References[References_Pos].CompleteDuration[Pos].FileName);
- if (Map_Item!=Map.end() && !Map_Item->second->ChunkList.empty()) // Note: ChunkLists with more than 1 file are not yet supported
- {
- ReferenceFiles->References[References_Pos].CompleteDuration[Pos].FileName.From_UTF8(Map_Item->second->ChunkList[0].Path);
- if (ReferenceFiles->References[References_Pos].Infos["UniqueID"].empty())
- ReferenceFiles->References[References_Pos].Infos["UniqueID"].From_UTF8(Map_Item->second->Id);
- }
- else
- {
- ReferenceFiles->References[References_Pos].CompleteDuration.erase(ReferenceFiles->References[References_Pos].CompleteDuration.begin()+Pos);
- Pos--;
- }
- }
-
- if (ReferenceFiles->References[References_Pos].FileNames.empty() && ReferenceFiles->References[References_Pos].CompleteDuration.empty())
- {
- ReferenceFiles->References.erase(ReferenceFiles->References.begin()+References_Pos);
- References_Pos--;
- }
- }
+ if (!StreamToMerge->ChunkList.empty()) // Note: ChunkLists with more than 1 file are not yet supported)
+ ReferenceFiles->UpdateFileName(Ztring().From_UTF8(StreamToMerge->Id), Ztring().From_UTF8(StreamToMerge->ChunkList[0].Path));
}
} //NameSpace
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_DcpPkl.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_DcpPkl.cpp
index 6fb592d68..0014bee51 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_DcpPkl.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_DcpPkl.cpp
@@ -38,13 +38,6 @@ namespace MediaInfoLib
{
//***************************************************************************
-// Infos
-//***************************************************************************
-
-//---------------------------------------------------------------------------
-extern void DcpCpl_MergeFromAm(File__ReferenceFilesHelper* FromCpl, File__ReferenceFilesHelper* FromPkl);
-
-//***************************************************************************
// Constructor/Destructor
//***************************************************************************
@@ -106,7 +99,7 @@ size_t File_DcpPkl::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
if (Config->File_IsReferenced_Get() || ReferenceFiles==NULL)
return 0;
- return ReferenceFiles->Read_Buffer_Seek(Method, Value, ID);
+ return ReferenceFiles->Seek(Method, Value, ID);
}
#endif //MEDIAINFO_SEEK
@@ -237,10 +230,11 @@ bool File_DcpPkl::FileHeader_Begin()
for (File_DcpPkl::streams::iterator Stream=Streams.begin(); Stream!=Streams.end(); ++Stream)
if (Stream->StreamKind==(stream_t)(Stream_Max+1) && Stream->ChunkList.size()==1) // Means CPL
{
- File__ReferenceFilesHelper::reference ReferenceFile;
- ReferenceFile.FileNames.push_back(Ztring().From_UTF8(Stream->ChunkList[0].Path));
+ sequence* Sequence=new sequence;
+ Sequence->FileNames.push_back(Ztring().From_UTF8(Stream->ChunkList[0].Path));
- ReferenceFiles->References.push_back(ReferenceFile);
+ Sequence->StreamID=ReferenceFiles->Sequences_Size()+1;
+ ReferenceFiles->AddSequence(Sequence);
}
ReferenceFiles->FilesForStorage=true;
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Dxw.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Dxw.cpp
index f536db46e..a001463a5 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Dxw.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Dxw.cpp
@@ -84,7 +84,7 @@ size_t File_Dxw::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
if (ReferenceFiles==NULL)
return 0;
- return ReferenceFiles->Read_Buffer_Seek(Method, Value, ID);
+ return ReferenceFiles->Seek(Method, Value, ID);
}
#endif //MEDIAINFO_SEEK
@@ -120,23 +120,23 @@ bool File_Dxw::FileHeader_Begin()
{
if (string(Track->Value())=="clip")
{
- File__ReferenceFilesHelper::reference ReferenceFile;
+ sequence* Sequence=new sequence;
Attribute=Track->Attribute("file");
if (Attribute)
{
- ReferenceFile.FileNames.push_back(Ztring().From_UTF8(Attribute));
+ Sequence->AddFileName(Ztring().From_UTF8(Attribute));
Attribute=Track->Attribute("type");
if (Attribute)
{
Ztring StreamKind; StreamKind.From_UTF8(Attribute);
if (StreamKind==__T("video"))
- ReferenceFile.StreamKind=Stream_Video;
+ Sequence->StreamKind=Stream_Video;
if (StreamKind==__T("audio"))
- ReferenceFile.StreamKind=Stream_Audio;
+ Sequence->StreamKind=Stream_Audio;
if (StreamKind==__T("data"))
- ReferenceFile.StreamKind=Stream_Text; //Not sure this is a right mapping, but this is only used when file is missing
+ Sequence->StreamKind=Stream_Text; //Not sure this is a right mapping, but this is only used when file is missing
}
Attribute=Track->Attribute("source");
@@ -144,27 +144,27 @@ bool File_Dxw::FileHeader_Begin()
{
Ztring StreamKind; StreamKind.From_UTF8(Attribute);
if (StreamKind==__T("main"))
- ReferenceFile.IsMain=true;
+ Sequence->IsMain=true;
}
- ReferenceFile.StreamID=ReferenceFiles->References.size()+1;
+ Sequence->StreamID=ReferenceFiles->Sequences_Size()+1;
}
Attribute=Track->Attribute("framerate");
if (Attribute)
{
- ReferenceFile.FrameRate=Ztring().From_UTF8(Attribute).To_float64();
+ Sequence->FrameRate_Set(Ztring().From_UTF8(Attribute).To_float64());
Attribute=Track->Attribute("type");
if (Attribute)
{
Ztring StreamKind; StreamKind.From_UTF8(Attribute);
if (StreamKind==__T("video"))
- ReferenceFile.StreamKind=Stream_Video;
+ Sequence->StreamKind=Stream_Video;
if (StreamKind==__T("audio"))
- ReferenceFile.StreamKind=Stream_Audio;
+ Sequence->StreamKind=Stream_Audio;
if (StreamKind==__T("data"))
- ReferenceFile.StreamKind=Stream_Text; //Not sure this is a right mapping, but this is only used when file is missing
+ Sequence->StreamKind=Stream_Text; //Not sure this is a right mapping, but this is only used when file is missing
}
XMLElement* Frame=Track->FirstChildElement();
@@ -174,15 +174,15 @@ bool File_Dxw::FileHeader_Begin()
{
Attribute=Frame->Attribute("file");
if (Attribute)
- ReferenceFile.FileNames.push_back(Ztring().From_UTF8(Attribute));
+ Sequence->AddFileName(Ztring().From_UTF8(Attribute));
}
Frame=Frame->NextSiblingElement();
}
}
- ReferenceFile.StreamID=ReferenceFiles->References.size()+1;
- ReferenceFiles->References.push_back(ReferenceFile);
+ Sequence->StreamID=ReferenceFiles->Sequences_Size()+1;
+ ReferenceFiles->AddSequence(Sequence);
}
Track=Track->NextSiblingElement();
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Flv.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Flv.cpp
index 91a46232c..b43a764ed 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Flv.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Flv.cpp
@@ -1132,7 +1132,10 @@ void File_Flv::video_AVC()
//Disabling this stream
if (Stream[Stream_Video].Parser->File_GoTo!=(int64u)-1 || Stream[Stream_Video].Parser->Count_Get(Stream_Video)>0 || (Config->ParseSpeed<1.0 && Stream[Stream_Video].PacketCount>=300))
- video_stream_Count=false;
+ {
+ Stream[Stream_Video].Parser->Open_Buffer_Unsynch();
+ video_stream_Count=false;
+ }
#else
Skip_XX(Element_Size-Element_Offset, "AVC Data");
video_stream_Count=false; //Unable to parse it
@@ -1212,7 +1215,10 @@ void File_Flv::video_HEVC()
//Disabling this stream
if (Stream[Stream_Video].Parser->File_GoTo!=(int64u)-1 || Stream[Stream_Video].Parser->Count_Get(Stream_Video)>0 || (Config->ParseSpeed<1.0 && Stream[Stream_Video].PacketCount>=300))
- video_stream_Count=false;
+ {
+ Stream[Stream_Video].Parser->Open_Buffer_Unsynch();
+ video_stream_Count=false;
+ }
#else
Skip_XX(Element_Size-Element_Offset, "HEVC Data");
video_stream_Count=false; //Unable to parse it
@@ -1321,7 +1327,10 @@ void File_Flv::audio_MPEG()
//Disabling this stream
if (Stream[Stream_Audio].Parser->File_GoTo!=(int64u)-1 || Stream[Stream_Audio].Parser->Count_Get(Stream_Audio)>0)
- audio_stream_Count=false;
+ {
+ Stream[Stream_Audio].Parser->Open_Buffer_Unsynch();
+ audio_stream_Count=false;
+ }
#endif
}
@@ -1374,6 +1383,7 @@ void File_Flv::audio_AAC()
Demux(Buffer+Buffer_Offset+(size_t)Element_Offset, (size_t)(Element_Size-Element_Offset), ContentType_MainStream);
Open_Buffer_Continue(Stream[Stream_Audio].Parser);
+ Stream[Stream_Audio].Parser->Open_Buffer_Unsynch();
audio_stream_Count=false; //No need of more
break;
default: Skip_XX(Element_Size-Element_Offset, "Unknown");
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Gxf.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Gxf.cpp
index a7b5563b4..0b6fb816d 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Gxf.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Gxf.cpp
@@ -82,7 +82,7 @@ const char* Gxf_Tag_Name(int8u Tag)
case 0x50 : return "Frame rate";
case 0x51 : return "Lines per frame";
case 0x52 : return "Fields per frame";
- default : return "Unknown";
+ default : return "";
}
}
@@ -112,7 +112,7 @@ const char* Gxf_MediaTypes(int8u Type)
case 23 : return "MPEG-1 Video"; //625 lines
case 24 : return "SMPTE 12M"; //HD
case 25 : return "DV"; //DVCPRO HD
- default : return "Unknown";
+ default : return "";
}
}
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_HdsF4m.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_HdsF4m.cpp
index a66001af5..139738eeb 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_HdsF4m.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_HdsF4m.cpp
@@ -81,7 +81,7 @@ size_t File_HdsF4m::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
if (ReferenceFiles==NULL)
return 0;
- return ReferenceFiles->Read_Buffer_Seek(Method, Value, ID);
+ return ReferenceFiles->Seek(Method, Value, ID);
}
#endif //MEDIAINFO_SEEK
@@ -128,16 +128,16 @@ bool File_HdsF4m::FileHeader_Begin()
//Period
if (string(Root_Item->Value())=="media")
{
- File__ReferenceFilesHelper::reference ReferenceFile;
+ sequence* Sequence=new sequence;
const char* Attribute;
//Attributes - mineType
Attribute=Root_Item->Attribute("url");
if (Attribute)
- ReferenceFile.FileNames.push_back(Ztring().From_UTF8(Attribute)+__T("Seg1.f4f"));
+ Sequence->AddFileName(Ztring().From_UTF8(Attribute)+__T("Seg1.f4f"));
- ReferenceFile.StreamID=ReferenceFiles->References.size()+1;
- ReferenceFiles->References.push_back(ReferenceFile);
+ Sequence->StreamID=ReferenceFiles->Sequences_Size()+1;
+ ReferenceFiles->AddSequence(Sequence);
}
}
}
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Hls.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Hls.cpp
index ffe8b7e28..e6b3b99c0 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Hls.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Hls.cpp
@@ -83,7 +83,7 @@ size_t File_Hls::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
if (ReferenceFiles==NULL)
return 0;
- return ReferenceFiles->Read_Buffer_Seek(Method, Value, ID);
+ return ReferenceFiles->Seek(Method, Value, ID);
}
#endif //MEDIAINFO_SEEK
@@ -140,7 +140,7 @@ bool File_Hls::FileHeader_Begin()
if (!IsSub)
ReferenceFiles->ContainerHasNoId=true;
- File__ReferenceFilesHelper::reference ReferenceFile;
+ sequence* Sequence=new sequence;
bool IsGroup=false;
for (size_t Line=0; Line<Lines.size(); Line++)
@@ -199,25 +199,25 @@ bool File_Hls::FileHeader_Begin()
{
if (IsGroup)
{
- ReferenceFile.FileNames.push_back(Lines[Line]);
- ReferenceFile.StreamID=ReferenceFiles->References.size()+1;
- ReferenceFiles->References.push_back(ReferenceFile);
+ Sequence->AddFileName(Lines[Line]);
+ Sequence->StreamID=ReferenceFiles->Sequences_Size()+1;
+ ReferenceFiles->AddSequence(Sequence);
IsGroup=false;
- ReferenceFile=File__ReferenceFilesHelper::reference();
+ Sequence=new sequence();
#if MEDIAINFO_EVENTS
ParserIDs[0]=MediaInfo_Parser_HlsIndex;
StreamIDs_Width[0]=sizeof(size_t);
#endif //MEDIAINFO_EVENTS
}
else
- ReferenceFile.FileNames.push_back(Lines[Line]);
+ Sequence->AddFileName(Lines[Line]);
}
}
}
- if (!ReferenceFile.FileNames.empty())
+ if (!Sequence->FileNames.empty())
{
- ReferenceFiles->References.push_back(ReferenceFile);
+ ReferenceFiles->AddSequence(Sequence);
Fill(Stream_General, 0, General_Format_Profile, "Media");
}
else
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ibi.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ibi.cpp
index a342ae7fe..a267125d7 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ibi.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ibi.cpp
@@ -43,18 +43,22 @@ File_Ibi::File_Ibi()
#endif //MEDIAINFO_DEMUX
DataMustAlwaysBeComplete=false;
- //In
- Ibi=NULL;
+ #if MEDIAINFO_IBIUSAGE
+ //In
+ Ibi=NULL;
- //Temp
- Ibi_MustDelete=false;
+ //Temp
+ Ibi_MustDelete=false;
+ #endif //MEDIAINFO_IBIUSAGE
}
//---------------------------------------------------------------------------
File_Ibi::~File_Ibi()
{
- if (Ibi_MustDelete)
- delete Ibi; //Ibi=NULL;
+ #if MEDIAINFO_IBIUSAGE
+ if (Ibi_MustDelete)
+ delete Ibi; //Ibi=NULL;
+ #endif //MEDIAINFO_IBIUSAGE
}
//***************************************************************************
@@ -62,6 +66,7 @@ File_Ibi::~File_Ibi()
//***************************************************************************
//---------------------------------------------------------------------------
+#if MEDIAINFO_IBIUSAGE
const Ztring &File_Ibi::Get (stream_t /*StreamKind*/, size_t /*StreamNumber*/, const Ztring &Parameter, info_t /*KindOfInfo*/, info_t /*KindOfSearch*/)
{
ibi::streams::iterator IbiStream_Temp=Ibi->Streams.begin(); //TODO: management of multiple streams
@@ -83,6 +88,7 @@ const Ztring &File_Ibi::Get (stream_t /*StreamKind*/, size_t /*StreamNumber*/, c
Get_Temp.clear();
return Get_Temp;
}
+#endif //MEDIAINFO_IBIUSAGE
//***************************************************************************
// Streams management
@@ -93,14 +99,17 @@ void File_Ibi::Streams_Accept()
{
Fill(Stream_General, 0, General_Format, "Ibi");
- if (Ibi==NULL)
- {
- Ibi=new ibi();
- Ibi_MustDelete=true;
- }
+ #if MEDIAINFO_IBIUSAGE
+ if (Ibi==NULL)
+ {
+ Ibi=new ibi();
+ Ibi_MustDelete=true;
+ }
+ #endif //MEDIAINFO_IBIUSAGE
}
//---------------------------------------------------------------------------
+#if MEDIAINFO_IBIUSAGE
void File_Ibi::Streams_Finish()
{
Config->File_KeepInfo_Set(true); //In order to let Get() available
@@ -112,6 +121,7 @@ void File_Ibi::Streams_Finish()
Fill(Stream_Video, StreamPos_Last, General_ID, IbiStream_Temp->first);
}
}
+#endif //MEDIAINFO_IBIUSAGE
//***************************************************************************
// Buffer
@@ -386,6 +396,7 @@ void File_Ibi::Stream_Header()
Get_EB (ID_Current, "ID");
FILLING_BEGIN();
+ #if MEDIAINFO_IBIUSAGE
if (Ibi)
{
//Filling information for ID after data
@@ -396,6 +407,10 @@ void File_Ibi::Stream_Header()
Ibi->Streams.erase(IbiStream_Temp);
}
}
+ #else //MEDIAINFO_IBIUSAGE
+ Stream_Prepare(Stream_Video);
+ Fill(Stream_Video, StreamPos_Last, General_ID, ID_Current);
+ #endif //MEDIAINFO_IBIUSAGE
FILLING_END();
}
@@ -404,16 +419,21 @@ void File_Ibi::Stream_ByteOffset()
Element_Name("Byte Offset");
//Parsing
+ #if MEDIAINFO_IBIUSAGE
size_t Pos=0;
+ #endif //MEDIAINFO_IBIUSAGE
int64u Offset=0;
while (Element_Offset<Element_Size)
{
int64u Item;
Get_EB (Item, "Item");
Offset+=Item;
+ #if MEDIAINFO_IBIUSAGE
Param_Info1(Pos);
+ #endif //MEDIAINFO_IBIUSAGE
Param_Info1(Ztring::ToZtring(Offset)+__T(" (0x")+Ztring::ToZtring(Offset, 16)+__T(')'));
+ #if MEDIAINFO_IBIUSAGE
FILLING_BEGIN();
if (Ibi)
{
@@ -429,6 +449,7 @@ void File_Ibi::Stream_ByteOffset()
Pos++;
}
FILLING_END();
+ #endif //MEDIAINFO_IBIUSAGE
}
}
@@ -437,16 +458,21 @@ void File_Ibi::Stream_FrameNumber()
Element_Name("Frame Number");
//Parsing
+ #if MEDIAINFO_IBIUSAGE
size_t Pos=0;
+ #endif //MEDIAINFO_IBIUSAGE
int64u Offset=0;
while (Element_Offset<Element_Size)
{
int64u Item;
Get_EB (Item, "Item");
Offset+=Item;
+ #if MEDIAINFO_IBIUSAGE
Param_Info1(Pos);
+ #endif //MEDIAINFO_IBIUSAGE
Param_Info1(Ztring::ToZtring(Offset)+__T(" (0x")+Ztring::ToZtring(Offset, 16)+__T(')'));
+ #if MEDIAINFO_IBIUSAGE
FILLING_BEGIN();
if (Ibi)
{
@@ -462,6 +488,7 @@ void File_Ibi::Stream_FrameNumber()
Pos++;
}
FILLING_END();
+ #endif //MEDIAINFO_IBIUSAGE
}
}
@@ -472,11 +499,14 @@ void File_Ibi::Stream_Dts()
//Parsing
int64u Item;
Get_EB (Item, "DtsFrequencyNumerator");
+ #if MEDIAINFO_IBIUSAGE
FILLING_BEGIN();
if (Ibi)
Ibi->Streams[ID_Current]->DtsFrequencyNumerator=Item;
FILLING_END();
+ #endif //MEDIAINFO_IBIUSAGE
Get_EB (Item, "DtsFrequencyDenominator");
+ #if MEDIAINFO_IBIUSAGE
FILLING_BEGIN();
if (Ibi)
{
@@ -487,17 +517,23 @@ void File_Ibi::Stream_Dts()
std::swap(Ibi->Streams[ID_Current]->DtsFrequencyNumerator, Ibi->Streams[ID_Current]->DtsFrequencyDenominator);
}
FILLING_END();
+ #endif //MEDIAINFO_IBIUSAGE
+ #if MEDIAINFO_IBIUSAGE
size_t Pos=0;
+ #endif //MEDIAINFO_IBIUSAGE
int64u Offset=0;
while (Element_Offset<Element_Size)
{
int64u Item;
Get_EB (Item, "Item");
Offset+=Item;
+ #if MEDIAINFO_IBIUSAGE
Param_Info1(Pos);
+ #endif //MEDIAINFO_IBIUSAGE
Param_Info1(Ztring::ToZtring(Offset)+__T(" (0x")+Ztring::ToZtring(Offset, 16)+__T(')'));
+ #if MEDIAINFO_IBIUSAGE
FILLING_BEGIN();
if (Ibi)
{
@@ -513,6 +549,7 @@ void File_Ibi::Stream_Dts()
Pos++;
}
FILLING_END();
+ #endif //MEDIAINFO_IBIUSAGE
}
}
@@ -684,9 +721,10 @@ void File_Ibi::InformData()
Get_UTF8 (Element_Size, InformData_FromFile, "Data");
//Filling
- ZtringListList Fields(InformData_FromFile);
+ #if MEDIAINFO_IBIUSAGE
if (Config->Ibi_UseIbiInfoIfAvailable_Get())
{
+ ZtringListList Fields(InformData_FromFile);
for (size_t Pos=0; Pos<Fields.size(); Pos++)
{
if (Pos==0 || Fields[Pos].size()<2)
@@ -720,6 +758,7 @@ void File_Ibi::InformData()
(*Stream_More)[StreamKind_Last][StreamPos_Last](Fields[Pos][0].To_UTF8().c_str(), Info_Options)=Fields[Pos][Info_Options];
}
}
+ #endif //MEDIAINFO_IBIUSAGE
}
//***************************************************************************
@@ -904,4 +943,4 @@ int128u File_Ibi::UInteger16_Get()
} //NameSpace
-#endif //MEDIAINFO_IBI_YES
+#endif //MEDIAINFO_IBI
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ibi.h b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ibi.h
index 145d7acd6..76538aad1 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ibi.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ibi.h
@@ -33,15 +33,21 @@ public :
~File_Ibi();
//In
- ibi* Ibi;
+ #if MEDIAINFO_IBIUSAGE
+ ibi* Ibi;
+ #endif //MEDIAINFO_IBIUSAGE
private :
- //Get information
- const Ztring &Get (stream_t StreamKind, size_t StreamNumber, const Ztring &Parameter, info_t KindOfInfo=Info_Text, info_t KindOfSearch=Info_Name);
+ #if MEDIAINFO_IBIUSAGE
+ //Get information
+ const Ztring &Get (stream_t StreamKind, size_t StreamNumber, const Ztring &Parameter, info_t KindOfInfo=Info_Text, info_t KindOfSearch=Info_Name);
+ #endif //MEDIAINFO_IBIUSAGE
//Streams management
void Streams_Accept();
+ #if MEDIAINFO_IBIUSAGE
void Streams_Finish();
+ #endif //MEDIAINFO_IBIUSAGE
//Buffer - Element
void Header_Parse();
@@ -82,7 +88,9 @@ private :
//Temp
Ztring Get_Temp;
int64u ID_Current;
- bool Ibi_MustDelete;
+ #if MEDIAINFO_IBIUSAGE
+ bool Ibi_MustDelete;
+ #endif //MEDIAINFO_IBIUSAGE
};
} //NameSpace
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ibi_Creation.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ibi_Creation.cpp
index 13c0f1212..398e1aba3 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ibi_Creation.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ibi_Creation.cpp
@@ -17,7 +17,7 @@
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
-#if MEDIAINFO_IBI
+#if MEDIAINFO_IBIUSAGE
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
@@ -539,9 +539,9 @@ Ztring File_Ibi_Creation::Finish()
else
{
//Filling
- Buffer.Size = Main_Offset;
+ Buffer.Size = Size;
Buffer.Content = new int8u[Buffer.Size];
- std::memcpy(Buffer.Content, Main, Main_Offset);
+ std::memcpy(Buffer.Content, Main, Size);
}
std::string Data_Raw((const char*)Buffer.Content, Buffer.Size);
@@ -561,5 +561,5 @@ Ztring File_Ibi_Creation::Finish()
} //NameSpace
-#endif //MEDIAINFO_IBI_YES
+#endif //MEDIAINFO_IBIUSAGE
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ism.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ism.cpp
index 2357af29e..60e9b1f38 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ism.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ism.cpp
@@ -91,7 +91,7 @@ size_t File_Ism::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
if (ReferenceFiles==NULL)
return 0;
- return ReferenceFiles->Read_Buffer_Seek(Method, Value, ID);
+ return ReferenceFiles->Seek(Method, Value, ID);
}
#endif //MEDIAINFO_SEEK
@@ -132,18 +132,18 @@ bool File_Ism::FileHeader_Begin()
string Value(Stream->Value());
if (Value=="video" || Value=="videostream" || Value=="audio" || Value=="audiostream" || Value=="text" || Value=="textstream")
{
- File__ReferenceFilesHelper::reference ReferenceFile;
+ sequence* Sequence=new sequence;
if (Value=="video" || Value=="videostream")
- ReferenceFile.StreamKind=Stream_Video;
+ Sequence->StreamKind=Stream_Video;
if (Value=="audio" || Value=="audiostream")
- ReferenceFile.StreamKind=Stream_Audio;
+ Sequence->StreamKind=Stream_Audio;
if (Value=="text" || Value=="textstream" )
- ReferenceFile.StreamKind=Stream_Text;
+ Sequence->StreamKind=Stream_Text;
const char* Attribute=Stream->Attribute("src");
if (Attribute)
- ReferenceFile.FileNames.push_back(Ztring().From_UTF8(Attribute));
+ Sequence->AddFileName(Ztring().From_UTF8(Attribute));
XMLElement* Param=Stream->FirstChildElement();
while (Param)
@@ -155,16 +155,16 @@ bool File_Ism::FileHeader_Begin()
{
Attribute=Param->Attribute("value");
if (Attribute)
- ReferenceFile.StreamID=Ztring().From_UTF8(Attribute).To_int64u();
+ Sequence->StreamID=Ztring().From_UTF8(Attribute).To_int64u();
}
}
Param=Param->NextSiblingElement();
}
- if (!ReferenceFile.FileNames.empty() && !ReferenceFile.FileNames[0].empty() && FileNames.find(ReferenceFile.FileNames[0])==FileNames.end())
+ if (!Sequence->FileNames.empty() && !Sequence->FileNames[0].empty() && FileNames.find(Sequence->FileNames[0])==FileNames.end())
{
- ReferenceFiles->References.push_back(ReferenceFile);
- FileNames.insert(ReferenceFile.FileNames[0]);
+ ReferenceFiles->AddSequence(Sequence);
+ FileNames.insert(Sequence->FileNames[0]);
}
}
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mk.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mk.cpp
index d50dc6aa0..a514f2362 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mk.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mk.cpp
@@ -135,7 +135,7 @@ const char* Mk_StereoMode(int64u StereoMode)
case 0x0C : return "Anaglyph (green/magenta)";
case 0x0D : return "Both Eyes laced in one block (left eye first)";
case 0x0E : return "Both Eyes laced in one block (right eye first)";
- default : return "Unknown";
+ default : return "";
}
}
@@ -148,7 +148,7 @@ const char* Mk_StereoMode_v2(int64u StereoMode)
case 0x01 : return "Right Eye";
case 0x02 : return "Left Eye";
case 0x03 : return "Both Eye";
- default : return "Unknown";
+ default : return "";
}
}
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4.cpp
index 1d2b45d0b..4735b0094 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4.cpp
@@ -636,6 +636,7 @@ void File_Mpeg4::Streams_Finish()
else
{
//Temp->second.Parsers[0]->Clear(StreamKind_Last, StreamPos_Last, "Delay"); //DV TimeCode is removed
+ Temp->second.Parsers[0]->Clear(StreamKind_Last, StreamPos_Last, "FrameCount");
Merge(*Temp->second.Parsers[0], StreamKind_Last, 0, StreamPos_Last);
//Law rating
@@ -846,31 +847,9 @@ void File_Mpeg4::Streams_Finish()
//Aperture size
if (Temp->second.CleanAperture_Width)
{
- Ztring CleanAperture_Width=Ztring().From_Number(Temp->second.CleanAperture_Width, 0);
- Ztring CleanAperture_Height=Ztring().From_Number(Temp->second.CleanAperture_Height, 0);
- if (CleanAperture_Width!=Retrieve(Stream_Video, StreamPos_Last, Video_Width))
- {
- Fill(Stream_Video, StreamPos_Last, Video_Width_Original, Retrieve(Stream_Video, StreamPos_Last, Video_Width), true);
- Fill(Stream_Video, StreamPos_Last, Video_Width, Temp->second.CleanAperture_Width, 0, true);
- }
- if (CleanAperture_Height!=Retrieve(Stream_Video, StreamPos_Last, Video_Height))
- {
- Fill(Stream_Video, StreamPos_Last, Video_Height_Original, Retrieve(Stream_Video, StreamPos_Last, Video_Height), true);
- Fill(Stream_Video, StreamPos_Last, Video_Height, Temp->second.CleanAperture_Height, 0, true);
- }
- if (Temp->second.CleanAperture_PixelAspectRatio)
- {
- Clear(Stream_Video, StreamPos_Last, Video_DisplayAspectRatio);
- Clear(Stream_Video, StreamPos_Last, Video_PixelAspectRatio);
- Fill(Stream_Video, StreamPos_Last, Video_PixelAspectRatio, Temp->second.CleanAperture_PixelAspectRatio, 3, true);
- if (Retrieve(Stream_Video, StreamPos_Last, Video_PixelAspectRatio)==Retrieve(Stream_Video, StreamPos_Last, Video_PixelAspectRatio_Original))
- Clear(Stream_Video, StreamPos_Last, Video_PixelAspectRatio_Original);
- if (Retrieve(Stream_Video, StreamPos_Last, Video_DisplayAspectRatio)==Retrieve(Stream_Video, StreamPos_Last, Video_DisplayAspectRatio_Original))
- {
- Clear(Stream_Video, StreamPos_Last, Video_DisplayAspectRatio_Original);
- Clear(Stream_Video, StreamPos_Last, Video_DisplayAspectRatio_Original_String);
- }
- }
+ Fill(Stream_Video, StreamPos_Last, "Width_CleanAperture", Temp->second.CleanAperture_Width, 0, true);
+ Fill(Stream_Video, StreamPos_Last, "Height_CleanAperture", Temp->second.CleanAperture_Height, 0, true);
+ Fill(Stream_Video, StreamPos_Last, "PixelAspectRatio_CleanAperture", Temp->second.CleanAperture_PixelAspectRatio, 3, true);
}
//Special case: QuickTime files and Stereo streams, there is a default value in QuickTime player, a QuickTime "standard"?
@@ -932,7 +911,7 @@ void File_Mpeg4::Streams_Finish()
if (Count_Get(Stream_Video)==0 && Count_Get(Stream_Image)==0 && Count_Get(Stream_Audio)>0)
Fill(Stream_General, 0, General_InternetMediaType, "audio/mp4", Unlimited, true, true);
- //Parsing reference files
+ //Parsing sequence files
#ifdef MEDIAINFO_REFERENCES_YES
for (streams::iterator Stream=Streams.begin(); Stream!=Streams.end(); ++Stream)
if (!Stream->second.File_Name.empty())
@@ -940,16 +919,16 @@ void File_Mpeg4::Streams_Finish()
if (ReferenceFiles==NULL)
ReferenceFiles=new File__ReferenceFilesHelper(this, Config);
- File__ReferenceFilesHelper::reference ReferenceFile;
- ReferenceFile.FileNames.push_back(Stream->second.File_Name);
- ReferenceFile.StreamKind=Stream->second.StreamKind;
- ReferenceFile.StreamPos=Stream->second.StreamPos;
- ReferenceFile.StreamID=Retrieve(Stream->second.StreamKind, Stream->second.StreamPos, General_ID).To_int64u();
+ sequence* Sequence=new sequence;
+ Sequence->AddFileName(Stream->second.File_Name);
+ Sequence->StreamKind=Stream->second.StreamKind;
+ Sequence->StreamPos=Stream->second.StreamPos;
+ Sequence->StreamID=Retrieve(Stream->second.StreamKind, Stream->second.StreamPos, General_ID).To_int64u();
if (Stream->second.StreamKind==Stream_Video)
{
- ReferenceFile.FrameRate=Retrieve(Stream_Video, Stream->second.StreamPos, Video_FrameRate).To_float64();
+ Sequence->FrameRate_Set(Retrieve(Stream_Video, Stream->second.StreamPos, Video_FrameRate).To_float64());
- #ifdef MEDIAINFO_IBI_YES
+ #if MEDIAINFO_IBIUSAGE
for (size_t stss_Pos=0; stss_Pos<Stream->second.stss.size(); stss_Pos++)
{
int64u Value=Stream->second.stss[stss_Pos];
@@ -974,22 +953,22 @@ void File_Mpeg4::Streams_Finish()
IbiInfo.StreamOffset=Stream->second.stco[stco_Pos];
IbiInfo.FrameNumber=Value;
IbiInfo.Dts=TimeCode_DtsOffset+(stts_Duration->DTS_Begin+(((int64u)stts_Duration->SampleDuration)*(Value-stts_Duration->Pos_Begin)))*1000000000/Stream->second.mdhd_TimeScale;
- ReferenceFile.IbiStream.Add(IbiInfo);
+ Sequence->IbiStream.Add(IbiInfo);
}
}
}
}
- #endif //MEDIAINFO_IBI_YES
+ #endif //MEDIAINFO_IBIUSAGE
}
- ReferenceFiles->References.push_back(ReferenceFile);
+ ReferenceFiles->AddSequence(Sequence);
}
if (ReferenceFiles)
{
ReferenceFiles->ParseReferences();
#if MEDIAINFO_NEXTPACKET
- if (Config->NextPacket_Get() && ReferenceFiles && !ReferenceFiles->References.empty())
+ if (Config->NextPacket_Get() && ReferenceFiles && ReferenceFiles->Sequences_Size())
{
ReferenceFiles_IsParsing=true;
return;
@@ -1186,7 +1165,7 @@ size_t File_Mpeg4::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
{
#if defined(MEDIAINFO_REFERENCES_YES)
if (ReferenceFiles)
- return ReferenceFiles->Read_Buffer_Seek(Method, Value, ID);
+ return ReferenceFiles->Seek(Method, Value, ID);
#endif //defined(MEDIAINFO_REFERENCES_YES)
if (!IsSub && MajorBrand==0x6A703220) //"jp2 "
return Read_Buffer_Seek_OneFramePerFile(Method, Value, ID);
@@ -1323,6 +1302,15 @@ size_t File_Mpeg4::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
default : ;
}
+ if (!StreamOffset_Jump.empty())
+ {
+ std::map<int64u, int64u>::iterator StreamOffset_Current=StreamOffset_Jump.end();
+ do
+ --StreamOffset_Current;
+ while (StreamOffset_Current->second>JumpTo && StreamOffset_Current!=StreamOffset_Jump.begin());
+ JumpTo=StreamOffset_Current->second;
+ }
+
GoTo(JumpTo);
Open_Buffer_Unsynch();
return 1;
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4.h b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4.h
index c1ff5b89d..aedf73b6e 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4.h
@@ -164,6 +164,8 @@ private :
void moov_trak_mdia_minf_stbl_stsd_xxxx_chan();
void moov_trak_mdia_minf_stbl_stsd_xxxx_clap();
void moov_trak_mdia_minf_stbl_stsd_xxxx_colr();
+ void moov_trak_mdia_minf_stbl_stsd_xxxx_colr_nclc(bool LittleEndian=false);
+ void moov_trak_mdia_minf_stbl_stsd_xxxx_colr_prof();
void moov_trak_mdia_minf_stbl_stsd_xxxx_d263();
void moov_trak_mdia_minf_stbl_stsd_xxxx_dac3();
void moov_trak_mdia_minf_stbl_stsd_xxxx_damr();
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4_Elements.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4_Elements.cpp
index 4866faad8..dad3df2c8 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4_Elements.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg4_Elements.cpp
@@ -40,6 +40,9 @@
#if defined(MEDIAINFO_AVC_YES)
#include "MediaInfo/Video/File_Avc.h"
#endif
+#if defined(MEDIAINFO_FFV1_YES)
+ #include "MediaInfo/Video/File_Ffv1.h"
+#endif
#if defined(MEDIAINFO_H263_YES)
#include "MediaInfo/Video/File_H263.h"
#endif
@@ -128,7 +131,7 @@ const char* Mpeg4_Meta_Kind(int32u Kind)
case 0x15 : return "Signed Integer"; //the size of the integer is derived from the container size
case 0x16 : return "Float 32";
case 0x17 : return "Float 64";
- default : return "Unknown";
+ default : return "";
}
}
@@ -145,7 +148,7 @@ const char* Mpeg4_TypeModifierName(int32u TypeModifierName)
case 0x06 : return "Matrix object";
case 0x07 : return "Graphics mode object";
case 0x76696465 : return "Image type";
- default : return "Unknown";
+ default : return "";
}
}
@@ -694,6 +697,9 @@ namespace Elements
const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_clap=0x636C6170;
const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_chan=0x6368616E;
const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_colr=0x636F6C72;
+ const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_colr_clcn=0x636C636E;
+ const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_colr_nclc=0x6E636C63;
+ const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_colr_prof=0x70726F66;
const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_d263=0x64323633;
const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_dac3=0x64616333;
const int64u moov_trak_mdia_minf_stbl_stsd_xxxx_damr=0x64616D72;
@@ -840,7 +846,7 @@ const char* Mpeg4_Description(int32u Description)
case Elements::moov_trak_mdia_minf_stbl_stsd_xxxx_idfm_priv : return "Private";
case Elements::moov_trak_mdia_minf_stbl_stsd_xxxx_idfm_subs : return "Substitute if main codec not available";
case Elements::moov_trak_mdia_minf_stbl_stsd_xxxx_idfm_cspc : return "Native pixel format";
- default : return "Unknown";
+ default : return "";
}
}
@@ -1316,7 +1322,8 @@ void File_Mpeg4::cdat()
#if MEDIAINFO_DEMUX
Demux(Buffer+Buffer_Offset, (size_t)Element_Size, ContentType_MainStream);
- Streams[(int32u)Element_Code].Parsers[0]->FrameInfo=FrameInfo;
+ Streams[(int32u)Element_Code].Parsers[0]->FrameInfo.DTS=FrameInfo.DTS;
+ Streams[(int32u)Element_Code].Parsers[0]->FrameInfo.DUR=FrameInfo.DUR/(Element_Size/2);
#endif //MEDIAINFO_DEMUX
while (Element_Offset+2<=Element_Size)
{
@@ -4056,6 +4063,8 @@ void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxx()
default : Skip_XX(Element_TotalSize_Get()-Element_Offset, "Unknown");
}
}
+ if (Element_IsWaitingForMoreData())
+ return;
if (Streams[moov_trak_tkhd_TrackID].Parsers.size()==1 && !Retrieve(StreamKind_Last, StreamPos_Last, "Encryption").empty())
{
@@ -4488,6 +4497,7 @@ void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxxVideo()
int16u Width, Height, Depth, ColorTableID;
int8u CompressorName_Size;
+ bool IsGreyscale;
Skip_B2( "Version");
Skip_B2( "Revision level");
Skip_C4( "Vendor");
@@ -4511,9 +4521,31 @@ void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxxVideo()
//this is hard-coded 32-byte string
Skip_Local(32, "Compressor name");
Get_B2 (Depth, "Depth");
+ if (Depth>0x20 && Depth<0x40)
+ {
+ Depth-=0x20;
+ IsGreyscale=true;
+ }
+ else if (Depth==1)
+ IsGreyscale=true;
+ else
+ IsGreyscale=false;
Get_B2 (ColorTableID, "Color table ID");
- if (ColorTableID==0 && Width && Height) //In one file, if Zero-filled, Color table is not present
- Skip_XX(32, "Color Table");
+ if (!IsGreyscale && (Depth>1 && Depth<=8) && !ColorTableID)
+ {
+ int32u ColorStart;
+ int16u ColorEnd;
+ Get_B4 (ColorStart, "Color Start");
+ Skip_B2( "Color Count");
+ Get_B2 (ColorEnd, "Color End");
+ for (int32u Color=ColorStart; Color<=ColorEnd; Color++)
+ {
+ Skip_B2( "Alpha");
+ Skip_B2( "Red");
+ Skip_B2( "Green");
+ Skip_B2( "Blue");
+ }
+ }
if (moov_trak_mdia_minf_stbl_stsd_Pos)
return; //Handling only the first description
@@ -4590,6 +4622,13 @@ void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxxVideo()
Streams[moov_trak_tkhd_TrackID].Parsers.push_back(Parser);
}
#endif
+ #if defined(MEDIAINFO_FFV1_YES)
+ if (MediaInfoLib::Config.CodecID_Get(Stream_Video, InfoCodecID_Format_Mpeg4, Ztring().From_CC4((int32u)Element_Code), InfoCodecID_Format)==__T("FFV1"))
+ {
+ File_Ffv1* Parser=new File_Ffv1;
+ Streams[moov_trak_tkhd_TrackID].Parsers.push_back(Parser);
+ }
+ #endif
#if defined(MEDIAINFO_H263_YES)
if (MediaInfoLib::Config.CodecID_Get(Stream_Video, InfoCodecID_Format_Mpeg4, Ztring().From_CC4((int32u)Element_Code), InfoCodecID_Format)==__T("H.263"))
{
@@ -4692,17 +4731,12 @@ void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxxVideo()
//RGB(A)
if (Codec=="raw " || Codec=="rle ")
{
- if (Depth==1)
+ if (IsGreyscale)
{
Fill(Stream_Video, StreamPos_Last, Video_ColorSpace, "Y", Unlimited, true, true);
- Fill(Stream_Video, StreamPos_Last, Video_BitDepth, 1);
- }
- else if (Depth<15)
- {
- Fill(Stream_Video, StreamPos_Last, Video_ColorSpace, "RGB", Unlimited, true, true);
- Fill(Stream_Video, StreamPos_Last, Video_BitDepth, 8);
+ Fill(Stream_Video, StreamPos_Last, Video_BitDepth, Depth);
}
- else if (Depth==32 || Depth==36)
+ else if (Depth==32)
{
Fill(Stream_Video, StreamPos_Last, Video_ColorSpace, "RGBA", Unlimited, true, true);
Fill(Stream_Video, StreamPos_Last, Video_BitDepth, Depth/4);
@@ -5034,11 +5068,37 @@ void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxx_colr()
Element_Name("Color Parameter");
//Parsing
+ int32u ColorParameterType;
+ Get_C4 (ColorParameterType, "Color parameter type");
+ switch (ColorParameterType)
+ {
+ case Elements::moov_trak_mdia_minf_stbl_stsd_xxxx_colr_clcn: moov_trak_mdia_minf_stbl_stsd_xxxx_colr_nclc(true); break;
+ case Elements::moov_trak_mdia_minf_stbl_stsd_xxxx_colr_nclc: moov_trak_mdia_minf_stbl_stsd_xxxx_colr_nclc(); break;
+ case Elements::moov_trak_mdia_minf_stbl_stsd_xxxx_colr_prof: moov_trak_mdia_minf_stbl_stsd_xxxx_colr_prof(); break;
+ default : Skip_XX(Element_Size-Element_Offset, "Unknown");
+ }
+}
+
+//---------------------------------------------------------------------------
+void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxx_colr_nclc(bool LittleEndian)
+{
+ //Parsing
int16u colour_primaries, transfer_characteristics, matrix_coefficients;
- Skip_C4( "Color parameter type");
- Get_B2 (colour_primaries, "Primaries index"); Param_Info1(Mpegv_colour_primaries((int8u)colour_primaries));
- Get_B2 (transfer_characteristics, "Transfer function index"); Param_Info1(Mpegv_transfer_characteristics((int8u)transfer_characteristics));
- Get_B2 (matrix_coefficients, "Matrix index"); Param_Info1(Mpegv_matrix_coefficients((int8u)matrix_coefficients));
+ if (LittleEndian)
+ Get_L2 (colour_primaries, "Primaries index");
+ else
+ Get_B2 (colour_primaries, "Primaries index");
+ Param_Info1(Mpegv_colour_primaries((int8u)colour_primaries));
+ if (LittleEndian)
+ Get_L2 (transfer_characteristics, "Transfer function index");
+ else
+ Get_B2 (transfer_characteristics, "Transfer function index");
+ Param_Info1(Mpegv_transfer_characteristics((int8u)transfer_characteristics));
+ if (LittleEndian)
+ Get_L2 (matrix_coefficients, "Matrix index");
+ else
+ Get_B2 (matrix_coefficients, "Matrix index");
+ Param_Info1(Mpegv_matrix_coefficients((int8u)matrix_coefficients));
FILLING_BEGIN();
if (Retrieve(Stream_Video, StreamPos_Last, Video_colour_description_present).empty()) //Using only the first one met
@@ -5052,6 +5112,13 @@ void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxx_colr()
}
//---------------------------------------------------------------------------
+void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxx_colr_prof()
+{
+ //Parsing
+ Skip_XX(Element_Size-Element_Offset, "ICC profile"); //TODO: parse ICC profile
+}
+
+//---------------------------------------------------------------------------
void File_Mpeg4::moov_trak_mdia_minf_stbl_stsd_xxxx_d263()
{
Element_Name("H263SpecificBox");
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_MpegPs.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_MpegPs.cpp
index e2fb1843a..bd5c9dd1f 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_MpegPs.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_MpegPs.cpp
@@ -90,11 +90,9 @@
#include "MediaInfo/MediaInfo_Config_MediaInfo.h"
#include "MediaInfo/MediaInfo_Events_Internal.h"
#endif //MEDIAINFO_EVENTS
-#if MEDIAINFO_IBI
- #if MEDIAINFO_SEEK
- #include "MediaInfo/Multiple/File_Ibi.h"
- #endif //MEDIAINFO_SEEK
-#endif //MEDIAINFO_IBI
+#if MEDIAINFO_IBIUSAGE && MEDIAINFO_SEEK
+ #include "MediaInfo/Multiple/File_Ibi.h"
+#endif //MEDIAINFO_IBIUSAGE && MEDIAINFO_SEEK
using namespace ZenLib;
using namespace std;
//---------------------------------------------------------------------------
@@ -556,7 +554,7 @@ void File_MpegPs::Streams_Finish()
}
}
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
if (!IsSub && Config_Ibi_Create)
{
for (ibi::streams::iterator IbiStream_Temp=Ibi.Streams.begin(); IbiStream_Temp!=Ibi.Streams.end(); ++IbiStream_Temp)
@@ -579,7 +577,7 @@ void File_MpegPs::Streams_Finish()
}
}
}
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
}
//---------------------------------------------------------------------------
@@ -1005,7 +1003,7 @@ size_t File_MpegPs::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
if (!Duration_Detected)
{
//External IBI
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
std::string IbiFile=Config->Ibi_Get();
if (!IbiFile.empty())
{
@@ -1046,7 +1044,7 @@ size_t File_MpegPs::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
if (Ibi.Streams.empty())
return 4; //Problem during IBI file parsing
}
- #endif //#if MEDIAINFO_IBI
+ #endif //#if MEDIAINFO_IBIUSAGE
Duration_Detected=true;
}
@@ -1063,7 +1061,7 @@ size_t File_MpegPs::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
Open_Buffer_Unsynch();
return 1;
case 2 : //Timestamp
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
{
ibi::streams::iterator IbiStream_Temp;
if (ID==(int64u)-1)
@@ -1118,11 +1116,11 @@ size_t File_MpegPs::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
return 2; //Invalid value
}
- #else //MEDIAINFO_IBI
+ #else //MEDIAINFO_IBIUSAGE
return (size_t)-2; //Not supported / IBI disabled
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
case 3 : //FrameNumber
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
{
ibi::streams::iterator IbiStream_Temp;
if (ID==(int64u)-1)
@@ -1154,9 +1152,9 @@ size_t File_MpegPs::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
return 2; //Invalid value
}
- #else //MEDIAINFO_IBI
+ #else //MEDIAINFO_IBIUSAGE
return (size_t)-2; //Not supported / IBI disabled
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
default : return (size_t)-1; //Not supported
}
}
@@ -1649,6 +1647,8 @@ void File_MpegPs::Header_Parse_PES_packet_MPEG1(int8u stream_id)
FrameInfo.DTS=(((int64u)DTS_32)<<30)
| (((int64u)DTS_29)<<15)
| (((int64u)DTS_14));
+ if (Frame_Count<16 &&FrameInfo.DTS>=0x100000000LL) //Hack in case DTS is negative (currently not supported by MI). TODO: negative DTS.
+ FrameInfo.DTS=0;
if (Streams[stream_id].Searching_TimeStamp_End)
{
if (Streams[stream_id].TimeStamp_End.DTS.TimeStamp==(int64u)-1)
@@ -1734,15 +1734,15 @@ void File_MpegPs::Header_Parse_PES_packet_MPEG2(int8u stream_id)
return;
}
Buffer_Pos_Flags++;
- PTS_DTS_flags =Buffer[Buffer_Pos_Flags]>>6;
- ESCR_flag =Buffer[Buffer_Pos_Flags]&0x20?true:false;
- ES_rate_flag =Buffer[Buffer_Pos_Flags]&0x10?true:false;
- DSM_trick_mode_flag =Buffer[Buffer_Pos_Flags]&0x08?true:false;
- additional_copy_info_flag =Buffer[Buffer_Pos_Flags]&0x04?true:false;
- PES_CRC_flag =Buffer[Buffer_Pos_Flags]&0x02?true:false;
- PES_extension_flag =Buffer[Buffer_Pos_Flags]&0x01?true:false;
+ PTS_DTS_flags = Buffer[Buffer_Pos_Flags] >> 6;
+ ESCR_flag = (Buffer[Buffer_Pos_Flags] & 0x20) ? true: false;
+ ES_rate_flag = (Buffer[Buffer_Pos_Flags] & 0x10) ? true: false;
+ DSM_trick_mode_flag = (Buffer[Buffer_Pos_Flags] & 0x08) ? true: false;
+ additional_copy_info_flag = (Buffer[Buffer_Pos_Flags] & 0x04) ? true: false;
+ PES_CRC_flag = (Buffer[Buffer_Pos_Flags] & 0x02) ? true: false;
+ PES_extension_flag = (Buffer[Buffer_Pos_Flags] & 0x01) ? true: false;
Buffer_Pos_Flags++;
- PES_header_data_length =Buffer[Buffer_Pos_Flags];
+ PES_header_data_length = Buffer[Buffer_Pos_Flags];
Element_Offset+=3;
#if MEDIAINFO_TRACE
}
@@ -1939,6 +1939,8 @@ void File_MpegPs::Header_Parse_PES_packet_MPEG2(int8u stream_id)
FrameInfo.DTS=(((int64u)DTS_32)<<30)
| (((int64u)DTS_29)<<15)
| (((int64u)DTS_14));
+ if (Frame_Count<16 &&FrameInfo.DTS>=0x100000000LL) //Hack in case DTS is negative (currently not supported by MI). TODO: negative DTS.
+ FrameInfo.DTS=0;
Element_Info_From_Milliseconds(float64_int64s(((float64)FrameInfo.DTS)/90));
Element_End0();
Element_End0();
@@ -1963,6 +1965,8 @@ void File_MpegPs::Header_Parse_PES_packet_MPEG2(int8u stream_id)
| ( ((int64u)Buffer[Buffer_Pos+1] )<<22)|((((int64u)Buffer[Buffer_Pos+2]&0xFE))<<14)
| ( ((int64u)Buffer[Buffer_Pos+3] )<< 7)|((((int64u)Buffer[Buffer_Pos+4]&0xFE))>> 1);
Element_Offset+=5;
+ if (Frame_Count<16 &&FrameInfo.DTS>=0x100000000LL) //Hack in case DTS is negative (currently not supported by MI). TODO: negative DTS.
+ FrameInfo.DTS=0;
#if MEDIAINFO_TRACE
}
#endif //MEDIAINFO_TRACE
@@ -2470,10 +2474,10 @@ void File_MpegPs::pack_start()
SizeToAnalyze=2*1024*1024; //Not too less
}
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
if (!IsSub)
Ibi_SynchronizationOffset_Current=File_Offset+Buffer_Offset-Header_Size;
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
FILLING_END();
}
@@ -3409,7 +3413,7 @@ void File_MpegPs::video_stream()
{
Streams[stream_id].Parsers[Pos]->CA_system_ID_MustSkipSlices=CA_system_ID_MustSkipSlices;
Open_Buffer_Init(Streams[stream_id].Parsers[Pos]);
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
if (FromTS)
Streams[stream_id].Parsers[Pos]->IbiStream=IbiStream;
else
@@ -3418,7 +3422,7 @@ void File_MpegPs::video_stream()
Ibi.Streams[stream_id]=new ibi::stream;
Streams[stream_id].Parsers[Pos]->IbiStream=Ibi.Streams[stream_id];
}
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
#if MEDIAINFO_SEEK
if (Unsynch_Frame_Counts.find(stream_id)!=Unsynch_Frame_Counts.end())
Streams[stream_id].Parsers[Pos]->Frame_Count_NotParsedIncluded=Unsynch_Frame_Counts[stream_id];
@@ -3970,9 +3974,9 @@ void File_MpegPs::xxx_stream_Parse(ps_stream &Temp, int8u &stream_Count)
if (Temp.Parsers.size()>1)
Element_Begin1("Test");
#endif //MEDIAINFO_TRACE
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
Temp.Parsers[Pos]->Ibi_SynchronizationOffset_Current=Ibi_SynchronizationOffset_Current;
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
#if defined(MEDIAINFO_EIA608_YES) || defined(MEDIAINFO_EIA708_YES)
Temp.Parsers[Pos]->ServiceDescriptors=ServiceDescriptors;
#endif
@@ -4088,7 +4092,7 @@ void File_MpegPs::xxx_stream_Parse(ps_stream &Temp, int8u &stream_Count)
#endif //MEDIAINFO_DEMUX
#endif //MEDIAINFO_EVENTS
- #if MEDIAINFO_SEEK && MEDIAINFO_IBI
+ #if MEDIAINFO_SEEK && MEDIAINFO_IBIUSAGE
if (Seek_ID!=(int64u)-1)
{
if (Ibi.Streams[Seek_ID]->IsModified)
@@ -4117,7 +4121,7 @@ void File_MpegPs::xxx_stream_Parse(ps_stream &Temp, int8u &stream_Count)
}
}
}
- #endif //MEDIAINFO_SEEK && MEDIAINFO_IBI
+ #endif //MEDIAINFO_SEEK && MEDIAINFO_IBIUSAGE
}
//***************************************************************************
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_MpegTs.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_MpegTs.cpp
index 5b41da130..db0abb821 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_MpegTs.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_MpegTs.cpp
@@ -34,11 +34,9 @@
#include "MediaInfo/MediaInfo_Config_MediaInfo.h"
#include "MediaInfo/MediaInfo_Events_Internal.h"
#endif //MEDIAINFO_EVENTS
-#if MEDIAINFO_IBI
- #if MEDIAINFO_SEEK
- #include "MediaInfo/Multiple/File_Ibi.h"
- #endif //MEDIAINFO_SEEK
-#endif //MEDIAINFO_IBI
+#if MEDIAINFO_IBIUSAGE && MEDIAINFO_SEEK
+ #include "MediaInfo/Multiple/File_Ibi.h"
+#endif //MEDIAINFO_IBIUSAGE && MEDIAINFO_SEEK
using namespace std;
//---------------------------------------------------------------------------
@@ -324,7 +322,7 @@ void File_MpegTs::Streams_Accept()
Config->File_IgnoreSequenceFileSize_Set(false);
if (Config->File_IgnoreSequenceFilesCount_Get())
Config->File_IgnoreSequenceFilesCount_Set(false);
- #endif MEDIAINFO_ADVANCED
+ #endif //MEDIAINFO_ADVANCED
TestContinuousFileNames();
}
@@ -1272,7 +1270,7 @@ void File_MpegTs::Streams_Finish()
File__Duplicate_Streams_Finish();
#endif //MEDIAINFO_DUPLICATE
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBICREATE
if (!IsSub && Config_Ibi_Create)
{
for (ibi::streams::iterator IbiStream_Temp=Ibi.Streams.begin(); IbiStream_Temp!=Ibi.Streams.end(); ++IbiStream_Temp)
@@ -1295,7 +1293,7 @@ void File_MpegTs::Streams_Finish()
}
}
}
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
}
//***************************************************************************
@@ -1420,12 +1418,12 @@ bool File_MpegTs::Synched_Test()
}
return true; //Version has no meaning
}
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
if (table_id==0x00)
Complete_Stream->Streams[pid]->Ibi_SynchronizationOffset_BeginOfFrame=File_Offset+Buffer_Offset;
if (table_id==0x02)
Complete_Stream->Streams[pid]->Ibi_SynchronizationOffset_BeginOfFrame=Complete_Stream->Streams[0x0000]->Ibi_SynchronizationOffset_BeginOfFrame;
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
complete_stream::stream::table_ids::iterator Table_ID=Stream->Table_IDs.begin()+table_id;
if (*Table_ID)
{
@@ -1696,8 +1694,17 @@ bool File_MpegTs::Synched_Test()
{
//We are already parsing 16 seconds (for all PCRs), we don't hope to have more info
MpegTs_JumpTo_Begin=File_Offset+Buffer_Offset-Buffer_TotalBytes_FirstSynched;
- if (MpegTs_JumpTo_End>MpegTs_JumpTo_Begin)
- MpegTs_JumpTo_End=MpegTs_JumpTo_Begin;
+ MpegTs_JumpTo_End=MpegTs_JumpTo_Begin;
+ if (MpegTs_JumpTo_Begin+MpegTs_JumpTo_End>=File_Size)
+ {
+ if (MpegTs_JumpTo_Begin+MpegTs_JumpTo_End>File_Size)
+ {
+ MpegTs_JumpTo_Begin=File_Size;
+ MpegTs_JumpTo_End=0;
+ }
+ else
+ MpegTs_JumpTo_Begin=File_Size-MpegTs_JumpTo_End;
+ }
}
}
}
@@ -1821,13 +1828,13 @@ void File_MpegTs::Read_Buffer_Unsynched()
Complete_Stream->Streams[StreamID]->Parser->Unsynch_Frame_Count=0;
Complete_Stream->Streams[StreamID]->Parser->Open_Buffer_Unsynch();
}
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
Complete_Stream->Streams[StreamID]->Ibi_SynchronizationOffset_BeginOfFrame=(int64u)-1;
for (complete_stream::stream::table_ids::iterator TableID=Complete_Stream->Streams[StreamID]->Table_IDs.begin(); TableID!=Complete_Stream->Streams[StreamID]->Table_IDs.end(); ++TableID)
if (*TableID)
for (complete_stream::stream::table_id::table_id_extensions::iterator TableIdExtension=(*TableID)->Table_ID_Extensions.begin(); TableIdExtension!=(*TableID)->Table_ID_Extensions.end(); ++TableIdExtension)
TableIdExtension->second.version_number=(int8u)-1;
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
}
Complete_Stream->Duration_End.clear();
@@ -1916,6 +1923,24 @@ void File_MpegTs::Read_Buffer_AfterParsing()
Status[IsUpdated]=true;
Status[User_19]=true;
+ //
+ if (!(Buffer_TotalBytes-Buffer_TotalBytes_FirstSynched>=MpegTs_JumpTo_Begin && Config->ParseSpeed<0.8))
+ {
+ //We are already parsing 16 seconds (for all PCRs), we don't hope to have more info
+ MpegTs_JumpTo_Begin=File_Offset+Buffer_Offset-Buffer_TotalBytes_FirstSynched;
+ MpegTs_JumpTo_End=MpegTs_JumpTo_Begin;
+ if (MpegTs_JumpTo_Begin+MpegTs_JumpTo_End>=File_Size)
+ {
+ if (MpegTs_JumpTo_Begin+MpegTs_JumpTo_End>File_Size)
+ {
+ MpegTs_JumpTo_Begin=File_Size;
+ MpegTs_JumpTo_End=0;
+ }
+ else
+ MpegTs_JumpTo_Begin=File_Size-MpegTs_JumpTo_End;
+ }
+ }
+
//Jumping
if (Config->ParseSpeed<1.0 && Config->File_IsSeekable_Get()
#if MEDIAINFO_ADVANCED
@@ -1951,7 +1976,7 @@ size_t File_MpegTs::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
if (!Duration_Detected)
{
//External IBI
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
std::string IbiFile=Config->Ibi_Get();
if (!IbiFile.empty())
{
@@ -1995,7 +2020,7 @@ size_t File_MpegTs::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
if (Ibi.Streams.empty())
return 4; //Problem during IBI file parsing
}
- #endif //#if MEDIAINFO_IBI
+ #endif //#if MEDIAINFO_IBIUSAGE
Duration_Detected=true;
}
@@ -2012,7 +2037,7 @@ size_t File_MpegTs::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
Open_Buffer_Unsynch();
return 1;
case 2 : //Timestamp
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
{
ibi::streams::iterator IbiStream_Temp;
if (ID==(int64u)-1)
@@ -2075,11 +2100,11 @@ size_t File_MpegTs::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
return 2; //Invalid value
}
- #else //MEDIAINFO_IBI
+ #else //MEDIAINFO_IBIUSAGE
return (size_t)-2; //Not supported / IBI disabled
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
case 3 : //FrameNumber
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
{
ibi::streams::iterator IbiStream_Temp;
if (ID==(int64u)-1)
@@ -2118,9 +2143,9 @@ size_t File_MpegTs::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
return 2; //Invalid value
}
- #else //MEDIAINFO_IBI
+ #else //MEDIAINFO_IBIUSAGE
return (size_t)-2; //Not supported / IBI disabled
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
default : return (size_t)-1; //Not supported
}
}
@@ -2427,8 +2452,17 @@ void File_MpegTs::Header_Parse_AdaptationField()
{
//We are already parsing 16 seconds (for all PCRs), we don't hope to have more info
MpegTs_JumpTo_Begin=File_Offset+Buffer_Offset-Buffer_TotalBytes_FirstSynched;
- if (MpegTs_JumpTo_End>MpegTs_JumpTo_Begin)
- MpegTs_JumpTo_End=MpegTs_JumpTo_Begin;
+ MpegTs_JumpTo_End=MpegTs_JumpTo_Begin;
+ if (MpegTs_JumpTo_Begin+MpegTs_JumpTo_End>=File_Size)
+ {
+ if (MpegTs_JumpTo_Begin+MpegTs_JumpTo_End>File_Size)
+ {
+ MpegTs_JumpTo_Begin=File_Size;
+ MpegTs_JumpTo_End=0;
+ }
+ else
+ MpegTs_JumpTo_Begin=File_Size-MpegTs_JumpTo_End;
+ }
}
}
}
@@ -2656,8 +2690,17 @@ void File_MpegTs::Header_Parse_AdaptationField()
{
//We are already parsing 16 seconds (for all PCRs), we don't hope to have more info
MpegTs_JumpTo_Begin=File_Offset+Buffer_Offset-Buffer_TotalBytes_FirstSynched;
- if (MpegTs_JumpTo_End>MpegTs_JumpTo_Begin)
- MpegTs_JumpTo_End=MpegTs_JumpTo_Begin;
+ MpegTs_JumpTo_End=MpegTs_JumpTo_Begin;
+ if (MpegTs_JumpTo_Begin+MpegTs_JumpTo_End>=File_Size)
+ {
+ if (MpegTs_JumpTo_Begin+MpegTs_JumpTo_End>File_Size)
+ {
+ MpegTs_JumpTo_Begin=File_Size;
+ MpegTs_JumpTo_End=0;
+ }
+ else
+ MpegTs_JumpTo_Begin=File_Size-MpegTs_JumpTo_End;
+ }
}
}
}
@@ -2904,11 +2947,11 @@ void File_MpegTs::PES()
Streams[pid]->Parser=new File_Unknown();
#endif
Complete_Stream->Streams[pid]->Parser->CA_system_ID_MustSkipSlices=Complete_Stream->Streams[pid]->CA_system_ID_MustSkipSlices;
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
if (Ibi.Streams[pid]==NULL)
Ibi.Streams[pid]=new ibi::stream;
Complete_Stream->Streams[pid]->Parser->IbiStream=Ibi.Streams[pid];
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
Open_Buffer_Init(Complete_Stream->Streams[pid]->Parser);
}
@@ -2922,7 +2965,7 @@ void File_MpegTs::PES()
//Parsing
if (Complete_Stream->Streams[pid]->IsPCR)
((File_MpegPs*)Complete_Stream->Streams[pid]->Parser)->FrameInfo.PCR=Complete_Stream->Streams[pid]->TimeStamp_End==(int64u)-1?(int64u)-1:Complete_Stream->Streams[pid]->TimeStamp_End*1000/27; //27 MHz
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
if (Complete_Stream->transport_stream_id!=(int16u)-1 && !Complete_Stream->Streams[pid]->program_numbers.empty())
{
int16u Program_PID=Complete_Stream->Transport_Streams[Complete_Stream->transport_stream_id].Programs[Complete_Stream->Streams[pid]->program_numbers[0]].pid;
@@ -2932,7 +2975,7 @@ void File_MpegTs::PES()
}
else
Complete_Stream->Streams[pid]->Parser->Ibi_SynchronizationOffset_Current=File_Offset+Buffer_Offset-Header_Size;
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
#if defined(MEDIAINFO_ARIBSTDB24B37_YES)
if (FromAribStdB24B37)
@@ -3028,7 +3071,7 @@ void File_MpegTs::PES_Parse_Finish()
#endif //MEDIAINFO_MPEGTS_PESTIMESTAMP_YES
}
- #if MEDIAINFO_SEEK && MEDIAINFO_IBI
+ #if MEDIAINFO_SEEK && MEDIAINFO_IBIUSAGE
if (Seek_ID!=(int64u)-1)
{
if (Ibi.Streams[Seek_ID]->IsModified)
@@ -3054,7 +3097,7 @@ void File_MpegTs::PES_Parse_Finish()
}
}
}
- #endif //MEDIAINFO_SEEK && MEDIAINFO_IBI
+ #endif //MEDIAINFO_SEEK && MEDIAINFO_IBIUSAGE
}
//---------------------------------------------------------------------------
@@ -3075,9 +3118,9 @@ void File_MpegTs::PSI()
}
//Parsing
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
Complete_Stream->Streams[pid]->Parser->Ibi_SynchronizationOffset_Current=File_Offset+Buffer_Offset-Header_Size;
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
Open_Buffer_Continue(Complete_Stream->Streams[pid]->Parser);
//Filling
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg_Descriptors.h b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg_Descriptors.h
index 5e0195a17..56f5c0abe 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg_Descriptors.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg_Descriptors.h
@@ -379,9 +379,9 @@ struct complete_stream
size_t IsScrambled;
int16u CA_system_ID;
int16u SubStream_pid;
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
int64u Ibi_SynchronizationOffset_BeginOfFrame;
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
#if defined(MEDIAINFO_EIA608_YES) || defined(MEDIAINFO_EIA708_YES)
File__Analyze::servicedescriptors ServiceDescriptors;
bool ServiceDescriptors_IsPresent;
@@ -448,9 +448,9 @@ struct complete_stream
CA_system_ID=0x0000;
EBP_IsPresent=false;
SubStream_pid=0x0000;
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
Ibi_SynchronizationOffset_BeginOfFrame=(int64u)-1;
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
#if defined(MEDIAINFO_EIA608_YES) || defined(MEDIAINFO_EIA708_YES)
ServiceDescriptors_IsPresent=false;
#endif
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg_Psi.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg_Psi.cpp
index 795a29332..17836f4a9 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg_Psi.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mpeg_Psi.cpp
@@ -135,6 +135,8 @@ const char* Mpeg_Psi_stream_type_Format(int8u stream_type, int32u format_identif
case 0x85 : return "DTS"; //" (HD-HRA)"
case 0x86 : return "DTS"; //" (HD-MA)"
case 0x90 : return "PGS";
+ case 0x91 : return "PGS";
+ case 0x92 : return "TEXTST"; //Blu-ray subtitle text
case 0xA1 : return "AC-3";
case 0xA2 : return "DTS";
case 0xEA : return "VC-1";
@@ -200,6 +202,8 @@ const char* Mpeg_Psi_stream_type_Codec(int8u stream_type, int32u format_identifi
case 0x83 : return "AC3+";
case 0x86 : return "DTS";
case 0x90 : return "PGS";
+ case 0x91 : return "PGS";
+ case 0x92 : return "TEXTST"; //Blu-ray Subtitle Text
case 0xEA : return "VC1";
default : return "";
}
@@ -268,6 +272,8 @@ stream_t Mpeg_Psi_stream_type_StreamKind(int32u stream_type, int32u format_ident
case 0x85 : return Stream_Audio;
case 0x86 : return Stream_Audio;
case 0x90 : return Stream_Text;
+ case 0x91 : return Stream_Text;
+ case 0x92 : return Stream_Text;
case 0xA1 : return Stream_Audio;
case 0xA2 : return Stream_Audio;
case 0xEA : return Stream_Video;
@@ -370,6 +376,8 @@ const char* Mpeg_Psi_stream_type_Info(int8u stream_type, int32u format_identifie
case 0x85 : return "BluRay - DTS (HD-HRA)";
case 0x86 : return "BluRay - DTS (HD-MA)";
case 0x90 : return "BluRay - PGS";
+ case 0x91 : return "BluRay - PGS";
+ case 0x92 : return "BluRay - TEXTST";
case 0xA1 : return "BluRay - AC-3";
case 0xA2 : return "BluRay - DTS";
case 0xEA : return "BluRay - VC-1";
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mxf.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mxf.cpp
index 1aafe061b..e15fcb7b8 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mxf.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mxf.cpp
@@ -73,7 +73,9 @@
#include "ZenLib/FileName.h"
#include "ZenLib/Dir.h"
#include "MediaInfo/MediaInfo_Internal.h"
-#include "MediaInfo/Multiple/File__ReferenceFilesHelper.h"
+#if defined(MEDIAINFO_REFERENCES_YES)
+ #include "MediaInfo/Multiple/File__ReferenceFilesHelper.h"
+#endif //defined(MEDIAINFO_REFERENCES_YES)
#include "ZenLib/Format/Http/Http_Utils.h"
#include <cfloat>
#if MEDIAINFO_SEEK
@@ -114,7 +116,7 @@ namespace MediaInfoLib
namespace Elements
{
- // 01 - Identifiers and locators
+ // 01 - Identification and location
// 01 - Globally Unique Identifiers
// 15 - Object Identifiers
UUID(060E2B34, 0101010C, 01011512, 00000000, 0000, "SMPTE ST 429-5", ResourceID, "Resource ID")
@@ -148,6 +150,8 @@ namespace Elements
UUID(060E2B34, 0101010E, 01051200, 00000000, 0000, "SMPTE ST 377-4", MCATitleSubVersion, "MCA Title Sub-version")
UUID(060E2B34, 0101010E, 01051300, 00000000, 0000, "SMPTE ST 377-4", MCAEpisode, "MCA Episode")
+ // 02 - Administrative
+
// 03 - Interpretive
// 01 - Fundamental
// 01 - Countries and Languages
@@ -192,16 +196,28 @@ namespace Elements
// 06 - Digital Video and Image Compression Parameters
// 02 - MPEG Coding Parameters
// 01 - MPEG-2 Coding Parameters
- UUID(060E2B34, 01010105, 04010602, 01020000, 0000, "", MPEG2VideoDescriptor_SingleSequence, "")
- UUID(060E2B34, 01010105, 04010602, 01030000, 0000, "", MPEG2VideoDescriptor_ConstantBFrames, "")
- UUID(060E2B34, 01010105, 04010602, 01040000, 0000, "", MPEG2VideoDescriptor_CodedContentType, "")
- UUID(060E2B34, 01010105, 04010602, 01050000, 0000, "", MPEG2VideoDescriptor_LowDelay, "")
- UUID(060E2B34, 01010105, 04010602, 01060000, 0000, "", MPEG2VideoDescriptor_ClosedGOP, "")
- UUID(060E2B34, 01010105, 04010602, 01070000, 0000, "", MPEG2VideoDescriptor_IdenticalGOP, "")
- UUID(060E2B34, 01010105, 04010602, 01080000, 0000, "", MPEG2VideoDescriptor_MaxGOP, "")
- UUID(060E2B34, 01010105, 04010602, 01090000, 0000, "", MPEG2VideoDescriptor_BPictureCount, "")
- UUID(060E2B34, 01010105, 04010602, 010A0000, 0000, "", MPEG2VideoDescriptor_ProfileAndLevel, "")
- UUID(060E2B34, 01010105, 04010602, 010B0000, 0000, "", MPEG2VideoDescriptor_BitRate, "")
+ UUID(060E2B34, 01010105, 04010602, 01020000, 0000, "SMPTE ST 381-1", MPEG2VideoDescriptor_SingleSequence, "")
+ UUID(060E2B34, 01010105, 04010602, 01030000, 0000, "SMPTE ST 381-1", MPEG2VideoDescriptor_ConstantBFrames, "")
+ UUID(060E2B34, 01010105, 04010602, 01040000, 0000, "SMPTE ST 381-1", MPEG2VideoDescriptor_CodedContentType, "")
+ UUID(060E2B34, 01010105, 04010602, 01050000, 0000, "SMPTE ST 381-1", MPEG2VideoDescriptor_LowDelay, "")
+ UUID(060E2B34, 01010105, 04010602, 01060000, 0000, "SMPTE ST 381-1", MPEG2VideoDescriptor_ClosedGOP, "")
+ UUID(060E2B34, 01010105, 04010602, 01070000, 0000, "SMPTE ST 381-1", MPEG2VideoDescriptor_IdenticalGOP, "")
+ UUID(060E2B34, 01010105, 04010602, 01080000, 0000, "SMPTE ST 381-1", MPEG2VideoDescriptor_MaxGOP, "")
+ UUID(060E2B34, 01010105, 04010602, 01090000, 0000, "SMPTE ST 381-1", MPEG2VideoDescriptor_BPictureCount, "")
+ UUID(060E2B34, 01010105, 04010602, 010A0000, 0000, "SMPTE ST 381-1", MPEG2VideoDescriptor_ProfileAndLevel, "")
+ UUID(060E2B34, 01010105, 04010602, 010B0000, 0000, "SMPTE ST 381-1", MPEG2VideoDescriptor_BitRate, "")
+
+ // 02 - MPEG-4 Visual Coding Parameters
+ UUID(060E2B34, 01010105, 04010602, 02020000, 0000, "SMPTE ST 381-2", Mpeg4VisualDescriptor_SingleSequence, "")
+ UUID(060E2B34, 01010105, 04010602, 02030000, 0000, "SMPTE ST 381-2", Mpeg4VisualDescriptor_ConstantBFrames, "")
+ UUID(060E2B34, 01010105, 04010602, 02040000, 0000, "SMPTE ST 381-2", Mpeg4VisualDescriptor_CodedContentType, "")
+ UUID(060E2B34, 01010105, 04010602, 02050000, 0000, "SMPTE ST 381-2", Mpeg4VisualDescriptor_LowDelay, "")
+ UUID(060E2B34, 01010105, 04010602, 02060000, 0000, "SMPTE ST 381-2", Mpeg4VisualDescriptor_ClosedGOP, "")
+ UUID(060E2B34, 01010105, 04010602, 02070000, 0000, "SMPTE ST 381-2", Mpeg4VisualDescriptor_IdenticalGOP, "")
+ UUID(060E2B34, 01010105, 04010602, 02080000, 0000, "SMPTE ST 381-2", Mpeg4VisualDescriptor_MaxGOP, "")
+ UUID(060E2B34, 01010105, 04010602, 02090000, 0000, "SMPTE ST 381-2", Mpeg4VisualDescriptor_BPictureCount, "")
+ UUID(060E2B34, 01010105, 04010602, 020A0000, 0000, "SMPTE ST 381-2", Mpeg4VisualDescriptor_ProfileAndLevel, "")
+ UUID(060E2B34, 01010105, 04010602, 020B0000, 0000, "SMPTE ST 381-2", Mpeg4VisualDescriptor_BitRate, "")
// 02 - JPEG 2000 Coding Parameters
UUID(060E2B34, 0101010A, 04010603, 01000000, 0000, "", JPEG2000PictureSubDescriptor_Rsiz, "")
@@ -218,15 +234,33 @@ namespace Elements
UUID(060E2B34, 0101010A, 04010603, 0C000000, 0000, "", JPEG2000PictureSubDescriptor_CodingStyleDefault, "")
UUID(060E2B34, 0101010A, 04010603, 0D000000, 0000, "", JPEG2000PictureSubDescriptor_QuantizationDefault, "")
+ // 02 - Audio Essence Characteristics
+ // 04 - Audio Compression Parameters
+ // 03 - MPEG Coding Parameters
+ // 01 - MPEG-2 Coding Parameters
+ UUID(060E2B34, 01010105, 04020403, 01020000, 0000, "SMPTE ST 381-2", MpegAudioDescriptor_BitRate, "")
+
// 09 - Format Characteristics
UUID(060E2B34, 0101010C, 04090500, 00000000, 0000, "SMPTE ST 429-5", UCSEncoding, "UCS Encoding")
+ // 05 - Process
+
// 06 - Relational
// 01 - Essence and Metadata Relationships
// 04 - Essence to Essence Relationships
UUID(060E2B34, 01010109, 06010104, 06100000, 0000, "", SubDescriptors, "")
- // 0D - User organization registred for public use
+ // 07 - Spatio-temporal
+
+ // 0C - Compound
+ // 02 - Metadata sets created at point of creation or capture
+ // 01 - Metadata sets associated with a video camera
+ // 01 - Frame-based metadata set
+ UUID(060E2B34, 02530101, 0C020101, 01010000, 0000, "SMPTE RDD 18", LensUnitMetadata, "")
+ UUID(060E2B34, 02530101, 0C020101, 02010000, 0000, "SMPTE RDD 18", CameraUnitMetadata, "")
+ UUID(060E2B34, 02530101, 0C020101, 7F010000, 0000, "SMPTE RDD 18", UserDefinedAcquisitionMetadata, "")
+
+ // 0D - Organizationally registered for public use
// 01 - AAF Association
// 01 - MXF Structural Metadata Sets
// 01 - Version 1
@@ -265,11 +299,12 @@ namespace Elements
UUID(060E2B34, 02530101, 0D010101, 01014500, 0000, "SMPTE ST 377-1", DMSourceClip, "")
UUID(060E2B34, 02530101, 0D010101, 01014700, 0000, "", AES3PCMDescriptor, "")
UUID(060E2B34, 02530101, 0D010101, 01014800, 0000, "", WaveAudioDescriptor, "")
- UUID(060E2B34, 02530101, 0D010101, 01015100, 0000, "", MPEG2VideoDescriptor, "")
+ UUID(060E2B34, 02530101, 0D010101, 01015100, 0000, "SMPTE ST 381-1", MPEG2VideoDescriptor, "")
+ UUID(060E2B34, 02530101, 0D010101, 01015900, 0000, "SMPTE ST 377-1", SubDescriptor, "Sub Descriptor")
UUID(060E2B34, 02530101, 0D010101, 01015A00, 0000, "", JPEG2000PictureSubDescriptor, "")
UUID(060E2B34, 02530101, 0D010101, 01015B00, 0000, "", VbiPacketsDescriptor, "")
UUID(060E2B34, 02530101, 0D010101, 01015C00, 0000, "", AncPacketsDescriptor, "")
- UUID(060E2B34, 02530101, 0D010101, 01015900, 0000, "SMPTE ST 377-1", SubDescriptor, "Sub Descriptor")
+ UUID(060E2B34, 02530101, 0D010101, 01015E00, 0000, "SMPTE ST 381-2", MpegAudioDescriptor, "MPEG Audio Descriptor")
UUID(060E2B34, 02530101, 0D010101, 01016000, 0000, "SMPTE ST 377-1", PackageMarkerObject, "")
UUID(060E2B34, 02530101, 0D010101, 01016100, 0000, "SMPTE ST 377-1", ApplicationPlugInObject, "")
UUID(060E2B34, 02530101, 0D010101, 01016200, 0000, "SMPTE ST 377-1", ApplicationReferencedObject, "")
@@ -277,6 +312,8 @@ namespace Elements
UUID(060E2B34, 02530101, 0D010101, 01016400, 0000, "SMPTE ST 429-5", TimedTextDescriptor, "")
UUID(060E2B34, 02530101, 0D010101, 01016500, 0000, "SMPTE ST 429-5", TimedTextResourceSubDescriptor, "")
UUID(060E2B34, 02530101, 0D010101, 01016600, 0000, "SMPTE ST 377-1", ApplicationObject, "Application Object")
+ UUID(060E2B34, 02530101, 0D010101, 01016700, 0000, "SMPTE ST ?", Unknown67SubDescriptor, "Unknown 0x67 Sub-Descriptor")
+ UUID(060E2B34, 02530101, 0D010101, 01016800, 0000, "SMPTE ST 381-2", Mpeg4VisualSubDescriptor, "MPEG-4 Visual Sub-Descriptor")
UUID(060E2B34, 02530101, 0D010101, 01016A00, 0000, "SMPTE ST 377-4", MCALabelSubDescriptor, "")
UUID(060E2B34, 02530101, 0D010101, 01016B00, 0000, "SMPTE ST 377-4", AudioChannelLabelSubDescriptor, "")
UUID(060E2B34, 02530101, 0D010101, 01016C00, 0000, "SMPTE ST 377-4", SoundfieldGroupLabelSubDescriptor, "")
@@ -326,7 +363,7 @@ namespace Elements
// 0B - ?
// 01 - AS-11 core metadata framework
UUID(060E2B34, 02530101, 0D010701, 0B010100, 0000, "AMWA AS-11", AS11_AAF_Core, "")
- UUID(060E2B34, 01010101, 0D010701, 0B010101, 0000, "AMWA AS-11", AS11_Core_SerieTitle, "")
+ UUID(060E2B34, 01010101, 0D010701, 0B010101, 0000, "AMWA AS-11", AS11_Core_SeriesTitle, "")
UUID(060E2B34, 01010101, 0D010701, 0B010102, 0000, "AMWA AS-11", AS11_Core_ProgrammeTitle, "")
UUID(060E2B34, 01010101, 0D010701, 0B010103, 0000, "AMWA AS-11", AS11_Core_EpisodeTitleNumber, "")
UUID(060E2B34, 01010101, 0D010701, 0B010104, 0000, "AMWA AS-11", AS11_Core_ShimName, "")
@@ -386,7 +423,7 @@ namespace Elements
UUID(060E2B34, 01010101, 0D0C0101, 01012400, 0000, "AMWA AS-11", AS11_UKDPP_ContactEmail, "")
UUID(060E2B34, 01010101, 0D0C0101, 01012500, 0000, "AMWA AS-11", AS11_UKDPP_ContactTelephoneNumber, "")
- // 0E - User organization registred for private use
+ // 0E - Organizationally registered for private use
// 04 - Avid
UUID(060E2B34, 01020101, 0E040301, 00000000, 0000, "", GenericContainer_Avid, "")
@@ -1777,9 +1814,59 @@ const char* Mxf_AS11_SignLanguage[Mxf_AS11_SignLanguage_Count]=
"BSL (Makaton)",
};
+
+//---------------------------------------------------------------------------
+// EBU Tech 3349
+string Mxf_CameraUnitMetadata_GammaforCDL(int8u Value)
+{
+ switch(Value)
+ {
+ case 0x00 : return "Same as Capture Gamma";
+ case 0x01 : return "Scene Linear";
+ case 0x02 : return "S-Log";
+ case 0x03 : return "Cine-Log";
+ case 0xFF : return "Undefined";
+ default : return Ztring::ToZtring(Value).To_UTF8();
+ }
+};
+
+//---------------------------------------------------------------------------
+// EBU Tech 3349
+string Mxf_CameraUnitMetadata_ImageSensorReadoutMode(int8u Value)
+{
+ switch(Value)
+ {
+ case 0x00 : return "Interlaced field";
+ case 0x01 : return "Interlaced frame";
+ case 0x02 : return "Progressive frame ";
+ case 0xFF : return "Undefined";
+ default : return Ztring::ToZtring(Value).To_UTF8();
+ }
+};
+
+//---------------------------------------------------------------------------
+// EBU Tech 3349
+string Mxf_CameraUnitMetadata_CaptureGammaEquation(int128u Value)
+{
+ switch(Value.lo)
+ {
+ case 0x0401010101020000LL : return "BT.709";
+ case 0x0401010101030000LL : return "SMPTE ST 240";
+ default :
+ {
+ Ztring ValueS;
+ ValueS.From_Number(Value.lo, 16);
+ if (ValueS.size()<16)
+ ValueS.insert(0, 16-ValueS.size(), __T('0'));
+ return ValueS.To_UTF8();
+ }
+ }
+};
+
//---------------------------------------------------------------------------
extern const char* Mpegv_profile_and_level_indication_profile[];
extern const char* Mpegv_profile_and_level_indication_level[];
+extern const char* Mpeg4v_Profile_Level(int32u Profile_Level);
//---------------------------------------------------------------------------
extern const char* AfdBarData_active_format[];
@@ -1832,9 +1919,6 @@ File_Mxf::File_Mxf()
IdIsAlwaysSame_Offset=0;
PartitionMetadata_PreviousPartition=(int64u)-1;
PartitionMetadata_FooterPartition=(int64u)-1;
- TimeCode_StartTimecode=(int64u)-1;
- TimeCode_RoundedTimecodeBase=0;
- TimeCode_DropFrame=false;
DTS_Delay=0;
StreamPos_StartAtOne=true;
SDTI_TimeCode_StartTimecode_ms=(int64u)-1;
@@ -1845,6 +1929,7 @@ File_Mxf::File_Mxf()
SystemScheme1_FrameRateFromDescriptor=0;
Essences_FirstEssence_Parsed=false;
StereoscopicPictureSubDescriptor_IsPresent=false;
+ UserDefinedAcquisitionMetadata_UdamSetIdentifier_IsSony=false;
Essences_UsedForFrameCount=(int32u)-1;
#if MEDIAINFO_ADVANCED
Footer_Position=(int64u)-1;
@@ -1875,14 +1960,24 @@ File_Mxf::File_Mxf()
OverallBitrate_IsCbrForSure=0;
Duration_Detected=false;
#endif //MEDIAINFO_SEEK
+ #if MEDIAINFO_DEMUX
+ DemuxedSampleCount_Total=(int64u)-1;
+ DemuxedSampleCount_Current=(int64u)-1;
+ DemuxedSampleCount_AddedToFirstFrame=0;
+ DemuxedElementSize_AddedToFirstFrame=0;
+ #endif //MEDIAINFO_DEMUX
}
//---------------------------------------------------------------------------
File_Mxf::~File_Mxf()
{
- delete ReferenceFiles;
- if (!Ancillary_IsBinded)
- delete Ancillary;
+ #if defined(MEDIAINFO_REFERENCES_YES)
+ delete ReferenceFiles;
+ #endif //defined(MEDIAINFO_REFERENCES_YES)
+ #if defined(MEDIAINFO_ANCILLARY_YES)
+ if (!Ancillary_IsBinded)
+ delete Ancillary;
+ #endif //defined(MEDIAINFO_ANCILLARY_YES)
}
//***************************************************************************
@@ -1907,7 +2002,7 @@ void File_Mxf::Streams_Fill()
//---------------------------------------------------------------------------
void File_Mxf::Streams_Finish()
{
- #if MEDIAINFO_NEXTPACKET
+ #if MEDIAINFO_NEXTPACKET && defined(MEDIAINFO_REFERENCES_YES)
//Locators only
if (ReferenceFiles_IsParsing)
{
@@ -1920,12 +2015,12 @@ void File_Mxf::Streams_Finish()
Streams_Finish_CommercialNames();
return;
}
- #endif //MEDIAINFO_NEXTPACKET
+ #endif //MEDIAINFO_NEXTPACKET && defined(MEDIAINFO_REFERENCES_YES)
//Per stream
for (essences::iterator Essence=Essences.begin(); Essence!=Essences.end(); ++Essence)
{
- if (Essence->second.Parsers.size()!=1 && Essence->second.StreamKind==Stream_Audio) // Last parser is PCM, impossible to detect with another method if there is only one block
+ if (Essence->second.Parsers.size()>1 && Essence->second.StreamKind==Stream_Audio) // Last parser is PCM, impossible to detect with another method if there is only one block
{
for (size_t Pos=0; Pos<Essence->second.Parsers.size()-1; Pos++)
delete Essence->second.Parsers[Pos];
@@ -2043,7 +2138,7 @@ void File_Mxf::Streams_Finish()
//Parsing locators
Locators_Test();
#if MEDIAINFO_NEXTPACKET
- if (Config->NextPacket_Get() && ReferenceFiles && !ReferenceFiles->References.empty())
+ if (Config->NextPacket_Get() && ReferenceFiles)
{
ReferenceFiles_IsParsing=true;
return;
@@ -2071,7 +2166,7 @@ void File_Mxf::Streams_Finish()
}
//File size in case of partial file analysis
- if (Config->File_IgnoreFramesBefore || Config->File_IgnoreFramesAfter!=(int64u)-1)
+ if (Config->File_IgnoreEditsBefore || Config->File_IgnoreEditsAfter!=(int64u)-1)
{
int64u FrameCount_FromComponent=(int64u)-1;
for (components::iterator Component=Components.begin(); Component!=Components.end(); ++Component)
@@ -2084,17 +2179,17 @@ void File_Mxf::Streams_Finish()
if (FrameCount_FromComponent!=(int64u)-1 && FrameCount_FromComponent && EditRate_FromTrack!=DBL_MAX && EditRate_FromTrack)
{
int64u FrameCount=FrameCount_FromComponent;
- int64u File_IgnoreFramesBefore=Config->File_IgnoreFramesBefore;
- if (File_IgnoreFramesBefore && Config->File_IgnoreFramesRate && (EditRate_FromTrack<Config->File_IgnoreFramesRate*0.9 || EditRate_FromTrack>Config->File_IgnoreFramesRate*1.1)) //In case of problem or EditRate being sampling rate
- File_IgnoreFramesBefore=float64_int64s(((float64)File_IgnoreFramesBefore)/Config->File_IgnoreFramesRate*EditRate_FromTrack);
- int64u File_IgnoreFramesAfter=Config->File_IgnoreFramesAfter;
- if (File_IgnoreFramesAfter!=(int64u)-1 && Config->File_IgnoreFramesRate && (EditRate_FromTrack<Config->File_IgnoreFramesRate*0.9 || EditRate_FromTrack>Config->File_IgnoreFramesRate*1.1)) //In case of problem or EditRate being sampling rate
- File_IgnoreFramesAfter=float64_int64s(((float64)File_IgnoreFramesAfter)/Config->File_IgnoreFramesRate*EditRate_FromTrack);
- if (File_IgnoreFramesAfter<FrameCount)
- FrameCount=File_IgnoreFramesAfter;
- if (FrameCount<File_IgnoreFramesBefore)
- FrameCount=File_IgnoreFramesBefore;
- FrameCount-=File_IgnoreFramesBefore;
+ int64u File_IgnoreEditsBefore=Config->File_IgnoreEditsBefore;
+ if (File_IgnoreEditsBefore && Config->File_EditRate && (EditRate_FromTrack<Config->File_EditRate*0.9 || EditRate_FromTrack>Config->File_EditRate*1.1)) //In case of problem or EditRate being sampling rate
+ File_IgnoreEditsBefore=float64_int64s(((float64)File_IgnoreEditsBefore)/Config->File_EditRate*EditRate_FromTrack);
+ int64u File_IgnoreEditsAfter=Config->File_IgnoreEditsAfter;
+ if (File_IgnoreEditsAfter!=(int64u)-1 && Config->File_EditRate && (EditRate_FromTrack<Config->File_EditRate*0.9 || EditRate_FromTrack>Config->File_EditRate*1.1)) //In case of problem or EditRate being sampling rate
+ File_IgnoreEditsAfter=float64_int64s(((float64)File_IgnoreEditsAfter)/Config->File_EditRate*EditRate_FromTrack);
+ if (File_IgnoreEditsAfter<FrameCount)
+ FrameCount=File_IgnoreEditsAfter;
+ if (FrameCount<File_IgnoreEditsBefore)
+ FrameCount=File_IgnoreEditsBefore;
+ FrameCount-=File_IgnoreEditsBefore;
float64 File_Size_Temp=(float64)File_Size;
File_Size_Temp/=FrameCount_FromComponent;
@@ -2371,19 +2466,19 @@ void File_Mxf::Streams_Finish_Essence(int32u EssenceUID, int128u TrackUID)
for (std::map<std::string, Ztring>::iterator Info=Essence->second.Infos.begin(); Info!=Essence->second.Infos.end(); ++Info)
Fill(StreamKind_Last, StreamPos_Last, Info->first.c_str(), Info->second, true);
- if (TimeCode_RoundedTimecodeBase && TimeCode_StartTimecode!=(int64u)-1)
+ if (MxfTimeCodeForDelay.RoundedTimecodeBase && MxfTimeCodeForDelay.StartTimecode!=(int64u)-1)
{
- float64 TimeCode_StartTimecode_Temp=((float64)(TimeCode_StartTimecode+Config->File_IgnoreFramesBefore))/TimeCode_RoundedTimecodeBase;
- if (TimeCode_DropFrame)
+ float64 TimeCode_StartTimecode_Temp=((float64)(MxfTimeCodeForDelay.StartTimecode+Config->File_IgnoreEditsBefore))/MxfTimeCodeForDelay.RoundedTimecodeBase;
+ if (MxfTimeCodeForDelay.DropFrame)
{
TimeCode_StartTimecode_Temp*=1001;
TimeCode_StartTimecode_Temp/=1000;
}
Fill(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_Delay), TimeCode_StartTimecode_Temp*1000, 0, true);
Fill(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_Delay_Source), "Container");
- Fill(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_Delay_DropFrame), TimeCode_DropFrame?"Yes":"No");
+ Fill(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_Delay_DropFrame), MxfTimeCodeForDelay.DropFrame?"Yes":"No");
- //TimeCode TC(TimeCode_StartTimecode, TimeCode_RoundedTimecodeBase, TimeCode_DropFrame);
+ //TimeCode TC(MxfTimeCodeForDelay.StartTimecode, MxfTimeCodeForDelay.RoundedTimecodeBase, MxfTimeCodeForDelay.DropFrame);
//Fill(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_TimeCode_FirstFrame), TC.ToString().c_str());
//Fill(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_TimeCode_Source), "Time code track (stripped)");
}
@@ -2595,10 +2690,10 @@ void File_Mxf::Streams_Finish_Essence(int32u EssenceUID, int128u TrackUID)
Stream_Prepare(Stream_Audio);
size_t Pos=Count_Get(Stream_Audio)-1;
(*Parser)->Finish();
- if (TimeCode_RoundedTimecodeBase && TimeCode_StartTimecode!=(int64u)-1)
+ if (MxfTimeCodeForDelay.RoundedTimecodeBase && MxfTimeCodeForDelay.StartTimecode!=(int64u)-1)
{
- float64 TimeCode_StartTimecode_Temp=((float64)(TimeCode_StartTimecode+Config->File_IgnoreFramesBefore))/TimeCode_RoundedTimecodeBase;
- if (TimeCode_DropFrame)
+ float64 TimeCode_StartTimecode_Temp=((float64)(MxfTimeCodeForDelay.StartTimecode+Config->File_IgnoreEditsBefore))/MxfTimeCodeForDelay.RoundedTimecodeBase;
+ if (MxfTimeCodeForDelay.DropFrame)
{
TimeCode_StartTimecode_Temp*=1001;
TimeCode_StartTimecode_Temp/=1000;
@@ -2635,10 +2730,10 @@ void File_Mxf::Streams_Finish_Essence(int32u EssenceUID, int128u TrackUID)
Fill_Flush();
Stream_Prepare(Stream_Text);
(*Parser)->Finish();
- if (TimeCode_RoundedTimecodeBase && TimeCode_StartTimecode!=(int64u)-1)
+ if (MxfTimeCodeForDelay.RoundedTimecodeBase && MxfTimeCodeForDelay.StartTimecode!=(int64u)-1)
{
- float64 TimeCode_StartTimecode_Temp=((float64)(TimeCode_StartTimecode+Config->File_IgnoreFramesBefore))/TimeCode_RoundedTimecodeBase;
- if (TimeCode_DropFrame)
+ float64 TimeCode_StartTimecode_Temp=((float64)(MxfTimeCodeForDelay.StartTimecode+Config->File_IgnoreEditsBefore))/MxfTimeCodeForDelay.RoundedTimecodeBase;
+ if (MxfTimeCodeForDelay.DropFrame)
{
TimeCode_StartTimecode_Temp*=1001;
TimeCode_StartTimecode_Temp/=1000;
@@ -2693,7 +2788,7 @@ void File_Mxf::Streams_Finish_Essence(int32u EssenceUID, int128u TrackUID)
{
//TODO: Stream_Size is present only if there is one stream, so it works in most cases. We should find a better way.
int64u Stream_Size=Essence->second.Stream_Size;
- if (Config->File_IgnoreFramesBefore || Config->File_IgnoreFramesAfter!=(int64u)-1)
+ if (Config->File_IgnoreEditsBefore || Config->File_IgnoreEditsAfter!=(int64u)-1)
{
int64u FrameCount_FromComponent=(int64u)-1;
for (components::iterator Component=Components.begin(); Component!=Components.end(); ++Component)
@@ -2706,17 +2801,17 @@ void File_Mxf::Streams_Finish_Essence(int32u EssenceUID, int128u TrackUID)
if (FrameCount_FromComponent!=(int64u)-1 && FrameCount_FromComponent && EditRate_FromTrack!=DBL_MAX && EditRate_FromTrack)
{
int64u FrameCount=FrameCount_FromComponent;
- int64u File_IgnoreFramesBefore=Config->File_IgnoreFramesBefore;
- if (File_IgnoreFramesBefore && Config->File_IgnoreFramesRate && (EditRate_FromTrack<Config->File_IgnoreFramesRate*0.9 || EditRate_FromTrack>Config->File_IgnoreFramesRate*1.1)) //In case of problem or EditRate being sampling rate
- File_IgnoreFramesBefore=float64_int64s(((float64)File_IgnoreFramesBefore)/Config->File_IgnoreFramesRate*EditRate_FromTrack);
- int64u File_IgnoreFramesAfter=Config->File_IgnoreFramesAfter;
- if (File_IgnoreFramesAfter!=(int64u)-1 && Config->File_IgnoreFramesRate && (EditRate_FromTrack<Config->File_IgnoreFramesRate*0.9 || EditRate_FromTrack>Config->File_IgnoreFramesRate*1.1)) //In case of problem or EditRate being sampling rate
- File_IgnoreFramesAfter=float64_int64s(((float64)File_IgnoreFramesAfter)/Config->File_IgnoreFramesRate*EditRate_FromTrack);
- if (File_IgnoreFramesAfter<FrameCount)
- FrameCount=File_IgnoreFramesAfter;
- if (FrameCount<File_IgnoreFramesBefore)
- FrameCount=File_IgnoreFramesBefore;
- FrameCount-=File_IgnoreFramesBefore;
+ int64u File_IgnoreEditsBefore=Config->File_IgnoreEditsBefore;
+ if (File_IgnoreEditsBefore && Config->File_EditRate && (EditRate_FromTrack<Config->File_EditRate*0.9 || EditRate_FromTrack>Config->File_EditRate*1.1)) //In case of problem or EditRate being sampling rate
+ File_IgnoreEditsBefore=float64_int64s(((float64)File_IgnoreEditsBefore)/Config->File_EditRate*EditRate_FromTrack);
+ int64u File_IgnoreEditsAfter=Config->File_IgnoreEditsAfter;
+ if (File_IgnoreEditsAfter!=(int64u)-1 && Config->File_EditRate && (EditRate_FromTrack<Config->File_EditRate*0.9 || EditRate_FromTrack>Config->File_EditRate*1.1)) //In case of problem or EditRate being sampling rate
+ File_IgnoreEditsAfter=float64_int64s(((float64)File_IgnoreEditsAfter)/Config->File_EditRate*EditRate_FromTrack);
+ if (File_IgnoreEditsAfter<FrameCount)
+ FrameCount=File_IgnoreEditsAfter;
+ if (FrameCount<File_IgnoreEditsBefore)
+ FrameCount=File_IgnoreEditsBefore;
+ FrameCount-=File_IgnoreEditsBefore;
float64 Stream_Size_Temp=(float64)Stream_Size;
Stream_Size_Temp/=FrameCount_FromComponent;
@@ -3270,19 +3365,19 @@ void File_Mxf::Streams_Finish_Component(const int128u ComponentUID, float64 Edit
if (EditRate && StreamKind_Last!=Stream_Max && Component->second.Duration!=(int64u)-1)
{
int64u FrameCount=Component->second.Duration;
- if (StreamKind_Last==Stream_Video || Config->File_IgnoreFramesRate)
- {
- int64u File_IgnoreFramesBefore=Config->File_IgnoreFramesBefore;
- if (File_IgnoreFramesBefore && Config->File_IgnoreFramesRate && (EditRate<Config->File_IgnoreFramesRate*0.9 || EditRate>Config->File_IgnoreFramesRate*1.1)) //In case of problem or EditRate being sampling rate
- File_IgnoreFramesBefore=float64_int64s(((float64)File_IgnoreFramesBefore)/Config->File_IgnoreFramesRate*EditRate);
- int64u File_IgnoreFramesAfter=Config->File_IgnoreFramesAfter;
- if (File_IgnoreFramesAfter!=(int64u)-1 && Config->File_IgnoreFramesRate && (EditRate<Config->File_IgnoreFramesRate*0.9 || EditRate>Config->File_IgnoreFramesRate*1.1)) //In case of problem or EditRate being sampling rate
- File_IgnoreFramesAfter=float64_int64s(((float64)File_IgnoreFramesAfter)/Config->File_IgnoreFramesRate*EditRate);
- if (File_IgnoreFramesAfter<FrameCount)
- FrameCount=File_IgnoreFramesAfter;
- if (FrameCount<File_IgnoreFramesBefore)
- FrameCount=File_IgnoreFramesBefore;
- FrameCount-=File_IgnoreFramesBefore;
+ if (StreamKind_Last==Stream_Video || Config->File_EditRate)
+ {
+ int64u File_IgnoreEditsBefore=Config->File_IgnoreEditsBefore;
+ if (File_IgnoreEditsBefore && Config->File_EditRate && (EditRate<Config->File_EditRate*0.9 || EditRate>Config->File_EditRate*1.1)) //In case of problem or EditRate being sampling rate
+ File_IgnoreEditsBefore=float64_int64s(((float64)File_IgnoreEditsBefore)/Config->File_EditRate*EditRate);
+ int64u File_IgnoreEditsAfter=Config->File_IgnoreEditsAfter;
+ if (File_IgnoreEditsAfter!=(int64u)-1 && Config->File_EditRate && (EditRate<Config->File_EditRate*0.9 || EditRate>Config->File_EditRate*1.1)) //In case of problem or EditRate being sampling rate
+ File_IgnoreEditsAfter=float64_int64s(((float64)File_IgnoreEditsAfter)/Config->File_EditRate*EditRate);
+ if (File_IgnoreEditsAfter<FrameCount)
+ FrameCount=File_IgnoreEditsAfter;
+ if (FrameCount<File_IgnoreEditsBefore)
+ FrameCount=File_IgnoreEditsBefore;
+ FrameCount-=File_IgnoreEditsBefore;
}
Fill(StreamKind_Last, StreamPos_Last, Fill_Parameter(StreamKind_Last, Generic_Duration), FrameCount*1000/EditRate, 0, true);
size_t ID_SubStreamInfo_Pos=Retrieve(StreamKind_Last, StreamPos_Last, General_ID).find(__T("-"));
@@ -3329,10 +3424,10 @@ void File_Mxf::Streams_Finish_Component_ForTimeCode(const int128u ComponentUID,
for (size_t Pos=0; Pos<Component->second.StructuralComponents.size(); Pos++)
{
components::iterator Component2=Components.find(Component->second.StructuralComponents[Pos]);
- if (Component2!=Components.end() && Component2->second.TimeCode_StartTimecode!=(int64u)-1 && !Config->File_IsReferenced_Get())
+ if (Component2!=Components.end() && Component2->second.MxfTimeCode.StartTimecode!=(int64u)-1 && !Config->File_IsReferenced_Get())
{
//Note: Origin is not part of the StartTimecode for the first frame in the source package. From specs: "For a Timecode Track with a single Timecode Component and with origin N, where N greater than 0, the timecode value at the Zero Point of the Track equals the start timecode of the Timecode Component incremented by N units."
- TimeCode TC(Component2->second.TimeCode_StartTimecode+Config->File_IgnoreFramesBefore, (int8u)Component2->second.TimeCode_RoundedTimecodeBase, Component2->second.TimeCode_DropFrame);
+ TimeCode TC(Component2->second.MxfTimeCode.StartTimecode+Config->File_IgnoreEditsBefore, (int8u)Component2->second.MxfTimeCode.RoundedTimecodeBase, Component2->second.MxfTimeCode.DropFrame);
Stream_Prepare(Stream_Other);
Fill(Stream_Other, StreamPos_Last, Other_ID, Ztring::ToZtring(TrackID)+(IsSourcePackage?__T("-Source"):__T("-Material")));
Fill(Stream_Other, StreamPos_Last, Other_Type, "Time code");
@@ -3343,12 +3438,10 @@ void File_Mxf::Streams_Finish_Component_ForTimeCode(const int128u ComponentUID,
if ((!TimeCodeFromMaterialPackage && IsSourcePackage) || (TimeCodeFromMaterialPackage && !IsSourcePackage))
{
- TimeCode_RoundedTimecodeBase=Component2->second.TimeCode_RoundedTimecodeBase;
- TimeCode_StartTimecode=Component2->second.TimeCode_StartTimecode;
- TimeCode_DropFrame=Component2->second.TimeCode_DropFrame;
+ MxfTimeCodeForDelay=Component2->second.MxfTimeCode;
- DTS_Delay=((float64)TimeCode_StartTimecode)/TimeCode_RoundedTimecodeBase;
- if (TimeCode_DropFrame)
+ DTS_Delay=((float64)MxfTimeCodeForDelay.StartTimecode)/MxfTimeCodeForDelay.RoundedTimecodeBase;
+ if (MxfTimeCodeForDelay.DropFrame)
{
DTS_Delay*=1001;
DTS_Delay/=1000;
@@ -3358,6 +3451,11 @@ void File_Mxf::Streams_Finish_Component_ForTimeCode(const int128u ComponentUID,
Config->Demux_Offset_DTS_FromStream=FrameInfo.DTS;
#endif //MEDIAINFO_DEMUX
}
+
+ if (!IsSourcePackage)
+ {
+ MxfTimeCodeMaterial=Component2->second.MxfTimeCode;
+ }
}
}
}
@@ -3373,11 +3471,11 @@ void File_Mxf::Streams_Finish_Component_ForAS11(const int128u ComponentUID, floa
int64u TC_Temp=0;
int8u FrameRate_TempI;
bool DropFrame_Temp;
- if (TimeCode_RoundedTimecodeBase && TimeCode_StartTimecode!=(int64u)-1 && TimeCode_RoundedTimecodeBase<256)
+ if (MxfTimeCodeMaterial.RoundedTimecodeBase && MxfTimeCodeMaterial.StartTimecode!=(int64u)-1 && MxfTimeCodeMaterial.RoundedTimecodeBase)
{
- TC_Temp=TimeCode_StartTimecode;
- FrameRate_TempI=(int8u)TimeCode_RoundedTimecodeBase;
- DropFrame_Temp=TimeCode_DropFrame;
+ TC_Temp=MxfTimeCodeMaterial.StartTimecode;
+ FrameRate_TempI=(int8u)MxfTimeCodeMaterial.RoundedTimecodeBase;
+ DropFrame_Temp=MxfTimeCodeMaterial.DropFrame;
}
else
{
@@ -3430,7 +3528,7 @@ void File_Mxf::Streams_Finish_Component_ForAS11(const int128u ComponentUID, floa
{
case as11::Type_Core:
Fill(Stream_Other, StreamPos_Last, "Format", "AS-11 Core");
- Fill(Stream_Other, StreamPos_Last, "SerieTitle", AS11->second.SerieTitle);
+ Fill(Stream_Other, StreamPos_Last, "SeriesTitle", AS11->second.SeriesTitle);
Fill(Stream_Other, StreamPos_Last, "ProgrammeTitle", AS11->second.ProgrammeTitle);
Fill(Stream_Other, StreamPos_Last, "EpisodeTitleNumber", AS11->second.EpisodeTitleNumber);
Fill(Stream_Other, StreamPos_Last, "ShimName", AS11->second.ShimName);
@@ -3558,7 +3656,7 @@ void File_Mxf::Streams_Finish_Component_ForAS11(const int128u ComponentUID, floa
}
}
if (Duration_Programme)
- Fill(Stream_Other, StreamPos_Last, "Total Programme Duration", TimeCode(Duration_Programme, FrameRate_TempI, DropFrame_Temp).ToString());
+ Fill(Stream_Other, StreamPos_Last, "TotalProgrammeDuration", TimeCode(Duration_Programme, FrameRate_TempI, DropFrame_Temp).ToString());
}
//---------------------------------------------------------------------------
@@ -3568,34 +3666,37 @@ void File_Mxf::Streams_Finish_Identification (const int128u IdentificationUID)
if (Identification==Identifications.end())
return;
- if (!Identification->second.ProductName.empty())
+ //Product part
+ Ztring Encoded_Application_Version=Identification->second.ProductVersion.empty()?Identification->second.VersionString:Identification->second.ProductVersion;
+ Ztring Encoded_Application_ProductName(Identification->second.ProductName);
+ if (!Identification->second.CompanyName.empty() && Identification->second.CompanyName.size()<Encoded_Application_ProductName.size())
{
- Ztring Encoded_Library_Name;
- if (!Identification->second.CompanyName.empty())
- {
- Encoded_Library_Name+=Identification->second.CompanyName;
- Encoded_Library_Name+=__T(' ');
- }
- Encoded_Library_Name+=Identification->second.ProductName;
- Ztring Encoded_Library_Version;
- if (!Identification->second.ProductVersion.empty())
- {
- Encoded_Library_Version=Identification->second.ProductVersion;
- }
- else if (!Identification->second.VersionString.empty())
- {
- Encoded_Library_Version=Identification->second.VersionString;
- }
- Ztring Encoded_Application=Encoded_Library_Name;
- if (!Encoded_Library_Version.empty())
- {
- Encoded_Application+=__T(' ');
- Encoded_Application+=Encoded_Library_Version;
- }
- Fill(Stream_General, 0, General_Encoded_Application, Encoded_Application, true);
- Fill(Stream_General, 0, General_Encoded_Library_Name, Encoded_Library_Name, true);
- Fill(Stream_General, 0, General_Encoded_Library_Version, Encoded_Library_Version, true);
+ Ztring ProductName_Begin(Encoded_Application_ProductName.c_str(), Identification->second.CompanyName.size());
+ if (Identification->second.CompanyName.Compare(ProductName_Begin) && Encoded_Application_ProductName[Identification->second.CompanyName.size()]==__T(' '))
+ Encoded_Application_ProductName.erase(0, Identification->second.CompanyName.size()+1);
+ }
+ size_t Encoded_Application_ProductName_Pos = Encoded_Application_ProductName.find_last_of(__T(' '));
+ if (Encoded_Application_ProductName_Pos!=string::npos)
+ {
+ Ztring Encoded_Application_ProductName_End(Encoded_Application_ProductName.c_str()+Encoded_Application_ProductName_Pos+1);
+ if (Encoded_Application_Version.find(Encoded_Application_ProductName_End)==0)
+ Encoded_Application_ProductName.resize(Encoded_Application_ProductName_Pos); //Removing version number from the name (format not conform)
}
+ Fill(Stream_General, 0, General_Encoded_Application_CompanyName, Identification->second.CompanyName, true);
+ Fill(Stream_General, 0, General_Encoded_Application_Name, Encoded_Application_ProductName, true);
+ Fill(Stream_General, 0, General_Encoded_Application_Version, Encoded_Application_Version, true);
+
+ //Platform part
+ Ztring Library_Name(Identification->second.Platform);
+ size_t Library_Name_Pos = Library_Name.find_last_of(__T(' '));
+ if (Library_Name_Pos!=string::npos)
+ {
+ Ztring Library_Name_End(Library_Name.c_str()+Library_Name_Pos+1);
+ if (Identification->second.ToolkitVersion.find(Library_Name_End)==0)
+ Library_Name.resize(Library_Name_Pos); //Removing version number from the name (format not conform)
+ }
+ Fill(Stream_General, 0, General_Encoded_Library_Name, Library_Name, true);
+ Fill(Stream_General, 0, General_Encoded_Library_Version, Identification->second.ToolkitVersion, true);
for (std::map<std::string, Ztring>::iterator Info=Identification->second.Infos.begin(); Info!=Identification->second.Infos.end(); ++Info)
Fill(Stream_General, 0, Info->first.c_str(), Info->second, true);
@@ -3835,6 +3936,9 @@ void File_Mxf::Read_Buffer_Unsynched()
Partitions_Pos++;
}
+ if (Partitions_Pos==2 && Partitions[1].StreamOffset==FutureFileOffset && Descriptors.size()==1 && Descriptors.begin()->second.StreamKind==Stream_Text)
+ Frame_Count_NotParsedIncluded=0;
+
if (Descriptors.size()==1 && Descriptors.begin()->second.ByteRate!=(int32u)-1 && Descriptors.begin()->second.SampleRate)
{
float64 BytePerFrame=Descriptors.begin()->second.ByteRate/Descriptors.begin()->second.SampleRate;
@@ -3914,7 +4018,7 @@ void File_Mxf::Read_Buffer_Unsynched()
int64u Entry0_StreamOffset=0; //For coherency checking
int64u Entry_StreamOffset=IndexTables[Pos].Entries[EntryPos].StreamOffset+(IndexTables[Pos].IndexStartPosition+EntryPos)*SDTI_SizePerFrame;
int64u Entry1_StreamOffset=File_Size; //For coherency checking
- if (EntryPos==0 && Pos && IndexTables[Pos-1].Entries.empty())
+ if (EntryPos==0 && Pos && !IndexTables[Pos-1].Entries.empty())
Entry0_StreamOffset=IndexTables[Pos-1].Entries[IndexTables[Pos-1].Entries.size()-1].StreamOffset+(IndexTables[Pos].IndexStartPosition+EntryPos-1)*SDTI_SizePerFrame;
else if (EntryPos)
Entry0_StreamOffset=IndexTables[Pos].Entries[EntryPos-1].StreamOffset+(IndexTables[Pos].IndexStartPosition+EntryPos-1)*SDTI_SizePerFrame;
@@ -4050,8 +4154,10 @@ bool File_Mxf::DetectDuration ()
#if MEDIAINFO_SEEK
size_t File_Mxf::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
{
- if (ReferenceFiles)
- return ReferenceFiles->Read_Buffer_Seek(Method, Value, ID);
+ #if defined(MEDIAINFO_REFERENCES_YES)
+ if (ReferenceFiles)
+ return ReferenceFiles->Seek(Method, Value, ID);
+ #endif //defined(MEDIAINFO_REFERENCES_YES)
//Init
if (!Duration_Detected)
@@ -4097,7 +4203,7 @@ size_t File_Mxf::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
{
float64 EditRate_FromTrack=DBL_MAX;
for (tracks::iterator Track=Tracks.begin(); Track!=Tracks.end(); ++Track)
- if (EditRate_FromTrack>Track->second.EditRate)
+ if (Track->second.EditRate && EditRate_FromTrack>Track->second.EditRate)
EditRate_FromTrack=Track->second.EditRate;
if (EditRate_FromTrack>1000)
EditRate_FromTrack=Demux_Rate; //Default value;
@@ -4118,7 +4224,7 @@ size_t File_Mxf::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
{
case 0 :
{
- if (Config->File_IgnoreFramesBefore && Config->File_IgnoreFramesRate)
+ if (Config->File_IgnoreEditsBefore && Config->File_EditRate)
{
Read_Buffer_Seek(3, 0, (int64u)-1);
if (File_GoTo!=(int64u)-1)
@@ -4192,25 +4298,15 @@ size_t File_Mxf::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
return Read_Buffer_Seek(0, File_Size*Value/10000, ID);
case 2 : //Timestamp
{
- if (Config->File_IgnoreFramesBefore && Config->File_IgnoreFramesRate)
- Value+=float64_int64s(((float64)Config->File_IgnoreFramesBefore)/Config->File_IgnoreFramesRate*1000000000);
-
//We transform TimeStamp to a frame number
descriptors::iterator Descriptor;
for (Descriptor=Descriptors.begin(); Descriptor!=Descriptors.end(); ++Descriptor)
- if (Descriptors.begin()->second.SampleRate)
+ if (Descriptor->second.SampleRate)
break;
if (Descriptor==Descriptors.end())
return (size_t)-1; //Not supported
- if (Config->Demux_Offset_DTS!=(int64u)-1)
- {
- int64u Delay=Config->Demux_Offset_DTS;
- if (Value<Delay)
- return 2; //Invalid value
- Value-=Delay;
- }
- else if (TimeCode_StartTimecode!=(int64u)-1)
+ else if (MxfTimeCodeForDelay.StartTimecode!=(int64u)-1)
{
int64u Delay=float64_int64s(DTS_Delay*1000000000);
if (Value<Delay)
@@ -4221,10 +4317,17 @@ size_t File_Mxf::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
}
//No break;
case 3 : //FrameNumber
- Value+=Config->File_IgnoreFramesBefore;
+ Value+=Config->File_IgnoreEditsBefore;
if (Descriptors.size()==1 && Descriptors.begin()->second.ByteRate!=(int32u)-1 && Descriptors.begin()->second.BlockAlign && Descriptors.begin()->second.BlockAlign!=(int16u)-1 && Descriptors.begin()->second.SampleRate)
{
+ if (Descriptors.begin()->second.SampleRate!=Config->File_EditRate && Config->File_IgnoreEditsBefore)
+ {
+ //Edit rate and Demux rate are different, not well supported for the moment
+ Value-=Config->File_IgnoreEditsBefore;
+ Value+=float64_int64s(((float64)Config->File_IgnoreEditsBefore)/Config->File_EditRate*Descriptors.begin()->second.SampleRate);
+ }
+
float64 BytesPerFrame=Descriptors.begin()->second.ByteRate/Descriptors.begin()->second.SampleRate;
int64u StreamOffset=(int64u)(Value*BytesPerFrame);
StreamOffset/=Descriptors.begin()->second.BlockAlign;
@@ -4537,6 +4640,9 @@ bool File_Mxf::Header_Begin()
float64 BytesPerFrame=((float64)SingleDescriptor->second.ByteRate)/SingleDescriptor->second.SampleRate;
int64u FramesAlreadyParsed=float64_int64s(((float64)(File_Offset+Buffer_Offset-Buffer_Begin))/BytesPerFrame);
Element_Size=float64_int64s(SingleDescriptor->second.ByteRate/SingleDescriptor->second.SampleRate*(FramesAlreadyParsed+1));
+ #if MEDIAINFO_DEMUX
+ Element_Size+=DemuxedElementSize_AddedToFirstFrame;
+ #endif //MEDIAINFO_DEMUX
Element_Size/=SingleDescriptor->second.BlockAlign;
Element_Size*=SingleDescriptor->second.BlockAlign;
Element_Size-=File_Offset+Buffer_Offset-Buffer_Begin;
@@ -4548,6 +4654,37 @@ bool File_Mxf::Header_Begin()
Element_Size=Buffer_End-(File_Offset+Buffer_Offset);
if (Buffer_Offset+Element_Size>Buffer_Size)
return false;
+
+ #if MEDIAINFO_DEMUX
+ if (!DemuxedSampleCount_Total && Config->Demux_Offset_DTS!=(int64u)-1 && Config->File_EditRate)
+ {
+ //Need to sync to a rounded value compared to the whole stream (including previous files)
+ float64 TimeStamp=((float64)Config->Demux_Offset_DTS)/1000000000;
+ int64u FramesBeForeThisFileMinusOne=(int64u)(TimeStamp*SingleDescriptor->second.SampleRate);
+ if ((((float64)FramesBeForeThisFileMinusOne)/SingleDescriptor->second.SampleRate)!=TimeStamp)
+ {
+ float64 Delta=(((float64)FramesBeForeThisFileMinusOne+1)/SingleDescriptor->second.SampleRate)-TimeStamp;
+ DemuxedSampleCount_AddedToFirstFrame=float64_int64s(Delta*Config->File_EditRate);
+ DemuxedElementSize_AddedToFirstFrame=DemuxedSampleCount_AddedToFirstFrame*SingleDescriptor->second.BlockAlign;
+ Element_Size+=DemuxedElementSize_AddedToFirstFrame;
+ }
+ }
+ if (DemuxedSampleCount_Total!=(int64u)-1 && Config->File_IgnoreEditsAfter!=(int64u)-1)
+ {
+ DemuxedSampleCount_Current=Element_Size/SingleDescriptor->second.BlockAlign;
+ int64u RealSampleRate=SingleDescriptor->second.Infos["SamplingRate"].To_int64u();
+ int64u IgnoreSamplesAfter;
+ if (RealSampleRate==Config->File_EditRate)
+ IgnoreSamplesAfter=Config->File_IgnoreEditsAfter;
+ else
+ IgnoreSamplesAfter=float64_int64s(((float64)Config->File_IgnoreEditsAfter)/Config->File_EditRate*RealSampleRate);
+ if (DemuxedSampleCount_Total+DemuxedSampleCount_Current>IgnoreSamplesAfter)
+ {
+ DemuxedSampleCount_Current=Config->File_IgnoreEditsAfter-DemuxedSampleCount_Total;
+ Element_Size=DemuxedSampleCount_Current*SingleDescriptor->second.BlockAlign;
+ }
+ }
+ #endif //MEDIAINFO_DEMUX
}
else if (Demux_UnpacketizeContainer && !IndexTables.empty() && IndexTables[0].EditUnitByteCount)
{
@@ -4627,7 +4764,7 @@ bool File_Mxf::Header_Begin()
int64u Entry0_StreamOffset=0; //For coherency checking
int64u Entry_StreamOffset=IndexTables[Pos].Entries[EntryPos].StreamOffset+(IndexTables[Pos].IndexStartPosition+EntryPos)*SDTI_SizePerFrame;
int64u Entry1_StreamOffset=File_Size; //For coherency checking
- if (EntryPos==0 && Pos && IndexTables[Pos-1].Entries.empty())
+ if (EntryPos==0 && Pos && !IndexTables[Pos-1].Entries.empty())
Entry0_StreamOffset=IndexTables[Pos-1].Entries[IndexTables[Pos-1].Entries.size()-1].StreamOffset+(IndexTables[Pos].IndexStartPosition+EntryPos-1)*SDTI_SizePerFrame;
else if (EntryPos)
Entry0_StreamOffset=IndexTables[Pos].Entries[EntryPos-1].StreamOffset+(IndexTables[Pos].IndexStartPosition+EntryPos-1)*SDTI_SizePerFrame;
@@ -4799,8 +4936,8 @@ void File_Mxf::Header_Parse()
//Testing locators
Locators_CleanUp();
- if (Config->File_IgnoreFramesBefore && !Config->File_IsDetectingDuration_Get())
- Open_Buffer_Seek(3, 0, (int64u)-1); //Forcing seek to Config->File_IgnoreFramesBefore
+ if (Config->File_IgnoreEditsBefore && !Config->File_IsDetectingDuration_Get())
+ Open_Buffer_Seek(3, 0, (int64u)-1); //Forcing seek to Config->File_IgnoreEditsBefore
if (Config->NextPacket_Get() && Config->Event_CallBackFunction_IsSet())
{
if (Locators.empty())
@@ -4978,6 +5115,9 @@ void File_Mxf::Data_Parse()
ELEMENT(TerminatingFiller, "Terminating Filler")
ELEMENT(XmlDocumentText, "XML Document Text")
ELEMENT(SubDescriptors, "Sub Descriptors")
+ ELEMENT(LensUnitMetadata, "Lens Unit Metadata")
+ ELEMENT(CameraUnitMetadata, "Camera Unit Metadata")
+ ELEMENT(UserDefinedAcquisitionMetadata, "User Defined Acquisition Metadata")
ELEMENT(Filler53, "Filler")
ELEMENT(Sequence, "Sequence")
ELEMENT(SourceClip, "Source Clip")
@@ -5008,12 +5148,15 @@ void File_Mxf::Data_Parse()
ELEMENT(JPEG2000PictureSubDescriptor, "JPEG 2000 Picture Sub Descriptor")
ELEMENT(VbiPacketsDescriptor, "VBI Descriptor")
ELEMENT(AncPacketsDescriptor, "ANC Packets Descriptor")
+ ELEMENT(MpegAudioDescriptor, "MPEG Audio Descriptor")
ELEMENT(PackageMarkerObject, "DM Source Clip")
ELEMENT(ApplicationPlugInObject, "Application Plug-In Object")
ELEMENT(ApplicationReferencedObject, "Application Referenced Object")
ELEMENT(MCALabelSubDescriptor, "MCA Label Sub-Descriptor")
ELEMENT(TimedTextDescriptor, "Timed Text Descriptor")
ELEMENT(TimedTextResourceSubDescriptor, "Timed Text Resource Sub-Descriptor")
+ ELEMENT(Unknown67SubDescriptor, "Unknown 0x67 Sub-Descriptor")
+ ELEMENT(Mpeg4VisualSubDescriptor, "MPEG-4 Visual Sub-Descriptor")
ELEMENT(AudioChannelLabelSubDescriptor, "Audio Channel Label Sub-Descriptor")
ELEMENT(SoundfieldGroupLabelSubDescriptor, "Soundfield Group Label Sub-Descriptor")
ELEMENT(GroupOfSoundfieldGroupsLabelSubDescriptor, "Group Of Soundfield Groups Label Sub-Descriptor")
@@ -5110,11 +5253,12 @@ void File_Mxf::Data_Parse()
{
float64 EditRate_FromTrack=DBL_MAX;
for (tracks::iterator Track=Tracks.begin(); Track!=Tracks.end(); ++Track)
- if (EditRate_FromTrack>Track->second.EditRate)
+ if (Track->second.EditRate && EditRate_FromTrack>Track->second.EditRate)
EditRate_FromTrack=Track->second.EditRate;
if (EditRate_FromTrack>1000)
EditRate_FromTrack=Demux_Rate; //Default value;
Descriptor->second.SampleRate=EditRate_FromTrack;
+ DemuxedSampleCount_Total=Config->File_IgnoreEditsBefore;
for (tracks::iterator Track=Tracks.begin(); Track!=Tracks.end(); ++Track)
if (Track->second.EditRate>EditRate_FromTrack)
{
@@ -5233,13 +5377,14 @@ void File_Mxf::Data_Parse()
Essence->second.TrackID_WasLookedFor=true;
}
+ if ((Code_Compare4&0x000000FF)==0x00000000)
+ StreamPos_StartAtOne=false;
+
//Searching the corresponding Descriptor
for (descriptors::iterator Descriptor=Descriptors.begin(); Descriptor!=Descriptors.end(); ++Descriptor)
if (Descriptor==SingleDescriptor || (Descriptor->second.LinkedTrackID==Essence->second.TrackID && Descriptor->second.LinkedTrackID!=(int32u)-1))
{
Essence->second.StreamPos_Initial=Essence->second.StreamPos=Code_Compare4&0x000000FF;
- if ((Code_Compare4&0x000000FF)==0x00000000)
- StreamPos_StartAtOne=false;
if (Descriptor->second.StreamKind==Stream_Audio && Descriptor->second.Infos.find("Format_Settings_Endianness")==Descriptor->second.Infos.end())
{
@@ -5279,10 +5424,10 @@ void File_Mxf::Data_Parse()
if (!IsSub) //Updating for MXF only if MXF is not embedded in another container
{
Essence->second.Frame_Count_NotParsedIncluded=Frame_Count_NotParsedIncluded;
- if (Essence->second.Frame_Count_NotParsedIncluded!=(int64u)-1 && Essence->second.Frame_Count_NotParsedIncluded)
+ if (Essence->second.Frame_Count_NotParsedIncluded!=(int64u)-1 && Essence->second.Frame_Count_NotParsedIncluded && Essence->first!=Essences_UsedForFrameCount)
Essence->second.Frame_Count_NotParsedIncluded--; //Info is from the first essence parsed, and 1 frame is already parsed
Essence->second.FrameInfo.DTS=FrameInfo.DTS;
- if (Essence->second.FrameInfo.DTS!=(int64u)-1 && FrameInfo.DUR!=(int64u)-1 && Frame_Count_NotParsedIncluded)
+ if (Essence->second.FrameInfo.DTS!=(int64u)-1 && FrameInfo.DUR!=(int64u)-1 && Frame_Count_NotParsedIncluded && Essence->first!=Essences_UsedForFrameCount)
Essence->second.FrameInfo.DTS-=FrameInfo.DUR; //Info is from the first essence parsed, and 1 frame is already parsed
if (!Tracks.empty() && Tracks.begin()->second.EditRate) //TODO: use the corresponding track instead of the first one
Essence->second.FrameInfo.DUR=float64_int64s(1000000000/Tracks.begin()->second.EditRate);
@@ -5421,20 +5566,22 @@ void File_Mxf::Data_Parse()
(*Parser)->FrameInfo.PTS=Essence->second.FrameInfo.PTS;
if (Essence->second.FrameInfo.DUR!=(int64u)-1)
(*Parser)->FrameInfo.DUR=Essence->second.FrameInfo.DUR;
- if ((*Parser)->ParserName==__T("Ancillary"))
- ((File_Ancillary*)(*Parser))->LineNumber=LineNumber;
- if ((*Parser)->ParserName==__T("Ancillary") && (((File_Ancillary*)(*Parser))->FrameRate==0 || ((File_Ancillary*)(*Parser))->AspectRatio==0))
- {
- //Configuring with video info
- for (descriptors::iterator Descriptor=Descriptors.begin(); Descriptor!=Descriptors.end(); ++Descriptor)
- if (Descriptor->second.StreamKind==Stream_Video)
- {
- ((File_Ancillary*)(*Parser))->HasBFrames=Descriptor->second.HasBFrames;
- ((File_Ancillary*)(*Parser))->AspectRatio=Descriptor->second.DisplayAspectRatio;
- ((File_Ancillary*)(*Parser))->FrameRate=Descriptor->second.SampleRate;
- break;
- }
- }
+ #if defined(MEDIAINFO_ANCILLARY_YES)
+ if ((*Parser)->ParserName==__T("Ancillary"))
+ ((File_Ancillary*)(*Parser))->LineNumber=LineNumber;
+ if ((*Parser)->ParserName==__T("Ancillary") && (((File_Ancillary*)(*Parser))->FrameRate==0 || ((File_Ancillary*)(*Parser))->AspectRatio==0))
+ {
+ //Configuring with video info
+ for (descriptors::iterator Descriptor=Descriptors.begin(); Descriptor!=Descriptors.end(); ++Descriptor)
+ if (Descriptor->second.StreamKind==Stream_Video)
+ {
+ ((File_Ancillary*)(*Parser))->HasBFrames=Descriptor->second.HasBFrames;
+ ((File_Ancillary*)(*Parser))->AspectRatio=Descriptor->second.DisplayAspectRatio;
+ ((File_Ancillary*)(*Parser))->FrameRate=Descriptor->second.SampleRate;
+ break;
+ }
+ }
+ #endif //defined(MEDIAINFO_ANCILLARY_YES)
if (Element_Offset+Size>Element_Size)
Size=(int16u)(Element_Size-Element_Offset);
Open_Buffer_Continue((*Parser), Buffer+Buffer_Offset+(size_t)(Element_Offset), Size);
@@ -5457,14 +5604,28 @@ void File_Mxf::Data_Parse()
for (size_t Pos=0; Pos<Essence->second.Parsers.size(); Pos++)
{
//Parsing
- if (Essence->second.Frame_Count_NotParsedIncluded!=(int64u)-1)
- Essence->second.Parsers[Pos]->Frame_Count_NotParsedIncluded=Essence->second.Frame_Count_NotParsedIncluded;
- if (Essence->second.FrameInfo.DTS!=(int64u)-1)
- Essence->second.Parsers[Pos]->FrameInfo.DTS=Essence->second.FrameInfo.DTS;
- if (Essence->second.FrameInfo.PTS!=(int64u)-1)
- Essence->second.Parsers[Pos]->FrameInfo.PTS=Essence->second.FrameInfo.PTS;
- if (Essence->second.FrameInfo.DUR!=(int64u)-1)
- Essence->second.Parsers[Pos]->FrameInfo.DUR=Essence->second.FrameInfo.DUR;
+ if (IsSub)
+ {
+ if (Frame_Count_NotParsedIncluded!=(int64u)-1)
+ Essence->second.Parsers[Pos]->Frame_Count_NotParsedIncluded=Frame_Count_NotParsedIncluded;
+ if (FrameInfo.DTS!=(int64u)-1)
+ Essence->second.Parsers[Pos]->FrameInfo.DTS=FrameInfo.DTS;
+ if (FrameInfo.PTS!=(int64u)-1)
+ Essence->second.Parsers[Pos]->FrameInfo.PTS=FrameInfo.PTS;
+ if (FrameInfo.DUR!=(int64u)-1)
+ Essence->second.Parsers[Pos]->FrameInfo.DUR=FrameInfo.DUR;
+ }
+ else
+ {
+ if (Essence->second.Frame_Count_NotParsedIncluded!=(int64u)-1)
+ Essence->second.Parsers[Pos]->Frame_Count_NotParsedIncluded=Essence->second.Frame_Count_NotParsedIncluded;
+ if (Essence->second.FrameInfo.DTS!=(int64u)-1)
+ Essence->second.Parsers[Pos]->FrameInfo.DTS=Essence->second.FrameInfo.DTS;
+ if (Essence->second.FrameInfo.PTS!=(int64u)-1)
+ Essence->second.Parsers[Pos]->FrameInfo.PTS=Essence->second.FrameInfo.PTS;
+ if (Essence->second.FrameInfo.DUR!=(int64u)-1)
+ Essence->second.Parsers[Pos]->FrameInfo.DUR=Essence->second.FrameInfo.DUR;
+ }
Open_Buffer_Continue(Essence->second.Parsers[Pos], Buffer+Buffer_Offset, (size_t)Element_Size);
#if MEDIAINFO_DEMUX
if (Demux_Level==4 && Config->Demux_EventWasSent && Essence->second.StreamKind==Stream_Video && Essence->second.Parsers[Pos]->ParserIDs[StreamIDs_Size]==MediaInfo_Parser_Jpeg) // Only File_Jpeg. TODO: limit to File_Jpeg instead of video streams
@@ -5557,13 +5718,47 @@ void File_Mxf::Data_Parse()
}
//Ignore tail
- if (Config->ParseSpeed>=1.0 && Frame_Count_NotParsedIncluded!=(int64u)-1 && Config->File_IgnoreFramesAfter!=(int64u)-1 && Frame_Count_NotParsedIncluded>=Config->File_IgnoreFramesAfter)
+ #if MEDIAINFO_DEMUX
+ if (DemuxedSampleCount_Total!=(int64u)-1 && DemuxedSampleCount_Current!=(int64u)-1)
+ {
+ DemuxedSampleCount_Total+=DemuxedSampleCount_Current;
+ Frame_Count_NotParsedIncluded=DemuxedSampleCount_Total;
+ }
+ #endif //MEDIAINFO_DEMUX
+ if (Config->ParseSpeed>=1.0 && Frame_Count_NotParsedIncluded!=(int64u)-1 && Config->File_IgnoreEditsAfter!=(int64u)-1)
{
- if (PartitionMetadata_FooterPartition!=(int64u)-1 && PartitionMetadata_FooterPartition>=File_Offset+Buffer_Offset+Element_Size)
- GoTo(PartitionMetadata_FooterPartition);
+ descriptors::iterator SingleDescriptor=Descriptors.end();
+ for (descriptors::iterator SingleDescriptor_Temp=Descriptors.begin(); SingleDescriptor_Temp!=Descriptors.end(); ++SingleDescriptor_Temp)
+ if (SingleDescriptor_Temp->second.StreamKind!=Stream_Max)
+ {
+ if (SingleDescriptor!=Descriptors.end())
+ {
+ SingleDescriptor=Descriptors.end();
+ break; // 2 or more descriptors, can not be used
+ }
+ SingleDescriptor=SingleDescriptor_Temp;
+ }
+
+ int64u RealSampleRate=(SingleDescriptor==Descriptors.end() || SingleDescriptor->second.StreamKind!=Stream_Audio)?((int64u)Config->File_EditRate):SingleDescriptor->second.Infos["SamplingRate"].To_int64u();
+ int64u IgnoreSamplesAfter;
+ if (!RealSampleRate || RealSampleRate==Config->File_EditRate)
+ IgnoreSamplesAfter=Config->File_IgnoreEditsAfter;
else
- GoToFromEnd(0);
+ IgnoreSamplesAfter=float64_int64s(((float64)Config->File_IgnoreEditsAfter)/Config->File_EditRate*RealSampleRate);
+ if (Frame_Count_NotParsedIncluded>=IgnoreSamplesAfter)
+ {
+ if (PartitionMetadata_FooterPartition!=(int64u)-1 && PartitionMetadata_FooterPartition>=File_Offset+Buffer_Offset+Element_Size)
+ GoTo(PartitionMetadata_FooterPartition);
+ else
+ GoToFromEnd(0);
+ }
}
+ #if MEDIAINFO_DEMUX
+ if (DemuxedSampleCount_Total!=(int64u)-1)
+ {
+ Frame_Count_NotParsedIncluded=(int64u)-1;
+ }
+ #endif //MEDIAINFO_DEMUX
}
else
Skip_XX(Element_Size, "Unknown");
@@ -5637,6 +5832,28 @@ void File_Mxf::AES3PCMDescriptor()
//---------------------------------------------------------------------------
void File_Mxf::CDCIEssenceDescriptor()
{
+ if (Code2>=0x8000)
+ {
+ // Not a short code
+ std::map<int16u, int128u>::iterator Primer_Value=Primer_Values.find(Code2);
+ if (Primer_Value!=Primer_Values.end())
+ {
+ int32u Code_Compare1=Primer_Value->second.hi>>32;
+ int32u Code_Compare2=(int32u)Primer_Value->second.hi;
+ int32u Code_Compare3=Primer_Value->second.lo>>32;
+ int32u Code_Compare4=(int32u)Primer_Value->second.lo;
+ if(0);
+ ELEMENT_UUID(SubDescriptors, "Sub Descriptors")
+ else
+ {
+ Element_Info1(Ztring().From_UUID(Primer_Value->second));
+ Skip_XX(Length2, "Data");
+ }
+
+ return;
+ }
+ }
+
switch(Code2)
{
ELEMENT(3301, CDCIEssenceDescriptor_ComponentDepth, "Active bits per sample")
@@ -5698,8 +5915,8 @@ void File_Mxf::OpenIncompleteBodyPartition()
//Testing locators
Locators_CleanUp();
- if (Config->File_IgnoreFramesBefore && !Config->File_IsDetectingDuration_Get())
- Open_Buffer_Seek(3, 0, (int64u)-1); //Forcing seek to Config->File_IgnoreFramesBefore
+ if (Config->File_IgnoreEditsBefore && !Config->File_IsDetectingDuration_Get())
+ Open_Buffer_Seek(3, 0, (int64u)-1); //Forcing seek to Config->File_IgnoreEditsBefore
if (Config->NextPacket_Get() && Config->Event_CallBackFunction_IsSet())
{
if (Locators.empty())
@@ -5726,8 +5943,8 @@ void File_Mxf::ClosedIncompleteBodyPartition()
//Testing locators
Locators_CleanUp();
- if (Config->File_IgnoreFramesBefore && !Config->File_IsDetectingDuration_Get())
- Open_Buffer_Seek(3, 0, (int64u)-1); //Forcing seek to Config->File_IgnoreFramesBefore
+ if (Config->File_IgnoreEditsBefore && !Config->File_IsDetectingDuration_Get())
+ Open_Buffer_Seek(3, 0, (int64u)-1); //Forcing seek to Config->File_IgnoreEditsBefore
if (Config->NextPacket_Get() && Config->Event_CallBackFunction_IsSet())
{
if (Locators.empty())
@@ -5754,8 +5971,8 @@ void File_Mxf::OpenCompleteBodyPartition()
//Testing locators
Locators_CleanUp();
- if (Config->File_IgnoreFramesBefore && !Config->File_IsDetectingDuration_Get())
- Open_Buffer_Seek(3, 0, (int64u)-1); //Forcing seek to Config->File_IgnoreFramesBefore
+ if (Config->File_IgnoreEditsBefore && !Config->File_IsDetectingDuration_Get())
+ Open_Buffer_Seek(3, 0, (int64u)-1); //Forcing seek to Config->File_IgnoreEditsBefore
if (Config->NextPacket_Get() && Config->Event_CallBackFunction_IsSet())
{
if (Locators.empty())
@@ -5782,8 +5999,8 @@ void File_Mxf::ClosedCompleteBodyPartition()
//Testing locators
Locators_CleanUp();
- if (Config->File_IgnoreFramesBefore && !Config->File_IsDetectingDuration_Get())
- Open_Buffer_Seek(3, 0, (int64u)-1); //Forcing seek to Config->File_IgnoreFramesBefore
+ if (Config->File_IgnoreEditsBefore && !Config->File_IsDetectingDuration_Get())
+ Open_Buffer_Seek(3, 0, (int64u)-1); //Forcing seek to Config->File_IgnoreEditsBefore
if (Config->NextPacket_Get() && Config->Event_CallBackFunction_IsSet())
{
if (Locators.empty())
@@ -5901,7 +6118,7 @@ void File_Mxf::Identification()
ELEMENT(3C03, Identification_ProductVersion, "ProductVersion")
ELEMENT(3C04, Identification_VersionString, "VersionString")
ELEMENT(3C05, Identification_ProductUID, "ProductUID")
- ELEMENT(3C06, Identification_ModificationDate , "ModificationDate ")
+ ELEMENT(3C06, Identification_ModificationDate , "ModificationDate")
ELEMENT(3C07, Identification_ToolkitVersion, "ToolkitVersion")
ELEMENT(3C08, Identification_Platform, "Platform")
ELEMENT(3C09, Identification_ThisGenerationUID, "ThisGenerationUID")
@@ -5979,9 +6196,9 @@ void File_Mxf::JPEG2000PictureSubDescriptor()
ELEMENT_UUID(JPEG2000PictureSubDescriptor_Xsiz, "Xsiz - Width")
ELEMENT_UUID(JPEG2000PictureSubDescriptor_Ysiz, "Ysiz - Height")
ELEMENT_UUID(JPEG2000PictureSubDescriptor_XOsiz, "XOsiz - Horizontal offset")
- ELEMENT_UUID(JPEG2000PictureSubDescriptor_YOsiz, "YOsiz - Vertical offset ")
- ELEMENT_UUID(JPEG2000PictureSubDescriptor_XTsiz, "XTsiz - Width of one reference tile ")
- ELEMENT_UUID(JPEG2000PictureSubDescriptor_YTsiz, "YTsiz - Height of one reference tile ")
+ ELEMENT_UUID(JPEG2000PictureSubDescriptor_YOsiz, "YOsiz - Vertical offset")
+ ELEMENT_UUID(JPEG2000PictureSubDescriptor_XTsiz, "XTsiz - Width of one reference tile")
+ ELEMENT_UUID(JPEG2000PictureSubDescriptor_YTsiz, "YTsiz - Height of one reference tile")
ELEMENT_UUID(JPEG2000PictureSubDescriptor_XTOsiz, "XTOsiz - Horizontal offset of the first tile")
ELEMENT_UUID(JPEG2000PictureSubDescriptor_YTOsiz, "YTOsiz - Vertical offset of the first tile")
ELEMENT_UUID(JPEG2000PictureSubDescriptor_Csiz, "Csiz - Number of components in the picture")
@@ -6076,7 +6293,7 @@ void File_Mxf::GenericSoundEssenceDescriptor()
switch(Code2)
{
ELEMENT(3D01, GenericSoundEssenceDescriptor_QuantizationBits, "QuantizationBits")
- ELEMENT(3D02, GenericSoundEssenceDescriptor_Locked , "Locked ")
+ ELEMENT(3D02, GenericSoundEssenceDescriptor_Locked , "Locked")
ELEMENT(3D03, GenericSoundEssenceDescriptor_AudioSamplingRate, "AudioSamplingRate")
ELEMENT(3D04, GenericSoundEssenceDescriptor_AudioRefLevel, "AudioRefLevel")
ELEMENT(3D05, GenericSoundEssenceDescriptor_ElectroSpatialFormulation, "ElectroSpatialFormulation")
@@ -6202,6 +6419,31 @@ void File_Mxf::MultipleDescriptor()
if (Descriptors[InstanceUID].Type==descriptor::Type_Unknown)
Descriptors[InstanceUID].Type=descriptor::type_Mutiple;
+ /*
+ //TODO: check when MPEG-4 Visual subdescriptor, it disabled stream info merge
+ if (Code2>=0x8000)
+ {
+ // Not a short code
+ std::map<int16u, int128u>::iterator Primer_Value=Primer_Values.find(Code2);
+ if (Primer_Value!=Primer_Values.end())
+ {
+ int32u Code_Compare1=Primer_Value->second.hi>>32;
+ int32u Code_Compare2=(int32u)Primer_Value->second.hi;
+ int32u Code_Compare3=Primer_Value->second.lo>>32;
+ int32u Code_Compare4=(int32u)Primer_Value->second.lo;
+ if(0);
+ ELEMENT_UUID(SubDescriptors, "Sub Descriptors")
+ else
+ {
+ Element_Info1(Ztring().From_UUID(Primer_Value->second));
+ Skip_XX(Length2, "Data");
+ }
+
+ return;
+ }
+ }
+ */
+
switch(Code2)
{
ELEMENT(3F01, MultipleDescriptor_SubDescriptorUIDs, "SubDescriptorUIDs")
@@ -6472,7 +6714,7 @@ void File_Mxf::AS11_AAF_Core()
int32u Code_Compare3=Primer_Value->second.lo>>32;
int32u Code_Compare4=(int32u)Primer_Value->second.lo;
if(0);
- ELEMENT_UUID(AS11_Core_SerieTitle, "Serie Title")
+ ELEMENT_UUID(AS11_Core_SeriesTitle, "Series Title")
ELEMENT_UUID(AS11_Core_ProgrammeTitle, "Programme Title")
ELEMENT_UUID(AS11_Core_EpisodeTitleNumber, "Episode Title Number")
ELEMENT_UUID(AS11_Core_ShimName, "Shim Name")
@@ -6669,9 +6911,7 @@ void File_Mxf::TimecodeComponent()
{
if (Element_Offset==4)
{
- TimeCode_StartTimecode=(int64u)-1;
- TimeCode_RoundedTimecodeBase=0;
- TimeCode_DropFrame=false;
+ MxfTimeCodeForDelay=mxftimecode();
DTS_Delay=0;
FrameInfo.DTS=0;
}
@@ -6766,6 +7006,37 @@ void File_Mxf::AncPacketsDescriptor()
}
//---------------------------------------------------------------------------
+void File_Mxf::MpegAudioDescriptor()
+{
+ if (Code2>=0x8000)
+ {
+ // Not a short code
+ std::map<int16u, int128u>::iterator Primer_Value=Primer_Values.find(Code2);
+ if (Primer_Value!=Primer_Values.end())
+ {
+ int32u Code_Compare1=Primer_Value->second.hi>>32;
+ int32u Code_Compare2=(int32u)Primer_Value->second.hi;
+ int32u Code_Compare3=Primer_Value->second.lo>>32;
+ int32u Code_Compare4=(int32u)Primer_Value->second.lo;
+ if(0);
+ ELEMENT_UUID(MpegAudioDescriptor_BitRate, "Bit Rate")
+ else
+ {
+ Element_Info1(Ztring().From_UUID(Primer_Value->second));
+ Skip_XX(Length2, "Data");
+ }
+
+ return;
+ }
+ }
+
+ //switch(Code2)
+ //{
+ // default: GenericSoundEssenceDescriptor();
+ //}
+}
+
+//---------------------------------------------------------------------------
void File_Mxf::PackageMarkerObject()
{
//switch(Code2)
@@ -6898,6 +7169,57 @@ void File_Mxf::TimedTextResourceSubDescriptor()
}
//---------------------------------------------------------------------------
+void File_Mxf::Unknown67SubDescriptor()
+{
+ //switch(Code2)
+ //{
+ // default:
+ GenerationInterchangeObject();
+ //}
+}
+
+//---------------------------------------------------------------------------
+void File_Mxf::Mpeg4VisualSubDescriptor()
+{
+ if (Code2>=0x8000)
+ {
+ // Not a short code
+ std::map<int16u, int128u>::iterator Primer_Value=Primer_Values.find(Code2);
+ if (Primer_Value!=Primer_Values.end())
+ {
+ int32u Code_Compare1=Primer_Value->second.hi>>32;
+ int32u Code_Compare2=(int32u)Primer_Value->second.hi;
+ int32u Code_Compare3=Primer_Value->second.lo>>32;
+ int32u Code_Compare4=(int32u)Primer_Value->second.lo;
+ if(0);
+ ELEMENT_UUID(Mpeg4VisualDescriptor_SingleSequence, "Single sequence")
+ ELEMENT_UUID(Mpeg4VisualDescriptor_ConstantBFrames, "Number of B frames always constant")
+ ELEMENT_UUID(Mpeg4VisualDescriptor_CodedContentType, "Coded content type")
+ ELEMENT_UUID(Mpeg4VisualDescriptor_LowDelay, "Low delay")
+ ELEMENT_UUID(Mpeg4VisualDescriptor_ClosedGOP, "Closed GOP")
+ ELEMENT_UUID(Mpeg4VisualDescriptor_IdenticalGOP, "Identical GOP")
+ ELEMENT_UUID(Mpeg4VisualDescriptor_MaxGOP, "Maximum occurring spacing between I frames")
+ ELEMENT_UUID(Mpeg4VisualDescriptor_BPictureCount, "Maximum number of B pictures between P or I frames")
+ ELEMENT_UUID(Mpeg4VisualDescriptor_ProfileAndLevel, "Profile and level")
+ ELEMENT_UUID(Mpeg4VisualDescriptor_BitRate, "Maximum bit rate")
+ else
+ {
+ Element_Info1(Ztring().From_UUID(Primer_Value->second));
+ Skip_XX(Length2, "Data");
+ }
+
+ return;
+ }
+ }
+
+ //switch(Code2)
+ //{
+ // default:
+ GenerationInterchangeObject();
+ //}
+}
+
+//---------------------------------------------------------------------------
void File_Mxf::ResourceID()
{
//Parsing
@@ -7236,6 +7558,71 @@ void File_Mxf::SubDescriptors()
}
//---------------------------------------------------------------------------
+void File_Mxf::LensUnitMetadata()
+{
+ //switch(Code2)
+ //{
+ // default:
+ GenerationInterchangeObject();
+ //}
+}
+
+//---------------------------------------------------------------------------
+void File_Mxf::CameraUnitMetadata()
+{
+ if (Count_Get(Stream_Other)==0)
+ Stream_Prepare(Stream_Other);
+
+ switch(Code2)
+ {
+ ELEMENT(3210, CameraUnitMetadata_CaptureGammaEquation, "Capture Gamma Equation")
+ ELEMENT(8103, CameraUnitMetadata_NeutralDensityFilterWheelSetting, "Neutral Density Filter Wheel Setting")
+ ELEMENT(8106, CameraUnitMetadata_CaptureFrameRate, "Capture Frame Rate")
+ ELEMENT(8107, CameraUnitMetadata_ImageSensorReadoutMode,"Image Sensor Readout Mode")
+ ELEMENT(8108, CameraUnitMetadata_ShutterSpeed_Angle, "Shutter Speed (Angle)")
+ ELEMENT(810B, CameraUnitMetadata_ISOSensitivity, "ISO Sensitivity")
+ ELEMENT(810E, CameraUnitMetadata_WhiteBalance, "White Balance")
+ ELEMENT(8114, CameraUnitMetadata_CameraAttributes, "Camera Attributes")
+ ELEMENT(8115, CameraUnitMetadata_ExposureIndexofPhotoMeter,"Exposure Index of Photo Meter")
+ ELEMENT(8116, CameraUnitMetadata_GammaforCDL, "Gamma for CDL")
+ ELEMENT(8117, CameraUnitMetadata_ASCCDLV1_2, "ASC CDL V1.2")
+ default:
+ GenerationInterchangeObject();
+ }
+}
+
+//---------------------------------------------------------------------------
+void File_Mxf::UserDefinedAcquisitionMetadata()
+{
+ if (Count_Get(Stream_Other)==0)
+ Stream_Prepare(Stream_Other);
+
+ switch(Code2)
+ {
+ ELEMENT(E000, UserDefinedAcquisitionMetadata_UdamSetIdentifier, "UDAM Set Identifier")
+ default:
+ if (UserDefinedAcquisitionMetadata_UdamSetIdentifier_IsSony)
+ switch(Code2)
+ {
+ ELEMENT(8007, UserDefinedAcquisitionMetadata_Sony_8007, "Lens Attributes")
+ ELEMENT(E101, UserDefinedAcquisitionMetadata_Sony_E101, "Effective Marker Coverage")
+ ELEMENT(E102, UserDefinedAcquisitionMetadata_Sony_E102, "Effective Marker Aspect Ratio")
+ ELEMENT(E103, UserDefinedAcquisitionMetadata_Sony_E103, "Camera Process Discrimination Code")
+ ELEMENT(E104, UserDefinedAcquisitionMetadata_Sony_E104, "Rotary Shutter Mode")
+ ELEMENT(E109, UserDefinedAcquisitionMetadata_Sony_E109, "Monitoring Descriptions")
+ ELEMENT(E10B, UserDefinedAcquisitionMetadata_Sony_E10B, "E10B")
+ ELEMENT(E201, UserDefinedAcquisitionMetadata_Sony_E201, "E201")
+ ELEMENT(E202, UserDefinedAcquisitionMetadata_Sony_E202, "E202")
+ ELEMENT(E203, UserDefinedAcquisitionMetadata_Sony_E203, "E203")
+ default:
+ GenerationInterchangeObject();
+ }
+ else
+ GenerationInterchangeObject();
+ }
+}
+
+//---------------------------------------------------------------------------
void File_Mxf::SDTI_SystemMetadataPack() //SMPTE 385M + 326M
{
//Info for SDTI in Index StreamOffset
@@ -8373,7 +8760,25 @@ void File_Mxf::GenericPictureEssenceDescriptor_ActiveFormatDescriptor()
{
//Parsing
int8u Data;
- Get_B1 (Data, "Data"); Element_Info1C((Data<16), AfdBarData_active_format[Data]);
+ bool Is1dot3=Retrieve(Stream_General, 0, General_Format_Version).To_float32()>=1.3?true:false;
+ if (!Is1dot3 && Element_Size && Buffer[(size_t)(Buffer_Offset+Element_Offset)]&0x60)
+ Is1dot3=true;
+
+ BS_Begin();
+ if (Is1dot3)
+ {
+ Skip_SB( "Reserved");
+ Get_S1 (4, Data, "Data"); Element_Info1C((Data<16), AfdBarData_active_format[Data]);
+ Skip_SB( "AR");
+ Skip_S1(2, "Reserved");
+ }
+ else
+ {
+ Skip_S1(3, "Reserved");
+ Get_S1 (4, Data, "Data"); Element_Info1C((Data<16), AfdBarData_active_format[Data]);
+ Skip_SB( "AR");
+ }
+ BS_End();
FILLING_BEGIN();
Descriptors[InstanceUID].ActiveFormat=Data;
@@ -8622,7 +9027,8 @@ void File_Mxf::Identification_ProductVersion()
Element_Info1(Version);
FILLING_BEGIN();
- Identifications[InstanceUID].ProductVersion=Version;
+ if (Major || Minor || Patch || Build || Release)
+ Identifications[InstanceUID].ProductVersion=Version;
FILLING_END();
}
@@ -8660,17 +9066,23 @@ void File_Mxf::Identification_ModificationDate()
void File_Mxf::Identification_ToolkitVersion()
{
//Parsing
- //Parsing
- Info_B2(Major, "Major");
- Info_B2(Minor, "Minor");
- Info_B2(Patch, "Patch");
- Info_B2(Build, "Build");
- Info_B2(Release, "Release");
- Element_Info1(Ztring::ToZtring(Major)+__T('.')
- +Ztring::ToZtring(Minor)+__T('.')
- +Ztring::ToZtring(Patch)+__T('.')
- +Ztring::ToZtring(Build)+__T('.')
- +Ztring::ToZtring(Release) );
+ int16u Major, Minor, Patch, Build, Release;
+ Get_B2 (Major, "Major");
+ Get_B2 (Minor, "Minor");
+ Get_B2 (Patch, "Patch");
+ Get_B2 (Build, "Build");
+ Get_B2 (Release, "Release");
+ Ztring Version=Ztring::ToZtring(Major)+__T('.')
+ +Ztring::ToZtring(Minor)+__T('.')
+ +Ztring::ToZtring(Patch)+__T('.')
+ +Ztring::ToZtring(Build)+__T('.')
+ +Ztring::ToZtring(Release) ;
+ Element_Info1(Version);
+
+ FILLING_BEGIN();
+ if (Major || Minor || Patch || Build || Release)
+ Identifications[InstanceUID].ToolkitVersion=Version;
+ FILLING_END();
}
//---------------------------------------------------------------------------
@@ -8678,7 +9090,13 @@ void File_Mxf::Identification_ToolkitVersion()
void File_Mxf::Identification_Platform()
{
//Parsing
- Info_UTF16B(Length2, Data, "Data"); Element_Info1(Data);
+ Ztring Data;
+ Get_UTF16B(Length2, Data, "Data"); Element_Info1(Data);
+
+ FILLING_BEGIN();
+ if (Data!=__T("Unknown"))
+ Identifications[InstanceUID].Platform=Data;
+ FILLING_END();
}
//---------------------------------------------------------------------------
@@ -8991,6 +9409,13 @@ void File_Mxf::JPEG2000PictureSubDescriptor_QuantizationDefault()
}
//---------------------------------------------------------------------------
+//
+void File_Mxf::MpegAudioDescriptor_BitRate()
+{
+ Skip_B4( "Data");
+}
+
+//---------------------------------------------------------------------------
// 0x3B02
void File_Mxf::Preface_LastModifiedDate()
{
@@ -9168,6 +9593,20 @@ void File_Mxf::MPEG2VideoDescriptor_ProfileAndLevel()
//---------------------------------------------------------------------------
// 0x
+void File_Mxf::Mpeg4VisualDescriptor_ProfileAndLevel()
+{
+ //Parsing
+ int8u profile_and_level_indication;
+ Get_B1 (profile_and_level_indication, "profile_and_level_indication"); Param_Info1(Mpeg4v_Profile_Level(profile_and_level_indication));
+
+ FILLING_BEGIN();
+ if (profile_and_level_indication)
+ Descriptors[InstanceUID].Infos["Format_Profile"]=Ztring().From_Local(Mpeg4v_Profile_Level(profile_and_level_indication));
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+// 0x
void File_Mxf::MPEG2VideoDescriptor_BitRate()
{
//Parsing
@@ -9223,8 +9662,9 @@ void File_Mxf::PartitionMetadata()
int64u PreviousPartition, FooterPartition, HeaderByteCount, IndexByteCount, BodyOffset;
int32u IndexSID;
int32u KAGSize;
- Skip_B2( "MajorVersion");
- Skip_B2( "MinorVersion");
+ int16u MajorVersion, MinorVersion;
+ Get_B2 (MajorVersion, "MajorVersion");
+ Get_B2 (MinorVersion, "MinorVersion");
Get_B4 (KAGSize, "KAGSize");
Skip_B8( "ThisPartition");
Get_B8 (PreviousPartition, "PreviousPartition");
@@ -9274,6 +9714,8 @@ void File_Mxf::PartitionMetadata()
Partitions_IsCalculatingHeaderByteCount=true;
}
+ Fill(Stream_General, 0, General_Format_Version, Ztring::ToZtring(MajorVersion)+__T('.')+Ztring::ToZtring(MinorVersion), true);
+
if ((Code.lo&0xFF0000)==0x020000) //If Header Partition Pack
switch ((Code.lo>>8)&0xFF)
{
@@ -9497,6 +9939,8 @@ void File_Mxf::RGBAEssenceDescriptor_AlphaMinRef()
// 0x1001
void File_Mxf::Sequence_StructuralComponents()
{
+ Components[InstanceUID].StructuralComponents.clear();
+
//Parsing
//Vector
int32u Count, Length;
@@ -9797,11 +10241,11 @@ void File_Mxf::TimecodeComponent_StartTimecode()
FILLING_BEGIN();
if (Data!=(int64u)-1)
{
- TimeCode_StartTimecode=Data;
- if (TimeCode_RoundedTimecodeBase)
+ MxfTimeCodeForDelay.StartTimecode=Data;
+ if (MxfTimeCodeForDelay.RoundedTimecodeBase)
{
- DTS_Delay=((float64)TimeCode_StartTimecode)/TimeCode_RoundedTimecodeBase;
- if (TimeCode_DropFrame)
+ DTS_Delay=((float64)MxfTimeCodeForDelay.StartTimecode)/MxfTimeCodeForDelay.RoundedTimecodeBase;
+ if (MxfTimeCodeForDelay.DropFrame)
{
DTS_Delay*=1001;
DTS_Delay/=1000;
@@ -9813,7 +10257,7 @@ void File_Mxf::TimecodeComponent_StartTimecode()
}
}
- Components[InstanceUID].TimeCode_StartTimecode=Data;
+ Components[InstanceUID].MxfTimeCode.StartTimecode=Data;
FILLING_END();
}
@@ -9828,11 +10272,11 @@ void File_Mxf::TimecodeComponent_RoundedTimecodeBase()
FILLING_BEGIN();
if (Data && Data!=(int16u)-1)
{
- TimeCode_RoundedTimecodeBase=Data;
- if (TimeCode_StartTimecode!=(int64u)-1)
+ MxfTimeCodeForDelay.RoundedTimecodeBase=Data;
+ if (MxfTimeCodeForDelay.StartTimecode!=(int64u)-1)
{
- DTS_Delay=((float64)TimeCode_StartTimecode)/TimeCode_RoundedTimecodeBase;
- if (TimeCode_DropFrame)
+ DTS_Delay=((float64)MxfTimeCodeForDelay.StartTimecode)/MxfTimeCodeForDelay.RoundedTimecodeBase;
+ if (MxfTimeCodeForDelay.DropFrame)
{
DTS_Delay*=1001;
DTS_Delay/=1000;
@@ -9844,7 +10288,7 @@ void File_Mxf::TimecodeComponent_RoundedTimecodeBase()
}
}
- Components[InstanceUID].TimeCode_RoundedTimecodeBase=Data;
+ Components[InstanceUID].MxfTimeCode.RoundedTimecodeBase=Data;
FILLING_END();
}
@@ -9859,7 +10303,7 @@ void File_Mxf::TimecodeComponent_DropFrame()
FILLING_BEGIN();
if (Data!=(int8u)-1 && Data)
{
- TimeCode_DropFrame=true;
+ MxfTimeCodeForDelay.DropFrame=true;
if (DTS_Delay)
{
DTS_Delay*=1001;
@@ -9871,7 +10315,7 @@ void File_Mxf::TimecodeComponent_DropFrame()
#endif //MEDIAINFO_DEMUX
}
- Components[InstanceUID].TimeCode_DropFrame=Data?true:false;
+ Components[InstanceUID].MxfTimeCode.DropFrame=Data?true:false;
FILLING_END();
}
@@ -10034,15 +10478,323 @@ void File_Mxf::WaveAudioDescriptor_ChannelAssignment()
}
//---------------------------------------------------------------------------
+//
+void File_Mxf::CameraUnitMetadata_CaptureGammaEquation()
+{
+ //Parsing
+ int128u Value;
+ Get_UUID(Value, "Value");
+
+ FILLING_BEGIN();
+ if (Retrieve(Stream_Other, 0, "CaptureGammaEquation").empty())
+ Fill(Stream_Other, 0, "CaptureGammaEquation", Mxf_CameraUnitMetadata_CaptureGammaEquation(Value));
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::CameraUnitMetadata_NeutralDensityFilterWheelSetting()
+{
+ //Parsing
+ int16u Value;
+ Get_B2(Value, "Value");
+
+ FILLING_BEGIN();
+ if (Retrieve(Stream_Other, 0, "NeutralDensityFilterWheelSetting").empty())
+ Fill(Stream_Other, 0, "NeutralDensityFilterWheelSetting", Value);
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::CameraUnitMetadata_CaptureFrameRate()
+{
+ //Parsing
+ float64 Value;
+ Get_Rational(Value);
+
+ FILLING_BEGIN();
+ if (Retrieve(Stream_Other, 0, "CaptureFrameRate").empty())
+ Fill(Stream_Other, 0, "CaptureFrameRate", Value);
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::CameraUnitMetadata_ImageSensorReadoutMode()
+{
+ //Parsing
+ int8u Value;
+ Get_B1(Value, "Value");
+
+ FILLING_BEGIN();
+ if (Retrieve(Stream_Other, 0, "ImageSensorReadoutMode").empty())
+ Fill(Stream_Other, 0, "ImageSensorReadoutMode", Mxf_CameraUnitMetadata_ImageSensorReadoutMode(Value));
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::CameraUnitMetadata_ShutterSpeed_Angle()
+{
+ //Parsing
+ int32u Value;
+ Get_B4(Value, "Value");
+
+ FILLING_BEGIN();
+ if (Retrieve(Stream_Other, 0, "ShutterSpeed_Angle").empty())
+ Fill(Stream_Other, 0, "ShutterSpeed_Angle", ((float)Value)/60, 1);
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::CameraUnitMetadata_ISOSensitivity()
+{
+ //Parsing
+ int16u Value;
+ Get_B2(Value, "Value");
+
+ FILLING_BEGIN();
+ if (Retrieve(Stream_Other, 0, "ISOSensitivity").empty())
+ Fill(Stream_Other, 0, "ISOSensitivity", Value);
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::CameraUnitMetadata_WhiteBalance()
+{
+ //Parsing
+ int16u Value;
+ Get_B2(Value, "Value");
+
+ FILLING_BEGIN();
+ if (Retrieve(Stream_Other, 0, "WhiteBalance").empty())
+ Fill(Stream_Other, 0, "WhiteBalance", Value);
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::CameraUnitMetadata_CameraAttributes()
+{
+ //Parsing
+ Ztring Value;
+ Get_UTF8(Length2, Value, "Value");
+
+ FILLING_BEGIN();
+ if (Retrieve(Stream_Other, 0, "CameraAttributes").empty())
+ Fill(Stream_Other, 0, "CameraAttributes", Value);
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::CameraUnitMetadata_ExposureIndexofPhotoMeter()
+{
+ //Parsing
+ int16u Value;
+ Get_B2(Value, "Value");
+
+ FILLING_BEGIN();
+ if (Retrieve(Stream_Other, 0, "ExposureIndexofPhotoMeter").empty())
+ Fill(Stream_Other, 0, "ExposureIndexofPhotoMeter", Value);
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::CameraUnitMetadata_GammaforCDL()
+{
+ //Parsing
+ int8u Value;
+ Get_B1(Value, "Value");
+
+ FILLING_BEGIN();
+ if (Retrieve(Stream_Other, 0, "GammaforCDL").empty())
+ Fill(Stream_Other, 0, "GammaforCDL", Mxf_CameraUnitMetadata_GammaforCDL(Value));
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::CameraUnitMetadata_ASCCDLV1_2()
+{
+ //Parsing
+ //Vector
+ int32u Count, Length;
+ Get_B4 (Count, "Count");
+ Get_B4 (Length, "Length");
+ if (Count!=10 || Length!=2)
+ {
+ Skip_XX (Length2-8, "Data");
+ return;
+ }
+ float32 sR, sG, sB, oR, oG, oB, pR, pG, pB, sat;
+ Get_BF2(sR, "sR");
+ Get_BF2(sG, "sG");
+ Get_BF2(sB, "sB");
+ Get_BF2(oR, "oR");
+ Get_BF2(oG, "oG");
+ Get_BF2(oB, "oB");
+ Get_BF2(pR, "pR");
+ Get_BF2(pG, "pG");
+ Get_BF2(pB, "pB");
+ Get_BF2(sat, "sat");
+
+ FILLING_BEGIN();
+ if (Retrieve(Stream_Other, 0, "ASCCDLV1_2").empty())
+ {
+ Ztring ValueS=__T("sR=")+Ztring::ToZtring(sR, 1)+__T(" sG=")+Ztring::ToZtring(sG, 1)+__T(" sB=")+Ztring::ToZtring(sB, 1)+__T(" oR=")+Ztring::ToZtring(oR, 1)+__T(" oG=")+Ztring::ToZtring(oG, 1)+__T(" oB=")+Ztring::ToZtring(oB, 1)+__T(" pR=")+Ztring::ToZtring(pR, 1)+__T(" pG=")+Ztring::ToZtring(pG, 1)+__T(" pB=")+Ztring::ToZtring(pB, 1)+__T(" sat=")+Ztring::ToZtring(sat, 1);
+ Fill(Stream_Other, 0, "ASCCDLV1_2", ValueS);
+ }
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::UserDefinedAcquisitionMetadata_UdamSetIdentifier()
+{
+ //Parsing
+ int128u Value;
+ Get_UUID(Value, "Value");
+
+ FILLING_BEGIN();
+ if (Value.hi==0x966908004678031CLL && Value.lo==0x20500000F0C01181LL)
+ UserDefinedAcquisitionMetadata_UdamSetIdentifier_IsSony=true;
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::UserDefinedAcquisitionMetadata_Sony_8007()
+{
+ //Parsing
+ Ztring Value;
+ Get_UTF8(Length2, Value, "Value");
+
+ FILLING_BEGIN();
+ if (Retrieve(Stream_Other, 0, "LensAttributes").empty())
+ Fill(Stream_Other, 0, "LensAttributes", Value);
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::UserDefinedAcquisitionMetadata_Sony_E101()
+{
+ //Parsing
+ int32u Width, Height;
+ Get_B4 (Width, "Width");
+ Get_B4 (Height, "Height");
+
+ FILLING_BEGIN();
+ if (Retrieve(Stream_Other, 0, "EffectiveMarkerCoverage").empty())
+ Fill(Stream_Other, 0, "EffectiveMarkerCoverage", Ztring::ToZtring(Width)+__T("x")+Ztring::ToZtring(Height));
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::UserDefinedAcquisitionMetadata_Sony_E102()
+{
+ //Parsing
+ int32u Width, Height;
+ Get_B4 (Width, "Width");
+ Get_B4 (Height, "Height");
+
+ FILLING_BEGIN();
+ if (Retrieve(Stream_Other, 0, "EffectiveMarkerAspectRatio").empty())
+ Fill(Stream_Other, 0, "EffectiveMarkerAspectRatio", Ztring::ToZtring(Width)+__T(":")+Ztring::ToZtring(Height));
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::UserDefinedAcquisitionMetadata_Sony_E103()
+{
+ //Parsing
+ int16u Value;
+ Get_B2(Value, "Value");
+
+ FILLING_BEGIN();
+ if (Retrieve(Stream_Other, 0, "CameraProcessDiscriminationCode").empty())
+ Fill(Stream_Other, 0, "CameraProcessDiscriminationCode", Value, 16);
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::UserDefinedAcquisitionMetadata_Sony_E104()
+{
+ //Parsing
+ int8u Value;
+ Get_B1(Value, "Value");
+
+ FILLING_BEGIN();
+ if (Retrieve(Stream_Other, 0, "RotaryShutterMode").empty())
+ Fill(Stream_Other, 0, "RotaryShutterMode", Value?"Yes":"No");
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::UserDefinedAcquisitionMetadata_Sony_E109()
+{
+ //Parsing
+ Ztring Value;
+ Get_UTF8(Length2, Value, "Value");
+
+ FILLING_BEGIN();
+ if (Retrieve(Stream_Other, 0, "MonitoringDescriptions").empty())
+ Fill(Stream_Other, 0, "MonitoringDescriptions", Value);
+ FILLING_END();
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::UserDefinedAcquisitionMetadata_Sony_E10B()
+{
+ //Parsing
+ Skip_UUID( "Value");
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::UserDefinedAcquisitionMetadata_Sony_E201()
+{
+ //Parsing
+ Skip_XX(Length2, "Value");
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::UserDefinedAcquisitionMetadata_Sony_E202()
+{
+ //Parsing
+ Ztring Value;
+ Get_UTF8(Length2, Value, "Value");
+}
+
+//---------------------------------------------------------------------------
+//
+void File_Mxf::UserDefinedAcquisitionMetadata_Sony_E203()
+{
+ //Parsing
+ Skip_B1( "Value");
+}
+
+//---------------------------------------------------------------------------
// AAF
-void File_Mxf::AS11_Core_SerieTitle()
+void File_Mxf::AS11_Core_SeriesTitle()
{
//Parsing
Ztring Value;
Get_UTF16B(Length2, Value, "Value"); Element_Info1(Value);
FILLING_BEGIN();
- AS11s[InstanceUID].SerieTitle=Value;
+ AS11s[InstanceUID].SeriesTitle=Value;
FILLING_END();
}
@@ -14094,10 +14846,12 @@ void File_Mxf::ChooseParser__Aaf_GC_Data(const essences::iterator &Essence, cons
Essence->second.Parsers.push_back(new File__Analyze());
break;
case 0x02 : //Ancillary
- if (!Ancillary)
- Ancillary=new File_Ancillary();
- Essence->second.Parsers.push_back(Ancillary);
- Ancillary_IsBinded=true;
+ #if defined(MEDIAINFO_ANCILLARY_YES)
+ if (!Ancillary)
+ Ancillary=new File_Ancillary();
+ Essence->second.Parsers.push_back(Ancillary);
+ Ancillary_IsBinded=true;
+ #endif //defined(MEDIAINFO_ANCILLARY_YES)
break;
case 0x08 : //Line Wrapped Data Element, SMPTE 384M
case 0x09 : //Line Wrapped VANC Data Element, SMPTE 384M
@@ -14374,6 +15128,8 @@ void File_Mxf::ChooseParser_ChannelGrouping(const essences::iterator &Essence, c
{
Essence->second.StreamKind=Stream_Audio;
+ #if defined(MEDIAINFO_SMPTEST0337_YES)
+
//Creating the parser
if (!((Essence->second.StreamPos-(StreamPos_StartAtOne?1:0))%2 && Essences[Essence->first-1].Parsers.size()<=1))
{
@@ -14424,6 +15180,7 @@ void File_Mxf::ChooseParser_ChannelGrouping(const essences::iterator &Essence, c
Essence->second.Parsers.push_back(Parser);
}
+ #endif //defined(MEDIAINFO_SMPTEST0337_YES)
//Adding PCM
ChooseParser_Pcm(Essence, Descriptor);
@@ -14473,6 +15230,8 @@ void File_Mxf::ChooseParser_Pcm(const essences::iterator &Essence, const descrip
{
if (Channels)
Parser->Channels=Channels;
+ if (Descriptor->second.Infos.find("SamplingRate")!=Descriptor->second.Infos.end())
+ Parser->SamplingRate=Descriptor->second.Infos["SamplingRate"].To_int16u();
if (Parser->Channels && Descriptor->second.BlockAlign!=(int16u)-1)
Parser->BitDepth=(int8u)(Descriptor->second.BlockAlign*8/Parser->Channels);
else if (Descriptor->second.QuantizationBits<256)
@@ -14597,6 +15356,7 @@ void File_Mxf::ChooseParser_Jpeg2000(const essences::iterator &Essence, const de
{
Parser->Demux_Level=2; //Container
Parser->Demux_UnpacketizeContainer=true;
+ Parser->FrameRate=Descriptor->second.SampleRate;
}
#endif //MEDIAINFO_DEMUX
}
@@ -14643,6 +15403,7 @@ void File_Mxf::Subsampling_Compute(descriptors::iterator Descriptor)
}
//---------------------------------------------------------------------------
+#if defined(MEDIAINFO_REFERENCES_YES)
void File_Mxf::Locators_CleanUp()
{
//Testing locators (TODO: check if this is still useful)
@@ -14672,8 +15433,10 @@ void File_Mxf::Locators_CleanUp()
}
}
+#endif //defined(MEDIAINFO_REFERENCES_YES)
//---------------------------------------------------------------------------
+#if defined(MEDIAINFO_REFERENCES_YES)
void File_Mxf::Locators_Test()
{
Locators_CleanUp();
@@ -14685,15 +15448,15 @@ void File_Mxf::Locators_Test()
for (locators::iterator Locator=Locators.begin(); Locator!=Locators.end(); ++Locator)
if (!Locator->second.IsTextLocator && !Locator->second.EssenceLocator.empty())
{
- File__ReferenceFilesHelper::reference ReferenceFile;
- ReferenceFile.FileNames.push_back(Locator->second.EssenceLocator);
- ReferenceFile.StreamKind=Locator->second.StreamKind;
- ReferenceFile.StreamPos=Locator->second.StreamPos;
+ sequence* Sequence=new sequence;
+ Sequence->AddFileName(Locator->second.EssenceLocator);
+ Sequence->StreamKind=Locator->second.StreamKind;
+ Sequence->StreamPos=Locator->second.StreamPos;
if (Locator->second.LinkedTrackID!=(int32u)-1)
- ReferenceFile.StreamID=Locator->second.LinkedTrackID;
+ Sequence->StreamID=Locator->second.LinkedTrackID;
else if (!Retrieve(Locator->second.StreamKind, Locator->second.StreamPos, General_ID).empty())
- ReferenceFile.StreamID=Retrieve(Locator->second.StreamKind, Locator->second.StreamPos, General_ID).To_int64u();
- ReferenceFile.Delay=float64_int64s(DTS_Delay*1000000000);
+ Sequence->StreamID=Retrieve(Locator->second.StreamKind, Locator->second.StreamPos, General_ID).To_int64u();
+ Sequence->Delay=float64_int64s(DTS_Delay*1000000000);
//Special cases
if (Locator->second.StreamKind==Stream_Video)
@@ -14702,18 +15465,17 @@ void File_Mxf::Locators_Test()
for (descriptors::iterator Descriptor=Descriptors.begin(); Descriptor!=Descriptors.end(); ++Descriptor)
for (size_t LocatorPos=0; LocatorPos<Descriptor->second.Locators.size(); LocatorPos++)
if (Descriptor->second.Locators[LocatorPos]==Locator->first)
- ReferenceFile.FrameRate=Descriptor->second.SampleRate;
+ Sequence->FrameRate_Set(Descriptor->second.SampleRate);
}
-
- if (ReferenceFile.StreamID!=(int32u)-1)
+ if (Sequence->StreamID!=(int32u)-1)
{
//Descriptive Metadata
std::vector<int128u> DMScheme1s_List;
for (dmsegments::iterator DMSegment=DMSegments.begin(); DMSegment!=DMSegments.end(); ++DMSegment)
for (size_t Pos=0; Pos<DMSegment->second.TrackIDs.size(); Pos++)
- if (DMSegment->second.TrackIDs[Pos]==ReferenceFile.StreamID)
+ if (DMSegment->second.TrackIDs[Pos]==Sequence->StreamID)
DMScheme1s_List.push_back(DMSegment->second.Framework);
for (size_t Pos=0; Pos<DMScheme1s_List.size(); Pos++)
@@ -14721,12 +15483,12 @@ void File_Mxf::Locators_Test()
dmscheme1s::iterator DMScheme1=DMScheme1s.find(DMScheme1s_List[Pos]);
if (DMScheme1!=DMScheme1s.end())
{
- ReferenceFile.Infos["Language"]=DMScheme1->second.PrimaryExtendedSpokenLanguage;
+ Sequence->Infos["Language"]=DMScheme1->second.PrimaryExtendedSpokenLanguage;
}
}
}
- ReferenceFiles->References.push_back(ReferenceFile);
+ ReferenceFiles->AddSequence(Sequence);
}
else
{
@@ -14737,6 +15499,7 @@ void File_Mxf::Locators_Test()
ReferenceFiles->ParseReferences();
}
}
+#endif //defined(MEDIAINFO_REFERENCES_YES)
//---------------------------------------------------------------------------
void File_Mxf::TryToFinish()
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mxf.h b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mxf.h
index 03d807929..507e229b2 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mxf.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Mxf.h
@@ -130,6 +130,9 @@ protected :
void TerminatingFiller();
void XmlDocumentText();
void SubDescriptors();
+ void LensUnitMetadata();
+ void CameraUnitMetadata();
+ void UserDefinedAcquisitionMetadata();
void Filler53();
void Sequence();
void SourceClip();
@@ -159,12 +162,15 @@ protected :
void JPEG2000PictureSubDescriptor();
void VbiPacketsDescriptor();
void AncPacketsDescriptor();
+ void MpegAudioDescriptor();
void PackageMarkerObject();
void ApplicationPlugInObject();
void ApplicationReferencedObject();
void MCALabelSubDescriptor();
void TimedTextDescriptor();
void TimedTextResourceSubDescriptor();
+ void Unknown67SubDescriptor();
+ void Mpeg4VisualSubDescriptor();
void AudioChannelLabelSubDescriptor();
void SoundfieldGroupLabelSubDescriptor();
void GroupOfSoundfieldGroupsLabelSubDescriptor();
@@ -321,6 +327,7 @@ protected :
void JPEG2000PictureSubDescriptor_PictureComponentSizing(); //800B
void JPEG2000PictureSubDescriptor_CodingStyleDefault(); //
void JPEG2000PictureSubDescriptor_QuantizationDefault(); //
+ void MpegAudioDescriptor_BitRate(); //
void MultipleDescriptor_SubDescriptorUIDs(); //3F01
void PrimaryExtendedSpokenLanguage(); //
void SecondaryExtendedSpokenLanguage(); //
@@ -337,6 +344,16 @@ protected :
void MPEG2VideoDescriptor_BPictureCount(); //
void MPEG2VideoDescriptor_ProfileAndLevel(); //
void MPEG2VideoDescriptor_BitRate(); //
+ void Mpeg4VisualDescriptor_SingleSequence() {MPEG2VideoDescriptor_SingleSequence();}
+ void Mpeg4VisualDescriptor_ConstantBFrames() {MPEG2VideoDescriptor_ConstantBFrames();}
+ void Mpeg4VisualDescriptor_CodedContentType() {MPEG2VideoDescriptor_CodedContentType();}
+ void Mpeg4VisualDescriptor_LowDelay() {MPEG2VideoDescriptor_LowDelay();}
+ void Mpeg4VisualDescriptor_ClosedGOP() {MPEG2VideoDescriptor_ClosedGOP();}
+ void Mpeg4VisualDescriptor_IdenticalGOP() {MPEG2VideoDescriptor_IdenticalGOP();}
+ void Mpeg4VisualDescriptor_MaxGOP() {MPEG2VideoDescriptor_MaxGOP();}
+ void Mpeg4VisualDescriptor_BPictureCount() {MPEG2VideoDescriptor_BPictureCount();}
+ void Mpeg4VisualDescriptor_ProfileAndLevel(); //
+ void Mpeg4VisualDescriptor_BitRate() {MPEG2VideoDescriptor_BitRate();}
void NetworkLocator_URLString(); //4001
void Preface_LastModifiedDate(); //3B02
void Preface_ContentStorage(); //3B03
@@ -391,7 +408,29 @@ protected :
void WaveAudioDescriptor_PeakEnvelopeTimestamp(); //3D30
void WaveAudioDescriptor_PeakEnvelopeData(); //3D31
void WaveAudioDescriptor_ChannelAssignment(); //3D31
- void AS11_Core_SerieTitle();
+ void CameraUnitMetadata_CaptureGammaEquation(); //3210
+ void CameraUnitMetadata_NeutralDensityFilterWheelSetting(); //8103
+ void CameraUnitMetadata_CaptureFrameRate(); //8106
+ void CameraUnitMetadata_ImageSensorReadoutMode(); //8107
+ void CameraUnitMetadata_ShutterSpeed_Angle(); //8108
+ void CameraUnitMetadata_ISOSensitivity(); //810B
+ void CameraUnitMetadata_WhiteBalance(); //800E
+ void CameraUnitMetadata_CameraAttributes(); //8114
+ void CameraUnitMetadata_ExposureIndexofPhotoMeter(); //8115
+ void CameraUnitMetadata_GammaforCDL(); //8116
+ void CameraUnitMetadata_ASCCDLV1_2(); //8117
+ void UserDefinedAcquisitionMetadata_UdamSetIdentifier(); //E000
+ void UserDefinedAcquisitionMetadata_Sony_8007();
+ void UserDefinedAcquisitionMetadata_Sony_E101();
+ void UserDefinedAcquisitionMetadata_Sony_E102();
+ void UserDefinedAcquisitionMetadata_Sony_E103();
+ void UserDefinedAcquisitionMetadata_Sony_E104();
+ void UserDefinedAcquisitionMetadata_Sony_E109();
+ void UserDefinedAcquisitionMetadata_Sony_E10B();
+ void UserDefinedAcquisitionMetadata_Sony_E201();
+ void UserDefinedAcquisitionMetadata_Sony_E202();
+ void UserDefinedAcquisitionMetadata_Sony_E203();
+ void AS11_Core_SeriesTitle();
void AS11_Core_ProgrammeTitle();
void AS11_Core_EpisodeTitleNumber();
void AS11_Core_ShimName();
@@ -473,6 +512,29 @@ protected :
#define Info_UL(_INFO, _NAME, _PARAM) int128u _INFO;
#endif //MEDIAINFO_TRACE
+ //TimeCode
+ struct mxftimecode
+ {
+ int16u RoundedTimecodeBase;
+ int64u StartTimecode;
+ bool DropFrame;
+
+ mxftimecode()
+ : RoundedTimecodeBase(0)
+ , StartTimecode((int64u)-1)
+ , DropFrame(false)
+ {
+ }
+
+ mxftimecode(int16u RoundedTimecodeBase_, int64u StartTimecode_, bool DropFrame_)
+ : RoundedTimecodeBase(RoundedTimecodeBase_)
+ , StartTimecode(StartTimecode_)
+ , DropFrame(DropFrame_)
+ {
+ }
+ };
+
+ // Temp
struct randomindexmetadata
{
int64u ByteOffset;
@@ -530,6 +592,8 @@ protected :
Ztring ProductName;
Ztring ProductVersion;
Ztring VersionString;
+ Ztring ToolkitVersion;
+ Ztring Platform;
std::map<std::string, Ztring> Infos;
};
typedef std::map<int128u, identification> identifications; //Key is InstanceUID of identification
@@ -791,21 +855,12 @@ protected :
int256u SourcePackageID; //Sequence from SourcePackage only
int32u SourceTrackID;
std::vector<int128u> StructuralComponents; //Sequence from MaterialPackage only
-
- //Time code component
- int16u TimeCode_RoundedTimecodeBase;
- int64u TimeCode_StartTimecode;
- bool TimeCode_DropFrame;
+ mxftimecode MxfTimeCode;
component()
{
Duration=(int64u)-1;
SourceTrackID=(int32u)-1;
-
- //Time code component
- TimeCode_RoundedTimecodeBase=(int16u)-1;
- TimeCode_StartTimecode=(int64u)-1;
- TimeCode_DropFrame=false;
}
void Update (struct component &New)
@@ -818,12 +873,12 @@ protected :
SourceTrackID=New.SourceTrackID;
if (!New.StructuralComponents.empty())
StructuralComponents=New.StructuralComponents;
- if (New.TimeCode_StartTimecode!=(int64u)-1)
- TimeCode_StartTimecode=New.TimeCode_StartTimecode;
- if (New.TimeCode_RoundedTimecodeBase!=(int16u)-1)
+ if (New.MxfTimeCode.StartTimecode!=(int64u)-1)
+ MxfTimeCode.StartTimecode=New.MxfTimeCode.StartTimecode;
+ if (New.MxfTimeCode.RoundedTimecodeBase)
{
- TimeCode_RoundedTimecodeBase=New.TimeCode_RoundedTimecodeBase;
- TimeCode_DropFrame=New.TimeCode_DropFrame;
+ MxfTimeCode.RoundedTimecodeBase=New.MxfTimeCode.RoundedTimecodeBase;
+ MxfTimeCode.DropFrame=New.MxfTimeCode.DropFrame;
}
}
};
@@ -880,7 +935,7 @@ protected :
Type_UKDPP,
};
as11_type Type;
- Ztring SerieTitle;
+ Ztring SeriesTitle;
Ztring ProgrammeTitle;
Ztring EpisodeTitleNumber;
Ztring ShimName;
@@ -1008,17 +1063,21 @@ protected :
//Helpers
void Subsampling_Compute(descriptors::iterator Descriptor);
- void Locators_CleanUp();
- void Locators_Test();
+ #if defined(MEDIAINFO_REFERENCES_YES)
+ void Locators_CleanUp();
+ void Locators_Test();
+ #else //defined(MEDIAINFO_REFERENCES_YES)
+ inline void Locators_CleanUp() {}
+ inline void Locators_Test() {}
+ #endif //defined(MEDIAINFO_REFERENCES_YES)
void TryToFinish();
//Temp
int128u EssenceContainer_FromPartitionMetadata;
int64u PartitionMetadata_PreviousPartition;
int64u PartitionMetadata_FooterPartition;
- int64u TimeCode_StartTimecode;
- int16u TimeCode_RoundedTimecodeBase;
- bool TimeCode_DropFrame;
+ mxftimecode MxfTimeCodeForDelay;
+ mxftimecode MxfTimeCodeMaterial;
float64 DTS_Delay; //In seconds
bool StreamPos_StartAtOne; //information about the base of StreamPos (0 or 1, 1 is found in 1 file)
string SDTI_TimeCode_StartTimecode;
@@ -1031,6 +1090,7 @@ protected :
int64u SystemScheme1_FrameRateFromDescriptor;
bool Essences_FirstEssence_Parsed;
bool StereoscopicPictureSubDescriptor_IsPresent;
+ bool UserDefinedAcquisitionMetadata_UdamSetIdentifier_IsSony;
int32u Essences_UsedForFrameCount;
int32u IndexTable_NSL;
int32u IndexTable_NPE;
@@ -1142,6 +1202,10 @@ protected :
int64u OverallBitrate_IsCbrForSure;
bool Duration_Detected;
bool DetectDuration();
+ int64u DemuxedSampleCount_Total;
+ int64u DemuxedSampleCount_Current;
+ int64u DemuxedSampleCount_AddedToFirstFrame;
+ int64u DemuxedElementSize_AddedToFirstFrame;
#endif //MEDIAINFO_DEMUX || MEDIAINFO_SEEK
};
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_P2_Clip.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_P2_Clip.cpp
index f19e49e43..706a6a456 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_P2_Clip.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_P2_Clip.cpp
@@ -83,7 +83,7 @@ size_t File_P2_Clip::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
if (ReferenceFiles==NULL)
return 0;
- return ReferenceFiles->Read_Buffer_Seek(Method, Value, ID);
+ return ReferenceFiles->Seek(Method, Value, ID);
}
#endif //MEDIAINFO_SEEK
@@ -144,7 +144,8 @@ bool File_P2_Clip::FileHeader_Begin()
string Field=Track->Value();
if (Field=="Video")
{
- File__ReferenceFilesHelper::reference ReferenceFile;
+ sequence* Sequence=new sequence;
+ float64 FrameRate=0;
//FrameRate
ChildElement=Track->FirstChildElement("FrameRate");
@@ -152,18 +153,19 @@ bool File_P2_Clip::FileHeader_Begin()
{
Ztring FrameRateS=Ztring(ChildElement->GetText());
if (FrameRateS.find(__T("23.97"))==0)
- ReferenceFile.FrameRate=((float64)24)*1000/1001;
+ FrameRate=((float64)24)*1000/1001;
else if (FrameRateS.find(__T("29.97"))==0)
- ReferenceFile.FrameRate=((float64)30)*1000/1001;
+ FrameRate=((float64)30)*1000/1001;
else if (FrameRateS.find(__T("59.94"))==0)
- ReferenceFile.FrameRate=((float64)60)*1000/1001;
+ FrameRate=((float64)60)*1000/1001;
else
- ReferenceFile.FrameRate=FrameRateS.To_float64();
+ FrameRate=FrameRateS.To_float64();
if (FrameRateS.find('i')!=string::npos)
- ReferenceFile.FrameRate/=2;
+ FrameRate/=2;
+ Sequence->FrameRate_Set(FrameRate);
}
- //CreationDate
+ //StartTimecode
ChildElement=Track->FirstChildElement("StartTimecode");
if (ChildElement)
{
@@ -176,8 +178,8 @@ bool File_P2_Clip::FileHeader_Begin()
+ (Text[4]-'0') *60*1000
+ (Text[6]-'0') *10*1000
+ (Text[7]-'0') *1000;
- if (ReferenceFile.FrameRate)
- ToFill+=float64_int64s(((Text[9]-'0')*10+(Text[10]-'0'))*1000/ReferenceFile.FrameRate);
+ if (FrameRate)
+ ToFill+=float64_int64s(((Text[9]-'0')*10+(Text[10]-'0'))*1000/FrameRate);
//Fill(Stream_Video, StreamPos_Last, Video_Delay, ToFill);
//Fill(Stream_Video, StreamPos_Last, Video_Delay_Source, "P2 Clip");
}
@@ -234,10 +236,10 @@ bool File_P2_Clip::FileHeader_Begin()
if (!Exists)
MXF_File+=__T(".MXF");
- ReferenceFile.FileNames.push_back(MXF_File);
- ReferenceFile.StreamKind=Stream_Video;
- ReferenceFile.StreamID=ReferenceFiles->References.size()+1;
- ReferenceFiles->References.push_back(ReferenceFile);
+ Sequence->AddFileName(MXF_File);
+ Sequence->StreamKind=Stream_Video;
+ Sequence->StreamID=ReferenceFiles->Sequences_Size()+1;
+ ReferenceFiles->AddSequence(Sequence);
}
#endif //defined(MEDIAINFO_MXF_YES)
}
@@ -298,11 +300,11 @@ bool File_P2_Clip::FileHeader_Begin()
if (!Exists)
MXF_File+=__T(".MXF");
- File__ReferenceFilesHelper::reference ReferenceFile;
- ReferenceFile.FileNames.push_back(MXF_File);
- ReferenceFile.StreamKind=Stream_Audio;
- ReferenceFile.StreamID=ReferenceFiles->References.size()+1;
- ReferenceFiles->References.push_back(ReferenceFile);
+ sequence* Sequence=new sequence;
+ Sequence->AddFileName(MXF_File);
+ Sequence->StreamKind=Stream_Audio;
+ Sequence->StreamID=ReferenceFiles->Sequences_Size()+1;
+ ReferenceFiles->AddSequence(Sequence);
Audio_Count++;
}
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ptx.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ptx.cpp
index 3c152e4ba..0b0cee913 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ptx.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Ptx.cpp
@@ -70,7 +70,7 @@ void File_Ptx::Streams_Finish()
#if MEDIAINFO_SEEK
size_t File_Ptx::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
{
- return ReferenceFiles->Read_Buffer_Seek(Method, Value, ID);
+ return ReferenceFiles->Seek(Method, Value, ID);
}
#endif //MEDIAINFO_SEEK
@@ -508,21 +508,21 @@ void File_Ptx::Read_Buffer_Continue()
&& FileNamesLowerCase[Pos].find(Names[Pos-Pos_Offset]+__T(".wav"))!=string::npos
&& FileNamesLowerCase[Pos].find(Names[Pos-Pos_Offset]+__T(".wav"))+Names[Pos-Pos_Offset].size()+4==FileNames[Pos].size())
{
- File__ReferenceFilesHelper::reference ReferenceFile;
- ReferenceFile.StreamKind=Stream_Audio;
- ReferenceFile.FileNames.push_back(Directory+PathSeparator+FileNames[Pos]);
- ReferenceFiles->References.push_back(ReferenceFile);
+ sequence* Sequence=new sequence;
+ Sequence->StreamKind=Stream_Audio;
+ Sequence->AddFileName(Directory+PathSeparator+FileNames[Pos]);
+ ReferenceFiles->AddSequence(Sequence);
}
- else if (ReferenceFiles->References.empty())
+ else if (!ReferenceFiles->Sequences_Size())
Pos_Offset++;
}
- if (Names.size()!=ReferenceFiles->References.size())
- ReferenceFiles->References.clear(); //Failed to detect correctly
+ if (Names.size()!=ReferenceFiles->Sequences_Size())
+ ReferenceFiles->Clear(); //Failed to detect correctly
}
// Role==2 + listed
- if (ReferenceFiles->References.empty() && (Names.size()>1 || FileNames.size()==1))
+ if (!ReferenceFiles->Sequences_Size() && (Names.size()>1 || FileNames.size()==1))
{
size_t Pos_Offset=0;
for (int32u Pos=0; Pos<FileName_Count; Pos++)
@@ -544,24 +544,24 @@ void File_Ptx::Read_Buffer_Continue()
if (FileName.find(Name)==0
|| FileName.find(Name+__T(".wav"))+5==Name.size())
{
- File__ReferenceFilesHelper::reference ReferenceFile;
- ReferenceFile.StreamKind=Stream_Audio;
- ReferenceFile.FileNames.push_back(Directory+PathSeparator+FileNames[Pos]);
- ReferenceFiles->References.push_back(ReferenceFile);
+ sequence* Sequence=new sequence;
+ Sequence->StreamKind=Stream_Audio;
+ Sequence->AddFileName(Directory+PathSeparator+FileNames[Pos]);
+ ReferenceFiles->AddSequence(Sequence);
}
- else if (ReferenceFiles->References.empty())
+ else if (!ReferenceFiles->Sequences_Size())
Pos_Offset++;
}
- else if (ReferenceFiles->References.empty())
+ else if (!ReferenceFiles->Sequences_Size())
Pos_Offset++;
}
- if (Names.size()!=ReferenceFiles->References.size())
- ReferenceFiles->References.clear(); //Failed to detect correctly
+ if (Names.size()!=ReferenceFiles->Sequences_Size())
+ ReferenceFiles->Clear(); //Failed to detect correctly
}
// Role==2 + Purpose==EWAV + listed, special case with specific file names
- if (ReferenceFiles->References.empty() && (Names.size()>1 || FileNames.size()==1))
+ if (!ReferenceFiles->Sequences_Size() && (Names.size()>1 || FileNames.size()==1))
{
for (int32u Pos=0; Pos<FileName_Count; Pos++)
{
@@ -578,10 +578,10 @@ void File_Ptx::Read_Buffer_Continue()
for (int32u Pos2=0; Pos2<Names.size(); Pos2++)
if (FileNamesLowerCase[Pos].find(Names[Pos2])==0)
{
- File__ReferenceFilesHelper::reference ReferenceFile;
- ReferenceFile.StreamKind=Stream_Audio;
- ReferenceFile.FileNames.push_back(Directory+PathSeparator+FileNames[Pos]);
- ReferenceFiles->References.push_back(ReferenceFile);
+ sequence* Sequence=new sequence;
+ Sequence->StreamKind=Stream_Audio;
+ Sequence->AddFileName(Directory+PathSeparator+FileNames[Pos]);
+ ReferenceFiles->AddSequence(Sequence);
break;
}
}
@@ -589,7 +589,7 @@ void File_Ptx::Read_Buffer_Continue()
}
// Role==2 + Purpose==EWAV
- if (ReferenceFiles->References.empty())
+ if (!ReferenceFiles->Sequences_Size())
{
for (int32u Pos=0; Pos<FileName_Count; Pos++)
{
@@ -603,16 +603,16 @@ void File_Ptx::Read_Buffer_Continue()
&& FileNames[Pos].find(__T(".1Khz.wav"))==string::npos //Exception?
&& FileNames[Pos].find(__T("_1KTONE_"))==string::npos) //Exception?
{
- File__ReferenceFilesHelper::reference ReferenceFile;
- ReferenceFile.StreamKind=Stream_Audio;
- ReferenceFile.FileNames.push_back(Directory+PathSeparator+FileNames[Pos]);
- ReferenceFiles->References.push_back(ReferenceFile);
+ sequence* Sequence=new sequence;
+ Sequence->StreamKind=Stream_Audio;
+ Sequence->AddFileName(Directory+PathSeparator+FileNames[Pos]);
+ ReferenceFiles->AddSequence(Sequence);
}
}
}
// Role==2
- if (ReferenceFiles->References.empty())
+ if (!ReferenceFiles->Sequences_Size())
{
for (int32u Pos=0; Pos<FileName_Count; Pos++)
{
@@ -625,10 +625,10 @@ void File_Ptx::Read_Buffer_Continue()
&& FileNames[Pos].find(__T(".1Khz.wav"))==string::npos //Exception?
&& FileNames[Pos].find(__T("_1KTONE_"))==string::npos) //Exception?
{
- File__ReferenceFilesHelper::reference ReferenceFile;
- ReferenceFile.StreamKind=Stream_Audio;
- ReferenceFile.FileNames.push_back(Directory+PathSeparator+FileNames[Pos]);
- ReferenceFiles->References.push_back(ReferenceFile);
+ sequence* Sequence=new sequence;
+ Sequence->StreamKind=Stream_Audio;
+ Sequence->AddFileName(Directory+PathSeparator+FileNames[Pos]);
+ ReferenceFiles->AddSequence(Sequence);
}
}
}
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Riff.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Riff.cpp
index 9b0897069..0f9a0d5d7 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Riff.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Riff.cpp
@@ -716,7 +716,7 @@ bool File_Riff::Header_Begin()
Element_Size=Buffer_Size; //All the buffer is used
else
{
- Element_Size=File_Offset+Buffer_Size-Buffer_DataToParse_End;
+ Element_Size=Buffer_DataToParse_End-(File_Offset+Buffer_Offset);
Buffer_DataToParse_End=0;
}
@@ -726,7 +726,10 @@ bool File_Riff::Header_Begin()
// Fake header
Element_Begin0();
Element_Begin0();
- Header_Fill_Size(Buffer_DataToParse_End-(File_Offset+Buffer_Offset));
+ if (Buffer_DataToParse_End)
+ Header_Fill_Size(Buffer_DataToParse_End-(File_Offset+Buffer_Offset));
+ else
+ Header_Fill_Size(Element_Size);
Element_End();
switch (Kind)
@@ -974,6 +977,9 @@ void File_Riff::Header_Parse()
//---------------------------------------------------------------------------
bool File_Riff::BookMark_Needed()
{
+ if (!movi_Size || SecondPass)
+ return false;
+
//Go to the first usefull chunk
if (stream_Count==0 && Stream_Structure.empty())
return false; //No need
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Riff_Elements.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Riff_Elements.cpp
index 83a0cb97c..c68b15f57 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Riff_Elements.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Riff_Elements.cpp
@@ -3643,7 +3643,7 @@ void File_Riff::WAVE_fact()
Get_L4 (SamplesCount, "SamplesCount");
SamplesCount64=SamplesCount;
if (SamplesCount64==0xFFFFFFFF)
- SamplesCount64=SamplesCount64;
+ SamplesCount64=WAVE_fact_samplesCount;
FILLING_BEGIN();
int32u SamplingRate=Retrieve(Stream_Audio, 0, Audio_SamplingRate).To_int32u();
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_SequenceInfo.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_SequenceInfo.cpp
index 74429df84..bc9727e8b 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_SequenceInfo.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_SequenceInfo.cpp
@@ -82,7 +82,7 @@ size_t File_SequenceInfo::Read_Buffer_Seek (size_t Method, int64u Value, int64u
if (ReferenceFiles==NULL)
return 0;
- return ReferenceFiles->Read_Buffer_Seek(Method, Value, ID);
+ return ReferenceFiles->Seek(Method, Value, ID);
}
#endif //MEDIAINFO_SEEK
@@ -106,8 +106,8 @@ bool File_SequenceInfo::FileHeader_Begin()
ReferenceFiles=new File__ReferenceFilesHelper(this, Config);
- File__ReferenceFilesHelper::reference ReferenceFile;
- ReferenceFile.StreamKind=Stream_Video;
+ sequence* Sequence=new sequence;
+ Sequence->StreamKind=Stream_Video;
FileName FN(File_Name);
Ztring Base=FN.Path_Get();
@@ -177,7 +177,7 @@ bool File_SequenceInfo::FileHeader_Begin()
if (FileNumberCount>=9)
{
//Trying with consecutive file numbers betweens dirs
- Number=Ztring::ToZtring(ReferenceFile.FileNames.size());
+ Number=Ztring::ToZtring(Sequence->FileNames.size());
FullFile=FileBase;
FullFile.insert(FullFile.size()-Extension.size()-1, Number);
FileNumberCount=Number.size();
@@ -200,7 +200,7 @@ bool File_SequenceInfo::FileHeader_Begin()
if (FileNumberCount<9)
{
- size_t FileNumber=FromZero?0:ReferenceFile.FileNames.size();
+ size_t FileNumber=FromZero?0:Sequence->FileNames.size();
do
{
Number=Ztring::ToZtring(FileNumber);
@@ -212,7 +212,7 @@ bool File_SequenceInfo::FileHeader_Begin()
if (!File::Exists(FullFile))
break;
- ReferenceFile.FileNames.push_back(FullFile);
+ Sequence->AddFileName(FullFile);
FileNumber++;
}
@@ -223,8 +223,7 @@ bool File_SequenceInfo::FileHeader_Begin()
}
while (DirNumber<1000000000);
- if (!ReferenceFile.FileNames.empty())
- ReferenceFiles->References.push_back(ReferenceFile);
+ ReferenceFiles->AddSequence(Sequence);
}
}
}
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Wm_Elements.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Wm_Elements.cpp
index 2bfddfe23..6c1b657f2 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Wm_Elements.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File_Wm_Elements.cpp
@@ -61,7 +61,7 @@ const char* Wm_CodecList_Kind(int32u Kind)
{
case 0x01 : return "Video";
case 0x02 : return "Audio";
- default : return "Unknown";
+ default : return "";
}
}
@@ -73,7 +73,7 @@ const char* Wm_BannerImageData_Type(int32u Type)
case 0x01 : return "Bitmap";
case 0x02 : return "JPEG";
case 0x03 : return "GIF";
- default : return "Unknown";
+ default : return "";
}
}
@@ -145,7 +145,7 @@ const char* Wm_StreamType(const int128u Kind)
case Elements::Header_StreamProperties_DegradableJPEG : return "Degradable JPEG";
case Elements::Header_StreamProperties_FileTransfer : return "File Transfer";
case Elements::Header_StreamProperties_Binary : return "Binary";
- default : return "Unknown";
+ default : return "";
}
}
@@ -155,7 +155,7 @@ const char* Wm_ExclusionType(const int128u ExclusionType)
{
case Elements::Header_StreamProperties_Audio : return "Language";
case Elements::Header_StreamProperties_Video : return "Bitrate";
- default : return "Unknown";
+ default : return "";
}
}
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper.cpp
index 3069891ec..92366519c 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper.cpp
@@ -50,35 +50,56 @@ namespace MediaInfoLib
//---------------------------------------------------------------------------
File__ReferenceFilesHelper::File__ReferenceFilesHelper(File__Analyze* MI_, MediaInfo_Config_MediaInfo* Config_)
{
- //Temp
- MI=MI_;
- Config=Config_;
- Reference=References.end();
- Init_Done=false;
+ //In
TestContinuousFileNames=false;
- FilesForStorage=false;
ContainerHasNoId=false;
- HasMainFile=false;
- HasMainFile_Filled=false;
ID_Max=0;
+
+ //Private
+ Sequences_Current=0;
+ MI=MI_;
+ Config=Config_;
+ Init_Done=false;
FrameRate=0;
Duration=0;
- #if MEDIAINFO_NEXTPACKET
- DTS_Interval=(int64u)-1;
- #endif //MEDIAINFO_NEXTPACKET
+ #if MEDIAINFO_DEMUX
+ Demux_Interleave=false;
+ DTS_Minimal=(int64u)-1;
+ #endif //MEDIAINFO_DEMUX
#if MEDIAINFO_EVENTS
StreamID_Previous=(int64u)-1;
#endif //MEDIAINFO_EVENTS
#if MEDIAINFO_DEMUX
Offset_Video_DTS=0;
#endif //MEDIAINFO_DEMUX
+
+ //Private
+ #if MEDIAINFO_DEMUX
+ Common=new rfh_common(&Demux_Interleave, &DTS_Minimal);
+ #else //MEDIAINFO_DEMUX
+ Common=new rfh_common();
+ #endif //MEDIAINFO_DEMUX
+ Common->ReferenceFilesHelper=this;
+ Common->MI=MI;
+ Common->Config=Config;
+
+
+
+ //Temp
+ FilesForStorage=false;
+ HasMainFile=false;
+ HasMainFile_Filled=false;
+ #if MEDIAINFO_NEXTPACKET
+ DTS_Interval=(int64u)-1;
+ #endif //MEDIAINFO_NEXTPACKET
}
//---------------------------------------------------------------------------
File__ReferenceFilesHelper::~File__ReferenceFilesHelper()
{
- for (references::iterator ReferenceTemp=References.begin(); ReferenceTemp!=References.end(); ++ReferenceTemp)
- delete ReferenceTemp->MI; //ReferenceTemp->MI=NULL;
+ size_t Sequences_Size=Sequences.size();
+ for (size_t Sequences_Pos=0; Sequences_Pos<Sequences_Size; ++Sequences_Pos)
+ delete Sequences[Sequences_Pos];
}
//***************************************************************************
@@ -86,21 +107,21 @@ File__ReferenceFilesHelper::~File__ReferenceFilesHelper()
//***************************************************************************
//---------------------------------------------------------------------------
-bool File__ReferenceFilesHelper_Algo1 (const File__ReferenceFilesHelper::reference &Ref1, const File__ReferenceFilesHelper::reference &Ref2) { return (Ref1.StreamID<Ref2.StreamID);}
-bool File__ReferenceFilesHelper_Algo2 (const File__ReferenceFilesHelper::reference &Ref1, const File__ReferenceFilesHelper::reference &Ref2) { return (Ref1.StreamPos<Ref2.StreamPos);}
-bool File__ReferenceFilesHelper_Algo3 (const File__ReferenceFilesHelper::reference &Ref1, const File__ReferenceFilesHelper::reference &Ref2) { return (Ref1.StreamKind<Ref2.StreamKind);}
-void File__ReferenceFilesHelper_InfoFromFileName (File__ReferenceFilesHelper::references &References)
+bool File__ReferenceFilesHelper_Algo1 (const sequence* Ref1, const sequence* Ref2) { return (Ref1->StreamID<Ref2->StreamID);}
+bool File__ReferenceFilesHelper_Algo2 (const sequence* Ref1, const sequence* Ref2) { return (Ref1->StreamPos<Ref2->StreamPos);}
+bool File__ReferenceFilesHelper_Algo3 (const sequence* Ref1, const sequence* Ref2) { return (Ref1->StreamKind<Ref2->StreamKind);}
+void File__ReferenceFilesHelper_InfoFromFileName (sequences &Sequences)
{
ZtringListList List;
- vector<File__ReferenceFilesHelper::references::iterator> Iterators;
+ vector<size_t> Iterators;
- for (File__ReferenceFilesHelper::references::iterator Reference=References.begin(); Reference<References.end(); ++Reference)
+ for (size_t Sequences_Pos=0; Sequences_Pos<Sequences.size(); Sequences_Pos++)
{
ZtringList List2;
List2.Separator_Set(0, __T(" "));
- if ((*Reference).StreamKind==Stream_Audio && !(*Reference).FileNames.empty())
+ if (Sequences[Sequences_Pos]->StreamKind==Stream_Audio && !Sequences[Sequences_Pos]->FileNames.empty())
{
- Ztring Name=(*Reference).FileNames[0];
+ Ztring Name=Sequences[Sequences_Pos]->FileNames[0];
while (Name.FindAndReplace(__T("51 "), Ztring()));
while (Name.FindAndReplace(__T("_"), __T(" ")));
while (Name.FindAndReplace(__T("."), __T(" ")));
@@ -117,7 +138,7 @@ void File__ReferenceFilesHelper_InfoFromFileName (File__ReferenceFilesHelper::re
for (size_t Pos=0; Pos<List2.size(); Pos++)
List2[Pos].MakeLowerCase();
List.push_back(List2);
- Iterators.push_back(Reference);
+ Iterators.push_back(Sequences_Pos);
}
}
@@ -234,9 +255,9 @@ void File__ReferenceFilesHelper_InfoFromFileName (File__ReferenceFilesHelper::re
ChannelLayout=__T("Cs");
}
- (*Iterators[Pos]).Infos["ChannelPositions"]=ChannelPositions;
- (*Iterators[Pos]).Infos["ChannelPositions/String2"]=ChannelPositions2;
- (*Iterators[Pos]).Infos["ChannelLayout"]=ChannelLayout;
+ Sequences[Iterators[Pos]]->Infos["ChannelPositions"]=ChannelPositions;
+ Sequences[Iterators[Pos]]->Infos["ChannelPositions/String2"]=ChannelPositions2;
+ Sequences[Iterators[Pos]]->Infos["ChannelLayout"]=ChannelLayout;
}
//Language
@@ -263,9 +284,41 @@ void File__ReferenceFilesHelper_InfoFromFileName (File__ReferenceFilesHelper::re
Language=__T("es");
if (!Language.empty())
- (*Iterators[Pos]).Infos["Language"]=Language;
+ Sequences[Iterators[Pos]]->Infos["Language"]=Language;
}
}
+
+//***************************************************************************
+// In
+//***************************************************************************
+
+//---------------------------------------------------------------------------
+void File__ReferenceFilesHelper::AddSequence(sequence* NewSequence)
+{
+ Common->HasMultipleSequences=!Sequences.empty(); //If not empty, there will be more than 1 sequence just after
+
+ NewSequence->Package=Common;
+ NewSequence->Common->Package=Common;
+
+ Sequences.push_back(NewSequence);
+}
+
+//---------------------------------------------------------------------------
+void File__ReferenceFilesHelper::UpdateFileName(const Ztring& OldFileName, const Ztring& NewFileName)
+{
+ size_t Sequences_Size=Sequences.size();
+ for (size_t Sequences_Pos=0; Sequences_Pos<Sequences_Size; ++Sequences_Pos)
+ {
+ sequence* Sequence=Sequences[Sequences_Pos];
+
+ Sequence->UpdateFileName(OldFileName, NewFileName);
+ }
+}
+
+//***************************************************************************
+// Streams management
+//***************************************************************************
+
void File__ReferenceFilesHelper::ParseReferences()
{
if (!Init_Done)
@@ -273,102 +326,103 @@ void File__ReferenceFilesHelper::ParseReferences()
#if MEDIAINFO_FILTER
if (MI->Config->File_Filter_Audio_Get())
{
- for (size_t Pos=0; Pos<References.size(); Pos++)
- if (References[Pos].StreamKind!=Stream_Audio)
+ for (size_t Pos=0; Pos<Sequences.size(); Pos++)
+ if (Sequences[Pos]->StreamKind!=Stream_Audio)
{
- References.erase(References.begin()+Pos);
+ Sequences.erase(Sequences.begin()+Pos);
Pos--;
}
- CountOfReferencesToParse=References.size();
+ CountOfReferencesToParse=Sequences.size();
}
#endif //MEDIAINFO_FILTER
//Filling Filenames from the more complete version and Edit rates
float64 EditRate=DBL_MAX;
size_t EditRate_Count=0;
- for (Reference=References.begin(); Reference!=References.end(); Reference++)
- if (Reference->FileNames.empty())
- for (size_t Pos=0; Pos<Reference->CompleteDuration.size(); Pos++)
+ for (Sequences_Current=0; Sequences_Current<Sequences.size(); Sequences_Current++)
+ if (Sequences[Sequences_Current]->FileNames.empty())
+ for (size_t Pos=0; Pos<Sequences[Sequences_Current]->Resources.size(); Pos++)
{
- Reference->FileNames.push_back(Reference->CompleteDuration[Pos].FileName);
- if (Reference->CompleteDuration[Pos].IgnoreFramesRate && EditRate!=Reference->CompleteDuration[Pos].IgnoreFramesRate)
+ for (size_t Resource_FileNames_Pos=0; Resource_FileNames_Pos<Sequences[Sequences_Current]->Resources[Pos]->FileNames.size(); Resource_FileNames_Pos++)
+ Sequences[Sequences_Current]->FileNames.push_back(Sequences[Sequences_Current]->Resources[Pos]->FileNames[Resource_FileNames_Pos]);
+ if (Sequences[Sequences_Current]->Resources[Pos]->EditRate && EditRate!=Sequences[Sequences_Current]->Resources[Pos]->EditRate)
{
- if (EditRate>Reference->CompleteDuration[Pos].IgnoreFramesRate)
- EditRate=Reference->CompleteDuration[Pos].IgnoreFramesRate;
+ if (EditRate>Sequences[Sequences_Current]->Resources[Pos]->EditRate)
+ EditRate=Sequences[Sequences_Current]->Resources[Pos]->EditRate;
EditRate_Count++;
}
}
if (EditRate_Count>1)
//Multiple rates, using only one rate
- for (Reference=References.begin(); Reference!=References.end(); Reference++)
- for (size_t Pos=0; Pos<Reference->CompleteDuration.size(); Pos++)
- if (Reference->CompleteDuration[Pos].IgnoreFramesRate && EditRate!=Reference->CompleteDuration[Pos].IgnoreFramesRate)
+ for (Sequences_Current=0; Sequences_Current<Sequences.size(); Sequences_Current++)
+ for (size_t Pos=0; Pos<Sequences[Sequences_Current]->Resources.size(); Pos++)
+ if (Sequences[Sequences_Current]->Resources[Pos]->EditRate && EditRate!=Sequences[Sequences_Current]->Resources[Pos]->EditRate)
{
- if (Reference->CompleteDuration[Pos].IgnoreFramesBefore)
+ if (Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsBefore)
{
- float64 Temp=(float64)Reference->CompleteDuration[Pos].IgnoreFramesBefore;
- Temp/=Reference->CompleteDuration[Pos].IgnoreFramesRate;
+ float64 Temp=(float64)Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsBefore;
+ Temp/=Sequences[Sequences_Current]->Resources[Pos]->EditRate;
Temp*=EditRate;
- Reference->CompleteDuration[Pos].IgnoreFramesBefore=float64_int64s(Temp);
+ Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsBefore=float64_int64s(Temp);
}
- if (Reference->CompleteDuration[Pos].IgnoreFramesAfter!=(int64u)-1)
+ if (Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsAfter!=(int64u)-1)
{
- float64 Temp=(float64)Reference->CompleteDuration[Pos].IgnoreFramesAfter;
- Temp/=Reference->CompleteDuration[Pos].IgnoreFramesRate;
+ float64 Temp=(float64)Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsAfter;
+ Temp/=Sequences[Sequences_Current]->Resources[Pos]->EditRate;
Temp*=EditRate;
- Reference->CompleteDuration[Pos].IgnoreFramesAfter=float64_int64s(Temp);
+ Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsAfter=float64_int64s(Temp);
}
- if (Reference->CompleteDuration[Pos].IgnoreFramesAfterDuration!=(int64u)-1)
+ if (Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsAfterDuration!=(int64u)-1)
{
- float64 Temp=(float64)Reference->CompleteDuration[Pos].IgnoreFramesAfterDuration;
- Temp/=Reference->CompleteDuration[Pos].IgnoreFramesRate;
+ float64 Temp=(float64)Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsAfterDuration;
+ Temp/=Sequences[Sequences_Current]->Resources[Pos]->EditRate;
Temp*=EditRate;
- Reference->CompleteDuration[Pos].IgnoreFramesAfterDuration=float64_int64s(Temp);
+ Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsAfterDuration=float64_int64s(Temp);
}
- Reference->CompleteDuration[Pos].IgnoreFramesRate=EditRate;
+ Sequences[Sequences_Current]->Resources[Pos]->EditRate=EditRate;
}
//Testing IDs
std::set<int64u> StreamList;
bool StreamList_DuplicatedIds=false;
- for (Reference=References.begin(); Reference<References.end(); ++Reference)
- if (StreamList.find((*Reference).StreamID)==StreamList.end())
- StreamList.insert((*Reference).StreamID);
+ for (Sequences_Current=0; Sequences_Current<Sequences.size(); Sequences_Current++)
+ if (StreamList.find(Sequences[Sequences_Current]->StreamID)==StreamList.end())
+ StreamList.insert(Sequences[Sequences_Current]->StreamID);
else
{
StreamList_DuplicatedIds=true;
break;
}
if (StreamList_DuplicatedIds)
- for (Reference=References.begin(); Reference<References.end(); ++Reference)
- (*Reference).StreamID=Reference-References.begin()+1;
- if (References.size()==1 && References.begin()->StreamID==(int64u)-1)
+ for (Sequences_Current=0; Sequences_Current<Sequences.size(); Sequences_Current++)
+ Sequences[Sequences_Current]->StreamID=Sequences_Current+1;
+ if (Sequences.size()==1 && (*Sequences.begin())->StreamID==(int64u)-1)
{
ContainerHasNoId=true;
#if MEDIAINFO_EVENTS
MI->StreamIDs_Width[MI->StreamIDs_Size-1]=0;
#endif //MEDIAINFO_EVENTS
}
- std::sort(References.begin(), References.end(), File__ReferenceFilesHelper_Algo1);
- std::sort(References.begin(), References.end(), File__ReferenceFilesHelper_Algo2);
- std::sort(References.begin(), References.end(), File__ReferenceFilesHelper_Algo3);
+ std::sort(Sequences.begin(), Sequences.end(), File__ReferenceFilesHelper_Algo1);
+ std::sort(Sequences.begin(), Sequences.end(), File__ReferenceFilesHelper_Algo2);
+ std::sort(Sequences.begin(), Sequences.end(), File__ReferenceFilesHelper_Algo3);
//InfoFromFileName
- File__ReferenceFilesHelper_InfoFromFileName(References);
+ File__ReferenceFilesHelper_InfoFromFileName(Sequences);
#if MEDIAINFO_EVENTS
if (MI->Config->Config_PerPackage==NULL)
{
MI->Config->Config_PerPackage=new MediaInfo_Config_PerPackage;
- MI->Config->Config_PerPackage->CountOfPackages=References.size();
+ MI->Config->Config_PerPackage->CountOfPackages=Sequences.size();
}
#endif //MEDIAINFO_EVENTS
//Configuring file names
- Reference=References.begin();
- while (Reference!=References.end())
+ Sequences_Current=0;
+ while (Sequences_Current<Sequences.size())
{
- ZtringList Names=Reference->FileNames;
+ ZtringList Names=Sequences[Sequences_Current]->FileNames;
ZtringList AbsoluteNames; AbsoluteNames.Separator_Set(0, ",");
for (size_t Pos=0; Pos<Names.size(); Pos++)
{
@@ -442,7 +496,7 @@ void File__ReferenceFilesHelper::ParseReferences()
if (AbsoluteNames.empty() || !File::Exists(AbsoluteNames[0]))
{
AbsoluteNames.clear();
- Names=Reference->FileNames;
+ Names=Sequences[Sequences_Current]->FileNames;
//Configuring file name (this time, we try to test local files)
size_t PathSeparator_Pos=Names.empty()?string::npos:Names[0].find_last_of(__T("\\/"));
@@ -485,7 +539,7 @@ void File__ReferenceFilesHelper::ParseReferences()
if (!File::Exists(AbsoluteNames[0]))
{
AbsoluteNames.clear();
- Names=Reference->FileNames;
+ Names=Sequences[Sequences_Current]->FileNames;
//Configuring file name (this time, we try to test local files)
size_t PathSeparator_Pos=Names[0].find_last_of(__T("\\/"));
@@ -531,54 +585,55 @@ void File__ReferenceFilesHelper::ParseReferences()
}
}
}
- Reference->Source=Reference->FileNames.Read(0);
- if (Reference->StreamKind!=Stream_Max && !Reference->Source.empty())
+ Sequences[Sequences_Current]->Source=Sequences[Sequences_Current]->FileNames.Read(0);
+ if (Sequences[Sequences_Current]->StreamKind!=Stream_Max && !Sequences[Sequences_Current]->Source.empty())
{
- if (Reference->StreamPos==(size_t)-1)
- Reference->StreamPos=Stream_Prepare(Reference->StreamKind);
- MI->Fill(Reference->StreamKind, Reference->StreamPos, "Source", Reference->Source);
+ if (Sequences[Sequences_Current]->StreamPos==(size_t)-1)
+ Sequences[Sequences_Current]->StreamPos=Stream_Prepare(Sequences[Sequences_Current]->StreamKind);
+ MI->Fill(Sequences[Sequences_Current]->StreamKind, Sequences[Sequences_Current]->StreamPos, "Source", Sequences[Sequences_Current]->Source);
}
if (!AbsoluteNames.empty())
- Reference->FileNames=AbsoluteNames;
+ Sequences[Sequences_Current]->FileNames=AbsoluteNames;
if (!AbsoluteNames.empty() && AbsoluteNames[0]==MI->File_Name)
{
- Reference->IsCircular=true;
- Reference->FileNames.clear();
- Reference->Status.set(File__Analyze::IsFinished);
+ Sequences[Sequences_Current]->IsCircular=true;
+ Sequences[Sequences_Current]->FileNames.clear();
+ Sequences[Sequences_Current]->Status.set(File__Analyze::IsFinished);
}
else if (!AbsoluteNames.empty())
- Reference->FileNames=AbsoluteNames;
+ Sequences[Sequences_Current]->FileNames=AbsoluteNames;
else
{
- Reference->Status.set(File__Analyze::IsFinished);
- if (Reference->StreamKind!=Stream_Max && !Reference->Source.empty())
+ Sequences[Sequences_Current]->Status.set(File__Analyze::IsFinished);
+ if (Sequences[Sequences_Current]->StreamKind!=Stream_Max && !Sequences[Sequences_Current]->Source.empty())
{
- MI->Fill(Reference->StreamKind, Reference->StreamPos, "Source_Info", "Missing");
- if (MI->Retrieve(Reference->StreamKind, Reference->StreamPos, General_ID).empty() && Reference->StreamID!=(int64u)-1)
- MI->Fill(Reference->StreamKind, Reference->StreamPos, General_ID, Reference->StreamID);
- for (std::map<string, Ztring>::iterator Info=Reference->Infos.begin(); Info!=Reference->Infos.end(); ++Info)
+ MI->Fill(Sequences[Sequences_Current]->StreamKind, Sequences[Sequences_Current]->StreamPos, "Source_Info", "Missing");
+ if (MI->Retrieve(Sequences[Sequences_Current]->StreamKind, Sequences[Sequences_Current]->StreamPos, General_ID).empty() && Sequences[Sequences_Current]->StreamID!=(int64u)-1)
+ MI->Fill(Sequences[Sequences_Current]->StreamKind, Sequences[Sequences_Current]->StreamPos, General_ID, Sequences[Sequences_Current]->StreamID);
+ for (std::map<string, Ztring>::iterator Info=Sequences[Sequences_Current]->Infos.begin(); Info!=Sequences[Sequences_Current]->Infos.end(); ++Info)
{
if (Info->first=="CodecID")
- MI->CodecID_Fill(Info->second, Reference->StreamKind, Reference->StreamPos, InfoCodecID_Format_Mpeg4);
+ MI->CodecID_Fill(Info->second, Sequences[Sequences_Current]->StreamKind, Sequences[Sequences_Current]->StreamPos, InfoCodecID_Format_Mpeg4);
else
- MI->Fill(Reference->StreamKind, Reference->StreamPos, Info->first.c_str(), Info->second);
+ MI->Fill(Sequences[Sequences_Current]->StreamKind, Sequences[Sequences_Current]->StreamPos, Info->first.c_str(), Info->second);
}
}
}
if (FilesForStorage)
{
- for (size_t Pos=0; Pos<Reference->FileNames.size(); Pos++)
+ for (size_t Pos=0; Pos<Sequences[Sequences_Current]->FileNames.size(); Pos++)
{
- if (Pos>=Reference->CompleteDuration.size())
- Reference->CompleteDuration.resize(Pos+1);
- Reference->CompleteDuration[Pos].FileName=Reference->FileNames[Pos];
+ if (Pos==Sequences[Sequences_Current]->Resources.size())
+ Sequences[Sequences_Current]->Resources.push_back(new resource);
+ Sequences[Sequences_Current]->Resources[Pos]->FileNames.clear();
+ Sequences[Sequences_Current]->Resources[Pos]->FileNames.push_back(Sequences[Sequences_Current]->FileNames[Pos]);
}
- Reference->FileNames.resize(1);
+ Sequences[Sequences_Current]->FileNames.resize(1);
}
- ++Reference;
+ Sequences_Current++;
}
#if MEDIAINFO_DEMUX && MEDIAINFO_NEXTPACKET
@@ -587,9 +642,9 @@ void File__ReferenceFilesHelper::ParseReferences()
Demux_Interleave=Config->File_Demux_Interleave_Get();
if (Demux_Interleave)
{
- CountOfReferencesToParse=References.size();
- for (references::iterator ReferenceSource=References.begin(); ReferenceSource!=References.end(); ++ReferenceSource)
- if (ReferenceSource->FileNames.empty())
+ CountOfReferencesToParse=Sequences.size();
+ for (sequences::iterator ReferenceSource=Sequences.begin(); ReferenceSource!=Sequences.end(); ++ReferenceSource)
+ if ((*ReferenceSource)->FileNames.empty())
CountOfReferencesToParse--;
DTS_Interval=250000000LL; // 250 milliseconds
}
@@ -599,31 +654,31 @@ void File__ReferenceFilesHelper::ParseReferences()
//Using the frame rate from the first stream having a frame rate
if (!FrameRate)
- for (references::iterator ReferenceFrameRate=References.begin(); ReferenceFrameRate!=References.end(); ++ReferenceFrameRate)
- if (ReferenceFrameRate->FrameRate)
+ for (sequences::iterator ReferenceFrameRate=Sequences.begin(); ReferenceFrameRate!=Sequences.end(); ++ReferenceFrameRate)
+ if ((*ReferenceFrameRate)->FrameRate)
{
- FrameRate=ReferenceFrameRate->FrameRate;
+ FrameRate=(*ReferenceFrameRate)->FrameRate;
break;
}
if (Config->NextPacket_Get())
{
- Reference=References.begin();
- while (Reference!=References.end())
+ Sequences_Current=0;
+ while (Sequences_Current<Sequences.size())
{
ParseReference(); //Init
- Reference++;
+ Sequences_Current++;
}
//Cleanup
- for (size_t Pos=0; Pos<References.size(); Pos++)
- if (References[Pos].Status[File__Analyze::IsFinished])
+ for (size_t Pos=0; Pos<Sequences.size(); Pos++)
+ if (Sequences[Pos]->Status[File__Analyze::IsFinished])
{
- References.erase(References.begin()+Pos);
+ Sequences.erase(Sequences.begin()+Pos);
Pos--;
}
- CountOfReferencesToParse=References.size();
- if (References.empty())
+ CountOfReferencesToParse=Sequences.size();
+ if (Sequences.empty())
return;
//File size handling
@@ -637,8 +692,8 @@ void File__ReferenceFilesHelper::ParseReferences()
#endif //MEDIAINFO_DEMUX && MEDIAINFO_NEXTPACKET
FileSize_Compute();
- Reference=References.begin();
- CountOfReferences_ForReadSize=References.size();
+ Sequences_Current=0;
+ CountOfReferences_ForReadSize=Sequences.size();
Init_Done=true;
#if MEDIAINFO_DEMUX && MEDIAINFO_NEXTPACKET
@@ -650,10 +705,10 @@ void File__ReferenceFilesHelper::ParseReferences()
#endif //MEDIAINFO_DEMUX && MEDIAINFO_NEXTPACKET
}
- while (Reference!=References.end())
+ while (Sequences_Current<Sequences.size())
{
#if MEDIAINFO_NEXTPACKET
- if (!Reference->Status[File__Analyze::IsFinished])
+ if (!Sequences[Sequences_Current]->Status[File__Analyze::IsFinished])
#endif //MEDIAINFO_NEXTPACKET
ParseReference();
@@ -662,47 +717,47 @@ void File__ReferenceFilesHelper::ParseReferences()
#if MEDIAINFO_NEXTPACKET
DTS_Minimal=(int64u)-1;
#endif //MEDIAINFO_NEXTPACKET
- for (references::iterator ReferenceTemp=References.begin(); ReferenceTemp!=References.end(); ++ReferenceTemp)
+ for (sequences::iterator ReferenceTemp=Sequences.begin(); ReferenceTemp!=Sequences.end(); ++ReferenceTemp)
{
- if (ReferenceTemp->MI)
+ if ((*ReferenceTemp)->MI)
{
- if (ReferenceTemp->State<10000)
+ if ((*ReferenceTemp)->State<10000)
{
- if (ReferenceTemp->MI)
- ReferenceTemp->State=ReferenceTemp->MI->State_Get();
- if (ReferenceTemp->State && ReferenceTemp->MI->Config.File_Size!=(int64u)-1)
- FileSize_Parsed+=(int64u)(ReferenceTemp->MI->Config.File_Size*(((float)ReferenceTemp->State)/10000));
+ if ((*ReferenceTemp)->MI)
+ (*ReferenceTemp)->State=(*ReferenceTemp)->MI->State_Get();
+ if ((*ReferenceTemp)->State && (*ReferenceTemp)->MI->Config.File_Size!=(int64u)-1)
+ FileSize_Parsed+=(int64u)((*ReferenceTemp)->MI->Config.File_Size*(((float)(*ReferenceTemp)->State)/10000));
}
else
- FileSize_Parsed+=ReferenceTemp->MI->Config.File_Size;
+ FileSize_Parsed+=(*ReferenceTemp)->MI->Config.File_Size;
#if MEDIAINFO_NEXTPACKET
//Minimal DTS
- if (DTS_Interval!=(int64u)-1 && !Reference->Status[File__Analyze::IsFinished] && (ReferenceTemp->CompleteDuration.empty() || ReferenceTemp->CompleteDuration_Pos<ReferenceTemp->CompleteDuration.size()))
+ if (DTS_Interval!=(int64u)-1 && !Sequences[Sequences_Current]->Status[File__Analyze::IsFinished] && ((*ReferenceTemp)->Resources.empty() || (*ReferenceTemp)->Resources_Current<(*ReferenceTemp)->Resources.size()))
{
int64u DTS_Temp;
- if (!ReferenceTemp->CompleteDuration.empty() && ReferenceTemp->CompleteDuration_Pos)
+ if (!(*ReferenceTemp)->Resources.empty() && (*ReferenceTemp)->Resources_Current)
{
- if (ReferenceTemp->CompleteDuration[ReferenceTemp->CompleteDuration_Pos].MI->Info->FrameInfo.DTS!=(int64u)-1)
- DTS_Temp=ReferenceTemp->CompleteDuration[ReferenceTemp->CompleteDuration_Pos].MI->Info->FrameInfo.DTS-ReferenceTemp->CompleteDuration[ReferenceTemp->CompleteDuration_Pos].MI->Info->Config->Demux_Offset_DTS_FromStream;
+ if ((*ReferenceTemp)->Resources[(*ReferenceTemp)->Resources_Current]->MI->Info->FrameInfo.DTS!=(int64u)-1)
+ DTS_Temp=(*ReferenceTemp)->Resources[(*ReferenceTemp)->Resources_Current]->MI->Info->FrameInfo.DTS-(*ReferenceTemp)->Resources[(*ReferenceTemp)->Resources_Current]->MI->Info->Config->Demux_Offset_DTS_FromStream;
else
DTS_Temp=0;
}
else
{
- if (ReferenceTemp->MI->Info->FrameInfo.DTS!=(int64u)-1)
- DTS_Temp=ReferenceTemp->MI->Info->FrameInfo.DTS-ReferenceTemp->MI->Info->Config->Demux_Offset_DTS_FromStream;
+ if ((*ReferenceTemp)->MI->Info->FrameInfo.DTS!=(int64u)-1)
+ DTS_Temp=(*ReferenceTemp)->MI->Info->FrameInfo.DTS-(*ReferenceTemp)->MI->Info->Config->Demux_Offset_DTS_FromStream;
else
DTS_Temp=0;
}
- DTS_Temp+=ReferenceTemp->CompleteDuration[ReferenceTemp->CompleteDuration_Pos].Demux_Offset_DTS;
+ DTS_Temp+=(*ReferenceTemp)->Resources[(*ReferenceTemp)->Resources_Current]->Demux_Offset_DTS;
if (DTS_Minimal>DTS_Temp)
DTS_Minimal=DTS_Temp;
}
#endif //MEDIAINFO_NEXTPACKET
}
else
- FileSize_Parsed+=ReferenceTemp->FileSize;
+ FileSize_Parsed+=(*ReferenceTemp)->FileSize;
}
Config->State_Set(((float)FileSize_Parsed)/MI->Config->File_Size);
@@ -716,14 +771,14 @@ void File__ReferenceFilesHelper::ParseReferences()
#endif //MEDIAINFO_EVENTS
#if MEDIAINFO_DEMUX && MEDIAINFO_NEXTPACKET
- if (Demux_Interleave && (Reference->MI==NULL || Reference->MI->Info==NULL || Reference->MI->Info->Demux_CurrentParser==NULL || Reference->MI->Info->Demux_CurrentParser->Demux_TotalBytes>=Reference->MI->Info->Demux_CurrentParser->Buffer_TotalBytes+Reference->MI->Info->Demux_CurrentParser->Buffer_Size))
+ if (Demux_Interleave && (Sequences[Sequences_Current]->MI==NULL || Sequences[Sequences_Current]->MI->Info==NULL || Sequences[Sequences_Current]->MI->Info->Demux_CurrentParser==NULL || Sequences[Sequences_Current]->MI->Info->Demux_CurrentParser->Demux_TotalBytes>=Sequences[Sequences_Current]->MI->Info->Demux_CurrentParser->Buffer_TotalBytes+Sequences[Sequences_Current]->MI->Info->Demux_CurrentParser->Buffer_Size))
{
- references::iterator Reference_Next=Reference; ++Reference_Next;
+ size_t Reference_Next=Sequences_Current; ++Reference_Next;
- if (Reference_Next==References.end() && Config->NextPacket_Get() && CountOfReferencesToParse)
- Reference=References.begin();
+ if (Reference_Next==Sequences.size() && Config->NextPacket_Get() && CountOfReferencesToParse)
+ Sequences_Current=0;
else
- Reference=Reference_Next;
+ Sequences_Current=Reference_Next;
if (Config->Demux_EventWasSent)
return;
@@ -733,10 +788,10 @@ void File__ReferenceFilesHelper::ParseReferences()
if (Config->Demux_EventWasSent)
return;
- Reference++;
+ Sequences_Current++;
}
#else //MEDIAINFO_DEMUX && MEDIAINFO_NEXTPACKET
- ++Reference;
+ Sequences_Current++;
#endif //MEDIAINFO_DEMUX
}
@@ -761,23 +816,23 @@ void File__ReferenceFilesHelper::ParseReferences()
bool File__ReferenceFilesHelper::ParseReference_Init()
{
//Configuration
- Reference->MI=MI_Create();
+ Sequences[Sequences_Current]->MI=MI_Create();
if (Config->ParseSpeed>=1)
{
- for (size_t Pos=0; Pos<Reference->CompleteDuration.size(); Pos++)
+ for (size_t Pos=0; Pos<Sequences[Sequences_Current]->Resources.size(); Pos++)
{
- if (Reference->CompleteDuration[0].IgnoreFramesRate)
+ if (Sequences[Sequences_Current]->Resources[0]->EditRate)
{
#if MEDIAINFO_DEMUX
if (Pos==0)
{
- Reference->CompleteDuration[0].Demux_Offset_DTS=0;
- Reference->CompleteDuration[0].Demux_Offset_Frame=0;
+ Sequences[Sequences_Current]->Resources[0]->Demux_Offset_DTS=0;
+ Sequences[Sequences_Current]->Resources[0]->Demux_Offset_Frame=0;
}
- if (Pos+1<Reference->CompleteDuration.size())
+ if (Pos+1<Sequences[Sequences_Current]->Resources.size())
{
- Reference->CompleteDuration[Pos+1].Demux_Offset_DTS=float64_int64s(Reference->CompleteDuration[Pos].Demux_Offset_DTS+(Reference->CompleteDuration[Pos].IgnoreFramesAfter-Reference->CompleteDuration[Pos].IgnoreFramesBefore)/Reference->CompleteDuration[0].IgnoreFramesRate*1000000000);
- Reference->CompleteDuration[Pos+1].Demux_Offset_Frame=Reference->CompleteDuration[Pos].Demux_Offset_Frame+Reference->CompleteDuration[Pos].IgnoreFramesAfter-Reference->CompleteDuration[Pos].IgnoreFramesBefore;
+ Sequences[Sequences_Current]->Resources[Pos+1]->Demux_Offset_DTS=float64_int64s(Sequences[Sequences_Current]->Resources[Pos]->Demux_Offset_DTS+(Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsAfter-Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsBefore)/Sequences[Sequences_Current]->Resources[0]->EditRate*1000000000);
+ Sequences[Sequences_Current]->Resources[Pos+1]->Demux_Offset_Frame=Sequences[Sequences_Current]->Resources[Pos]->Demux_Offset_Frame+Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsAfter-Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsBefore;
}
#endif //MEDIAINFO_DEMUX
}
@@ -789,79 +844,80 @@ bool File__ReferenceFilesHelper::ParseReference_Init()
Ztring Demux_Save=MI2.Option(__T("Demux_Get"), __T(""));
MI2.Option(__T("ParseSpeed"), __T("0"));
MI2.Option(__T("Demux"), Ztring());
- size_t MiOpenResult=MI2.Open(Reference->CompleteDuration[Pos].FileName);
+ Sequences[Sequences_Current]->Resources[Pos]->FileNames.Separator_Set(0, ",");
+ size_t MiOpenResult=MI2.Open(Sequences[Sequences_Current]->Resources[Pos]->FileNames.Read());
MI2.Option(__T("ParseSpeed"), ParseSpeed_Save); //This is a global value, need to reset it. TODO: local value
MI2.Option(__T("Demux"), Demux_Save); //This is a global value, need to reset it. TODO: local value
if (MiOpenResult)
{
#if MEDIAINFO_DEMUX
- int64u Duration=MI2.Get(Reference->StreamKind, 0, __T("Duration")).To_int64u()*1000000;
- int64u FrameCount=MI2.Get(Reference->StreamKind, 0, __T("FrameCount")).To_int64u();
+ int64u Duration=MI2.Get(Sequences[Sequences_Current]->StreamKind, 0, __T("Duration")).To_int64u()*1000000;
+ int64u FrameCount=MI2.Get(Sequences[Sequences_Current]->StreamKind, 0, __T("FrameCount")).To_int64u();
if (Pos==0)
{
int64u Delay=MI2.Get(Stream_Video, 0, Video_Delay).To_int64u()*1000000;
- if (Reference->StreamKind==Stream_Video && Offset_Video_DTS==0)
+ if (Sequences[Sequences_Current]->StreamKind==Stream_Video && Offset_Video_DTS==0)
Offset_Video_DTS=Delay;
- Reference->CompleteDuration[0].Demux_Offset_DTS=Offset_Video_DTS;
- Reference->CompleteDuration[0].Demux_Offset_Frame=0;
+ Sequences[Sequences_Current]->Resources[0]->Demux_Offset_DTS=Offset_Video_DTS;
+ Sequences[Sequences_Current]->Resources[0]->Demux_Offset_Frame=0;
}
- if (Pos+1<Reference->CompleteDuration.size())
+ if (Pos+1<Sequences[Sequences_Current]->Resources.size())
{
- Reference->CompleteDuration[Pos+1].Demux_Offset_DTS=Reference->CompleteDuration[Pos].Demux_Offset_DTS+Duration;
- Reference->CompleteDuration[Pos+1].Demux_Offset_Frame=Reference->CompleteDuration[Pos].Demux_Offset_Frame+FrameCount;
+ Sequences[Sequences_Current]->Resources[Pos+1]->Demux_Offset_DTS=Sequences[Sequences_Current]->Resources[Pos]->Demux_Offset_DTS+Duration;
+ Sequences[Sequences_Current]->Resources[Pos+1]->Demux_Offset_Frame=Sequences[Sequences_Current]->Resources[Pos]->Demux_Offset_Frame+FrameCount;
}
else
- Duration=Reference->CompleteDuration[Pos].Demux_Offset_DTS+Duration-Reference->CompleteDuration[0].Demux_Offset_DTS;
+ Duration=Sequences[Sequences_Current]->Resources[Pos]->Demux_Offset_DTS+Duration-Sequences[Sequences_Current]->Resources[0]->Demux_Offset_DTS;
#endif //MEDIAINFO_DEMUX
}
}
if (Pos)
{
- Reference->CompleteDuration[Pos].MI=MI_Create();
- Reference->CompleteDuration[Pos].MI->Config.File_IgnoreFramesBefore=Reference->CompleteDuration[Pos].IgnoreFramesBefore;
- if (Reference->CompleteDuration[Pos].IgnoreFramesAfter==(int64u)-1 && Reference->CompleteDuration[Pos].IgnoreFramesAfterDuration!=(int64u)-1)
- Reference->CompleteDuration[Pos].MI->Config.File_IgnoreFramesAfter=Reference->CompleteDuration[Pos].IgnoreFramesBefore+Reference->CompleteDuration[Pos].IgnoreFramesAfterDuration;
+ Sequences[Sequences_Current]->Resources[Pos]->MI=MI_Create();
+ Sequences[Sequences_Current]->Resources[Pos]->MI->Config.File_IgnoreEditsBefore=Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsBefore;
+ if (Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsAfter==(int64u)-1 && Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsAfterDuration!=(int64u)-1)
+ Sequences[Sequences_Current]->Resources[Pos]->MI->Config.File_IgnoreEditsAfter=Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsBefore+Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsAfterDuration;
else
- Reference->CompleteDuration[Pos].MI->Config.File_IgnoreFramesAfter=Reference->CompleteDuration[Pos].IgnoreFramesAfter;
- Reference->CompleteDuration[Pos].MI->Config.File_IgnoreFramesRate=Reference->CompleteDuration[Pos].IgnoreFramesRate;
+ Sequences[Sequences_Current]->Resources[Pos]->MI->Config.File_IgnoreEditsAfter=Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsAfter;
+ Sequences[Sequences_Current]->Resources[Pos]->MI->Config.File_EditRate=Sequences[Sequences_Current]->Resources[Pos]->EditRate;
#if MEDIAINFO_DEMUX
- Reference->CompleteDuration[Pos].MI->Config.Demux_Offset_Frame=Reference->CompleteDuration[Pos].Demux_Offset_Frame;
- Reference->CompleteDuration[Pos].MI->Config.Demux_Offset_DTS=Reference->CompleteDuration[Pos].Demux_Offset_DTS;
+ Sequences[Sequences_Current]->Resources[Pos]->MI->Config.Demux_Offset_Frame=Sequences[Sequences_Current]->Resources[Pos]->Demux_Offset_Frame;
+ Sequences[Sequences_Current]->Resources[Pos]->MI->Config.Demux_Offset_DTS=Sequences[Sequences_Current]->Resources[Pos]->Demux_Offset_DTS;
#endif //MEDIAINFO_DEMUX
}
}
- if (!Reference->CompleteDuration.empty())
+ if (!Sequences[Sequences_Current]->Resources.empty())
{
- Reference->MI->Config.File_IgnoreFramesBefore=Reference->CompleteDuration[0].IgnoreFramesBefore;
- if (Reference->CompleteDuration[0].IgnoreFramesAfter==(int64u)-1 && Reference->CompleteDuration[0].IgnoreFramesAfterDuration!=(int64u)-1)
- Reference->MI->Config.File_IgnoreFramesAfter=Reference->CompleteDuration[0].IgnoreFramesBefore+Reference->CompleteDuration[0].IgnoreFramesAfterDuration;
+ Sequences[Sequences_Current]->MI->Config.File_IgnoreEditsBefore=Sequences[Sequences_Current]->Resources[0]->IgnoreEditsBefore;
+ if (Sequences[Sequences_Current]->Resources[0]->IgnoreEditsAfter==(int64u)-1 && Sequences[Sequences_Current]->Resources[0]->IgnoreEditsAfterDuration!=(int64u)-1)
+ Sequences[Sequences_Current]->MI->Config.File_IgnoreEditsAfter=Sequences[Sequences_Current]->Resources[0]->IgnoreEditsBefore+Sequences[Sequences_Current]->Resources[0]->IgnoreEditsAfterDuration;
else
- Reference->MI->Config.File_IgnoreFramesAfter=Reference->CompleteDuration[0].IgnoreFramesAfter;
- Reference->MI->Config.File_IgnoreFramesRate=Reference->CompleteDuration[0].IgnoreFramesRate;
+ Sequences[Sequences_Current]->MI->Config.File_IgnoreEditsAfter=Sequences[Sequences_Current]->Resources[0]->IgnoreEditsAfter;
+ Sequences[Sequences_Current]->MI->Config.File_EditRate=Sequences[Sequences_Current]->Resources[0]->EditRate;
#if MEDIAINFO_DEMUX
- Reference->MI->Config.Demux_Offset_Frame=Reference->CompleteDuration[0].Demux_Offset_Frame;
- Reference->MI->Config.Demux_Offset_DTS=Reference->CompleteDuration[0].Demux_Offset_DTS;
+ Sequences[Sequences_Current]->MI->Config.Demux_Offset_Frame=Sequences[Sequences_Current]->Resources[0]->Demux_Offset_Frame;
+ Sequences[Sequences_Current]->MI->Config.Demux_Offset_DTS=Sequences[Sequences_Current]->Resources[0]->Demux_Offset_DTS;
#endif //MEDIAINFO_DEMUX
}
}
- if (Reference->IsCircular)
+ if (Sequences[Sequences_Current]->IsCircular)
{
- MI->Fill(Reference->StreamKind, Reference->StreamPos, "Source_Info", "Circular");
+ MI->Fill(Sequences[Sequences_Current]->StreamKind, Sequences[Sequences_Current]->StreamPos, "Source_Info", "Circular");
if (!Config->File_KeepInfo_Get())
{
#if MEDIAINFO_DEMUX
if (CountOfReferencesToParse)
CountOfReferencesToParse--;
#endif //MEDIAINFO_DEMUX
- Reference->StreamKind=Stream_Max;
- Reference->StreamPos=(size_t)-1;
- Reference->FileSize=Reference->MI->Config.File_Size;
- delete Reference->MI; Reference->MI=NULL;
+ Sequences[Sequences_Current]->StreamKind=Stream_Max;
+ Sequences[Sequences_Current]->StreamPos=(size_t)-1;
+ Sequences[Sequences_Current]->FileSize=Sequences[Sequences_Current]->MI->Config.File_Size;
+ delete Sequences[Sequences_Current]->MI; Sequences[Sequences_Current]->MI=NULL;
}
- Reference->FileNames.clear();
- Reference->Status.set(File__Analyze::IsFinished);
+ Sequences[Sequences_Current]->FileNames.clear();
+ Sequences[Sequences_Current]->Status.set(File__Analyze::IsFinished);
}
else
{
@@ -869,27 +925,30 @@ bool File__ReferenceFilesHelper::ParseReference_Init()
#if MEDIAINFO_EVENTS
SubFile_Start();
#endif //MEDIAINFO_EVENTS
- if (!Reference->MI->Open(Reference->FileNames.Read()))
+ if (!Sequences[Sequences_Current]->MI->Open(Sequences[Sequences_Current]->FileNames.Read()))
{
- if (Reference->StreamKind!=Stream_Max)
- MI->Fill(Reference->StreamKind, Reference->StreamPos, "Source_Info", "Missing");
+ if (Sequences[Sequences_Current]->StreamKind!=Stream_Max)
+ MI->Fill(Sequences[Sequences_Current]->StreamKind, Sequences[Sequences_Current]->StreamPos, "Source_Info", "Missing", Unlimited, true, true);
if (!Config->File_KeepInfo_Get())
{
#if MEDIAINFO_DEMUX
if (CountOfReferencesToParse)
CountOfReferencesToParse--;
#endif //MEDIAINFO_DEMUX
- Reference->StreamKind=Stream_Max;
- Reference->StreamPos=(size_t)-1;
- Reference->FileSize=Reference->MI->Config.File_Size;
- delete Reference->MI; Reference->MI=NULL;
+ Sequences[Sequences_Current]->StreamKind=Stream_Max;
+ Sequences[Sequences_Current]->StreamPos=(size_t)-1;
+ Sequences[Sequences_Current]->FileSize=Sequences[Sequences_Current]->MI->Config.File_Size;
+ delete Sequences[Sequences_Current]->MI; Sequences[Sequences_Current]->MI=NULL;
}
- Reference->Status.set(File__Analyze::IsFinished);
+ Sequences[Sequences_Current]->Status.set(File__Analyze::IsFinished);
}
if (Config->ParseSpeed>=1)
- for (size_t Pos=1; Pos<Reference->CompleteDuration.size(); Pos++)
- Reference->CompleteDuration[Pos].MI->Open(Reference->CompleteDuration[Pos].FileName);
+ for (size_t Pos=1; Pos<Sequences[Sequences_Current]->Resources.size(); Pos++)
+ {
+ Sequences[Sequences_Current]->Resources[Pos]->FileNames.Separator_Set(0, ",");
+ Sequences[Sequences_Current]->Resources[Pos]->MI->Open(Sequences[Sequences_Current]->Resources[Pos]->FileNames.Read());
+ }
#if MEDIAINFO_NEXTPACKET && MEDIAINFO_DEMUX
if (Config->NextPacket_Get())
@@ -903,36 +962,36 @@ bool File__ReferenceFilesHelper::ParseReference_Init()
//---------------------------------------------------------------------------
void File__ReferenceFilesHelper::ParseReference()
{
- if (Reference->MI==NULL && !Reference->FileNames.empty())
+ if (Sequences[Sequences_Current]->MI==NULL && !Sequences[Sequences_Current]->FileNames.empty())
{
if (!ParseReference_Init())
return;
}
- if (Reference->MI)
+ if (Sequences[Sequences_Current]->MI)
{
#if MEDIAINFO_EVENTS && MEDIAINFO_NEXTPACKET
- if (DTS_Interval!=(int64u)-1 && !Reference->Status[File__Analyze::IsFinished] && Reference->MI->Info->FrameInfo.DTS!=(int64u)-1 && DTS_Minimal!=(int64u)-1 && (Reference->CompleteDuration.empty() || Reference->CompleteDuration_Pos<Reference->CompleteDuration.size()))
+ if (DTS_Interval!=(int64u)-1 && !Sequences[Sequences_Current]->Status[File__Analyze::IsFinished] && Sequences[Sequences_Current]->MI->Info->FrameInfo.DTS!=(int64u)-1 && DTS_Minimal!=(int64u)-1 && (Sequences[Sequences_Current]->Resources.empty() || Sequences[Sequences_Current]->Resources_Current<Sequences[Sequences_Current]->Resources.size()))
{
int64u DTS_Temp;
- if (!Reference->CompleteDuration.empty() && Reference->CompleteDuration_Pos)
+ if (!Sequences[Sequences_Current]->Resources.empty() && Sequences[Sequences_Current]->Resources_Current)
{
- if (Reference->CompleteDuration[Reference->CompleteDuration_Pos].MI->Info->FrameInfo.DTS!=(int64u)-1)
- DTS_Temp=Reference->CompleteDuration[Reference->CompleteDuration_Pos].MI->Info->FrameInfo.DTS-Reference->CompleteDuration[Reference->CompleteDuration_Pos].MI->Info->Config->Demux_Offset_DTS_FromStream;
+ if (Sequences[Sequences_Current]->Resources[Sequences[Sequences_Current]->Resources_Current]->MI->Info->FrameInfo.DTS!=(int64u)-1)
+ DTS_Temp=Sequences[Sequences_Current]->Resources[Sequences[Sequences_Current]->Resources_Current]->MI->Info->FrameInfo.DTS-Sequences[Sequences_Current]->Resources[Sequences[Sequences_Current]->Resources_Current]->MI->Info->Config->Demux_Offset_DTS_FromStream;
else
DTS_Temp=0;
}
else
{
- if (Reference->MI->Info->FrameInfo.DTS!=(int64u)-1)
- DTS_Temp=Reference->MI->Info->FrameInfo.DTS-Reference->MI->Info->Config->Demux_Offset_DTS_FromStream;
+ if (Sequences[Sequences_Current]->MI->Info->FrameInfo.DTS!=(int64u)-1)
+ DTS_Temp=Sequences[Sequences_Current]->MI->Info->FrameInfo.DTS-Sequences[Sequences_Current]->MI->Info->Config->Demux_Offset_DTS_FromStream;
else
DTS_Temp=0;
}
- DTS_Temp+=Reference->CompleteDuration[Reference->CompleteDuration_Pos].Demux_Offset_DTS;
- if (!Reference->CompleteDuration.empty() && Reference->CompleteDuration_Pos<Reference->CompleteDuration.size() && Reference->CompleteDuration[Reference->CompleteDuration_Pos].IgnoreFramesRate && Reference->CompleteDuration[Reference->CompleteDuration_Pos].IgnoreFramesBefore)
+ DTS_Temp+=Sequences[Sequences_Current]->Resources[Sequences[Sequences_Current]->Resources_Current]->Demux_Offset_DTS;
+ if (!Sequences[Sequences_Current]->Resources.empty() && Sequences[Sequences_Current]->Resources_Current<Sequences[Sequences_Current]->Resources.size() && Sequences[Sequences_Current]->Resources[Sequences[Sequences_Current]->Resources_Current]->EditRate && Sequences[Sequences_Current]->Resources[Sequences[Sequences_Current]->Resources_Current]->IgnoreEditsBefore)
{
- int64u TimeOffset=float64_int64s(((float64)Reference->CompleteDuration[Reference->CompleteDuration_Pos].IgnoreFramesBefore)/Reference->CompleteDuration[Reference->CompleteDuration_Pos].IgnoreFramesRate*1000000000);
+ int64u TimeOffset=float64_int64s(((float64)Sequences[Sequences_Current]->Resources[Sequences[Sequences_Current]->Resources_Current]->IgnoreEditsBefore)/Sequences[Sequences_Current]->Resources[Sequences[Sequences_Current]->Resources_Current]->EditRate*1000000000);
if (DTS_Temp>TimeOffset)
DTS_Temp-=TimeOffset;
else
@@ -941,17 +1000,17 @@ void File__ReferenceFilesHelper::ParseReference()
if (DTS_Temp>DTS_Minimal+DTS_Interval)
return;
}
- if (Config->Event_CallBackFunction_IsSet() && !Reference->Status[File__Analyze::IsFinished])
+ if (Config->Event_CallBackFunction_IsSet() && !Sequences[Sequences_Current]->Status[File__Analyze::IsFinished])
{
#if MEDIAINFO_DEMUX
SubFile_Start();
- if (Reference->CompleteDuration_Pos==0)
+ if (Sequences[Sequences_Current]->Resources_Current==0)
{
- while ((Reference->Status=Reference->MI->Open_NextPacket())[8])
+ while ((Sequences[Sequences_Current]->Status=Sequences[Sequences_Current]->MI->Open_NextPacket())[8])
{
- if (!Reference->FileSize_IsPresent && Reference->MI->Config.File_Size!=(int64u)-1)
+ if (!Sequences[Sequences_Current]->FileSize_IsPresent && Sequences[Sequences_Current]->MI->Config.File_Size!=(int64u)-1)
{
- Reference->FileSize_IsPresent=true;
+ Sequences[Sequences_Current]->FileSize_IsPresent=true;
if (CountOfReferences_ForReadSize)
{
CountOfReferences_ForReadSize--;
@@ -966,23 +1025,23 @@ void File__ReferenceFilesHelper::ParseReference()
return;
}
}
- Reference->CompleteDuration_Pos++;
- if (Reference->CompleteDuration_Pos<Reference->CompleteDuration.size() && Reference->CompleteDuration[Reference->CompleteDuration_Pos].MI)
- Reference->CompleteDuration[Reference->CompleteDuration_Pos].MI->Open_Buffer_Seek(0, 0, (int64u)-1);
+ Sequences[Sequences_Current]->Resources_Current++;
+ if (Sequences[Sequences_Current]->Resources_Current<Sequences[Sequences_Current]->Resources.size() && Sequences[Sequences_Current]->Resources[Sequences[Sequences_Current]->Resources_Current]->MI)
+ Sequences[Sequences_Current]->Resources[Sequences[Sequences_Current]->Resources_Current]->MI->Open_Buffer_Seek(0, 0, (int64u)-1);
}
#if MEDIAINFO_NEXTPACKET && MEDIAINFO_DEMUX
if (Config->ParseSpeed<1.0)
- Reference->CompleteDuration_Pos=Reference->CompleteDuration.size(); //No need to parse all files
+ Sequences[Sequences_Current]->Resources_Current=Sequences[Sequences_Current]->Resources.size(); //No need to parse all files
#endif //MEDIAINFO_NEXTPACKET
- while (Reference->CompleteDuration_Pos<Reference->CompleteDuration.size())
+ while (Sequences[Sequences_Current]->Resources_Current<Sequences[Sequences_Current]->Resources.size())
{
- while ((Reference->Status=Reference->CompleteDuration[Reference->CompleteDuration_Pos].MI->Open_NextPacket())[8])
+ while ((Sequences[Sequences_Current]->Status=Sequences[Sequences_Current]->Resources[Sequences[Sequences_Current]->Resources_Current]->MI->Open_NextPacket())[8])
{
- if (!Reference->FileSize_IsPresent && Reference->MI->Config.File_Size!=(int64u)-1)
+ if (!Sequences[Sequences_Current]->FileSize_IsPresent && Sequences[Sequences_Current]->MI->Config.File_Size!=(int64u)-1)
{
- Reference->FileSize_IsPresent=true;
+ Sequences[Sequences_Current]->FileSize_IsPresent=true;
if (CountOfReferences_ForReadSize)
{
CountOfReferences_ForReadSize--;
@@ -997,9 +1056,9 @@ void File__ReferenceFilesHelper::ParseReference()
return;
}
}
- Reference->CompleteDuration_Pos++;
- if (Reference->CompleteDuration_Pos<Reference->CompleteDuration.size() && Reference->CompleteDuration[Reference->CompleteDuration_Pos].MI)
- Reference->CompleteDuration[Reference->CompleteDuration_Pos].MI->Open_Buffer_Seek(0, 0, (int64u)-1);
+ Sequences[Sequences_Current]->Resources_Current++;
+ if (Sequences[Sequences_Current]->Resources_Current<Sequences[Sequences_Current]->Resources.size() && Sequences[Sequences_Current]->Resources[Sequences[Sequences_Current]->Resources_Current]->MI)
+ Sequences[Sequences_Current]->Resources[Sequences[Sequences_Current]->Resources_Current]->MI->Open_Buffer_Seek(0, 0, (int64u)-1);
}
if (CountOfReferencesToParse)
CountOfReferencesToParse--;
@@ -1009,18 +1068,19 @@ void File__ReferenceFilesHelper::ParseReference()
ParseReference_Finalize();
if (!Config->File_KeepInfo_Get())
{
- Reference->StreamKind=Stream_Max;
- Reference->StreamPos=(size_t)-1;
- Reference->State=10000;
- if (Reference->CompleteDuration.empty())
- Reference->FileSize=Reference->MI->Config.File_Size;
- else if (Reference->FileSize==(int64u)-1)
+ Sequences[Sequences_Current]->StreamKind=Stream_Max;
+ Sequences[Sequences_Current]->StreamPos=(size_t)-1;
+ Sequences[Sequences_Current]->State=10000;
+ if (Sequences[Sequences_Current]->Resources.empty())
+ Sequences[Sequences_Current]->FileSize=Sequences[Sequences_Current]->MI->Config.File_Size;
+ else if (Sequences[Sequences_Current]->FileSize==(int64u)-1)
{
- Reference->FileSize=0;
- for (size_t Pos=0; Pos<Reference->CompleteDuration.size(); Pos++)
- Reference->FileSize+=File::Size_Get(Reference->CompleteDuration[Pos].FileName);
+ Sequences[Sequences_Current]->FileSize=0;
+ for (size_t Pos=0; Pos<Sequences[Sequences_Current]->Resources.size(); Pos++)
+ for (size_t Resource_FileNames_Pos=0; Resource_FileNames_Pos<Sequences[Sequences_Current]->Resources[Pos]->FileNames.size(); Resource_FileNames_Pos++)
+ Sequences[Sequences_Current]->FileSize+=File::Size_Get(Sequences[Sequences_Current]->Resources[Pos]->FileNames[Resource_FileNames_Pos]);
}
- delete Reference->MI; Reference->MI=NULL;
+ delete Sequences[Sequences_Current]->MI; Sequences[Sequences_Current]->MI=NULL;
}
}
}
@@ -1029,33 +1089,33 @@ void File__ReferenceFilesHelper::ParseReference()
void File__ReferenceFilesHelper::ParseReference_Finalize ()
{
//Removing wrong initial value
- if (Reference->MI->Count_Get(Reference->StreamKind)==0 && Reference->StreamPos!=(size_t)-1
- && Reference->MI->Count_Get(Stream_Video)+Reference->MI->Count_Get(Stream_Audio)+Reference->MI->Count_Get(Stream_Image)+Reference->MI->Count_Get(Stream_Text)+Reference->MI->Count_Get(Stream_Other))
+ if (Sequences[Sequences_Current]->MI->Count_Get(Sequences[Sequences_Current]->StreamKind)==0 && Sequences[Sequences_Current]->StreamPos!=(size_t)-1
+ && Sequences[Sequences_Current]->MI->Count_Get(Stream_Video)+Sequences[Sequences_Current]->MI->Count_Get(Stream_Audio)+Sequences[Sequences_Current]->MI->Count_Get(Stream_Image)+Sequences[Sequences_Current]->MI->Count_Get(Stream_Text)+Sequences[Sequences_Current]->MI->Count_Get(Stream_Other))
{
- MI->Stream_Erase(Reference->StreamKind, Reference->StreamPos);
- for (references::iterator ReferenceTemp=References.begin(); ReferenceTemp!=References.end(); ++ReferenceTemp)
- if (ReferenceTemp->StreamKind==Reference->StreamKind && ReferenceTemp->StreamPos!=(size_t)-1 && ReferenceTemp->StreamPos>Reference->StreamPos)
- ReferenceTemp->StreamPos--;
- Reference->StreamPos=(size_t)-1;
+ MI->Stream_Erase(Sequences[Sequences_Current]->StreamKind, Sequences[Sequences_Current]->StreamPos);
+ for (sequences::iterator ReferenceTemp=Sequences.begin(); ReferenceTemp!=Sequences.end(); ++ReferenceTemp)
+ if ((*ReferenceTemp)->StreamKind==Sequences[Sequences_Current]->StreamKind && (*ReferenceTemp)->StreamPos!=(size_t)-1 && (*ReferenceTemp)->StreamPos>Sequences[Sequences_Current]->StreamPos)
+ (*ReferenceTemp)->StreamPos--;
+ Sequences[Sequences_Current]->StreamPos=(size_t)-1;
}
bool StreamFound=false;
for (size_t StreamKind=Stream_General+1; StreamKind<Stream_Max; StreamKind++)
- for (size_t StreamPos=0; StreamPos<Reference->MI->Count_Get((stream_t)StreamKind); StreamPos++)
+ for (size_t StreamPos=0; StreamPos<Sequences[Sequences_Current]->MI->Count_Get((stream_t)StreamKind); StreamPos++)
{
StreamKind_Last=(stream_t)StreamKind;
- if (Reference->StreamPos!=(size_t)-1 && StreamKind_Last==Reference->StreamKind && StreamPos==0)
+ if (Sequences[Sequences_Current]->StreamPos!=(size_t)-1 && StreamKind_Last==Sequences[Sequences_Current]->StreamKind && StreamPos==0)
{
- StreamPos_To=Reference->StreamPos;
+ StreamPos_To=Sequences[Sequences_Current]->StreamPos;
StreamFound=true;
}
else
{
size_t ToInsert=(size_t)-1;
- for (references::iterator ReferencePos=References.begin(); ReferencePos!=References.end(); ++ReferencePos)
- if (ReferencePos->StreamKind==StreamKind_Last && Reference->StreamID<ReferencePos->StreamID)
+ for (sequences::iterator ReferencePos=Sequences.begin(); ReferencePos!=Sequences.end(); ++ReferencePos)
+ if ((*ReferencePos)->StreamKind==StreamKind_Last && Sequences[Sequences_Current]->StreamID<(*ReferencePos)->StreamID)
{
- ToInsert=ReferencePos->StreamPos;
+ ToInsert=(*ReferencePos)->StreamPos;
break;
}
@@ -1066,12 +1126,12 @@ void File__ReferenceFilesHelper::ParseReference_Finalize ()
ParseReference_Finalize_PerStream();
}
- if (!StreamFound && Reference->StreamKind!=Stream_Max && Reference->StreamPos!=(size_t)-1)
+ if (!StreamFound && Sequences[Sequences_Current]->StreamKind!=Stream_Max && Sequences[Sequences_Current]->StreamPos!=(size_t)-1 && Sequences[Sequences_Current]->MI->Info)
{
- Ztring MuxingMode=MI->Retrieve(Reference->StreamKind, Reference->StreamPos, "MuxingMode");
+ Ztring MuxingMode=MI->Retrieve(Sequences[Sequences_Current]->StreamKind, Sequences[Sequences_Current]->StreamPos, "MuxingMode");
if (!MuxingMode.empty())
MuxingMode.insert(0, __T(" / "));
- MI->Fill(Reference->StreamKind, Reference->StreamPos, "MuxingMode", Reference->MI->Info->Get(Stream_General, 0, General_Format)+MuxingMode, true);
+ MI->Fill(Sequences[Sequences_Current]->StreamKind, Sequences[Sequences_Current]->StreamPos, "MuxingMode", Sequences[Sequences_Current]->MI->Info->Get(Stream_General, 0, General_Format)+MuxingMode, true);
}
}
@@ -1081,39 +1141,39 @@ void File__ReferenceFilesHelper::ParseReference_Finalize_PerStream ()
//Hacks - Before
Ztring CodecID=MI->Retrieve(StreamKind_Last, StreamPos_To, MI->Fill_Parameter(StreamKind_Last, Generic_CodecID));
Ztring ID_Base;
- if (HasMainFile_Filled && !Reference->IsMain)
+ if (HasMainFile_Filled && !Sequences[Sequences_Current]->IsMain)
{
- ID_Base=Ztring::ToZtring(ID_Max+Reference->StreamID-1);
- MI->Fill(StreamKind_Last, StreamPos_To, "SideCar_FilePos", Reference->StreamID-1);
+ ID_Base=Ztring::ToZtring(ID_Max+Sequences[Sequences_Current]->StreamID-1);
+ MI->Fill(StreamKind_Last, StreamPos_To, "SideCar_FilePos", Sequences[Sequences_Current]->StreamID-1);
(*MI->Stream_More)[StreamKind_Last][StreamPos_To](Ztring().From_Local("SideCar_FilePos"), Info_Options)=__T("N NT");
}
- else if (Reference->StreamID!=(int64u)-1)
- ID_Base=Ztring::ToZtring(Reference->StreamID);
+ else if (Sequences[Sequences_Current]->StreamID!=(int64u)-1)
+ ID_Base=Ztring::ToZtring(Sequences[Sequences_Current]->StreamID);
Ztring ID=ID_Base;
Ztring ID_String=ID_Base;
Ztring MenuID;
Ztring MenuID_String;
- if (!HasMainFile_Filled && Reference->IsMain)
+ if (!HasMainFile_Filled && Sequences[Sequences_Current]->IsMain)
{
- MI->Fill(Stream_General, 0, General_Format, Reference->MI->Get(Stream_General, 0, General_Format) , true);
- MI->Fill(Stream_General, 0, General_CompleteName, Reference->MI->Get(Stream_General, 0, General_CompleteName) , true);
- MI->Fill(Stream_General, 0, General_FileExtension, Reference->MI->Get(Stream_General, 0, General_FileExtension) , true);
+ MI->Fill(Stream_General, 0, General_Format, Sequences[Sequences_Current]->MI->Get(Stream_General, 0, General_Format) , true);
+ MI->Fill(Stream_General, 0, General_CompleteName, Sequences[Sequences_Current]->MI->Get(Stream_General, 0, General_CompleteName) , true);
+ MI->Fill(Stream_General, 0, General_FileExtension, Sequences[Sequences_Current]->MI->Get(Stream_General, 0, General_FileExtension) , true);
HasMainFile=true;
HasMainFile_Filled=true;
}
- if (Reference->IsMain)
+ if (Sequences[Sequences_Current]->IsMain)
{
- int64u ID_New=Reference->MI->Get(StreamKind_Last, StreamPos_From, General_ID).To_int64u();
+ int64u ID_New=Sequences[Sequences_Current]->MI->Get(StreamKind_Last, StreamPos_From, General_ID).To_int64u();
if (ID_Max<ID_New)
ID_Max=ID_New;
}
MI->Clear(StreamKind_Last, StreamPos_To, General_ID);
- MI->Merge(*Reference->MI->Info, StreamKind_Last, StreamPos_From, StreamPos_To);
+ MI->Merge(*Sequences[Sequences_Current]->MI->Info, StreamKind_Last, StreamPos_From, StreamPos_To);
- if (!Reference->CompleteDuration.empty())
+ if (!Sequences[Sequences_Current]->Resources.empty())
{
MI->Clear(StreamKind_Last, StreamPos_To, MI->Fill_Parameter(StreamKind_Last, Generic_BitRate));
MI->Clear(StreamKind_Last, StreamPos_To, MI->Fill_Parameter(StreamKind_Last, Generic_Duration));
@@ -1125,7 +1185,7 @@ void File__ReferenceFilesHelper::ParseReference_Finalize_PerStream ()
int64u FrameCount_Temp=0;
int64u StreamSize_Temp=0;
int64u FileSize_Temp=0;
- for (size_t Pos=0; Pos<Reference->CompleteDuration.size(); Pos++)
+ for (size_t Pos=0; Pos<Sequences[Sequences_Current]->Resources.size(); Pos++)
{
MediaInfo_Internal MI2;
MI2.Option(__T("File_KeepInfo"), __T("1"));
@@ -1133,13 +1193,14 @@ void File__ReferenceFilesHelper::ParseReference_Finalize_PerStream ()
Ztring Demux_Save=MI2.Option(__T("Demux_Get"), __T(""));
MI2.Option(__T("ParseSpeed"), __T("0"));
MI2.Option(__T("Demux"), Ztring());
- MI2.Config.File_IgnoreFramesBefore=Reference->CompleteDuration[Pos].IgnoreFramesBefore;
- if (Reference->CompleteDuration[Pos].IgnoreFramesAfter==(int64u)-1 && Reference->CompleteDuration[Pos].IgnoreFramesAfterDuration!=(int64u)-1)
- MI2.Config.File_IgnoreFramesAfter=Reference->CompleteDuration[Pos].IgnoreFramesBefore+Reference->CompleteDuration[Pos].IgnoreFramesAfterDuration;
+ MI2.Config.File_IgnoreEditsBefore=Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsBefore;
+ if (Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsAfter==(int64u)-1 && Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsAfterDuration!=(int64u)-1)
+ MI2.Config.File_IgnoreEditsAfter=Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsBefore+Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsAfterDuration;
else
- MI2.Config.File_IgnoreFramesAfter=Reference->CompleteDuration[Pos].IgnoreFramesAfter;
- MI2.Config.File_IgnoreFramesRate=Reference->CompleteDuration[Pos].IgnoreFramesRate;
- size_t MiOpenResult=MI2.Open(Reference->CompleteDuration[Pos].FileName);
+ MI2.Config.File_IgnoreEditsAfter=Sequences[Sequences_Current]->Resources[Pos]->IgnoreEditsAfter;
+ MI2.Config.File_EditRate=Sequences[Sequences_Current]->Resources[Pos]->EditRate;
+ Sequences[Sequences_Current]->Resources[Pos]->FileNames.Separator_Set(0, ",");
+ size_t MiOpenResult=MI2.Open(Sequences[Sequences_Current]->Resources[Pos]->FileNames.Read());
MI2.Option(__T("ParseSpeed"), ParseSpeed_Save); //This is a global value, need to reset it. TODO: local value
MI2.Option(__T("Demux"), Demux_Save); //This is a global value, need to reset it. TODO: local value
if (MiOpenResult)
@@ -1183,7 +1244,7 @@ void File__ReferenceFilesHelper::ParseReference_Finalize_PerStream ()
if (StreamSize_Temp!=(int64u)-1)
MI->Fill(StreamKind_Last, StreamPos_To, MI->Fill_Parameter(StreamKind_Last, Generic_StreamSize), StreamSize_Temp, 10, true);
if (FileSize_Temp!=(int64u)-1)
- Reference->FileSize=FileSize_Temp;
+ Sequences[Sequences_Current]->FileSize=FileSize_Temp;
if (BitRate_Before && Duration_Temp)
{
float64 BitRate_After=((float64)StreamSize_Temp)*8000/Duration_Temp;
@@ -1193,18 +1254,18 @@ void File__ReferenceFilesHelper::ParseReference_Finalize_PerStream ()
}
//Frame rate if available from container
- if (StreamKind_Last==Stream_Video && Reference->FrameRate)
- MI->Fill(Stream_Video, StreamPos_To, Video_FrameRate, Reference->FrameRate, 3 , true);
+ if (StreamKind_Last==Stream_Video && Sequences[Sequences_Current]->FrameRate)
+ MI->Fill(Stream_Video, StreamPos_To, Video_FrameRate, Sequences[Sequences_Current]->FrameRate, 3 , true);
//Hacks - After
- if (!Reference->IsMain && CodecID!=MI->Retrieve(StreamKind_Last, StreamPos_To, MI->Fill_Parameter(StreamKind_Last, Generic_CodecID)))
+ if (!Sequences[Sequences_Current]->IsMain && CodecID!=MI->Retrieve(StreamKind_Last, StreamPos_To, MI->Fill_Parameter(StreamKind_Last, Generic_CodecID)))
{
if (!CodecID.empty())
CodecID+=__T(" / ");
CodecID+=MI->Retrieve(StreamKind_Last, StreamPos_To, MI->Fill_Parameter(StreamKind_Last, Generic_CodecID));
MI->Fill(StreamKind_Last, StreamPos_To, MI->Fill_Parameter(StreamKind_Last, Generic_CodecID), CodecID, true);
}
- if (!Reference->IsMain && Reference->MI->Count_Get(Stream_Video)+Reference->MI->Count_Get(Stream_Audio)>1 && Reference->MI->Get(Stream_Video, 0, Video_Format)!=__T("DV"))
+ if (!Sequences[Sequences_Current]->IsMain && Sequences[Sequences_Current]->MI->Count_Get(Stream_Video)+Sequences[Sequences_Current]->MI->Count_Get(Stream_Audio)>1 && Sequences[Sequences_Current]->MI->Get(Stream_Video, 0, Video_Format)!=__T("DV"))
{
if (StreamKind_Last==Stream_Menu)
{
@@ -1219,26 +1280,26 @@ void File__ReferenceFilesHelper::ParseReference_Finalize_PerStream ()
MI->Fill(Stream_Menu, StreamPos_To, Menu_List, List.Read(), true);
MI->Fill(Stream_Menu, StreamPos_To, Menu_List_String, List_String.Read(), true);
}
- else if (References.size()>1 && Reference->MI->Count_Get(Stream_Menu)==0)
+ else if (Sequences.size()>1 && Sequences[Sequences_Current]->MI->Count_Get(Stream_Menu)==0)
{
- if (Reference->MenuPos==(size_t)-1)
+ if (Sequences[Sequences_Current]->MenuPos==(size_t)-1)
{
- Reference->MenuPos=MI->Stream_Prepare(Stream_Menu);
- MI->Fill(Stream_Menu, Reference->MenuPos, General_ID, ID_Base);
- MI->Fill(Stream_Menu, Reference->StreamPos, "Source", Reference->Source);
+ Sequences[Sequences_Current]->MenuPos=MI->Stream_Prepare(Stream_Menu);
+ MI->Fill(Stream_Menu, Sequences[Sequences_Current]->MenuPos, General_ID, ID_Base);
+ MI->Fill(Stream_Menu, Sequences[Sequences_Current]->StreamPos, "Source", Sequences[Sequences_Current]->Source);
}
- Ztring List=Reference->MI->Get(StreamKind_Last, StreamPos_From, General_ID);
- Ztring List_String=Reference->MI->Get(StreamKind_Last, StreamPos_From, General_ID_String);
+ Ztring List=Sequences[Sequences_Current]->MI->Get(StreamKind_Last, StreamPos_From, General_ID);
+ Ztring List_String=Sequences[Sequences_Current]->MI->Get(StreamKind_Last, StreamPos_From, General_ID_String);
if (!ID_Base.empty())
{
List.insert(0, ID_Base+__T("-"));
List_String.insert(0, ID_Base+__T("-"));
}
- MI->Fill(Stream_Menu, Reference->MenuPos, Menu_List, List);
- MI->Fill(Stream_Menu, Reference->MenuPos, Menu_List_String, List_String);
+ MI->Fill(Stream_Menu, Sequences[Sequences_Current]->MenuPos, Menu_List, List);
+ MI->Fill(Stream_Menu, Sequences[Sequences_Current]->MenuPos, Menu_List_String, List_String);
}
}
- if (!Reference->IsMain && (ContainerHasNoId || !Config->File_ID_OnlyRoot_Get() || Reference->MI->Get(Stream_General, 0, General_Format)==__T("SCC") || Reference->MI->Count_Get(Stream_Video)+Reference->MI->Count_Get(Stream_Audio)>1) && !MI->Retrieve(StreamKind_Last, StreamPos_To, General_ID).empty())
+ if (!Sequences[Sequences_Current]->IsMain && (ContainerHasNoId || !Config->File_ID_OnlyRoot_Get() || Sequences[Sequences_Current]->MI->Get(Stream_General, 0, General_Format)==__T("SCC") || Sequences[Sequences_Current]->MI->Count_Get(Stream_Video)+Sequences[Sequences_Current]->MI->Count_Get(Stream_Audio)>1) && !MI->Retrieve(StreamKind_Last, StreamPos_To, General_ID).empty())
{
if (!ID.empty())
ID+=__T('-');
@@ -1255,13 +1316,13 @@ void File__ReferenceFilesHelper::ParseReference_Finalize_PerStream ()
MenuID_String=ID_Base+__T('-');
MenuID_String+=MI->Retrieve(StreamKind_Last, StreamPos_To, "MenuID/String");
}
- else if (Reference->MenuPos!=(size_t)-1)
+ else if (Sequences[Sequences_Current]->MenuPos!=(size_t)-1)
{
MenuID=ID_Base;
MenuID_String=ID_Base;
}
}
- if (!Reference->IsMain)
+ if (!Sequences[Sequences_Current]->IsMain)
{
MI->Fill(StreamKind_Last, StreamPos_To, General_ID, ID, true);
MI->Fill(StreamKind_Last, StreamPos_To, General_ID_String, ID_String, true);
@@ -1269,7 +1330,7 @@ void File__ReferenceFilesHelper::ParseReference_Finalize_PerStream ()
MI->Fill(StreamKind_Last, StreamPos_To, "MenuID/String", MenuID_String, true);
if (!MI->Retrieve(StreamKind_Last, StreamPos_To, "Source").empty())
{
- if (MI->Retrieve(StreamKind_Last, StreamPos_To, "Source_Original").empty() && Reference->Source!=MI->Retrieve(StreamKind_Last, StreamPos_To, "Source")) // TODO: better handling
+ if (MI->Retrieve(StreamKind_Last, StreamPos_To, "Source_Original").empty() && Sequences[Sequences_Current]->Source!=MI->Retrieve(StreamKind_Last, StreamPos_To, "Source")) // TODO: better handling
{
MI->Fill(StreamKind_Last, StreamPos_To, "Source_Original", MI->Retrieve(StreamKind_Last, StreamPos_To, "Source"));
MI->Fill(StreamKind_Last, StreamPos_To, "Source_Original_Kind", MI->Retrieve(StreamKind_Last, StreamPos_To, "Source_Kind"));
@@ -1279,27 +1340,27 @@ void File__ReferenceFilesHelper::ParseReference_Finalize_PerStream ()
MI->Clear(StreamKind_Last, StreamPos_To, "Source_Kind");
MI->Clear(StreamKind_Last, StreamPos_To, "Source_Info");
}
- MI->Fill(StreamKind_Last, StreamPos_To, "Source", Reference->Source);
+ MI->Fill(StreamKind_Last, StreamPos_To, "Source", Sequences[Sequences_Current]->Source);
}
- for (std::map<string, Ztring>::iterator Info=Reference->Infos.begin(); Info!=Reference->Infos.end(); ++Info)
+ for (std::map<string, Ztring>::iterator Info=Sequences[Sequences_Current]->Infos.begin(); Info!=Sequences[Sequences_Current]->Infos.end(); ++Info)
if (MI->Retrieve(StreamKind_Last, StreamPos_To, Info->first.c_str()).empty())
MI->Fill(StreamKind_Last, StreamPos_To, Info->first.c_str(), Info->second);
//Others
- if (!Reference->IsMain && Reference->MI->Info && MI->Retrieve(StreamKind_Last, StreamPos_To, Reference->MI->Info->Fill_Parameter(StreamKind_Last, Generic_Format))!=Reference->MI->Info->Get(Stream_General, 0, General_Format))
+ if (!Sequences[Sequences_Current]->IsMain && Sequences[Sequences_Current]->MI->Info && MI->Retrieve(StreamKind_Last, StreamPos_To, Sequences[Sequences_Current]->MI->Info->Fill_Parameter(StreamKind_Last, Generic_Format))!=Sequences[Sequences_Current]->MI->Info->Get(Stream_General, 0, General_Format))
{
Ztring MuxingMode=MI->Retrieve(StreamKind_Last, StreamPos_To, "MuxingMode");
if (!MuxingMode.empty())
MuxingMode.insert(0, __T(" / "));
- MI->Fill(StreamKind_Last, StreamPos_To, "MuxingMode", Reference->MI->Info->Get(Stream_General, 0, General_Format)+MuxingMode, true);
+ MI->Fill(StreamKind_Last, StreamPos_To, "MuxingMode", Sequences[Sequences_Current]->MI->Info->Get(Stream_General, 0, General_Format)+MuxingMode, true);
}
//Lists
#if MEDIAINFO_ADVANCED || MEDIAINFO_MD5
- if (!Reference->List_Compute_Done && (Reference->MI->Count_Get(Stream_Menu)==0 || StreamKind_Last==Stream_Menu))
+ if (!Sequences[Sequences_Current]->List_Compute_Done && (Sequences[Sequences_Current]->MI->Count_Get(Stream_Menu)==0 || StreamKind_Last==Stream_Menu))
{
List_Compute();
- Reference->List_Compute_Done=true;
+ Sequences[Sequences_Current]->List_Compute_Done=true;
}
#endif //MEDIAINFO_ADVANCED || MEDIAINFO_MD5
}
@@ -1308,19 +1369,19 @@ void File__ReferenceFilesHelper::ParseReference_Finalize_PerStream ()
#if MEDIAINFO_ADVANCED || MEDIAINFO_MD5
void File__ReferenceFilesHelper::List_Compute()
{
- stream_t StreamKind=References.size()>1?StreamKind_Last:Stream_General;
- size_t StreamPos=References.size()>1?StreamPos_To:0;
+ stream_t StreamKind=Sequences.size()>1?StreamKind_Last:Stream_General;
+ size_t StreamPos=Sequences.size()>1?StreamPos_To:0;
- stream_t StreamKind_Target=Reference->MenuPos==(size_t)-1?StreamKind:Stream_Menu;
- size_t StreamPos_Target=Reference->MenuPos==(size_t)-1?StreamPos:Reference->MenuPos;
+ stream_t StreamKind_Target=Sequences[Sequences_Current]->MenuPos==(size_t)-1?StreamKind:Stream_Menu;
+ size_t StreamPos_Target=Sequences[Sequences_Current]->MenuPos==(size_t)-1?StreamPos:Sequences[Sequences_Current]->MenuPos;
//MD5
#if MEDIAINFO_MD5
if (!HasMainFile && Config->File_Md5_Get())
{
- if (!Reference->MI->Get(Stream_General, 0, __T("MD5_Generated")).empty())
+ if (!Sequences[Sequences_Current]->MI->Get(Stream_General, 0, __T("MD5_Generated")).empty())
{
- if (Reference->MI->Config.File_Names.size()==1)
+ if (Sequences[Sequences_Current]->MI->Config.File_Names.size()==1)
{
if (MI->Retrieve(StreamKind_Target, StreamPos_Target, "Source").empty())
{
@@ -1335,25 +1396,25 @@ void File__ReferenceFilesHelper::List_Compute()
SourcePath=SourceName.substr(0, Pos_Path);
}
size_t SourcePath_Size=SourcePath.size()+1; //Path size + path separator size
- Ztring Temp=Reference->MI->Config.File_Names[0];
+ Ztring Temp=Sequences[Sequences_Current]->MI->Config.File_Names[0];
if (!Config->File_IsReferenced_Get())
Temp.erase(0, SourcePath_Size);
MI->Fill(StreamKind_Target, StreamPos_Target, "Source", Temp);
}
- MI->Fill(StreamKind_Target, StreamPos_Target, "Source_MD5_Generated", Reference->MI->Get(Stream_General, 0, __T("MD5_Generated")));
+ MI->Fill(StreamKind_Target, StreamPos_Target, "Source_MD5_Generated", Sequences[Sequences_Current]->MI->Get(Stream_General, 0, __T("MD5_Generated")));
(*MI->Stream_More)[StreamKind_Target][StreamPos_Target](Ztring().From_Local("Source_MD5_Generated"), Info_Options)=__T("N NT");
}
- MI->Fill(StreamKind_Target, StreamPos_Target, "Source_List_MD5_Generated", Reference->MI->Get(Stream_General, 0, __T("MD5_Generated")));
+ MI->Fill(StreamKind_Target, StreamPos_Target, "Source_List_MD5_Generated", Sequences[Sequences_Current]->MI->Get(Stream_General, 0, __T("MD5_Generated")));
(*MI->Stream_More)[StreamKind_Target][StreamPos_Target](Ztring().From_Local("Source_List_MD5_Generated"), Info_Options)=__T("N NT");
}
- if (!Reference->MI->Get(Stream_General, 0, __T("Source_List_MD5_Generated")).empty())
+ if (!Sequences[Sequences_Current]->MI->Get(Stream_General, 0, __T("Source_List_MD5_Generated")).empty())
{
- MI->Fill(StreamKind_Target, StreamPos_Target, "Source_List_MD5_Generated", Reference->MI->Get(Stream_General, 0, __T("Source_List_MD5_Generated")));
+ MI->Fill(StreamKind_Target, StreamPos_Target, "Source_List_MD5_Generated", Sequences[Sequences_Current]->MI->Get(Stream_General, 0, __T("Source_List_MD5_Generated")));
(*MI->Stream_More)[StreamKind_Target][StreamPos_Target](Ztring().From_Local("Source_List_MD5_Generated"), Info_Options)=__T("N NT");
}
- else if (!Reference->MI->Get(StreamKind, StreamPos, __T("Source_List_MD5_Generated")).empty())
+ else if (!Sequences[Sequences_Current]->MI->Get(StreamKind, StreamPos, __T("Source_List_MD5_Generated")).empty())
{
- MI->Fill(StreamKind_Target, StreamPos_Target, "Source_List_MD5_Generated", Reference->MI->Get(StreamKind, StreamPos, __T("Source_List_MD5_Generated")));
+ MI->Fill(StreamKind_Target, StreamPos_Target, "Source_List_MD5_Generated", Sequences[Sequences_Current]->MI->Get(StreamKind, StreamPos, __T("Source_List_MD5_Generated")));
(*MI->Stream_More)[StreamKind_Target][StreamPos_Target](Ztring().From_Local("Source_List_MD5_Generated"), Info_Options)=__T("N NT");
}
}
@@ -1374,18 +1435,18 @@ void File__ReferenceFilesHelper::List_Compute()
SourcePath=SourceName.substr(0, Pos_Path);
}
size_t SourcePath_Size=SourcePath.size()+1; //Path size + path separator size
- for (size_t Pos=0; Pos<Reference->FileNames.size(); Pos++)
+ for (size_t Pos=0; Pos<Sequences[Sequences_Current]->FileNames.size(); Pos++)
{
- Ztring Temp=Reference->FileNames[Pos];
+ Ztring Temp=Sequences[Sequences_Current]->FileNames[Pos];
if (!Config->File_IsReferenced_Get())
Temp.erase(0, SourcePath_Size);
MI->Fill(StreamKind_Target, StreamPos_Target, "Source_List", Temp);
}
- if (!Reference->MI->Get(Stream_General, 0, __T("Source_List")).empty())
+ if (!Sequences[Sequences_Current]->MI->Get(Stream_General, 0, __T("Source_List")).empty())
{
ZtringList List;
List.Separator_Set(0, __T(" / "));
- List.Write(Reference->MI->Get(Stream_General, 0, __T("Source_List")));
+ List.Write(Sequences[Sequences_Current]->MI->Get(Stream_General, 0, __T("Source_List")));
for (size_t Pos=0; Pos<List.size(); Pos++)
{
Ztring Temp=List[Pos];
@@ -1410,7 +1471,7 @@ MediaInfo_Internal* File__ReferenceFilesHelper::MI_Create()
MI_Temp->Option(__T("File_KeepInfo"), __T("1"));
MI_Temp->Option(__T("File_ID_OnlyRoot"), Config->File_ID_OnlyRoot_Get()?__T("1"):__T("0"));
MI_Temp->Option(__T("File_DvDif_DisableAudioIfIsInContainer"), Config->File_DvDif_DisableAudioIfIsInContainer_Get()?__T("1"):__T("0"));
- if ((References.size()>1 || Config->File_MpegTs_ForceMenu_Get()) && !Reference->IsMain && !HasMainFile)
+ if ((Sequences.size()>1 || Config->File_MpegTs_ForceMenu_Get()) && !Sequences[Sequences_Current]->IsMain && !HasMainFile)
MI_Temp->Option(__T("File_MpegTs_ForceMenu"), __T("1"));
#if MEDIAINFO_AES
MI_Temp->Option(__T("File_Encryption_Format"), MI->Retrieve(Stream_General, 0, "Encryption_Format"));
@@ -1423,6 +1484,8 @@ MediaInfo_Internal* File__ReferenceFilesHelper::MI_Create()
#if MEDIAINFO_NEXTPACKET
if (Config->NextPacket_Get())
MI_Temp->Option(__T("File_NextPacket"), __T("1"));
+ if (Config->File_Demux_Interleave_Get())
+ MI_Temp->Option(__T("File_Demux_Interleave"), __T("1"));
#endif //MEDIAINFO_NEXTPACKET
#if MEDIAINFO_ADVANCED
if (Config->File_IgnoreSequenceFileSize_Get())
@@ -1444,27 +1507,27 @@ MediaInfo_Internal* File__ReferenceFilesHelper::MI_Create()
MI_Temp->Config.Config_PerPackage->Event_CallBackFunction_Set(Config->Event_CallBackFunction_Get());
}
MI_Temp->Config.File_Names_RootDirectory=FileName(MI->File_Name).Path_Get();
- if (Reference->FileNames.size()>1)
+ if (Sequences[Sequences_Current]->FileNames.size()>1)
MI_Temp->Option(__T("File_TestContinuousFileNames"), __T("0"));
ZtringListList SubFile_IDs;
- if (Reference->IsMain)
+ if (Sequences[Sequences_Current]->IsMain)
HasMainFile=true;
- if (HasMainFile && !Reference->IsMain)
+ if (HasMainFile && !Sequences[Sequences_Current]->IsMain)
{
ZtringList ID;
- ID.push_back(Ztring::ToZtring((((int64u)MediaInfo_Parser_SideCar)<<56)|Reference->StreamID-1));
+ ID.push_back(Ztring::ToZtring((((int64u)MediaInfo_Parser_SideCar)<<56)|Sequences[Sequences_Current]->StreamID-1));
ID.push_back(Ztring::ToZtring(16));
ID.push_back(Ztring::ToZtring(MediaInfo_Parser_SideCar));
SubFile_IDs.push_back(ID);
}
- else if (!Reference->IsMain)
+ else if (!Sequences[Sequences_Current]->IsMain)
for (size_t Pos=0; Pos<MI->StreamIDs_Size; Pos++)
{
ZtringList ID;
if (MI->StreamIDs_Width[Pos]==0)
ID.push_back(Ztring::ToZtring(-1));
else if (Pos+1==MI->StreamIDs_Size)
- ID.push_back(Ztring::ToZtring(Reference->StreamID));
+ ID.push_back(Ztring::ToZtring(Sequences[Sequences_Current]->StreamID));
else
ID.push_back(Ztring::ToZtring(MI->StreamIDs[Pos]));
ID.push_back(Ztring::ToZtring(MI->StreamIDs_Width[Pos]));
@@ -1487,8 +1550,8 @@ MediaInfo_Internal* File__ReferenceFilesHelper::MI_Create()
MI_Temp->Option(__T("File_Demux_Hevc_Transcode_Iso14496_15_to_AnnexB"), __T("1"));
if (FrameRate)
MI_Temp->Option(__T("File_Demux_Rate"), Ztring::ToZtring(FrameRate));
- else if (!Reference->CompleteDuration.empty() && Reference->CompleteDuration[0].IgnoreFramesRate) //TODO: per Pos
- MI_Temp->Option(__T("File_Demux_Rate"), Ztring::ToZtring(Reference->CompleteDuration[0].IgnoreFramesRate));
+ else if (!Sequences[Sequences_Current]->Resources.empty() && Sequences[Sequences_Current]->Resources[0]->EditRate) //TODO: per Pos
+ MI_Temp->Option(__T("File_Demux_Rate"), Ztring::ToZtring(Sequences[Sequences_Current]->Resources[0]->EditRate));
switch (Config->Demux_InitData_Get())
{
case 0 : MI_Temp->Option(__T("File_Demux_InitData"), __T("Event")); break;
@@ -1496,11 +1559,11 @@ MediaInfo_Internal* File__ReferenceFilesHelper::MI_Create()
default: ;
}
#endif //MEDIAINFO_DEMUX
- #if MEDIAINFO_IBI
- if (!Reference->IbiStream.Infos.empty())
+ #if MEDIAINFO_IBIUSAGE
+ if (!Sequences[Sequences_Current]->IbiStream.Infos.empty())
{
ibi Ibi;
- Ibi.Streams[(int64u)-1]=new ibi::stream(Reference->IbiStream);
+ Ibi.Streams[(int64u)-1]=new ibi::stream(Sequences[Sequences_Current]->IbiStream);
//IBI Creation
File_Ibi_Creation IbiCreation(Ibi);
@@ -1508,7 +1571,7 @@ MediaInfo_Internal* File__ReferenceFilesHelper::MI_Create()
if (!IbiText.empty())
MI_Temp->Option(__T("File_Ibi"), IbiText);
}
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
return MI_Temp;
}
@@ -1517,9 +1580,9 @@ MediaInfo_Internal* File__ReferenceFilesHelper::MI_Create()
void File__ReferenceFilesHelper::Read_Buffer_Unsynched()
{
MI->Open_Buffer_Unsynch();
- for (references::iterator Reference=References.begin(); Reference!=References.end(); ++Reference)
- if (Reference->MI)
- Reference->MI->Open_Buffer_Unsynch();
+ for (size_t Sequences_Pos=0; Sequences_Pos<Sequences.size(); Sequences_Pos++)
+ if (Sequences[Sequences_Pos]->MI)
+ Sequences[Sequences_Pos]->MI->Open_Buffer_Unsynch();
#if MEDIAINFO_DEMUX
DTS_Minimal=(int64u)-1;
@@ -1529,10 +1592,10 @@ void File__ReferenceFilesHelper::Read_Buffer_Unsynched()
//---------------------------------------------------------------------------
#if MEDIAINFO_SEEK
-size_t File__ReferenceFilesHelper::Read_Buffer_Seek (size_t Method, int64u Value, int64u ID)
+size_t File__ReferenceFilesHelper::Seek (size_t Method, int64u Value, int64u ID)
{
- for (Reference=References.begin(); Reference!=References.end(); Reference++)
- if (Reference->MI==NULL && !Reference->FileNames.empty())
+ for (Sequences_Current=0; Sequences_Current<Sequences.size(); Sequences_Current++)
+ if (Sequences[Sequences_Current]->MI==NULL && !Sequences[Sequences_Current]->FileNames.empty())
ParseReference_Init();
//Parsing
@@ -1582,52 +1645,52 @@ size_t File__ReferenceFilesHelper::Read_Buffer_Seek (size_t Method, int64u Value
DurationS+=L'0'+(Char)(DurationM/( 10)); DurationM%= 10;
DurationS+=L'0'+(Char)(DurationM);
- CountOfReferencesToParse=References.size();
+ CountOfReferencesToParse=Sequences.size();
bool HasProblem=false;
- for (Reference=References.begin(); Reference!=References.end(); Reference++)
+ for (Sequences_Current=0; Sequences_Current<Sequences.size(); Sequences_Current++)
{
- if (Reference->MI)
+ if (Sequences[Sequences_Current]->MI)
{
Ztring Result;
- if (Reference->CompleteDuration.size()<=1 || DurationM<Reference->CompleteDuration[1].Demux_Offset_DTS)
+ if (Sequences[Sequences_Current]->Resources.size()<=1 || DurationM<Sequences[Sequences_Current]->Resources[1]->Demux_Offset_DTS)
{
- Reference->CompleteDuration_Pos=0;
- Result=Reference->MI->Option(__T("File_Seek"), DurationS);
+ Sequences[Sequences_Current]->Resources_Current=0;
+ Result=Sequences[Sequences_Current]->MI->Option(__T("File_Seek"), DurationS);
}
else
{
- size_t CompleteDuration_Pos_Temp=1;
- while (CompleteDuration_Pos_Temp<Reference->CompleteDuration.size() && DurationM>=Reference->CompleteDuration[CompleteDuration_Pos_Temp].Demux_Offset_DTS)
- CompleteDuration_Pos_Temp++;
- CompleteDuration_Pos_Temp--;
- Result=Reference->CompleteDuration[CompleteDuration_Pos_Temp].MI->Option(__T("File_Seek"), DurationS);
+ size_t Resources_Current_Temp=1;
+ while (Resources_Current_Temp<Sequences[Sequences_Current]->Resources.size() && DurationM>=Sequences[Sequences_Current]->Resources[Resources_Current_Temp]->Demux_Offset_DTS)
+ Resources_Current_Temp++;
+ Resources_Current_Temp--;
+ Result=Sequences[Sequences_Current]->Resources[Resources_Current_Temp]->MI->Option(__T("File_Seek"), DurationS);
if (Result.empty())
- Reference->CompleteDuration_Pos=CompleteDuration_Pos_Temp;
+ Sequences[Sequences_Current]->Resources_Current=Resources_Current_Temp;
}
if (!Result.empty())
HasProblem=true;
}
- Reference->Status.reset();
+ Sequences[Sequences_Current]->Status.reset();
}
- Reference=References.begin();
+ Sequences_Current=0;
Open_Buffer_Unsynch();
return HasProblem?(size_t)-1:1; //Not supported value if there is a problem (TODO: better info)
}
- CountOfReferencesToParse=References.size();
+ CountOfReferencesToParse=Sequences.size();
bool HasProblem=false;
- for (Reference=References.begin(); Reference!=References.end(); Reference++)
+ for (Sequences_Current=0; Sequences_Current<Sequences.size(); Sequences_Current++)
{
- if (Reference->MI)
+ if (Sequences[Sequences_Current]->MI)
{
- Reference->CompleteDuration_Pos=0;
- Ztring Result=Reference->MI->Option(__T("File_Seek"), Ztring::ToZtring(Value));
+ Sequences[Sequences_Current]->Resources_Current=0;
+ Ztring Result=Sequences[Sequences_Current]->MI->Option(__T("File_Seek"), Ztring::ToZtring(Value));
if (!Result.empty())
HasProblem=true;
}
- Reference->Status.reset();
+ Sequences[Sequences_Current]->Status.reset();
}
- Reference=References.begin();
+ Sequences_Current=0;
Open_Buffer_Unsynch();
return HasProblem?(size_t)-1:1; //Not supported value if there is a problem (TODO: better info)
}
@@ -1660,34 +1723,34 @@ size_t File__ReferenceFilesHelper::Read_Buffer_Seek (size_t Method, int64u Value
else
DurationS=Ztring::ToZtring(((float64)Value)/100)+__T('%');
- CountOfReferencesToParse=References.size();
+ CountOfReferencesToParse=Sequences.size();
bool HasProblem=false;
- for (Reference=References.begin(); Reference!=References.end(); Reference++)
+ for (Sequences_Current=0; Sequences_Current<Sequences.size(); Sequences_Current++)
{
- if (Reference->MI)
+ if (Sequences[Sequences_Current]->MI)
{
Ztring Result;
- if (Reference->CompleteDuration.empty() || Duration<Reference->CompleteDuration[1].Demux_Offset_DTS)
+ if (Sequences[Sequences_Current]->Resources.empty() || Duration<Sequences[Sequences_Current]->Resources[1]->Demux_Offset_DTS)
{
- Reference->CompleteDuration_Pos=0;
- Result=Reference->MI->Option(__T("File_Seek"), DurationS);
+ Sequences[Sequences_Current]->Resources_Current=0;
+ Result=Sequences[Sequences_Current]->MI->Option(__T("File_Seek"), DurationS);
}
else
{
- size_t CompleteDuration_Pos_Temp=1;
- while (CompleteDuration_Pos_Temp<Reference->CompleteDuration.size() && Duration>=Reference->CompleteDuration[CompleteDuration_Pos_Temp].Demux_Offset_DTS)
- CompleteDuration_Pos_Temp++;
- CompleteDuration_Pos_Temp--;
- Result=Reference->CompleteDuration[CompleteDuration_Pos_Temp].MI->Option(__T("File_Seek"), DurationS);
+ size_t Resources_Current_Temp=1;
+ while (Resources_Current_Temp<Sequences[Sequences_Current]->Resources.size() && Duration>=Sequences[Sequences_Current]->Resources[Resources_Current_Temp]->Demux_Offset_DTS)
+ Resources_Current_Temp++;
+ Resources_Current_Temp--;
+ Result=Sequences[Sequences_Current]->Resources[Resources_Current_Temp]->MI->Option(__T("File_Seek"), DurationS);
if (Result.empty())
- Reference->CompleteDuration_Pos=CompleteDuration_Pos_Temp;
+ Sequences[Sequences_Current]->Resources_Current=Resources_Current_Temp;
}
if (!Result.empty())
HasProblem=true;
}
- Reference->Status.reset();
+ Sequences[Sequences_Current]->Status.reset();
}
- Reference=References.begin();
+ Sequences_Current=0;
Open_Buffer_Unsynch();
return HasProblem?2:1; //Invalid value if there is a problem (TODO: better info)
}
@@ -1697,40 +1760,40 @@ size_t File__ReferenceFilesHelper::Read_Buffer_Seek (size_t Method, int64u Value
case 2 : //Timestamp
#if MEDIAINFO_DEMUX && MEDIAINFO_NEXTPACKET
{
- CountOfReferencesToParse=References.size();
+ CountOfReferencesToParse=Sequences.size();
Ztring Time; Time.Duration_From_Milliseconds(Value/1000000);
- for (Reference=References.begin(); Reference!=References.end(); Reference++)
+ for (Sequences_Current=0; Sequences_Current<Sequences.size(); Sequences_Current++)
{
- if (Reference->MI)
+ if (Sequences[Sequences_Current]->MI)
{
Ztring Result;
- if (Reference->CompleteDuration.size()<2 || Value<Reference->CompleteDuration[1].Demux_Offset_DTS)
+ if (Sequences[Sequences_Current]->Resources.size()<2 || Value<Sequences[Sequences_Current]->Resources[1]->Demux_Offset_DTS)
{
- Reference->CompleteDuration_Pos=0;
- Result=Reference->MI->Option(__T("File_Seek"), Time);
+ Sequences[Sequences_Current]->Resources_Current=0;
+ Result=Sequences[Sequences_Current]->MI->Option(__T("File_Seek"), Time);
}
else
{
- size_t CompleteDuration_Pos_Temp=1;
- while (CompleteDuration_Pos_Temp<Reference->CompleteDuration.size() && Value>=Reference->CompleteDuration[CompleteDuration_Pos_Temp].Demux_Offset_DTS)
- CompleteDuration_Pos_Temp++;
- CompleteDuration_Pos_Temp--;
- Result=Reference->CompleteDuration[CompleteDuration_Pos_Temp].MI->Option(__T("File_Seek"), Time);
+ size_t Resources_Current_Temp=1;
+ while (Resources_Current_Temp<Sequences[Sequences_Current]->Resources.size() && Value>=Sequences[Sequences_Current]->Resources[Resources_Current_Temp]->Demux_Offset_DTS)
+ Resources_Current_Temp++;
+ Resources_Current_Temp--;
+ Result=Sequences[Sequences_Current]->Resources[Resources_Current_Temp]->MI->Option(__T("File_Seek"), Time);
if (Result.empty())
- Reference->CompleteDuration_Pos=CompleteDuration_Pos_Temp;
+ Sequences[Sequences_Current]->Resources_Current=Resources_Current_Temp;
}
if (!Result.empty())
return 2; //Invalid value
}
else
{
- //There was a problem, removing Reference
- References.clear();
- return Read_Buffer_Seek(Method, Value, ID);
+ //There was a problem, removing Sequence
+ Sequences.clear();
+ return Seek(Method, Value, ID);
}
- Reference->Status.reset();
+ Sequences[Sequences_Current]->Status.reset();
}
- Reference=References.begin();
+ Sequences_Current=0;
Open_Buffer_Unsynch();
return 1;
}
@@ -1739,33 +1802,33 @@ size_t File__ReferenceFilesHelper::Read_Buffer_Seek (size_t Method, int64u Value
#endif //MEDIAINFO_DEMUX && MEDIAINFO_NEXTPACKET
case 3 : //FrameNumber
#if MEDIAINFO_DEMUX && MEDIAINFO_NEXTPACKET
- CountOfReferencesToParse=References.size();
- for (Reference=References.begin(); Reference!=References.end(); Reference++)
+ CountOfReferencesToParse=Sequences.size();
+ for (Sequences_Current=0; Sequences_Current<Sequences.size(); Sequences_Current++)
{
- if (Reference->MI)
+ if (Sequences[Sequences_Current]->MI)
{
Ztring Result;
- if (Reference->CompleteDuration.size()<2 || Value<Reference->CompleteDuration[1].Demux_Offset_Frame)
+ if (Sequences[Sequences_Current]->Resources.size()<2 || Value<Sequences[Sequences_Current]->Resources[1]->Demux_Offset_Frame)
{
- Reference->CompleteDuration_Pos=0;
- Result=Reference->MI->Option(__T("File_Seek"), __T("Frame=")+Ztring::ToZtring(Value));
+ Sequences[Sequences_Current]->Resources_Current=0;
+ Result=Sequences[Sequences_Current]->MI->Option(__T("File_Seek"), __T("Frame=")+Ztring::ToZtring(Value));
}
else
{
- size_t CompleteDuration_Pos_Temp=1;
- while (CompleteDuration_Pos_Temp<Reference->CompleteDuration.size() && Value>=Reference->CompleteDuration[CompleteDuration_Pos_Temp].Demux_Offset_Frame)
- CompleteDuration_Pos_Temp++;
- CompleteDuration_Pos_Temp--;
- Result=Reference->CompleteDuration[CompleteDuration_Pos_Temp].MI->Option(__T("File_Seek"), __T("Frame=")+Ztring::ToZtring(Value-Reference->CompleteDuration[CompleteDuration_Pos_Temp].Demux_Offset_Frame));
+ size_t Resources_Current_Temp=1;
+ while (Resources_Current_Temp<Sequences[Sequences_Current]->Resources.size() && Value>=Sequences[Sequences_Current]->Resources[Resources_Current_Temp]->Demux_Offset_Frame)
+ Resources_Current_Temp++;
+ Resources_Current_Temp--;
+ Result=Sequences[Sequences_Current]->Resources[Resources_Current_Temp]->MI->Option(__T("File_Seek"), __T("Frame=")+Ztring::ToZtring(Value-Sequences[Sequences_Current]->Resources[Resources_Current_Temp]->Demux_Offset_Frame));
if (Result.empty())
- Reference->CompleteDuration_Pos=CompleteDuration_Pos_Temp;
+ Sequences[Sequences_Current]->Resources_Current=Resources_Current_Temp;
}
if (!Result.empty())
return 2; //Invalid value
}
- Reference->Status.reset();
+ Sequences[Sequences_Current]->Status.reset();
}
- Reference=References.begin();
+ Sequences_Current=0;
Open_Buffer_Unsynch();
return 1;
#else //MEDIAINFO_DEMUX && MEDIAINFO_NEXTPACKET
@@ -1785,10 +1848,10 @@ size_t File__ReferenceFilesHelper::Stream_Prepare (stream_t StreamKind, size_t S
{
size_t StreamPos_Last=MI->Stream_Prepare(StreamKind, StreamPos);
- for (references::iterator ReferencePos=References.begin(); ReferencePos!=References.end(); ++ReferencePos)
- if (ReferencePos->StreamKind==StreamKind && ReferencePos->StreamPos>=StreamPos_Last)
- if (ReferencePos->StreamPos!=(size_t)-1)
- ReferencePos->StreamPos++;
+ for (sequences::iterator ReferencePos=Sequences.begin(); ReferencePos!=Sequences.end(); ++ReferencePos)
+ if ((*ReferencePos)->StreamKind==StreamKind && (*ReferencePos)->StreamPos>=StreamPos_Last)
+ if ((*ReferencePos)->StreamPos!=(size_t)-1)
+ (*ReferencePos)->StreamPos++;
return StreamPos_Last;
}
@@ -1801,20 +1864,21 @@ void File__ReferenceFilesHelper::FileSize_Compute ()
MI->Config->File_Size=MI->File_Size;
- for (references::iterator Reference=References.begin(); Reference!=References.end(); ++Reference)
+ for (size_t Sequences_Pos=0; Sequences_Pos<Sequences.size(); Sequences_Pos++)
{
- if (Reference->FileSize!=(int64u)-1)
- MI->Config->File_Size+=Reference->FileSize;
- else if (Reference->MI && Reference->MI->Config.File_Size!=(int64u)-1)
+ if (Sequences[Sequences_Pos]->FileSize!=(int64u)-1)
+ MI->Config->File_Size+=Sequences[Sequences_Pos]->FileSize;
+ else if (Sequences[Sequences_Pos]->MI && Sequences[Sequences_Pos]->MI->Config.File_Size!=(int64u)-1)
{
- MI->Config->File_Size+=Reference->MI->Config.File_Size;
+ MI->Config->File_Size+=Sequences[Sequences_Pos]->MI->Config.File_Size;
#if MEDIAINFO_ADVANCED
if (!Config->File_IgnoreSequenceFileSize_Get())
#endif //MEDIAINFO_ADVANCED
{
- if (!Reference->CompleteDuration.empty())
- for (size_t Pos=1; Pos<Reference->CompleteDuration.size(); Pos++)
- MI->Config->File_Size+=File::Size_Get(Reference->CompleteDuration[Pos].FileName);
+ if (!Sequences[Sequences_Pos]->Resources.empty())
+ for (size_t Pos=1; Pos<Sequences[Sequences_Pos]->Resources.size(); Pos++)
+ for (size_t Resource_FileNames_Pos=0; Resource_FileNames_Pos<Sequences[Sequences_Pos]->Resources[Pos]->FileNames.size(); Resource_FileNames_Pos++)
+ MI->Config->File_Size+=File::Size_Get(Sequences[Sequences_Pos]->Resources[Pos]->FileNames[Resource_FileNames_Pos]);
}
}
else
@@ -1823,12 +1887,13 @@ void File__ReferenceFilesHelper::FileSize_Compute ()
if (!Config->File_IgnoreSequenceFileSize_Get())
#endif //MEDIAINFO_ADVANCED
{
- if (Reference->CompleteDuration.empty())
- for (size_t Pos=0; Pos<Reference->FileNames.size(); Pos++)
- MI->Config->File_Size+=File::Size_Get(Reference->FileNames[Pos]);
+ if (Sequences[Sequences_Pos]->Resources.empty())
+ for (size_t Pos=0; Pos<Sequences[Sequences_Pos]->FileNames.size(); Pos++)
+ MI->Config->File_Size+=File::Size_Get(Sequences[Sequences_Pos]->FileNames[Pos]);
else
- for (size_t Pos=0; Pos<Reference->CompleteDuration.size(); Pos++)
- MI->Config->File_Size+=File::Size_Get(Reference->CompleteDuration[Pos].FileName);
+ for (size_t Pos=0; Pos<Sequences[Sequences_Pos]->Resources.size(); Pos++)
+ for (size_t Resource_FileNames_Pos=0; Resource_FileNames_Pos<Sequences[Sequences_Pos]->Resources[Pos]->FileNames.size(); Resource_FileNames_Pos++)
+ MI->Config->File_Size+=File::Size_Get(Sequences[Sequences_Pos]->Resources[Pos]->FileNames[Resource_FileNames_Pos]);
}
}
}
@@ -1840,18 +1905,18 @@ void File__ReferenceFilesHelper::CountOfReferences_ForReadSize_Run ()
//Computing read buffer size
int64u File_Size_Total=0;
int64u Buffer_Read_Size_Total=MI->Config->File_Buffer_Read_Size_Get();
- for (references::iterator Reference_Temp=References.begin(); Reference_Temp!=References.end(); ++Reference_Temp)
- if (Reference_Temp->MI && Reference_Temp->MI->Config.File_Size!=(int64u)-1)
- File_Size_Total+=Reference_Temp->MI->Config.File_Size;
+ for (sequences::iterator Reference_Temp=Sequences.begin(); Reference_Temp!=Sequences.end(); ++Reference_Temp)
+ if ((*Reference_Temp)->MI && (*Reference_Temp)->MI->Config.File_Size!=(int64u)-1)
+ File_Size_Total+=(*Reference_Temp)->MI->Config.File_Size;
if (File_Size_Total)
- for (references::iterator Reference_Temp=References.begin(); Reference_Temp!=References.end(); ++Reference_Temp)
- if (Reference_Temp->MI)
+ for (sequences::iterator Reference_Temp=Sequences.begin(); Reference_Temp!=Sequences.end(); ++Reference_Temp)
+ if ((*Reference_Temp)->MI)
{
- int64u Buffer_Read_Size_Temp=float64_int64s(((float64)Reference_Temp->MI->Config.File_Size)/File_Size_Total*Buffer_Read_Size_Total);
+ int64u Buffer_Read_Size_Temp=float64_int64s(((float64)(*Reference_Temp)->MI->Config.File_Size)/File_Size_Total*Buffer_Read_Size_Total);
int64u Buffer_Read_Size=1;
while (Buffer_Read_Size<Buffer_Read_Size_Temp)
Buffer_Read_Size<<=1;
- Reference_Temp->MI->Config.File_Buffer_Read_Size_Set((size_t)Buffer_Read_Size);
+ (*Reference_Temp)->MI->Config.File_Buffer_Read_Size_Set((size_t)Buffer_Read_Size);
}
}
@@ -1859,18 +1924,18 @@ void File__ReferenceFilesHelper::CountOfReferences_ForReadSize_Run ()
#if MEDIAINFO_EVENTS
void File__ReferenceFilesHelper::SubFile_Start()
{
- if (Reference->StreamID!=StreamID_Previous)
+ if (Sequences[Sequences_Current]->StreamID!=StreamID_Previous)
{
Ztring FileName_Absolute, FileName_Relative;
- if (Reference->MI && Reference->MI->Config.File_Names_Pos && Reference->MI->Config.File_Names_Pos<Reference->MI->Config.File_Names.size())
- FileName_Absolute=Reference->MI->Config.File_Names[Reference->MI->Config.File_Names_Pos-1];
- else if (!Reference->FileNames.empty())
- FileName_Absolute=Reference->FileNames[0];
+ if (Sequences[Sequences_Current]->MI && Sequences[Sequences_Current]->MI->Config.File_Names_Pos && Sequences[Sequences_Current]->MI->Config.File_Names_Pos<Sequences[Sequences_Current]->MI->Config.File_Names.size())
+ FileName_Absolute=Sequences[Sequences_Current]->MI->Config.File_Names[Sequences[Sequences_Current]->MI->Config.File_Names_Pos-1];
+ else if (!Sequences[Sequences_Current]->FileNames.empty())
+ FileName_Absolute=Sequences[Sequences_Current]->FileNames[0];
else
- FileName_Absolute=Reference->Source.c_str();
+ FileName_Absolute=Sequences[Sequences_Current]->Source.c_str();
- Reference->MI->Config.Event_SubFile_Start(FileName_Absolute);
- StreamID_Previous=Reference->StreamID;
+ Sequences[Sequences_Current]->MI->Config.Event_SubFile_Start(FileName_Absolute);
+ StreamID_Previous=Sequences[Sequences_Current]->StreamID;
}
}
#endif //MEDIAINFO_EVENTS
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper.h b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper.h
index e7e771af7..ce11f95bb 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper.h
@@ -12,6 +12,8 @@
//---------------------------------------------------------------------------
#include "MediaInfo/File__Analyze.h"
#include "MediaInfo/MediaInfo_Internal.h"
+#include "MediaInfo/Multiple/File__ReferenceFilesHelper_Sequence.h"
+#include "MediaInfo/Multiple/File__ReferenceFilesHelper_Common.h"
#include <vector>
//---------------------------------------------------------------------------
@@ -25,113 +27,41 @@ namespace MediaInfoLib
class File__ReferenceFilesHelper
{
public :
+ //Constructor / Destructor
+ File__ReferenceFilesHelper(File__Analyze* MI, MediaInfo_Config_MediaInfo* Config);
+ ~File__ReferenceFilesHelper();
+
//In
- struct reference
- {
- ZtringList FileNames;
- Ztring Source; //Source file name (relative path)
- stream_t StreamKind;
- size_t StreamPos;
- size_t MenuPos;
- int64u StreamID;
- float64 FrameRate;
- int64u Delay;
- int64u FileSize;
- bool IsCircular;
- bool IsMain;
- bool FileSize_IsPresent; //TODO: merge with FileSize after regression tests
- #if MEDIAINFO_ADVANCED || MEDIAINFO_MD5
- bool List_Compute_Done;
- #endif //MEDIAINFO_ADVANCED || MEDIAINFO_MD5
- size_t State;
- std::map<std::string, Ztring> Infos;
- MediaInfo_Internal* MI;
- struct completeduration
- {
- Ztring FileName;
- MediaInfo_Internal* MI;
- int64u IgnoreFramesBefore;
- int64u IgnoreFramesAfterDuration; //temporary value, some formats have duration instead of frame position
- int64u IgnoreFramesAfter;
- float64 IgnoreFramesRate;
- #if MEDIAINFO_DEMUX
- int64u Demux_Offset_Frame;
- int64u Demux_Offset_DTS;
- int64u Demux_Offset_FileSize;
- #endif //MEDIAINFO_DEMUX
-
- completeduration()
- {
- MI=NULL;
- IgnoreFramesBefore=0;
- IgnoreFramesAfterDuration=(int64u)-1;
- IgnoreFramesAfter=(int64u)-1;
- IgnoreFramesRate=0;
- #if MEDIAINFO_DEMUX
- Demux_Offset_Frame=0;
- Demux_Offset_DTS=0;
- Demux_Offset_FileSize=0;
- #endif //MEDIAINFO_DEMUX
- }
-
- ~completeduration()
- {
- delete MI;
- }
- };
- vector<completeduration> CompleteDuration;
- size_t CompleteDuration_Pos;
- #if MEDIAINFO_FILTER
- int64u Enabled;
- #endif //MEDIAINFO_FILTER
- std::bitset<32> Status;
- #if MEDIAINFO_NEXTPACKET && MEDIAINFO_IBI
- ibi::stream IbiStream;
- #endif //MEDIAINFO_NEXTPACKET && MEDIAINFO_IBI
-
- reference()
- {
- FileNames.Separator_Set(0, __T(","));
- StreamKind=Stream_Max;
- StreamPos=(size_t)-1;
- MenuPos=(size_t)-1;
- StreamID=(int64u)-1;
- FrameRate=0;
- Delay=0;
- FileSize=(int64u)-1;
- IsCircular=false;
- IsMain=false;
- FileSize_IsPresent=false;
- #if MEDIAINFO_ADVANCED || MEDIAINFO_MD5
- List_Compute_Done=false;
- #endif //MEDIAINFO_ADVANCED || MEDIAINFO_MD5
- State=0;
- MI=NULL;
- CompleteDuration_Pos=0;
- #if MEDIAINFO_FILTER
- Enabled=true;
- #endif //MEDIAINFO_FILTER
- }
- };
- typedef std::vector<reference> references;
- references References;
+ void AddSequence(sequence* NewSequence);
+ void UpdateFileName(const Ztring& OldFileName, const Ztring& NewFileName);
bool TestContinuousFileNames;
- bool FilesForStorage;
bool ContainerHasNoId;
- bool HasMainFile;
- bool HasMainFile_Filled;
int64u ID_Max;
//Streams management
- bool ParseReference_Init();
void ParseReferences();
- //Constructor / Destructor
- File__ReferenceFilesHelper(File__Analyze* MI, MediaInfo_Config_MediaInfo* Config);
- ~File__ReferenceFilesHelper();
+private :
+ sequences Sequences;
+ size_t Sequences_Current;
+
+ //Temp
+ rfh_common* Common;
+
+
+
+public:
+ size_t Sequences_Size() {return Sequences.size();}
+ void Clear() {Sequences.clear();}
+ bool FilesForStorage;
+ bool HasMainFile;
+ bool HasMainFile_Filled;
+
+ //Streams management
+ bool ParseReference_Init();
#if MEDIAINFO_SEEK
- size_t Read_Buffer_Seek (size_t Method, int64u Value, int64u ID);
+ size_t Seek (size_t Method, int64u Value, int64u ID);
#endif //MEDIAINFO_SEEK
private :
@@ -147,7 +77,6 @@ private :
//temp
File__Analyze* MI;
MediaInfo_Config_MediaInfo* Config;
- references::iterator Reference;
bool Init_Done;
bool Demux_Interleave;
size_t CountOfReferencesToParse;
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Common.h b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Common.h
new file mode 100644
index 000000000..d798faaa4
--- /dev/null
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Common.h
@@ -0,0 +1,74 @@
+/* Copyright (c) MediaArea.net SARL. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can
+ * be found in the License.html file in the root of the source tree.
+ */
+
+//---------------------------------------------------------------------------
+#ifndef File__ReferenceFilesHelper_CommonH
+#define File__ReferenceFilesHelper_CommonH
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------
+
+namespace MediaInfoLib
+{
+
+class File__ReferenceFilesHelper;
+class File__Analyze;
+class MediaInfo_Config_MediaInfo;
+
+//***************************************************************************
+// Class resource
+//***************************************************************************
+
+class rfh_common
+{
+public:
+ #if MEDIAINFO_DEMUX
+ rfh_common(bool* Demux_Interleave_p, int64u* DTS_Minimal):
+ #else //MEDIAINFO_DEMUX
+ rfh_common():
+ #endif //MEDIAINFO_DEMUX
+ MI(NULL),
+ Config(NULL),
+ FileSize((int64u)-1),
+ HasMultipleSequences(false),
+ HasMainFile(false),
+ HasMainFile_Filled(false),
+ ContainerHasNoId(false)
+ #if MEDIAINFO_DEMUX
+ ,
+ Demux_Interleave(Demux_Interleave_p),
+ DTS_Minimal(DTS_Minimal)
+ #endif //MEDIAINFO_DEMUX
+ {
+ }
+
+ //Data
+ File__ReferenceFilesHelper* ReferenceFilesHelper;
+ File__Analyze* MI;
+ MediaInfo_Config_MediaInfo* Config;
+ int64u FileSize;
+ bool HasMultipleSequences;
+ bool HasMainFile;
+ bool HasMainFile_Filled;
+ bool ContainerHasNoId;
+ #if MEDIAINFO_DEMUX
+ const bool Demux_Interleave_Get() {return *Demux_Interleave;}
+ void Demux_Interleave_Set(bool Demux_Interleave_n) {*Demux_Interleave=Demux_Interleave_n;}
+ const int64u DTS_Minimal_Get() {return *DTS_Minimal;}
+ void DTS_Minimal_Set(size_t DTS_Minimal_n) {*DTS_Minimal=DTS_Minimal_n;}
+ #endif //MEDIAINFO_DEMUX
+
+private:
+ #if MEDIAINFO_DEMUX
+ bool* Demux_Interleave;
+ int64u* DTS_Minimal;
+ #endif //MEDIAINFO_DEMUX
+};
+
+} //NameSpace
+
+#endif
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Resource.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Resource.cpp
new file mode 100644
index 000000000..a49fa828a
--- /dev/null
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Resource.cpp
@@ -0,0 +1,93 @@
+/* Copyright (c) MediaArea.net SARL. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can
+ * be found in the License.html file in the root of the source tree.
+ */
+
+//---------------------------------------------------------------------------
+// Pre-compilation
+#include "MediaInfo/PreComp.h"
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+#include "MediaInfo/Setup.h"
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+#if defined(MEDIAINFO_REFERENCES_YES)
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+#include "MediaInfo/Multiple/File__ReferenceFilesHelper.h"
+#include "MediaInfo/Multiple/File__ReferenceFilesHelper_Sequence_Common.h"
+#include "MediaInfo/Multiple/File__ReferenceFilesHelper_Common.h"
+#include "ZenLib/FileName.h"
+#include "ZenLib/Format/Http/Http_Utils.h"
+#if MEDIAINFO_AES
+ #include "base64.h"
+#endif //MEDIAINFO_AES
+#if MEDIAINFO_EVENTS
+ #include "MediaInfo/MediaInfo_Events_Internal.h"
+ #include "MediaInfo/MediaInfo_Config_PerPackage.h"
+#endif //MEDIAINFO_EVENTS
+using namespace std;
+using namespace ZenLib;
+//---------------------------------------------------------------------------
+
+namespace MediaInfoLib
+{
+
+//***************************************************************************
+// Constructor/Destructor
+//***************************************************************************
+
+resource::resource()
+{
+ //In
+ FileNames.Separator_Set(0, __T(","));
+ EditRate=0;
+ IgnoreEditsBefore=0;
+ IgnoreEditsAfter=(int64u)-1;
+
+ //Config
+ Sequence=NULL;
+ #if MEDIAINFO_NEXTPACKET
+ Demux_Offset_Frame=(int64u)-1;
+ Demux_Offset_DTS=(int64u)-1;
+ #endif //MEDIAINFO_NEXTPACKET
+
+ //Private
+ MI=NULL;
+
+
+
+ IgnoreEditsAfterDuration=(int64u)-1;
+ #if MEDIAINFO_DEMUX
+ Demux_Offset_FileSize=0;
+ #endif //MEDIAINFO_DEMUX
+}
+
+resource::~resource()
+{
+ delete MI;
+}
+
+//***************************************************************************
+// In
+//***************************************************************************
+
+//---------------------------------------------------------------------------
+void resource::UpdateFileName(const Ztring& OldFileName, const Ztring& NewFileName)
+{
+ size_t FileNames_Size=FileNames.size();
+ for (size_t Pos=0; Pos<FileNames_Size; Pos++)
+ if (FileNames[Pos]==OldFileName)
+ FileNames[Pos]=NewFileName;
+}
+
+} //NameSpace
+
+#endif //MEDIAINFO_REFERENCES_YES
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Resource.h b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Resource.h
new file mode 100644
index 000000000..c7674a928
--- /dev/null
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Resource.h
@@ -0,0 +1,61 @@
+/* Copyright (c) MediaArea.net SARL. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can
+ * be found in the License.html file in the root of the source tree.
+ */
+
+//---------------------------------------------------------------------------
+#ifndef File__ReferenceFilesHelper_ResourceH
+#define File__ReferenceFilesHelper_ResourceH
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+#include "MediaInfo/File__Analyze.h"
+#include "MediaInfo/MediaInfo_Internal.h"
+#include <vector>
+#if MEDIAINFO_EVENTS
+ #include <set>
+#endif //MEDIAINFO_EVENTS
+//---------------------------------------------------------------------------
+
+namespace MediaInfoLib
+{
+
+class rfhs_common;
+
+class resource
+{
+public:
+ //Constructor/Desctructor
+ resource();
+ ~resource();
+
+ //In
+ void UpdateFileName(const Ztring& OldFileName, const Ztring& NewFileName);
+ ZtringList FileNames; //Source file name (relative path)
+ float64 EditRate;
+ int64u IgnoreEditsBefore;
+ int64u IgnoreEditsAfter;
+
+ //Config
+ rfhs_common* Sequence;
+ #if MEDIAINFO_NEXTPACKET
+ int64u Demux_Offset_Frame;
+ int64u Demux_Offset_DTS;
+ #endif //MEDIAINFO_NEXTPACKET
+
+ MediaInfo_Internal* MI;
+
+
+
+ int64u IgnoreEditsAfterDuration; //temporary value, some formats have duration instead of frame position
+ #if MEDIAINFO_DEMUX
+ int64u Demux_Offset_FileSize;
+ #endif //MEDIAINFO_DEMUX
+};
+
+typedef std::vector<resource*> resources;
+
+} //NameSpace
+
+#endif
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Sequence.cpp b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Sequence.cpp
new file mode 100644
index 000000000..cd4bf45b3
--- /dev/null
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Sequence.cpp
@@ -0,0 +1,130 @@
+/* Copyright (c) MediaArea.net SARL. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can
+ * be found in the License.html file in the root of the source tree.
+ */
+
+//---------------------------------------------------------------------------
+// Pre-compilation
+#include "MediaInfo/PreComp.h"
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+#include "MediaInfo/Setup.h"
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+#if defined(MEDIAINFO_REFERENCES_YES)
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+#include "MediaInfo/Multiple/File__ReferenceFilesHelper_Sequence.h"
+#include "MediaInfo/Multiple/File__ReferenceFilesHelper_Common.h"
+//---------------------------------------------------------------------------
+
+namespace MediaInfoLib
+{
+
+//---------------------------------------------------------------------------
+sequence::sequence()
+{
+ //In
+ StreamKind=Stream_Max;
+ StreamPos=(size_t)-1;
+ StreamID=(int64u)-1;
+ MenuPos=(size_t)-1;
+ Enabled=true;
+ IsMain=false;
+ //MenuPos=(size_t)-1;
+
+ //Out
+ State=0;
+ IsCircular=false;
+ #if MEDIAINFO_ADVANCED || MEDIAINFO_MD5
+ List_Compute_Done=false;
+ #endif //MEDIAINFO_ADVANCED || MEDIAINFO_MD5
+
+ //Config
+ Package=NULL;
+
+ //Private
+ Resources_Current=0;
+ Common=new rfhs_common(&StreamKind, &StreamPos, &StreamID, NULL, &Enabled, &IsMain);
+
+
+
+
+ FileNames.Separator_Set(0, __T(","));
+ FrameRate=0;
+ Delay=0;
+ FileSize=(int64u)-1;
+ IsMain=false;
+ FileSize_IsPresent=false;
+ #if MEDIAINFO_ADVANCED || MEDIAINFO_MD5
+ List_Compute_Done=false;
+ #endif //MEDIAINFO_ADVANCED || MEDIAINFO_MD5
+ MI=NULL;
+}
+
+//---------------------------------------------------------------------------
+sequence::~sequence()
+{
+ delete MI;
+}
+
+//***************************************************************************
+// In
+//***************************************************************************
+
+//---------------------------------------------------------------------------
+void sequence::AddFileName(const Ztring& FileName, size_t Pos)
+{
+ FileNames.push_back(FileName);
+}
+
+//---------------------------------------------------------------------------
+void sequence::AddResource(resource* NewResource, size_t Pos)
+{
+ NewResource->Sequence=Common;
+
+ #if MEDIAINFO_DEMUX
+ if (Resources.empty())
+ {
+ NewResource->Demux_Offset_DTS=0;
+ }
+ #endif //MEDIAINFO_DEMUX
+
+ if (Pos>=Resources.size())
+ Resources.push_back(NewResource);
+ else
+ Resources.insert(Resources.begin()+Pos, NewResource);
+}
+
+//---------------------------------------------------------------------------
+void sequence::UpdateFileName(const Ztring& OldFileName, const Ztring& NewFileName)
+{
+ size_t Resources_Size=Resources.size();
+ for (size_t Resources_Pos=0; Resources_Pos<Resources_Size; ++Resources_Pos)
+ {
+ resource* Resource=Resources[Resources_Pos];
+
+ Resource->UpdateFileName(OldFileName, NewFileName);
+
+ for (size_t Pos=0; Pos<Resource->FileNames.size(); Pos++)
+ if (Resource->FileNames[Pos]==NewFileName)
+ Infos["UniqueID"]=OldFileName;
+ }
+}
+
+//---------------------------------------------------------------------------
+void sequence::FrameRate_Set(float64 NewFrameRate)
+{
+ FrameRate=NewFrameRate;
+}
+
+} //NameSpace
+
+#endif //MEDIAINFO_REFERENCES_YES
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Sequence.h b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Sequence.h
new file mode 100644
index 000000000..d6a4e4bbb
--- /dev/null
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Sequence.h
@@ -0,0 +1,86 @@
+/* Copyright (c) MediaArea.net SARL. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can
+ * be found in the License.html file in the root of the source tree.
+ */
+
+//---------------------------------------------------------------------------
+#ifndef File__ReferenceFilesHelper_SequenceH
+#define File__ReferenceFilesHelper_SequenceH
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+#include "MediaInfo/Multiple/File__ReferenceFilesHelper_Resource.h"
+#include "MediaInfo/Multiple/File__ReferenceFilesHelper_Sequence_Common.h"
+//---------------------------------------------------------------------------
+
+namespace MediaInfoLib
+{
+
+class resource;
+typedef std::vector<resource*> resources;
+
+class rfhs_common;
+
+//***************************************************************************
+// Class sequence
+//***************************************************************************
+
+class sequence
+{
+public:
+ //Constructor/Desctructor
+ sequence();
+ ~sequence();
+
+ //In
+ void AddFileName(const Ztring& FileName, size_t Pos=(size_t)-1);
+ void AddResource(resource* NewResource, size_t Pos=(size_t)-1);
+ void UpdateFileName(const Ztring& OldFileName, const Ztring& NewFileName);
+ stream_t StreamKind;
+ size_t StreamPos;
+ int64u StreamID;
+ size_t MenuPos;
+ bool Enabled;
+ bool IsMain;
+ std::map<std::string, Ztring> Infos;
+ void FrameRate_Set(float64 NewFrameRate);
+
+ //Out
+ bool IsFinished() {return !Enabled || Resources_Current>=Resources.size();}
+ size_t State;
+ bool IsCircular;
+ #if MEDIAINFO_ADVANCED || MEDIAINFO_MD5
+ bool List_Compute_Done;
+ #endif //MEDIAINFO_ADVANCED || MEDIAINFO_MD5
+
+ //Config
+ rfh_common* Package;
+ #if MEDIAINFO_NEXTPACKET && MEDIAINFO_IBIUSAGE
+ ibi::stream IbiStream;
+ #endif //MEDIAINFO_NEXTPACKET && MEDIAINFO_IBIUSAGE
+
+ resources Resources;
+ size_t Resources_Current;
+
+public:
+ rfhs_common* Common;
+
+
+
+public:
+ ZtringList FileNames;
+ Ztring Source; //Source file name (relative path)
+ float64 FrameRate;
+ int64u Delay;
+ int64u FileSize;
+ bool FileSize_IsPresent; //TODO: merge with FileSize after regression tests
+ MediaInfo_Internal* MI;
+ std::bitset<32> Status;
+};
+
+typedef std::vector<sequence*> sequences;
+
+} //NameSpace
+
+#endif
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Sequence_Common.h b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Sequence_Common.h
new file mode 100644
index 000000000..1fe322be5
--- /dev/null
+++ b/src/thirdparty/MediaInfo/MediaInfo/Multiple/File__ReferenceFilesHelper_Sequence_Common.h
@@ -0,0 +1,71 @@
+/* Copyright (c) MediaArea.net SARL. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license that can
+ * be found in the License.html file in the root of the source tree.
+ */
+
+//---------------------------------------------------------------------------
+#ifndef File__ReferenceFilesHelper_Sequence_CommonH
+#define File__ReferenceFilesHelper_Sequence_CommonH
+//---------------------------------------------------------------------------
+
+//---------------------------------------------------------------------------
+#include "MediaInfo/MediaInfo_Const.h"
+//---------------------------------------------------------------------------
+
+namespace MediaInfoLib
+{
+
+class rfh_common;
+
+//***************************************************************************
+// Class resource
+//***************************************************************************
+
+class rfhs_common
+{
+public:
+ rfhs_common(stream_t* StreamKind_p, size_t* StreamPos_p, int64u* StreamID_p, int64u* DTS_p, bool* Enabled_p, bool* IsMain_p):
+ Package(NULL),
+ FileSize((int64u)-1),
+ Edits((int64u)-1),
+ DemuxRate(0),
+ HasMultipleResources(false),
+ StreamKind(StreamKind_p),
+ StreamPos(StreamPos_p),
+ StreamID(StreamID_p),
+ DTS(DTS_p),
+ Enabled(Enabled_p),
+ IsMain(IsMain_p)
+ {
+ }
+
+ //Data
+ rfh_common* Package;
+ int64u FileSize;
+ int64u Edits;
+ float64 DemuxRate;
+ bool HasMultipleResources;
+ const stream_t StreamKind_Get() {return *StreamKind;}
+ void StreamKind_Set(stream_t StreamKind_n) {*StreamKind=StreamKind_n;}
+ const size_t StreamPos_Get() {return *StreamPos;}
+ void StreamPos_Set(size_t StreamPos_n) {*StreamPos=StreamPos_n;}
+ const int64u StreamID_Get() {return *StreamID;}
+ void StreamID_Set(int64u StreamID_n) {*StreamID=StreamID_n;}
+ const int64u DTS_Get() {return *DTS;}
+ void DTS_Set(int64u DTS_n) {*DTS=DTS_n;}
+ const bool Enabled_Get() {return *Enabled;}
+ const bool IsMain_Get() {return *IsMain;}
+
+private:
+ stream_t* StreamKind;
+ size_t* StreamPos;
+ int64u* StreamID;
+ int64u* DTS;
+ bool* Enabled;
+ bool* IsMain;
+};
+
+} //NameSpace
+
+#endif
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Reader/Reader_File.cpp b/src/thirdparty/MediaInfo/MediaInfo/Reader/Reader_File.cpp
index a17a9dc8b..efec90876 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Reader/Reader_File.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Reader/Reader_File.cpp
@@ -425,15 +425,21 @@ size_t Reader_File::Format_Test_PerParser_Continue (MediaInfo_Internal* MI)
else
#endif //MEDIAINFO_SEEK
{
- for (Pos=0; Pos<MI->Config.File_Sizes.size(); Pos++)
+ for (Pos=0; Pos<MI->Config.File_Names.size(); Pos++)
{
- if (GoTo>=MI->Config.File_Sizes[Pos])
- {
- GoTo-=MI->Config.File_Sizes[Pos];
- MI->Config.File_Current_Offset+=MI->Config.File_Sizes[Pos];
- }
- else
+ if (Pos==MI->Config.File_Sizes.size())
+ MI->Config.File_Sizes.push_back(F.Size_Get());
+ else if (MI->Config.File_Sizes[Pos]==(int64u)-1)
+ MI->Config.File_Sizes[Pos]=F.Size_Get();
+
+ if (Pos>=MI->Config.File_Sizes.size() || MI->Config.File_Sizes[Pos]==(int64u)-1)
+ break;
+
+ if (GoTo<MI->Config.File_Sizes[Pos])
break;
+
+ GoTo-=MI->Config.File_Sizes[Pos];
+ MI->Config.File_Current_Offset+=MI->Config.File_Sizes[Pos];
}
if (Pos>=MI->Config.File_Sizes.size())
break;
@@ -525,9 +531,17 @@ size_t Reader_File::Format_Test_PerParser_Continue (MediaInfo_Internal* MI)
MI->Config.Event_SubFile_Start(MI->Config.File_Names[MI->Config.File_Names_Pos]);
#endif //MEDIAINFO_EVENTS
F.Open(MI->Config.File_Names[MI->Config.File_Names_Pos]);
+ while (!F.Opened_Get())
+ {
+ if (MI->Config.File_Names_Pos+1<MI->Config.File_Names.size())
+ {
+ MI->Config.File_Names_Pos++;
+ F.Open(MI->Config.File_Names[MI->Config.File_Names_Pos]);
+ }
+ }
if (MI->Config.File_Names_Pos>=MI->Config.File_Sizes.size())
{
- MI->Config.File_Sizes.resize(MI->Config.File_Names_Pos, (int64u)-1);
+ MI->Config.File_Sizes.resize(MI->Config.File_Names_Pos, 0);
MI->Config.File_Sizes.push_back(F.Size_Get());
}
MI->Config.File_Names_Pos++;
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Reader/Reader_libcurl.cpp b/src/thirdparty/MediaInfo/MediaInfo/Reader/Reader_libcurl.cpp
index 6eead5765..a654d6e99 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Reader/Reader_libcurl.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Reader/Reader_libcurl.cpp
@@ -60,7 +60,7 @@ struct Reader_libcurl::curl_data
char ErrorBuffer[CURL_ERROR_SIZE];
#if MEDIAINFO_NEXTPACKET
CURLM* CurlM;
- #endif MEDIAINFO_NEXTPACKET
+ #endif //MEDIAINFO_NEXTPACKET
struct curl_slist* HttpHeader;
std::bitset<32> Status;
String File_Name;
@@ -80,7 +80,7 @@ struct Reader_libcurl::curl_data
bool Init_NotAFile;
#if MEDIAINFO_NEXTPACKET
bool NextPacket;
- #endif MEDIAINFO_NEXTPACKET
+ #endif //MEDIAINFO_NEXTPACKET
time_t Time_Max;
#ifdef MEDIAINFO_DEBUG
int64u Debug_BytesRead_Total;
@@ -98,7 +98,7 @@ struct Reader_libcurl::curl_data
ErrorBuffer[0]='\0';
#if MEDIAINFO_NEXTPACKET
CurlM=NULL;
- #endif MEDIAINFO_NEXTPACKET
+ #endif //MEDIAINFO_NEXTPACKET
HttpHeader=NULL;
Ssl_IgnoreSecurity=false;
Ssh_IgnoreSecurity=false;
@@ -106,7 +106,7 @@ struct Reader_libcurl::curl_data
Init_NotAFile=false;
#if MEDIAINFO_NEXTPACKET
NextPacket=false;
- #endif MEDIAINFO_NEXTPACKET
+ #endif //MEDIAINFO_NEXTPACKET
Time_Max=0;
#ifdef MEDIAINFO_DEBUG
Debug_BytesRead_Total=0;
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Setup.h b/src/thirdparty/MediaInfo/MediaInfo/Setup.h
index 40d0e1d7a..f6cefdc9f 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Setup.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/Setup.h
@@ -116,6 +116,9 @@
#if !defined (MEDIAINFO_AES_NO) && !defined (MEDIAINFO_AES_YES)
#define MEDIAINFO_AES_NO
#endif
+ #if !defined (MEDIAINFO_EXPORT_NO) && !defined (MEDIAINFO_EXPORT_YES)
+ #define MEDIAINFO_EXPORT_NO
+ #endif
#endif
//---------------------------------------------------------------------------
@@ -256,6 +259,20 @@
#define MEDIAINFO_IBI 1
#endif
#endif
+#if !defined(MEDIAINFO_IBIUSAGE)
+ #if defined(MEDIAINFO_IBIUSAGE_NO) && defined(MEDIAINFO_IBIUSAGE_YES)
+ #undef MEDIAINFO_IBIUSAGE_NO //MEDIAINFO_IBIUSAGE_YES has priority
+ #endif
+ #if defined(MEDIAINFO_IBIUSAGE_NO)
+ #define MEDIAINFO_IBIUSAGE 0
+ #else
+ #if MEDIAINFO_ADVANCED2
+ #define MEDIAINFO_IBIUSAGE 1
+ #else //MEDIAINFO_ADVANCED2
+ #define MEDIAINFO_IBIUSAGE 0
+ #endif //MEDIAINFO_ADVANCED2
+ #endif
+#endif
#if !defined(MEDIAINFO_READTHREAD)
#if defined(MEDIAINFO_READTHREAD_NO) && defined(MEDIAINFO_READTHREAD_YES)
#undef MEDIAINFO_READTHREAD_NO //MEDIAINFO_READTHREAD_YES has priority
@@ -289,6 +306,36 @@
#endif
//---------------------------------------------------------------------------
+// Export
+#if !defined(MEDIAINFO_EXPORT_NO) && !defined(MEDIAINFO_TEXT_NO) && !defined(MEDIAINFO_TEXT_YES)
+ #define MEDIAINFO_TEXT_YES
+#endif
+#if !defined(MEDIAINFO_EXPORT_NO) && !defined(MEDIAINFO_HTML_NO) && !defined(MEDIAINFO_HTML_YES)
+ #define MEDIAINFO_HTML_YES
+#endif
+#if !defined(MEDIAINFO_EXPORT_NO) && !defined(MEDIAINFO_XML_NO) && !defined(MEDIAINFO_XML_YES)
+ #define MEDIAINFO_XML_YES
+#endif
+#if !defined(MEDIAINFO_EXPORT_NO) && !defined(MEDIAINFO_CSV_NO) && !defined(MEDIAINFO_CSV_YES)
+ #define MEDIAINFO_CSV_YES
+#endif
+#if !defined(MEDIAINFO_EXPORT_NO) && !defined(MEDIAINFO_CUSTOM_NO) && !defined(MEDIAINFO_CUSTOM_YES)
+ #define MEDIAINFO_CUSTOM_YES
+#endif
+#if !defined(MEDIAINFO_EXPORT_NO) && !defined(MEDIAINFO_EBUCORE_NO) && !defined(MEDIAINFO_EBUCORE_YES)
+ #define MEDIAINFO_EBUCORE_YES
+#endif
+#if !defined(MEDIAINFO_EXPORT_NO) && !defined(MEDIAINFO_MPEG7_NO) && !defined(MEDIAINFO_MPEG7_YES)
+ #define MEDIAINFO_MPEG7_YES
+#endif
+#if !defined(MEDIAINFO_EXPORT_NO) && !defined(MEDIAINFO_PBCORE_NO) && !defined(MEDIAINFO_PBCORE_YES)
+ #define MEDIAINFO_PBCORE_YES
+#endif
+#if !defined(MEDIAINFO_EXPORT_NO) && !defined(MEDIAINFO_REVTMD_NO) && !defined(MEDIAINFO_REVTMD_YES)
+ #define MEDIAINFO_REVTMD_YES
+#endif
+
+//---------------------------------------------------------------------------
// All in one for no parsers
#if defined(MEDIAINFO_ALL_NO) && !defined(MEDIAINFO_MULTI_NO)
#define MEDIAINFO_MULTI_NO
@@ -542,6 +589,9 @@
#if !defined(MEDIAINFO_AUDIO_NO) && !defined(MEDIAINFO_AU_NO) && !defined(MEDIAINFO_AU_YES)
#define MEDIAINFO_AU_YES
#endif
+#if !defined(MEDIAINFO_AUDIO_NO) && !defined(MEDIAINFO_CAF_NO) && !defined(MEDIAINFO_CAF_YES)
+ #define MEDIAINFO_CAF_YES
+#endif
#if !defined(MEDIAINFO_AUDIO_NO) && !defined(MEDIAINFO_CELT_NO) && !defined(MEDIAINFO_CELT_YES)
#define MEDIAINFO_CELT_YES
#endif
@@ -698,6 +748,9 @@
#if !defined(MEDIAINFO_IMAGE_NO) && !defined(MEDIAINFO_BMP_NO) && !defined(MEDIAINFO_BMP_YES)
#define MEDIAINFO_BMP_YES
#endif
+#if !defined(MEDIAINFO_IMAGE_NO) && !defined(MEDIAINFO_BPG_NO) && !defined(MEDIAINFO_BPG_YES)
+ #define MEDIAINFO_BPG_YES
+#endif
#if !defined(MEDIAINFO_IMAGE_NO) && !defined(MEDIAINFO_DDS_NO) && !defined(MEDIAINFO_DDS_YES)
#define MEDIAINFO_DDS_YES
#endif
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Tag/File_Id3v2.cpp b/src/thirdparty/MediaInfo/MediaInfo/Tag/File_Id3v2.cpp
index 3e10e5054..0af6ccbf7 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Tag/File_Id3v2.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Tag/File_Id3v2.cpp
@@ -464,6 +464,8 @@ void File_Id3v2::Header_Parse()
{
int16u Flags;
Get_C4 (Frame_ID, "Frame ID");
+ if (!(Frame_ID&0xFF))
+ Frame_ID>>=8;
Get_B4 (Size, "Size");
if (Id3v2_Version!=3)
{
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Tag/File_VorbisCom.cpp b/src/thirdparty/MediaInfo/MediaInfo/Tag/File_VorbisCom.cpp
index 3f598d44b..677bb2403 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Tag/File_VorbisCom.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Tag/File_VorbisCom.cpp
@@ -170,9 +170,9 @@ void File_VorbisCom::FileHeader_Parse()
if (vendor_string.find(__T("BS; Lancer"))==0) Library_Name="Lancer";
Fill(StreamKind_Specific, 0, "Encoded_Library", vendor_string);
- Fill(StreamKind_Specific, 0, "Encoded_Library/Name", Library_Name);
- Fill(StreamKind_Specific, 0, "Encoded_Library/Version", Library_Version);
- Fill(StreamKind_Specific, 0, "Encoded_Library/Date", Library_Date);
+ Fill(StreamKind_Specific, 0, "Encoded_Library_Name", Library_Name);
+ Fill(StreamKind_Specific, 0, "Encoded_Library_Version", Library_Version);
+ Fill(StreamKind_Specific, 0, "Encoded_Library_Date", Library_Date);
FILLING_END();
}
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Text/File_Cdp.cpp b/src/thirdparty/MediaInfo/MediaInfo/Text/File_Cdp.cpp
index b355d51fa..6307fdc89 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Text/File_Cdp.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Text/File_Cdp.cpp
@@ -25,6 +25,9 @@
#if defined(MEDIAINFO_EIA608_YES)
#include "MediaInfo/Text/File_Eia608.h"
#endif
+#if MEDIAINFO_ADVANCED
+ #include "MediaInfo/MediaInfo_Config_MediaInfo.h"
+#endif //MEDIAINFO_ADVANCED
#if MEDIAINFO_EVENTS
#include "MediaInfo/MediaInfo_Events.h"
#endif //MEDIAINFO_EVENTS
@@ -363,6 +366,12 @@ void File_Cdp::ccdata_section()
Get_SB ( cc_valid, "cc_valid");
Get_S1 (2, cc_type, "cc_type"); Param_Info1(Cdp_cc_type(cc_type));
BS_End();
+
+ #if MEDIAINFO_ADVANCED
+ if (cc_type>=2 && !Streams[2] && Config->File_Eia708_DisplayEmptyStream_Get())
+ CreateStream(2);
+ #endif //MEDIAINFO_ADVANCED
+
if (cc_valid)
{
Element_Begin1("cc_data");
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Text/File_DtvccTransport.cpp b/src/thirdparty/MediaInfo/MediaInfo/Text/File_DtvccTransport.cpp
index 6412809b8..e4c85a9c0 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Text/File_DtvccTransport.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Text/File_DtvccTransport.cpp
@@ -28,6 +28,9 @@
#if defined(MEDIAINFO_EIA708_YES)
#include "MediaInfo/Text/File_Eia708.h"
#endif
+#if MEDIAINFO_ADVANCED
+ #include "MediaInfo/MediaInfo_Config_MediaInfo.h"
+#endif //MEDIAINFO_ADVANCED
#if MEDIAINFO_EVENTS
#include "MediaInfo/MediaInfo_Events.h"
#endif //MEDIAINFO_EVENTS
@@ -227,6 +230,12 @@ void File_DtvccTransport::Read_Buffer_Continue()
Get_S1 (2, cc_type, "cc_type"); Param_Info1(DtvccTransport_cc_type(cc_type));
}
BS_End();
+
+ #if MEDIAINFO_ADVANCED
+ if (cc_type>=2 && !Streams[2] && Config->File_Eia708_DisplayEmptyStream_Get())
+ CreateStream(2);
+ #endif //MEDIAINFO_ADVANCED
+
if (cc_valid)
{
Element_Begin1("cc_data");
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Text/File_Eia708.cpp b/src/thirdparty/MediaInfo/MediaInfo/Text/File_Eia708.cpp
index ad5548c3c..81b229415 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Text/File_Eia708.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Text/File_Eia708.cpp
@@ -1267,12 +1267,16 @@ void File_Eia708::DFx(int8u WindowID)
window* Window=Streams[service_number]->Windows[WindowID];
Window->visible=visible;
Window->relative_positioning=relative_positioning;
- Window->anchor_vertical=anchor_vertical;
if (relative_positioning)
+ {
Window->Minimal.Window_y=(int8u)(((float)15)*anchor_vertical/100);
+ Window->Minimal.Window_x=(int8u)(24*AspectRatio*anchor_horizontal/100);;
+ }
else
+ {
Window->Minimal.Window_y=anchor_vertical/5;
- Window->anchor_horizontal=anchor_horizontal;
+ Window->Minimal.Window_x=anchor_horizontal/5;
+ }
int8u offset_y;
switch (anchor_point)
{
@@ -1295,10 +1299,6 @@ void File_Eia708::DFx(int8u WindowID)
}
if (offset_y<Window->Minimal.Window_y)
Window->Minimal.Window_y-=offset_y;
- if (relative_positioning)
- Window->Minimal.Window_x=(int8u)(24*AspectRatio*anchor_horizontal/100);
- else
- Window->Minimal.Window_x=anchor_horizontal/5;
int8u offset_x;
switch (anchor_point)
{
@@ -1337,6 +1337,15 @@ void File_Eia708::DFx(int8u WindowID)
Window->Minimal.CC.resize(Window->row_count);
for (int8u Pos_Y=0; Pos_Y<Window->row_count; Pos_Y++)
Window->Minimal.CC[Pos_Y].resize(Window->column_count);
+
+ if (Window->Minimal.Window_y+Window->row_count>15 || (AspectRatio && Window->Minimal.Window_x+Window->column_count>(int8u)(24*AspectRatio)))
+ {
+ //Correcting
+ if (Window->Minimal.Window_y+Window->row_count>15)
+ Window->Minimal.Window_y=15-Window->row_count;
+ if (AspectRatio && Window->Minimal.Window_x+Window->column_count>(int8u)(24*AspectRatio))
+ Window->Minimal.Window_x=(int8u)(24*AspectRatio)-Window->column_count;
+ }
}
//***************************************************************************
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Text/File_Sdp.cpp b/src/thirdparty/MediaInfo/MediaInfo/Text/File_Sdp.cpp
index d69abca6a..9df379a60 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Text/File_Sdp.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Text/File_Sdp.cpp
@@ -88,9 +88,9 @@ void File_Sdp::Streams_Finish()
bool File_Sdp::Synchronize()
{
//Synchronizing
- while (Buffer_Offset+3<=Buffer_Size)
+ while (Buffer_Offset+2<Buffer_Size)
{
- while (Buffer_Offset+3<=Buffer_Size)
+ while (Buffer_Offset+2<Buffer_Size)
{
if (Buffer[Buffer_Offset ]==0x51
&& Buffer[Buffer_Offset+1]==0x15)
@@ -99,16 +99,19 @@ bool File_Sdp::Synchronize()
Buffer_Offset++;
}
- if (Buffer_Offset+3<=Buffer_Size) //Testing if size is coherant
+ if (IsSub)
+ break; // Found one file with unknown bytes at the end of the stream, so removing this integrity test for the moment
+
+ if (Buffer_Offset+2<Buffer_Size) //Testing if size is coherant
{
- if (Buffer_Offset+3+Buffer[Buffer_Offset+2]==Buffer_Size)
+ if (Buffer_Offset+Buffer[Buffer_Offset+2]==Buffer_Size)
break;
- if (Buffer_Offset+3+Buffer[Buffer_Offset+2]+3>Buffer_Size)
+ if (Buffer_Offset+Buffer[Buffer_Offset+2]+3>Buffer_Size)
return false; //Wait for more data
- if (Buffer[Buffer_Offset+3+Buffer[Buffer_Offset+2] ]==0x51
- && Buffer[Buffer_Offset+3+Buffer[Buffer_Offset+2]+1]==0x15)
+ if (Buffer[Buffer_Offset+Buffer[Buffer_Offset+2] ]==0x51
+ && Buffer[Buffer_Offset+Buffer[Buffer_Offset+2]+1]==0x15)
break; //while()
Buffer_Offset++;
@@ -116,7 +119,7 @@ bool File_Sdp::Synchronize()
}
//Must have enough buffer for having header
- if (Buffer_Offset+3>=Buffer_Size)
+ if (Buffer_Offset+2>=Buffer_Size)
return false;
//Synched is OK
@@ -206,7 +209,10 @@ void File_Sdp::Header_Parse()
#endif //MEDIAINFO_TRACE
}
- Header_Fill_Size(3+Length);
+ if (IsSub)
+ Header_Fill_Size(Buffer_Size);
+ else
+ Header_Fill_Size(Length);
}
//---------------------------------------------------------------------------
@@ -237,8 +243,9 @@ void File_Sdp::Data_Parse()
Element_Begin1("SDP Footer");
Skip_B1( "Footer ID");
Skip_B2( "Footer Sequence number");
- Skip_B2( "SDP Cheksum");
- Skip_B2( "SMPTE 291 Cheksum");
+ Skip_B1( "SDP Cheksum");
+ if (Element_Offset<Element_Size)
+ Skip_XX(Element_Size-Element_Offset, "Unknown, out of specs");
Element_End0();
}
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Text/File_Ttml.cpp b/src/thirdparty/MediaInfo/MediaInfo/Text/File_Ttml.cpp
index b689680ce..26592d195 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Text/File_Ttml.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Text/File_Ttml.cpp
@@ -170,7 +170,12 @@ void File_Ttml::Read_Buffer_Continue()
MuxingMode=11; //MPEG-4
if (StreamIDs_Size>2 && ParserIDs[StreamIDs_Size-2]==MediaInfo_Parser_Mxf) //Only if referenced MXF
MuxingMode=13; //MXF
- #endif MEDIAINFO_EVENTS
+ #endif //MEDIAINFO_EVENTS
+
+ #if MEDIAINFO_DEMUX && MEDIAINFO_NEXTPACKET
+ if (Config->NextPacket_Get() && Config->Event_CallBackFunction_IsSet())
+ return; // Waiting for NextPacket
+ #endif //MEDIAINFO_DEMUX && MEDIAINFO_NEXTPACKET
}
tinyxml2::XMLElement* div=NULL;
@@ -241,7 +246,7 @@ void File_Ttml::Read_Buffer_Continue()
Frame_Count++;
}
}
- #endif MEDIAINFO_EVENTS
+ #endif //MEDIAINFO_EVENTS
Buffer_Offset=Buffer_Size;
}
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Text/File_Ttml.h b/src/thirdparty/MediaInfo/MediaInfo/Text/File_Ttml.h
index 60d16cba6..d4e9f5606 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Text/File_Ttml.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/Text/File_Ttml.h
@@ -39,7 +39,7 @@ public :
#if MEDIAINFO_EVENTS
int8u MuxingMode;
- #endif MEDIAINFO_EVENTS
+ #endif //MEDIAINFO_EVENTS
private :
//Streams management
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Video/File_Avc.cpp b/src/thirdparty/MediaInfo/MediaInfo/Video/File_Avc.cpp
index 01895cdf3..32f932371 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Video/File_Avc.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Video/File_Avc.cpp
@@ -49,7 +49,7 @@ const char* Avc_profile_idc(int8u profile_idc)
case 138 : return "Multiview Depth High";
case 144 : return "High 4:4:4";
case 244 : return "High 4:4:4 Predictive";
- default : return "Unknown";
+ default : return "";
}
}
@@ -73,6 +73,9 @@ const char* Avc_profile_idc(int8u profile_idc)
#if defined(MEDIAINFO_DTVCCTRANSPORT_YES)
#include "MediaInfo/Text/File_DtvccTransport.h"
#endif //defined(MEDIAINFO_DTVCCTRANSPORT_YES)
+#if MEDIAINFO_ADVANCED2
+ #include "base64.h"
+#endif //MEDIAINFO_ADVANCED2
#if MEDIAINFO_EVENTS
#include "MediaInfo/MediaInfo_Config_MediaInfo.h"
#include "MediaInfo/MediaInfo_Events.h"
@@ -96,7 +99,7 @@ const size_t Avc_Errors_MaxCount=32;
//---------------------------------------------------------------------------
extern const int8u Avc_PixelAspectRatio_Size=17;
-extern const float32 Avc_PixelAspectRatio[]=
+extern const float32 Avc_PixelAspectRatio[Avc_PixelAspectRatio_Size]=
{
(float32)1, //Reserved
(float32)1,
@@ -371,6 +374,13 @@ void File_Avc::Streams_Fill()
Streams_Fill_subset(subset_seq_parameter_set_Item);
Fill(Stream_Video, 0, Video_MultiView_Count, (*subset_seq_parameter_set_Item)->num_views_minus1+1);
}
+
+ #if MEDIAINFO_ADVANCED2
+ for (size_t Pos = 0; Pos<Dump_SPS.size(); Pos++)
+ Fill(Stream_Video, 0, "Dump_seq_parameter_set", Dump_SPS[Pos].c_str());
+ for (size_t Pos = 0; Pos<Dump_PPS.size(); Pos++)
+ Fill(Stream_Video, 0, "Dump_pic_parameter_set", Dump_PPS[Pos].c_str());
+ #endif //MEDIAINFO_ADVANCED2
}
//---------------------------------------------------------------------------
@@ -482,7 +492,7 @@ void File_Avc::Streams_Fill(std::vector<seq_parameter_set_struct*>::iterator seq
if ((*seq_parameter_set_Item)->constraint_set3_flag)
Profile+=__T(" Intra");
}
- Profile+=__T("@L")+Ztring().From_Number(((float)(*seq_parameter_set_Item)->level_idc)/10, 1);
+ Profile+=__T("@L")+Ztring().From_Number(((float)(*seq_parameter_set_Item)->level_idc)/10, ((*seq_parameter_set_Item)->level_idc%10)?1:0);
Fill(Stream_Video, 0, Video_Format_Profile, Profile);
Fill(Stream_Video, 0, Video_Codec_Profile, Profile);
Fill(Stream_Video, StreamPos_Last, Video_Width, Width);
@@ -588,7 +598,10 @@ void File_Avc::Streams_Fill(std::vector<seq_parameter_set_struct*>::iterator seq
Fill(Stream_Video, 0, Video_Format_Settings_RefFrames, (*seq_parameter_set_Item)->max_num_ref_frames);
Fill(Stream_Video, 0, Video_Codec_Settings_RefFrames, (*seq_parameter_set_Item)->max_num_ref_frames);
}
- Fill(Stream_Video, 0, Video_ColorSpace, "YUV");
+ if ((*seq_parameter_set_Item)->vui_parameters && (*seq_parameter_set_Item)->vui_parameters->matrix_coefficients == 0)
+ Fill(Stream_Video, 0, Video_ColorSpace, "RGB");
+ else
+ Fill(Stream_Video, 0, Video_ColorSpace, "YUV");
Fill(Stream_Video, 0, Video_Colorimetry, Avc_Colorimetry_format_idc[(*seq_parameter_set_Item)->chroma_format_idc]);
if ((*seq_parameter_set_Item)->bit_depth_luma_minus8==(*seq_parameter_set_Item)->bit_depth_chroma_minus8)
Fill(Stream_Video, 0, Video_BitDepth, (*seq_parameter_set_Item)->bit_depth_luma_minus8+8);
@@ -617,6 +630,8 @@ void File_Avc::Streams_Finish()
#if defined(MEDIAINFO_DTVCCTRANSPORT_YES)
if (GA94_03_Parser && GA94_03_Parser->Status[IsAccepted])
{
+ Clear(Stream_Text);
+
Finish(GA94_03_Parser);
Merge(*GA94_03_Parser);
@@ -635,10 +650,10 @@ void File_Avc::Streams_Finish()
}
#endif //defined(MEDIAINFO_DTVCCTRANSPORT_YES)
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
if (seq_parameter_sets.size()==1 && (*seq_parameter_sets.begin())->vui_parameters && (*seq_parameter_sets.begin())->vui_parameters->timing_info_present_flag && (*seq_parameter_sets.begin())->vui_parameters->fixed_frame_rate_flag)
Ibi_Stream_Finish((*seq_parameter_sets.begin())->vui_parameters->time_scale, (*seq_parameter_sets.begin())->vui_parameters->num_units_in_tick);
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
}
//***************************************************************************
@@ -728,12 +743,12 @@ bool File_Avc::Synched_Test()
if (!Header_Parser_QuickSearch())
return false;
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
bool zero_byte=Buffer[Buffer_Offset+2]==0x00;
bool RandomAccess=(Buffer[Buffer_Offset+(zero_byte?4:3)]&0x1F)==0x07 || ((Buffer[Buffer_Offset+(zero_byte?4:3)]&0x1F)==0x09 && ((Buffer[Buffer_Offset+(zero_byte?5:4)]&0xE0)==0x00 || (Buffer[Buffer_Offset+(zero_byte?5:4)]&0xE0)==0xA0)); //seq_parameter_set or access_unit_delimiter with value=0 or 5 (3 bits)
if (RandomAccess)
Ibi_Add();
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
//We continue
return true;
@@ -1330,6 +1345,24 @@ void File_Avc::Data_Parse()
Element_Size--;
}
+ //Dump of the SPS/PPS - Init
+ #if MEDIAINFO_ADVANCED2
+ size_t spspps_Size=0;
+ if (true) //TODO: add an option for activating this extra piece of information in the output
+ {
+ switch (Element_Code)
+ {
+ case 0x07 : //seq_parameter_set();
+ spspps_Size = seq_parameter_sets.size();
+ break;
+ case 0x08 : //pic_parameter_set();
+ spspps_Size = pic_parameter_sets.size();
+ break;
+ default: ;
+ }
+ }
+ #endif //MEDIAINFO_ADVANCED2
+
//svc_extension
bool svc_extension_flag=false;
if (Element_Code==0x0E || Element_Code==0x14)
@@ -1479,6 +1512,31 @@ void File_Avc::Data_Parse()
}
#endif //MEDIAINFO_DEMUX
+ //Dump of the SPS/PPS - Fill
+ #if MEDIAINFO_ADVANCED2
+ if (false) //TODO: add an option for activating this extra piece of information in the output
+ {
+ switch (Element_Code)
+ {
+ case 0x07 : //seq_parameter_set();
+ if (spspps_Size != seq_parameter_sets.size() && !Status[IsFilled])
+ {
+ std::string Data_Raw((const char*)(Buffer+(size_t)(Buffer_Offset-1)), (size_t)(Element_Size+1)); //Including the last byte in the header
+ Dump_SPS.push_back(Base64::encode(Data_Raw));
+ }
+ break;
+ case 0x08 : //pic_parameter_set();
+ if (spspps_Size != pic_parameter_sets.size() && !Status[IsFilled])
+ {
+ std::string Data_Raw((const char*)(Buffer+(size_t)(Buffer_Offset-1)), (size_t)(Element_Size+1)); //Including the last byte in the header
+ Dump_PPS.push_back(Base64::encode(Data_Raw));
+ }
+ break;
+ default: ;
+ }
+ }
+ #endif //MEDIAINFO_ADVANCED2
+
//Trailing zeroes
Element_Size=Element_Size_SaveBeforeZeroes;
}
@@ -1807,10 +1865,12 @@ void File_Avc::slice_header()
int32u tempPicOrderCnt;
if (Element_Code==5) //IdrPicFlag
tempPicOrderCnt=0;
- else if (nal_ref_idc)
- tempPicOrderCnt=2*(FrameNumOffset+frame_num);
else
- tempPicOrderCnt=2*(FrameNumOffset+frame_num)-1;
+ {
+ tempPicOrderCnt=2*(FrameNumOffset+frame_num);
+ if (!nal_ref_idc && tempPicOrderCnt) //Note: if nal_ref_idc is 0, tempPicOrderCnt is not expected to be 0 but it may be the case with invalid streams
+ tempPicOrderCnt--;
+ }
pic_order_cnt=tempPicOrderCnt;
@@ -1993,8 +2053,10 @@ void File_Avc::slice_header()
if ((Pos%2)==0)
PictureTypes+=' ';
}
- if (!GOP_Detect(PictureTypes).empty() && !GA94_03_IsPresent)
- Frame_Count_Valid=Frame_Count; //We have enough frames
+ #if defined(MEDIAINFO_DTVCCTRANSPORT_YES)
+ if (!GOP_Detect(PictureTypes).empty() && !GA94_03_IsPresent)
+ Frame_Count_Valid=Frame_Count; //We have enough frames
+ #endif //defined(MEDIAINFO_DTVCCTRANSPORT_YES)
}
}
}
@@ -2055,8 +2117,10 @@ void File_Avc::slice_header()
Accept("AVC");
if (!Status[IsFilled])
{
- if (!GA94_03_IsPresent && IFrame_Count>=8)
- Frame_Count_Valid=Frame_Count; //We have enough frames
+ #if defined(MEDIAINFO_DTVCCTRANSPORT_YES)
+ if (!GA94_03_IsPresent && IFrame_Count>=8)
+ Frame_Count_Valid=Frame_Count; //We have enough frames
+ #endif //defined(MEDIAINFO_DTVCCTRANSPORT_YES)
if (Frame_Count>=Frame_Count_Valid)
{
Fill("AVC");
@@ -2842,7 +2906,8 @@ void File_Avc::seq_parameter_set()
//parsing
int32u seq_parameter_set_id;
- if (!seq_parameter_set_data(seq_parameter_sets, seq_parameter_set_id))
+ seq_parameter_set_struct* Data_Item_New=seq_parameter_set_data(seq_parameter_set_id);
+ if (!Data_Item_New)
return;
Mark_1( );
size_t BS_bits=Data_BS_Remain()%8;
@@ -2886,6 +2951,9 @@ void File_Avc::seq_parameter_set()
NextCode_Clear();
NextCode_Add(0x08);
+ //Add
+ seq_parameter_set_data_Add(seq_parameter_sets, seq_parameter_set_id, Data_Item_New);
+
//Autorisation of other streams
Streams[0x08].Searching_Payload=true; //pic_parameter_set
if (Streams[0x07].ShouldDuplicate)
@@ -2899,6 +2967,36 @@ void File_Avc::seq_parameter_set()
FILLING_END();
}
+void File_Avc::seq_parameter_set_data_Add(std::vector<seq_parameter_set_struct*> &Data, const int32u Data_id, seq_parameter_set_struct* Data_Item_New)
+{
+ //Creating Data
+ if (Data_id>=Data.size())
+ Data.resize(Data_id+1);
+ std::vector<seq_parameter_set_struct*>::iterator Data_Item=Data.begin()+Data_id;
+ delete *Data_Item; *Data_Item=Data_Item_New;
+
+ //Computing values (for speed)
+ size_t MaxNumber;
+ switch (Data_Item_New->pic_order_cnt_type)
+ {
+ case 0 :
+ MaxNumber=Data_Item_New->MaxPicOrderCntLsb;
+ break;
+ case 1 :
+ case 2 :
+ MaxNumber=Data_Item_New->MaxFrameNum*2;
+ break;
+ default:
+ MaxNumber = 0;
+ }
+
+ if (MaxNumber>TemporalReferences_Reserved)
+ {
+ TemporalReferences.resize(4*MaxNumber);
+ TemporalReferences_Reserved=MaxNumber;
+ }
+}
+
//---------------------------------------------------------------------------
// Packet "08"
void File_Avc::pic_parameter_set()
@@ -3134,10 +3232,10 @@ void File_Avc::subset_seq_parameter_set()
//Parsing
int32u subset_seq_parameter_set_id;
- if (!seq_parameter_set_data(subset_seq_parameter_sets, subset_seq_parameter_set_id))
+ seq_parameter_set_struct* Data_Item_New=seq_parameter_set_data(subset_seq_parameter_set_id);
+ if (!Data_Item_New)
return;
- std::vector<seq_parameter_set_struct*>::iterator subset_seq_parameter_sets_Item=subset_seq_parameter_sets.begin()+subset_seq_parameter_set_id;
- if ((*subset_seq_parameter_sets_Item)->profile_idc==83 || (*subset_seq_parameter_sets_Item)->profile_idc==86)
+ if (Data_Item_New->profile_idc==83 || Data_Item_New->profile_idc==86)
{
//bool svc_vui_parameters_present_flag;
seq_parameter_set_svc_extension();
@@ -3147,11 +3245,11 @@ void File_Avc::subset_seq_parameter_set()
svc_vui_parameters_extension();
*/
}
- else if ((*subset_seq_parameter_sets_Item)->profile_idc==118 || (*subset_seq_parameter_sets_Item)->profile_idc==128)
+ else if (Data_Item_New->profile_idc==118 || Data_Item_New->profile_idc==128)
{
//bool mvc_vui_parameters_present_flag, additional_extension2_flag;
Mark_1();
- seq_parameter_set_mvc_extension(subset_seq_parameter_set_id);
+ seq_parameter_set_mvc_extension(Data_Item_New);
/* The rest is not yet implemented
Get_SB (mvc_vui_parameters_present_flag, "mvc_vui_parameters_present_flag");
if (mvc_vui_parameters_present_flag)
@@ -3175,6 +3273,9 @@ void File_Avc::subset_seq_parameter_set()
NextCode_Clear();
NextCode_Add(0x08);
+ //Add
+ seq_parameter_set_data_Add(subset_seq_parameter_sets, subset_seq_parameter_set_id, Data_Item_New);
+
//Autorisation of other streams
Streams[0x08].Searching_Payload=true; //pic_parameter_set
if (Streams[0x0F].ShouldDuplicate)
@@ -3213,7 +3314,7 @@ void File_Avc::slice_layer_extension(bool svc_extension_flag)
//***************************************************************************
//---------------------------------------------------------------------------
-bool File_Avc::seq_parameter_set_data(std::vector<seq_parameter_set_struct*> &Data, int32u &Data_id)
+File_Avc::seq_parameter_set_struct* File_Avc::seq_parameter_set_data(int32u &Data_id)
{
//Parsing
seq_parameter_set_struct::vui_parameters_struct* vui_parameters_Item=NULL;
@@ -3278,7 +3379,7 @@ bool File_Avc::seq_parameter_set_data(std::vector<seq_parameter_set_struct*> &Da
if (num_ref_frames_in_pic_order_cnt_cycle>=256)
{
Trusted_IsNot("num_ref_frames_in_pic_order_cnt_cycle too high");
- return false;
+ return NULL;
}
for(int32u Pos=0; Pos<num_ref_frames_in_pic_order_cnt_cycle; Pos++)
Skip_SE( "offset_for_ref_frame");
@@ -3286,7 +3387,7 @@ bool File_Avc::seq_parameter_set_data(std::vector<seq_parameter_set_struct*> &Da
else if (pic_order_cnt_type > 2)
{
Trusted_IsNot("pic_order_cnt_type not supported");
- return false;
+ return NULL;
}
Get_UE (max_num_ref_frames, "max_num_ref_frames");
Skip_SB( "gaps_in_frame_num_value_allowed_flag");
@@ -3312,26 +3413,23 @@ bool File_Avc::seq_parameter_set_data(std::vector<seq_parameter_set_struct*> &Da
{
Trusted_IsNot("seq_parameter_set_id not valid");
delete (seq_parameter_set_struct::vui_parameters_struct*)vui_parameters_Item;
- return false; //Problem, not valid
+ return NULL; //Problem, not valid
}
if (pic_order_cnt_type==0 && log2_max_pic_order_cnt_lsb_minus4>12)
{
Trusted_IsNot("log2_max_pic_order_cnt_lsb_minus4 not valid");
delete (seq_parameter_set_struct::vui_parameters_struct*)vui_parameters_Item;
- return false; //Problem, not valid
+ return NULL; //Problem, not valid
}
if (log2_max_frame_num_minus4>12)
{
Trusted_IsNot("log2_max_frame_num_minus4 not valid");
delete (seq_parameter_set_struct::vui_parameters_struct*)vui_parameters_Item;
- return false; //Problem, not valid
+ return NULL; //Problem, not valid
}
//Creating Data
- if (Data_id>=Data.size())
- Data.resize(Data_id+1);
- std::vector<seq_parameter_set_struct*>::iterator Data_Item=Data.begin()+Data_id;
- delete *Data_Item; *Data_Item=new seq_parameter_set_struct(
+ return new seq_parameter_set_struct(
vui_parameters_Item,
pic_width_in_mbs_minus1,
pic_height_in_map_units_minus1,
@@ -3354,32 +3452,10 @@ bool File_Avc::seq_parameter_set_data(std::vector<seq_parameter_set_struct*> &Da
frame_mbs_only_flag,
mb_adaptive_frame_field_flag
);
-
- //Computing values (for speed)
- size_t MaxNumber;
- switch (pic_order_cnt_type)
- {
- case 0 :
- MaxNumber=(*Data_Item)->MaxPicOrderCntLsb;
- break;
- case 1 :
- case 2 :
- MaxNumber=(*Data_Item)->MaxFrameNum*2;
- break;
- default:
- MaxNumber = 0;
- }
-
- if (MaxNumber>TemporalReferences_Reserved)
- {
- TemporalReferences.resize(4*MaxNumber);
- TemporalReferences_Reserved=MaxNumber;
- }
FILLING_ELSE();
delete vui_parameters_Item; //vui_parameters_Item=NULL;
- return false;
+ return NULL;
FILLING_END();
- return true;
}
//---------------------------------------------------------------------------
@@ -3602,7 +3678,7 @@ void File_Avc::svc_vui_parameters_extension()
}
//---------------------------------------------------------------------------
-void File_Avc::seq_parameter_set_mvc_extension(int32u subset_seq_parameter_sets_id)
+void File_Avc::seq_parameter_set_mvc_extension(seq_parameter_set_struct* Data_Item)
{
//Parsing
Element_Begin1("seq_parameter_set_mvc_extension");
@@ -3612,7 +3688,7 @@ void File_Avc::seq_parameter_set_mvc_extension(int32u subset_seq_parameter_sets_
Element_End0();
FILLING_BEGIN();
- subset_seq_parameter_sets[subset_seq_parameter_sets_id]->num_views_minus1 = (int16u)num_views_minus1;
+ Data_Item->num_views_minus1 = (int16u)num_views_minus1;
FILLING_END();
}
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Video/File_Avc.h b/src/thirdparty/MediaInfo/MediaInfo/Video/File_Avc.h
index 2bb03f90e..0b1dca944 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Video/File_Avc.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/Video/File_Avc.h
@@ -411,9 +411,10 @@ private :
void slice_layer_extension(bool svc_extension_flag);
//Packets - SubElements
- bool seq_parameter_set_data(vector<seq_parameter_set_struct*> &Data, int32u &Data_id);
+ seq_parameter_set_struct* seq_parameter_set_data(int32u &Data_id);
+ void seq_parameter_set_data_Add(vector<seq_parameter_set_struct*> &Data, const int32u Data_id, seq_parameter_set_struct* Data_Item_New);
void seq_parameter_set_svc_extension();
- void seq_parameter_set_mvc_extension(int32u subset_seq_parameter_sets_id);
+ void seq_parameter_set_mvc_extension(seq_parameter_set_struct* Data_Item);
void scaling_list(int32u ScalingList_Size);
void vui_parameters(seq_parameter_set_struct::vui_parameters_struct* &vui_parameters_Item);
void svc_vui_parameters_extension();
@@ -544,6 +545,10 @@ private :
int8u nal_ref_idc;
int8u FrameRate_Divider;
bool FirstPFrameInGop_IsParsed;
+ #if MEDIAINFO_ADVANCED2
+ std::vector<std::string> Dump_SPS;
+ std::vector<std::string> Dump_PPS;
+ #endif //MEDIAINFO_ADVANCED2
//Helpers
string GOP_Detect (string PictureTypes);
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Video/File_Hevc.cpp b/src/thirdparty/MediaInfo/MediaInfo/Video/File_Hevc.cpp
index 0f276c03b..c52c7eb5b 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Video/File_Hevc.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Video/File_Hevc.cpp
@@ -64,6 +64,16 @@ const int8u Hevc_SubHeightC[]=
};
//---------------------------------------------------------------------------
+const char* Hevc_tier_flag(bool tier_flag)
+{
+ switch (tier_flag)
+ {
+ case true : return "High";
+ default : return "Main";
+ }
+}
+
+//---------------------------------------------------------------------------
const char* Hevc_profile_idc(int32u profile_idc)
{
switch (profile_idc)
@@ -72,7 +82,7 @@ const char* Hevc_profile_idc(int32u profile_idc)
case 1 : return "Main";
case 2 : return "Main 10";
case 3 : return "Main Still";
- default : return "Unknown";
+ default : return "";
}
}
@@ -214,7 +224,9 @@ void File_Hevc::Streams_Fill(std::vector<seq_parameter_set_struct*>::iterator se
{
if ((*seq_parameter_set_Item)->profile_idc)
Profile+=__T('@');
- Profile+=__T('L')+Ztring().From_Number(((float)(*seq_parameter_set_Item)->level_idc)/30, 1);
+ Profile+=__T('L')+Ztring().From_Number(((float)(*seq_parameter_set_Item)->level_idc)/30, ((*seq_parameter_set_Item)->level_idc%10)?1:0);
+ Profile+=__T('@');
+ Profile+=Ztring().From_Local(Hevc_tier_flag((*seq_parameter_set_Item)->tier_flag));
}
}
Fill(Stream_Video, 0, Video_Format_Profile, Profile);
@@ -1296,6 +1308,7 @@ void File_Hevc::seq_parameter_set()
0,
0,
0,
+ 0,
false,
false,
false
@@ -1418,6 +1431,7 @@ void File_Hevc::seq_parameter_set()
delete *Data_Item; *Data_Item=new seq_parameter_set_struct(
vui_parameters_Item,
profile_space,
+ tier_flag,
profile_idc,
level_idc,
pic_width_in_luma_samples,
@@ -1907,7 +1921,7 @@ void File_Hevc::sei_message_user_data_unregistered_x265(int32u payloadSize)
Element_Begin1("options");
size_t Options_Pos_Before=Data_Pos_Before;
Encoded_Library_Settings.clear();
- do
+ while (Options_Pos_Before!=Data.size())
{
size_t Options_Pos=Data.find(__T(" "), Options_Pos_Before);
if (Options_Pos==std::string::npos)
@@ -1915,7 +1929,7 @@ void File_Hevc::sei_message_user_data_unregistered_x265(int32u payloadSize)
Ztring option;
Get_Local (Options_Pos-Options_Pos_Before, option, "option");
Options_Pos_Before=Options_Pos;
- do
+ while (Options_Pos_Before!=Data.size())
{
Ztring Separator;
Peek_Local(1, Separator);
@@ -1927,7 +1941,6 @@ void File_Hevc::sei_message_user_data_unregistered_x265(int32u payloadSize)
else
break;
}
- while (Options_Pos_Before!=Data.size());
//Filling
if (option!=__T("options:") && !(!option.empty() && option[0]>=__T('0') && option[0]<=__T('9')) && option.find(__T("fps="))!=0 && option.find(__T("bitdepth="))!=0) //Ignoring redundant information e.g. width, height, frame rate, bit depth
@@ -1937,7 +1950,6 @@ void File_Hevc::sei_message_user_data_unregistered_x265(int32u payloadSize)
Encoded_Library_Settings+=option;
}
}
- while (Options_Pos_Before!=Data.size());
Element_End0();
}
else
@@ -2089,7 +2101,7 @@ void File_Hevc::profile_tier_level(int8u maxNumSubLayersMinus1)
//Parsing
std::vector<bool>sub_layer_profile_present_flags, sub_layer_level_present_flags;
Get_S1 (2, profile_space, "general_profile_space");
- Skip_SB( "general_tier_flag");
+ Get_SB ( tier_flag, "general_tier_flag");
Get_S1 (5, profile_idc, "general_profile_idc");
Element_Begin1("general_profile_compatibility_flags");
for (int8u profile_pos=0; profile_pos<32; profile_pos++)
@@ -2470,11 +2482,11 @@ void File_Hevc::VPS_SPS_PPS()
int8u chromaFormat, bitDepthLumaMinus8, bitDepthChromaMinus8;
int8u general_profile_space, general_profile_idc, general_level_idc;
int8u numOfArrays, constantFrameRate, numTemporalLayers;
- bool temporalIdNested;
+ bool general_tier_flag, temporalIdNested;
Get_B1 (configurationVersion, "configurationVersion");
BS_Begin();
Get_S1 (2, general_profile_space, "general_profile_space");
- Skip_SB( "general_tier_flag");
+ Get_SB ( general_tier_flag, "general_tier_flag");
Get_S1 (5, general_profile_idc, "general_profile_idc");
BS_End();
Get_B4 (general_profile_compatibility_flags, "general_profile_compatibility_flags");
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Video/File_Hevc.h b/src/thirdparty/MediaInfo/MediaInfo/Video/File_Hevc.h
index f58a3d94a..e47d29caf 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Video/File_Hevc.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/Video/File_Hevc.h
@@ -225,6 +225,7 @@ private :
size_t AnnexB_Buffer_Size;
#endif //MEDIAINFO_DEMUX
int32u profile_space;
+ bool tier_flag;
int32u profile_idc;
int32u level_idc;
int32u pic_width_in_luma_samples;
@@ -250,7 +251,7 @@ private :
int8u ChromaArrayType() {return separate_colour_plane_flag?0:chroma_format_idc;}
//Constructor/Destructor
- seq_parameter_set_struct(vui_parameters_struct* vui_parameters_, int32u profile_space_, int32u profile_idc_, int32u level_idc_, int32u pic_width_in_luma_samples_, int32u pic_height_in_luma_samples_, int32u conf_win_left_offset_, int32u conf_win_right_offset_, int32u conf_win_top_offset_, int32u conf_win_bottom_offset_, int8u video_parameter_set_id_, int8u chroma_format_idc_, bool separate_colour_plane_flag_, int8u log2_max_pic_order_cnt_lsb_minus4_, int8u bit_depth_luma_minus8_, int8u bit_depth_chroma_minus8_, bool general_progressive_source_flag_, bool general_interlaced_source_flag_, bool general_frame_only_constraint_flag_)
+ seq_parameter_set_struct(vui_parameters_struct* vui_parameters_, int32u profile_space_, bool tier_flag_, int32u profile_idc_, int32u level_idc_, int32u pic_width_in_luma_samples_, int32u pic_height_in_luma_samples_, int32u conf_win_left_offset_, int32u conf_win_right_offset_, int32u conf_win_top_offset_, int32u conf_win_bottom_offset_, int8u video_parameter_set_id_, int8u chroma_format_idc_, bool separate_colour_plane_flag_, int8u log2_max_pic_order_cnt_lsb_minus4_, int8u bit_depth_luma_minus8_, int8u bit_depth_chroma_minus8_, bool general_progressive_source_flag_, bool general_interlaced_source_flag_, bool general_frame_only_constraint_flag_)
:
vui_parameters(vui_parameters_),
#if MEDIAINFO_DEMUX
@@ -259,6 +260,7 @@ private :
#endif //MEDIAINFO_DEMUX
profile_space(profile_space_),
profile_idc(profile_idc_),
+ tier_flag(tier_flag_),
level_idc(level_idc_),
pic_width_in_luma_samples(pic_width_in_luma_samples_),
pic_height_in_luma_samples(pic_height_in_luma_samples_),
@@ -436,6 +438,7 @@ private :
int8u profile_space;
int8u profile_idc;
int8u level_idc;
+ bool tier_flag;
bool general_progressive_source_flag;
bool general_interlaced_source_flag;
bool general_frame_only_constraint_flag;
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Video/File_Mpeg4v.cpp b/src/thirdparty/MediaInfo/MediaInfo/Video/File_Mpeg4v.cpp
index 785e9d15f..67c1f7afc 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Video/File_Mpeg4v.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Video/File_Mpeg4v.cpp
@@ -280,11 +280,11 @@ bool File_Mpeg4v::Synched_Test()
if (!Header_Parser_QuickSearch())
return false;
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
bool RandomAccess=Buffer[Buffer_Offset+3]==0xB0; //SequenceHeader
if (RandomAccess)
Ibi_Add();
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
//We continue
return true;
@@ -581,10 +581,10 @@ void File_Mpeg4v::Streams_Finish()
Fill(Stream_Video, 0, Video_Duration, Duration);
}
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
if (fixed_vop_time_increment)
Ibi_Stream_Finish(vop_time_increment_resolution, fixed_vop_time_increment);
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
}
//***************************************************************************
// Buffer - Demux
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Video/File_Mpegv.cpp b/src/thirdparty/MediaInfo/MediaInfo/Video/File_Mpegv.cpp
index a901dee25..46b5cc35e 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Video/File_Mpegv.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Video/File_Mpegv.cpp
@@ -1647,7 +1647,7 @@ void File_Mpegv::Streams_Finish()
}
#endif //defined(MEDIAINFO_AFDBARDATA_YES)
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
int64u Numerator=0, Denominator=0;
switch (frame_rate_code)
{
@@ -1667,7 +1667,7 @@ void File_Mpegv::Streams_Finish()
Denominator*=frame_rate_extension_d+1;
Ibi_Stream_Finish(Numerator, Denominator);
}
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
}
//***************************************************************************
@@ -1694,7 +1694,7 @@ bool File_Mpegv::Synched_Test()
if (!Header_Parser_QuickSearch())
return false;
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
if ((Ibi_SliceParsed && (Buffer[Buffer_Offset+3]==0x00)) || Buffer[Buffer_Offset+3]==0xB3) // picture_start without sequence_header or sequence_header
{
if (Buffer_Offset+6>Buffer_Size)
@@ -1705,7 +1705,7 @@ bool File_Mpegv::Synched_Test()
Ibi_SliceParsed=false;
}
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
//We continue
return true;
@@ -1774,9 +1774,9 @@ void File_Mpegv::Synched_Init()
tc=0;
IFrame_IsParsed=false;
IFrame_Count=0;
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
Ibi_SliceParsed=true;
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
#if MEDIAINFO_ADVANCED
Config_VariableGopDetection_Occurences=MediaInfoLib::Config.VariableGopDetection_Occurences_Get();
Config_VariableGopDetection_GiveUp=MediaInfoLib::Config.VariableGopDetection_GiveUp_Get();
@@ -1960,9 +1960,9 @@ void File_Mpegv::Read_Buffer_Unsynched()
PTS_LastIFrame=(int64u)-1;
IFrame_IsParsed=false;
picture_coding_types_Current.clear();
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
Ibi_SliceParsed=true;
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
#if MEDIAINFO_MACROBLOCKS
if (Macroblocks_Parse)
{
@@ -2184,7 +2184,7 @@ void File_Mpegv::Detect_EOF()
Streams[0x00].Searching_Payload=GA94_03_IsPresent || Cdp_IsPresent;
Streams[0xB2].Searching_Payload=GA94_03_IsPresent || CC___IsPresent || Scte_IsPresent;
Streams[0xB3].Searching_Payload=GA94_03_IsPresent || Cdp_IsPresent;
- #endif defined(MEDIAINFO_DTVCCTRANSPORT_YES) || defined(MEDIAINFO_SCTE20_YES) || (defined(MEDIAINFO_GXF_YES) && defined(MEDIAINFO_CDP_YES))
+ #endif //defined(MEDIAINFO_DTVCCTRANSPORT_YES) || defined(MEDIAINFO_SCTE20_YES) || (defined(MEDIAINFO_GXF_YES) && defined(MEDIAINFO_CDP_YES))
return;
}
@@ -2707,9 +2707,9 @@ void File_Mpegv::slice_start()
}
#endif //MEDIAINFO_DEMUX
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
Ibi_SliceParsed=true;
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
#if MEDIAINFO_MACROBLOCKS
if (Macroblocks_Parse)
{
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Video/File_Mpegv.h b/src/thirdparty/MediaInfo/MediaInfo/Video/File_Mpegv.h
index ac2c855bf..c9b54248a 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Video/File_Mpegv.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/Video/File_Mpegv.h
@@ -340,9 +340,9 @@ private :
vlc_fast coded_block_pattern;
#endif //MEDIAINFO_MACROBLOCKS
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
bool Ibi_SliceParsed;
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
#if MEDIAINFO_ADVANCED
int64u InitDataNotRepeated;
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Video/File_Vc1.cpp b/src/thirdparty/MediaInfo/MediaInfo/Video/File_Vc1.cpp
index 69a97c335..1aa639b63 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Video/File_Vc1.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Video/File_Vc1.cpp
@@ -349,7 +349,7 @@ void File_Vc1::Streams_Finish()
if (PTS_End>PTS_Begin)
Fill(Stream_Video, 0, Video_Duration, float64_int64s(((float64)(PTS_End-PTS_Begin))/1000000));
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
int64u Numerator=0, Denominator=0;
if (framerate_present)
{
@@ -366,7 +366,7 @@ void File_Vc1::Streams_Finish()
}
if (Numerator)
Ibi_Stream_Finish(Numerator, Denominator);
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
}
//***************************************************************************
@@ -414,11 +414,11 @@ bool File_Vc1::Synched_Test()
if (!Header_Parser_QuickSearch())
return false;
- #if MEDIAINFO_IBI
+ #if MEDIAINFO_IBIUSAGE
bool RandomAccess=Buffer[Buffer_Offset+3]==0x0F; //SequenceHeader
if (RandomAccess)
Ibi_Add();
- #endif //MEDIAINFO_IBI
+ #endif //MEDIAINFO_IBIUSAGE
//We continue
return true;
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Video/File_Vc3.cpp b/src/thirdparty/MediaInfo/MediaInfo/Video/File_Vc3.cpp
index 6be29f1a7..fdf0c41c8 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Video/File_Vc3.cpp
+++ b/src/thirdparty/MediaInfo/MediaInfo/Video/File_Vc3.cpp
@@ -46,6 +46,10 @@ const bool Vc3_FromCID_IsSupported (int32u CompressionID)
case 1251 :
case 1252 :
case 1253 :
+ case 1256 :
+ case 1258 :
+ case 1259 :
+ case 1260 :
return true;
default : return false;
}
@@ -67,6 +71,10 @@ const int32u Vc3_CompressedFrameSize(int32u CompressionID)
case 1251 : return 458752;
case 1252 : return 303104;
case 1253 : return 188416;
+ case 1256 : return 1835008;
+ case 1258 : return 212992;
+ case 1259 : return 417792;
+ case 1260 : return 417792;
default : return 0;
}
};
@@ -87,11 +95,23 @@ const int8u Vc3_SBD_FromCID (int32u CompressionID)
{
switch (CompressionID)
{
+ case 1237 :
+ case 1238 :
+ case 1242 :
+ case 1243 :
+ case 1251 :
+ case 1252 :
+ case 1253 :
+ case 1258 :
+ case 1259 :
+ case 1260 :
+ return 8;
case 1235 :
case 1241 :
case 1250 :
+ case 1256 :
return 10;
- default : return 8;
+ default : return 0;
}
}
@@ -132,11 +152,19 @@ const char* Vc3_SST_FromCID (int32u CompressionID)
{
switch (CompressionID)
{
+ case 1235 :
+ case 1237 :
+ case 1238 :
+ case 1250 :
+ case 1251 :
+ case 1252 :
+ case 1253 :
+ return Vc3_SST[0];
case 1241 :
case 1242 :
case 1243 :
return Vc3_SST[1];
- default : return Vc3_SST[0];
+ default : return "";
}
}
@@ -149,7 +177,15 @@ const int16u Vc3_SPL_FromCID (int32u CompressionID)
case 1251 :
case 1252 :
return 1280;
- default : return 1920;
+ case 1235 :
+ case 1237 :
+ case 1238 :
+ case 1241 :
+ case 1242 :
+ case 1243 :
+ case 1253 :
+ return 1920;
+ default : return 0;
}
}
@@ -162,10 +198,88 @@ const int16u Vc3_ALPF_PerFrame_FromCID (int32u CompressionID)
case 1251 :
case 1252 :
return 720;
- default : return 1080;
+ case 1235 :
+ case 1237 :
+ case 1238 :
+ case 1241 :
+ case 1242 :
+ case 1243 :
+ case 1253 :
+ return 1080;
+ default : return 0;
}
}
+//---------------------------------------------------------------------------
+const char* Vc3_CLR[8]=
+{
+ "YUV",
+ "RGB",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+};
+
+//---------------------------------------------------------------------------
+const char* Vc3_CLR_FromCID (int32u CompressionID)
+{
+ switch (CompressionID)
+ {
+ case 1235 :
+ case 1237 :
+ case 1238 :
+ case 1241 :
+ case 1242 :
+ case 1243 :
+ case 1250 :
+ case 1251 :
+ case 1252 :
+ case 1253 :
+ case 1258 :
+ case 1259 :
+ case 1260 :
+ return Vc3_CLR[0];
+ case 1256 :
+ return Vc3_CLR[1];
+ default : return "";
+ }
+};
+
+//---------------------------------------------------------------------------
+const char* Vc3_SSC[2]=
+{
+ "4:2:2",
+ "", // 4:4:4
+};
+
+//---------------------------------------------------------------------------
+const char* Vc3_SSC_FromCID (int32u CompressionID)
+{
+ switch (CompressionID)
+ {
+ case 1235 :
+ case 1237 :
+ case 1238 :
+ case 1241 :
+ case 1242 :
+ case 1243 :
+ case 1250 :
+ case 1251 :
+ case 1252 :
+ case 1253 :
+ case 1258 :
+ case 1259 :
+ case 1260 :
+ return Vc3_SSC[0];
+ case 1256 :
+ return Vc3_SSC[1];
+ default : return "";
+ }
+};
+
//***************************************************************************
// Constructor/Destructor
//***************************************************************************
@@ -182,7 +296,6 @@ File_Vc3::File_Vc3()
FrameRate=0;
//Temp
- Data_ToParse=0;
FFC_FirstFrame=(int8u)-1;
}
@@ -197,16 +310,20 @@ void File_Vc3::Streams_Fill()
Stream_Prepare(Stream_Video);
Fill(Stream_Video, 0, Video_Format, "VC-3");
Fill(Stream_Video, 0, Video_BitRate_Mode, "CBR");
- if (FrameRate)
+ if (FrameRate && Vc3_CompressedFrameSize(CID))
Fill(Stream_Video, 0, Video_BitRate, Vc3_CompressedFrameSize(CID)*8*FrameRate, 0);
+ Fill(Stream_Video, 0, Video_Format_Version, __T("Version ")+Ztring::ToZtring(HVN));
if (Vc3_FromCID_IsSupported(CID))
{
- Fill(Stream_Video, 0, Video_Width, Vc3_SPL_FromCID(CID));
- Fill(Stream_Video, 0, Video_Height, Vc3_ALPF_PerFrame_FromCID(CID));
- Fill(Stream_Video, 0, Video_BitDepth, Vc3_SBD_FromCID(CID));
+ if (Vc3_SPL_FromCID(CID))
+ Fill(Stream_Video, 0, Video_Width, Vc3_SPL_FromCID(CID));
+ if (Vc3_ALPF_PerFrame_FromCID(CID))
+ Fill(Stream_Video, 0, Video_Height, Vc3_ALPF_PerFrame_FromCID(CID));
+ if (Vc3_SBD_FromCID(CID))
+ Fill(Stream_Video, 0, Video_BitDepth, Vc3_SBD_FromCID(CID));
Fill(Stream_Video, 0, Video_ScanType, Vc3_SST_FromCID(CID));
- Fill(Stream_Video, 0, Video_ColorSpace, "YUV");
- Fill(Stream_Video, 0, Video_ChromaSubsampling, "4:2:2");
+ Fill(Stream_Video, 0, Video_ColorSpace, Vc3_CLR_FromCID(CID));
+ Fill(Stream_Video, 0, Video_ChromaSubsampling, Vc3_SSC_FromCID(CID));
}
else
{
@@ -214,6 +331,8 @@ void File_Vc3::Streams_Fill()
Fill(Stream_Video, 0, Video_Height, ALPF*(SST?2:1));
Fill(Stream_Video, 0, Video_BitDepth, Vc3_SBD(SBD));
Fill(Stream_Video, 0, Video_ScanType, Vc3_SST[SST]);
+ Fill(Stream_Video, 0, Video_ColorSpace, Vc3_CLR[SSC]);
+ Fill(Stream_Video, 0, Video_ChromaSubsampling, Vc3_SSC[CLR]);
}
if (FFC_FirstFrame!=(int8u)-1)
Fill(Stream_Video, 0, Video_ScanOrder, Vc3_FFC_ScanOrder[FFC_FirstFrame]);
@@ -231,7 +350,7 @@ bool File_Vc3::Synchronize()
|| Buffer[Buffer_Offset+1]!=0x00
|| Buffer[Buffer_Offset+2]!=0x02
|| Buffer[Buffer_Offset+3]!=0x80
- || Buffer[Buffer_Offset+4]!=0x01))
+ || Buffer[Buffer_Offset+4]==0x00))
{
Buffer_Offset+=2;
while (Buffer_Offset<Buffer_Size && Buffer[Buffer_Offset]!=0x00)
@@ -276,7 +395,7 @@ bool File_Vc3::Synched_Test()
|| Buffer[Buffer_Offset+1]!=0x00
|| Buffer[Buffer_Offset+2]!=0x02
|| Buffer[Buffer_Offset+3]!=0x80
- || Buffer[Buffer_Offset+4]!=0x01)
+ || Buffer[Buffer_Offset+4]==0x00)
{
Synched=false;
return true;
@@ -298,7 +417,16 @@ bool File_Vc3::Demux_UnpacketizeContainer_Test()
return false;
int32u CompressionID=BigEndian2int32u(Buffer+Buffer_Offset+0x28);
- int32u Size=Vc3_CompressedFrameSize(CompressionID);
+ size_t Size=Vc3_CompressedFrameSize(CompressionID);
+ if (!Size)
+ {
+ if (!IsSub)
+ {
+ Reject();
+ return false;
+ }
+ Size=Buffer_Size; //Hoping that the packet is complete. TODO: add a flag in the container parser saying if the packet is complete
+ }
Demux_Offset=Buffer_Offset+Size;
if (Demux_Offset>Buffer_Size && File_Offset+Buffer_Size!=File_Size)
@@ -329,7 +457,17 @@ void File_Vc3::Header_Parse()
int32u CompressionID=BigEndian2int32u(Buffer+Buffer_Offset+0x28);
Header_Fill_Code(0, "Frame");
- Header_Fill_Size(Vc3_CompressedFrameSize(CompressionID));
+ size_t Size=Vc3_CompressedFrameSize(CompressionID);
+ if (!Size)
+ {
+ if (!IsSub)
+ {
+ Reject();
+ return;
+ }
+ Size=Buffer_Size; //Hoping that the packet is complete. TODO: add a flag in the container parser saying if the packet is complete
+ }
+ Header_Fill_Size(Size);
}
//---------------------------------------------------------------------------
@@ -344,21 +482,23 @@ void File_Vc3::Data_Parse()
{
Element_Info1(Frame_Count+1);
HeaderPrefix();
- CodingControlA();
- Skip_XX(16, "Reserved");
- ImageGeometry();
- Skip_XX( 5, "Reserved");
- CompressionID();
- CodingControlB();
- Skip_XX( 3, "Reserved");
- TimeCode();
-
- Skip_XX(640-Element_Offset, "ToDo");
+ if (HVN <= 2)
+ {
+ CodingControlA();
+ Skip_XX(16, "Reserved");
+ ImageGeometry();
+ Skip_XX( 5, "Reserved");
+ CompressionID();
+ CodingControlB();
+ Skip_XX( 3, "Reserved");
+ TimeCode();
+
+ Skip_XX(640-Element_Offset, "ToDo");
+ }
Skip_XX(Element_Size-Element_Offset, "Data");
}
FILLING_BEGIN();
- Data_ToParse-=Buffer_Size-(size_t)Buffer_Offset;
Frame_Count++;
if (Frame_Count_NotParsedIncluded!=(int64u)-1)
Frame_Count_NotParsedIncluded++;
@@ -389,12 +529,13 @@ void File_Vc3::HeaderPrefix()
{
//Parsing
Element_Begin1("Header Prefix");
- int64u Data;
- Get_B5 (Data, "Contents");
+ int32u Data;
+ Get_B4 (Data, "Magic number");
+ Get_B1 (HVN, "HVN: Header Version Number");
Element_End0();
FILLING_BEGIN();
- if (Data==0x0000028001LL)
+ if (Data==0x00000280LL)
Accept("VC-3");
else
Reject("VC-3");
@@ -419,8 +560,11 @@ void File_Vc3::CodingControlA()
Mark_1();
Mark_0();
- Mark_0();
- Get_SB ( CRCF, "CRC flag");
+ if (HVN==1)
+ Mark_0();
+ else
+ Skip_SB( "MACF: Macroblock Adaptive Control Flag");
+ Get_SB ( CRCF, "CRC flag");
Mark_0();
Mark_0();
Mark_0();
@@ -488,9 +632,6 @@ void File_Vc3::CompressionID()
FILLING_BEGIN();
CID=Data;
- Data_ToParse=Vc3_CompressedFrameSize(Data);
- if (Data_ToParse==0)
- Reject("VC-3");
FILLING_END();
}
@@ -502,13 +643,29 @@ void File_Vc3::CodingControlB()
BS_Begin();
Info_S1(1, FFE, "Field/Frame Count"); Param_Info1(Vc3_FFE[FFE]);
+ if (HVN==1)
+ {
+ Mark_0();
+ SSC=false;
+ }
+ else
+ {
+ Get_SB (SSC, "SSC: Sub Sampling Control"); Param_Info1(Vc3_SSC[SSC]);
+ }
Mark_0();
Mark_0();
Mark_0();
- Mark_0();
- Mark_0();
- Mark_0();
- Mark_0();
+ if (HVN==1)
+ {
+ Mark_0();
+ Mark_0();
+ Mark_0();
+ CLR=0;
+ }
+ else
+ {
+ Get_S1 (3, CLR, "CLR: Color"); Param_Info1(Vc3_CLR[CLR]);
+ }
BS_End();
Element_End0();
diff --git a/src/thirdparty/MediaInfo/MediaInfo/Video/File_Vc3.h b/src/thirdparty/MediaInfo/MediaInfo/Video/File_Vc3.h
index 336e59279..9627ca6e4 100644
--- a/src/thirdparty/MediaInfo/MediaInfo/Video/File_Vc3.h
+++ b/src/thirdparty/MediaInfo/MediaInfo/Video/File_Vc3.h
@@ -66,14 +66,16 @@ private :
void MacroblockScanIndices();
//Temp
- int64u Data_ToParse;
int32u CID;
bool CRCF;
int16u ALPF;
int16u SPL;
int8u SBD;
int8u FFC_FirstFrame;
+ int8u HVN;
+ int8u CLR;
bool SST;
+ bool SSC;
};
} //NameSpace
diff --git a/src/thirdparty/MediaInfo/MediaInfoLib.vcxproj b/src/thirdparty/MediaInfo/MediaInfoLib.vcxproj
index b0b224343..a824e93c3 100644
--- a/src/thirdparty/MediaInfo/MediaInfoLib.vcxproj
+++ b/src/thirdparty/MediaInfo/MediaInfoLib.vcxproj
@@ -69,28 +69,28 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>.;ThirdParty\base64;ThirdParty\tinyxml2;..\ZenLib;..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_LIB;CURL_STATICLIB;MEDIAINFO_ADVANCED_NO;MEDIAINFO_ARCHIVE_NO;MEDIAINFO_DEMUX_NO;MEDIAINFO_DVDIF_ANALYZE_NO;MEDIAINFO_EVENTS_NO;MEDIAINFO_LIBCURL_NO;MEDIAINFO_LIBMMS_NO;MEDIAINFO_MD5_NO;MEDIAINFO_MINIMAL_YES;MEDIAINFO_MPEGTS_DUPLICATE_NO;MEDIAINFO_N19_NO;MEDIAINFO_OTHERTEXT_NO;MEDIAINFO_TRACE_NO;MEDIAINFO_READTHREAD_NO;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_LIB;CURL_STATICLIB;MEDIAINFO_ADVANCED_NO;MEDIAINFO_ARCHIVE_NO;MEDIAINFO_DEMUX_NO;MEDIAINFO_DVDIF_ANALYZE_NO;MEDIAINFO_EVENTS_NO;MEDIAINFO_LIBCURL_NO;MEDIAINFO_LIBMMS_NO;MEDIAINFO_MD5_NO;MEDIAINFO_MINIMAL_YES;MEDIAINFO_MPEGTS_DUPLICATE_NO;MEDIAINFO_N19_NO;MEDIAINFO_OTHERTEXT_NO;MEDIAINFO_TRACE_NO;MEDIAINFO_READTHREAD_NO;MEDIAINFO_EXPORT_NO;MEDIAINFO_TEXT_YES;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>MediaInfo/PreComp.h</PrecompiledHeaderFile>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalIncludeDirectories>.;ThirdParty\base64;ThirdParty\tinyxml2;..\ZenLib;..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_LIB;CURL_STATICLIB;MEDIAINFO_ADVANCED_NO;MEDIAINFO_ARCHIVE_NO;MEDIAINFO_DEMUX_NO;MEDIAINFO_DVDIF_ANALYZE_NO;MEDIAINFO_EVENTS_NO;MEDIAINFO_LIBCURL_NO;MEDIAINFO_LIBMMS_NO;MEDIAINFO_MD5_NO;MEDIAINFO_MINIMAL_YES;MEDIAINFO_MPEGTS_DUPLICATE_NO;MEDIAINFO_N19_NO;MEDIAINFO_OTHERTEXT_NO;MEDIAINFO_TRACE_NO;MEDIAINFO_READTHREAD_NO;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_LIB;CURL_STATICLIB;MEDIAINFO_ADVANCED_NO;MEDIAINFO_ARCHIVE_NO;MEDIAINFO_DEMUX_NO;MEDIAINFO_DVDIF_ANALYZE_NO;MEDIAINFO_EVENTS_NO;MEDIAINFO_LIBCURL_NO;MEDIAINFO_LIBMMS_NO;MEDIAINFO_MD5_NO;MEDIAINFO_MINIMAL_YES;MEDIAINFO_MPEGTS_DUPLICATE_NO;MEDIAINFO_N19_NO;MEDIAINFO_OTHERTEXT_NO;MEDIAINFO_TRACE_NO;MEDIAINFO_READTHREAD_NO;MEDIAINFO_EXPORT_NO;MEDIAINFO_TEXT_YES;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>MediaInfo/PreComp.h</PrecompiledHeaderFile>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>.;ThirdParty\base64;ThirdParty\tinyxml2;..\ZenLib;..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_LIB;CURL_STATICLIB;MEDIAINFO_ADVANCED_NO;MEDIAINFO_ARCHIVE_NO;MEDIAINFO_DEMUX_NO;MEDIAINFO_DVDIF_ANALYZE_NO;MEDIAINFO_EVENTS_NO;MEDIAINFO_LIBCURL_NO;MEDIAINFO_LIBMMS_NO;MEDIAINFO_MD5_NO;MEDIAINFO_MINIMAL_YES;MEDIAINFO_MPEGTS_DUPLICATE_NO;MEDIAINFO_N19_NO;MEDIAINFO_OTHERTEXT_NO;MEDIAINFO_TRACE_NO;MEDIAINFO_READTHREAD_NO;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_LIB;CURL_STATICLIB;MEDIAINFO_ADVANCED_NO;MEDIAINFO_ARCHIVE_NO;MEDIAINFO_DEMUX_NO;MEDIAINFO_DVDIF_ANALYZE_NO;MEDIAINFO_EVENTS_NO;MEDIAINFO_LIBCURL_NO;MEDIAINFO_LIBMMS_NO;MEDIAINFO_MD5_NO;MEDIAINFO_MINIMAL_YES;MEDIAINFO_MPEGTS_DUPLICATE_NO;MEDIAINFO_N19_NO;MEDIAINFO_OTHERTEXT_NO;MEDIAINFO_TRACE_NO;MEDIAINFO_READTHREAD_NO;MEDIAINFO_EXPORT_NO;MEDIAINFO_TEXT_YES;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>MediaInfo/PreComp.h</PrecompiledHeaderFile>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>.;ThirdParty\base64;ThirdParty\tinyxml2;..\ZenLib;..\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_LIB;CURL_STATICLIB;MEDIAINFO_ADVANCED_NO;MEDIAINFO_ARCHIVE_NO;MEDIAINFO_DEMUX_NO;MEDIAINFO_DVDIF_ANALYZE_NO;MEDIAINFO_EVENTS_NO;MEDIAINFO_LIBCURL_NO;MEDIAINFO_LIBMMS_NO;MEDIAINFO_MD5_NO;MEDIAINFO_MINIMAL_YES;MEDIAINFO_MPEGTS_DUPLICATE_NO;MEDIAINFO_N19_NO;MEDIAINFO_OTHERTEXT_NO;MEDIAINFO_TRACE_NO;MEDIAINFO_READTHREAD_NO;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <PreprocessorDefinitions>_LIB;CURL_STATICLIB;MEDIAINFO_ADVANCED_NO;MEDIAINFO_ARCHIVE_NO;MEDIAINFO_DEMUX_NO;MEDIAINFO_DVDIF_ANALYZE_NO;MEDIAINFO_EVENTS_NO;MEDIAINFO_LIBCURL_NO;MEDIAINFO_LIBMMS_NO;MEDIAINFO_MD5_NO;MEDIAINFO_MINIMAL_YES;MEDIAINFO_MPEGTS_DUPLICATE_NO;MEDIAINFO_N19_NO;MEDIAINFO_OTHERTEXT_NO;MEDIAINFO_TRACE_NO;MEDIAINFO_READTHREAD_NO;MEDIAINFO_EXPORT_NO;MEDIAINFO_TEXT_YES;WIN32_LEAN_AND_MEAN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PrecompiledHeaderFile>MediaInfo/PreComp.h</PrecompiledHeaderFile>
</ClCompile>
</ItemDefinitionGroup>
@@ -138,6 +138,7 @@
<ClInclude Include="MediaInfo\Audio\File_Amv.h" />
<ClInclude Include="MediaInfo\Audio\File_Ape.h" />
<ClInclude Include="MediaInfo\Audio\File_Au.h" />
+ <ClInclude Include="MediaInfo\Audio\File_Caf.h" />
<ClInclude Include="MediaInfo\Audio\File_Celt.h" />
<ClInclude Include="MediaInfo\Audio\File_ChannelGrouping.h" />
<ClInclude Include="MediaInfo\Audio\File_DolbyE.h" />
@@ -184,6 +185,7 @@
<ClInclude Include="MediaInfo\File__MultipleParsing.h" />
<ClInclude Include="MediaInfo\Image\File_ArriRaw.h" />
<ClInclude Include="MediaInfo\Image\File_Bmp.h" />
+ <ClInclude Include="MediaInfo\Image\File_Bpg.h" />
<ClInclude Include="MediaInfo\Image\File_Dds.h" />
<ClInclude Include="MediaInfo\Image\File_Dpx.h" />
<ClInclude Include="MediaInfo\Image\File_Exr.h" />
@@ -208,6 +210,10 @@
<ClInclude Include="MediaInfo\MediaInfo_Internal.h" />
<ClInclude Include="MediaInfo\MediaInfo_Internal_Const.h" />
<ClInclude Include="MediaInfo\Multiple\File__ReferenceFilesHelper.h" />
+ <ClInclude Include="MediaInfo\Multiple\File__ReferenceFilesHelper_Common.h" />
+ <ClInclude Include="MediaInfo\Multiple\File__ReferenceFilesHelper_Resource.h" />
+ <ClInclude Include="MediaInfo\Multiple\File__ReferenceFilesHelper_Sequence.h" />
+ <ClInclude Include="MediaInfo\Multiple\File__ReferenceFilesHelper_Sequence_Common.h" />
<ClInclude Include="MediaInfo\Multiple\File_Ancillary.h" />
<ClInclude Include="MediaInfo\Multiple\File_Bdmv.h" />
<ClInclude Include="MediaInfo\Multiple\File_Cdxa.h" />
@@ -318,6 +324,7 @@
<ClCompile Include="MediaInfo\Audio\File_Amv.cpp" />
<ClCompile Include="MediaInfo\Audio\File_Ape.cpp" />
<ClCompile Include="MediaInfo\Audio\File_Au.cpp" />
+ <ClCompile Include="MediaInfo\Audio\File_Caf.cpp" />
<ClCompile Include="MediaInfo\Audio\File_Celt.cpp" />
<ClCompile Include="MediaInfo\Audio\File_ChannelGrouping.cpp" />
<ClCompile Include="MediaInfo\Audio\File_DolbyE.cpp" />
@@ -368,6 +375,7 @@
<ClCompile Include="MediaInfo\File__MultipleParsing.cpp" />
<ClCompile Include="MediaInfo\Image\File_ArriRaw.cpp" />
<ClCompile Include="MediaInfo\Image\File_Bmp.cpp" />
+ <ClCompile Include="MediaInfo\Image\File_Bpg.cpp" />
<ClCompile Include="MediaInfo\Image\File_Dds.cpp" />
<ClCompile Include="MediaInfo\Image\File_Dpx.cpp" />
<ClCompile Include="MediaInfo\Image\File_Exr.cpp" />
@@ -399,6 +407,8 @@
<ClCompile Include="MediaInfo\Multiple\File_Pmp.cpp" />
<ClCompile Include="MediaInfo\Multiple\File_Ptx.cpp" />
<ClCompile Include="MediaInfo\Multiple\File__ReferenceFilesHelper.cpp" />
+ <ClCompile Include="MediaInfo\Multiple\File__ReferenceFilesHelper_Resource.cpp" />
+ <ClCompile Include="MediaInfo\Multiple\File__ReferenceFilesHelper_Sequence.cpp" />
<ClCompile Include="MediaInfo\PreComp.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
diff --git a/src/thirdparty/MediaInfo/MediaInfoLib.vcxproj.filters b/src/thirdparty/MediaInfo/MediaInfoLib.vcxproj.filters
index 7547f8c95..2e1a09366 100644
--- a/src/thirdparty/MediaInfo/MediaInfoLib.vcxproj.filters
+++ b/src/thirdparty/MediaInfo/MediaInfoLib.vcxproj.filters
@@ -197,6 +197,9 @@
<ClInclude Include="MediaInfo\Image\File_Bmp.h">
<Filter>Header Files\Image</Filter>
</ClInclude>
+ <ClInclude Include="MediaInfo\Image\File_Bpg.h">
+ <Filter>Header Files\Image</Filter>
+ </ClInclude>
<ClInclude Include="MediaInfo\Image\File_Dds.h">
<Filter>Header Files\Image</Filter>
</ClInclude>
@@ -233,6 +236,18 @@
<ClInclude Include="MediaInfo\Multiple\File__ReferenceFilesHelper.h">
<Filter>Header Files\Multiple</Filter>
</ClInclude>
+ <ClInclude Include="MediaInfo\Multiple\File__ReferenceFilesHelper_Common.h">
+ <Filter>Header Files\Multiple</Filter>
+ </ClInclude>
+ <ClInclude Include="MediaInfo\Multiple\File__ReferenceFilesHelper_Resource.h">
+ <Filter>Header Files\Multiple</Filter>
+ </ClInclude>
+ <ClInclude Include="MediaInfo\Multiple\File__ReferenceFilesHelper_Sequence.h">
+ <Filter>Header Files\Multiple</Filter>
+ </ClInclude>
+ <ClInclude Include="MediaInfo\Multiple\File__ReferenceFilesHelper_Sequence_Common.h">
+ <Filter>Header Files\Multiple</Filter>
+ </ClInclude>
<ClInclude Include="MediaInfo\Multiple\File_Ancillary.h">
<Filter>Header Files\Multiple</Filter>
</ClInclude>
@@ -500,6 +515,9 @@
<ClInclude Include="MediaInfo\Audio\File_Au.h">
<Filter>Header Files\Audio</Filter>
</ClInclude>
+ <ClInclude Include="MediaInfo\Audio\File_Caf.h">
+ <Filter>Header Files\Audio</Filter>
+ </ClInclude>
<ClInclude Include="MediaInfo\Audio\File_Celt.h">
<Filter>Header Files\Audio</Filter>
</ClInclude>
@@ -775,6 +793,9 @@
<ClCompile Include="MediaInfo\Image\File_Bmp.cpp">
<Filter>Source Files\Image</Filter>
</ClCompile>
+ <ClCompile Include="MediaInfo\Image\File_Bpg.cpp">
+ <Filter>Source Files\Image</Filter>
+ </ClCompile>
<ClCompile Include="MediaInfo\Image\File_Dds.cpp">
<Filter>Source Files\Image</Filter>
</ClCompile>
@@ -811,6 +832,12 @@
<ClCompile Include="MediaInfo\Multiple\File__ReferenceFilesHelper.cpp">
<Filter>Source Files\Multiple</Filter>
</ClCompile>
+ <ClCompile Include="MediaInfo\Multiple\File__ReferenceFilesHelper_Resource.cpp">
+ <Filter>Source Files\Multiple</Filter>
+ </ClCompile>
+ <ClCompile Include="MediaInfo\Multiple\File__ReferenceFilesHelper_Sequence.cpp">
+ <Filter>Source Files\Multiple</Filter>
+ </ClCompile>
<ClCompile Include="MediaInfo\Multiple\File_Ancillary.cpp">
<Filter>Source Files\Multiple</Filter>
</ClCompile>
@@ -1111,6 +1138,9 @@
<ClCompile Include="MediaInfo\Audio\File_Au.cpp">
<Filter>Source Files\Audio</Filter>
</ClCompile>
+ <ClCompile Include="MediaInfo\Audio\File_Caf.cpp">
+ <Filter>Source Files\Audio</Filter>
+ </ClCompile>
<ClCompile Include="MediaInfo\Audio\File_Celt.cpp">
<Filter>Source Files\Audio</Filter>
</ClCompile>
diff --git a/src/thirdparty/SoundTouch/include/STTypes.h b/src/thirdparty/SoundTouch/include/STTypes.h
index a961eb2e7..238ebbc1a 100644
--- a/src/thirdparty/SoundTouch/include/STTypes.h
+++ b/src/thirdparty/SoundTouch/include/STTypes.h
@@ -8,10 +8,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2014-04-06 15:57:21 +0000 (Sun, 06 Apr 2014) $
+// Last changed : $Date: 2015-05-18 15:25:07 +0000 (Mon, 18 May 2015) $
// File revision : $Revision: 3 $
//
-// $Id: STTypes.h 195 2014-04-06 15:57:21Z oparviai $
+// $Id: STTypes.h 215 2015-05-18 15:25:07Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -75,7 +75,7 @@ namespace soundtouch
/// runtime performance so recommendation is to keep this off.
// #define USE_MULTICH_ALWAYS
- #if (defined(__SOFTFP__))
+ #if (defined(__SOFTFP__) && defined(ANDROID))
// For Android compilation: Force use of Integer samples in case that
// compilation uses soft-floating point emulation - soft-fp is way too slow
#undef SOUNDTOUCH_FLOAT_SAMPLES
@@ -176,6 +176,7 @@ namespace soundtouch
#else
// use c++ standard exceptions
#include <stdexcept>
+ #include <string>
#define ST_THROW_RT_ERROR(x) {throw std::runtime_error(x);}
#endif
diff --git a/src/thirdparty/SoundTouch/include/SoundTouch.h b/src/thirdparty/SoundTouch/include/SoundTouch.h
index 02fde4937..e4a0b4165 100644
--- a/src/thirdparty/SoundTouch/include/SoundTouch.h
+++ b/src/thirdparty/SoundTouch/include/SoundTouch.h
@@ -41,10 +41,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2014-04-06 15:57:21 +0000 (Sun, 06 Apr 2014) $
+// Last changed : $Date: 2015-05-18 15:28:41 +0000 (Mon, 18 May 2015) $
// File revision : $Revision: 4 $
//
-// $Id: SoundTouch.h 195 2014-04-06 15:57:21Z oparviai $
+// $Id: SoundTouch.h 216 2015-05-18 15:28:41Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -79,10 +79,10 @@ namespace soundtouch
{
/// Soundtouch library version string
-#define SOUNDTOUCH_VERSION "1.8.0"
+#define SOUNDTOUCH_VERSION "1.9.0"
/// SoundTouch library version id
-#define SOUNDTOUCH_VERSION_ID (10800)
+#define SOUNDTOUCH_VERSION_ID (10900)
//
// Available setting IDs for the 'setSetting' & 'get_setting' functions:
diff --git a/src/thirdparty/SoundTouch/source/BPMDetect.cpp b/src/thirdparty/SoundTouch/source/BPMDetect.cpp
index be2478388..b77898ac8 100644
--- a/src/thirdparty/SoundTouch/source/BPMDetect.cpp
+++ b/src/thirdparty/SoundTouch/source/BPMDetect.cpp
@@ -26,10 +26,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2012-08-30 19:45:25 +0000 (Thu, 30 Aug 2012) $
+// Last changed : $Date: 2015-02-21 21:24:29 +0000 (Sat, 21 Feb 2015) $
// File revision : $Revision: 4 $
//
-// $Id: BPMDetect.cpp 149 2012-08-30 19:45:25Z oparviai $
+// $Id: BPMDetect.cpp 202 2015-02-21 21:24:29Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -226,6 +226,7 @@ void BPMDetect::updateXCorr(int process_samples)
assert(buffer->numSamples() >= (uint)(process_samples + windowLen));
pBuffer = buffer->ptrBegin();
+ #pragma omp parallel for
for (offs = windowStart; offs < windowLen; offs ++)
{
LONG_SAMPLETYPE sum;
diff --git a/src/thirdparty/SoundTouch/source/FIRFilter.cpp b/src/thirdparty/SoundTouch/source/FIRFilter.cpp
index abdf83038..6a6f46384 100644
--- a/src/thirdparty/SoundTouch/source/FIRFilter.cpp
+++ b/src/thirdparty/SoundTouch/source/FIRFilter.cpp
@@ -11,10 +11,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2014-10-08 15:26:57 +0000 (Wed, 08 Oct 2014) $
+// Last changed : $Date: 2015-02-21 21:24:29 +0000 (Sat, 21 Feb 2015) $
// File revision : $Revision: 4 $
//
-// $Id: FIRFilter.cpp 201 2014-10-08 15:26:57Z oparviai $
+// $Id: FIRFilter.cpp 202 2015-02-21 21:24:29Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -61,22 +61,18 @@ FIRFilter::FIRFilter()
length = 0;
lengthDiv8 = 0;
filterCoeffs = NULL;
- sum = NULL;
- sumsize = 0;
}
FIRFilter::~FIRFilter()
{
delete[] filterCoeffs;
- delete[] sum;
}
// Usual C-version of the filter routine for stereo sound
uint FIRFilter::evaluateFilterStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples) const
{
- uint i, j, end;
- LONG_SAMPLETYPE suml, sumr;
+ int j, end;
#ifdef SOUNDTOUCH_FLOAT_SAMPLES
// when using floating point samples, use a scaler instead of a divider
// because division is much slower operation than multiplying.
@@ -90,9 +86,12 @@ uint FIRFilter::evaluateFilterStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, ui
end = 2 * (numSamples - length);
+ #pragma omp parallel for
for (j = 0; j < end; j += 2)
{
const SAMPLETYPE *ptr;
+ LONG_SAMPLETYPE suml, sumr;
+ uint i;
suml = sumr = 0;
ptr = src + j;
@@ -133,28 +132,31 @@ uint FIRFilter::evaluateFilterStereo(SAMPLETYPE *dest, const SAMPLETYPE *src, ui
// Usual C-version of the filter routine for mono sound
uint FIRFilter::evaluateFilterMono(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples) const
{
- uint i, j, end;
- LONG_SAMPLETYPE sum;
+ int j, end;
#ifdef SOUNDTOUCH_FLOAT_SAMPLES
// when using floating point samples, use a scaler instead of a divider
// because division is much slower operation than multiplying.
double dScaler = 1.0 / (double)resultDivider;
#endif
-
assert(length != 0);
end = numSamples - length;
+ #pragma omp parallel for
for (j = 0; j < end; j ++)
{
+ const SAMPLETYPE *pSrc = src + j;
+ LONG_SAMPLETYPE sum;
+ uint i;
+
sum = 0;
for (i = 0; i < length; i += 4)
{
// loop is unrolled by factor of 4 here for efficiency
- sum += src[i + 0] * filterCoeffs[i + 0] +
- src[i + 1] * filterCoeffs[i + 1] +
- src[i + 2] * filterCoeffs[i + 2] +
- src[i + 3] * filterCoeffs[i + 3];
+ sum += pSrc[i + 0] * filterCoeffs[i + 0] +
+ pSrc[i + 1] * filterCoeffs[i + 1] +
+ pSrc[i + 2] * filterCoeffs[i + 2] +
+ pSrc[i + 3] * filterCoeffs[i + 3];
}
#ifdef SOUNDTOUCH_INTEGER_SAMPLES
sum >>= resultDivFactor;
@@ -164,7 +166,6 @@ uint FIRFilter::evaluateFilterMono(SAMPLETYPE *dest, const SAMPLETYPE *src, uint
sum *= dScaler;
#endif // SOUNDTOUCH_INTEGER_SAMPLES
dest[j] = (SAMPLETYPE)sum;
- src ++;
}
return end;
}
@@ -172,15 +173,7 @@ uint FIRFilter::evaluateFilterMono(SAMPLETYPE *dest, const SAMPLETYPE *src, uint
uint FIRFilter::evaluateFilterMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, uint numSamples, uint numChannels)
{
- uint i, j, end, c;
-
- if (sumsize < numChannels)
- {
- // allocate large enough array for keeping sums
- sumsize = numChannels;
- delete[] sum;
- sum = new LONG_SAMPLETYPE[numChannels];
- }
+ int j, end;
#ifdef SOUNDTOUCH_FLOAT_SAMPLES
// when using floating point samples, use a scaler instead of a divider
@@ -192,17 +185,21 @@ uint FIRFilter::evaluateFilterMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, uin
assert(src != NULL);
assert(dest != NULL);
assert(filterCoeffs != NULL);
+ assert(numChannels < 16);
end = numChannels * (numSamples - length);
- for (c = 0; c < numChannels; c ++)
- {
- sum[c] = 0;
- }
-
+ #pragma omp parallel for
for (j = 0; j < end; j += numChannels)
{
const SAMPLETYPE *ptr;
+ LONG_SAMPLETYPE sums[16];
+ uint c, i;
+
+ for (c = 0; c < numChannels; c ++)
+ {
+ sums[c] = 0;
+ }
ptr = src + j;
@@ -211,7 +208,7 @@ uint FIRFilter::evaluateFilterMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, uin
SAMPLETYPE coef=filterCoeffs[i];
for (c = 0; c < numChannels; c ++)
{
- sum[c] += ptr[0] * coef;
+ sums[c] += ptr[0] * coef;
ptr ++;
}
}
@@ -219,13 +216,11 @@ uint FIRFilter::evaluateFilterMulti(SAMPLETYPE *dest, const SAMPLETYPE *src, uin
for (c = 0; c < numChannels; c ++)
{
#ifdef SOUNDTOUCH_INTEGER_SAMPLES
- sum[c] >>= resultDivFactor;
+ sums[c] >>= resultDivFactor;
#else
- sum[c] *= dScaler;
+ sums[c] *= dScaler;
#endif // SOUNDTOUCH_INTEGER_SAMPLES
- *dest = (SAMPLETYPE)sum[c];
- dest++;
- sum[c] = 0;
+ dest[j+c] = (SAMPLETYPE)sums[c];
}
}
return numSamples - length;
diff --git a/src/thirdparty/SoundTouch/source/FIRFilter.h b/src/thirdparty/SoundTouch/source/FIRFilter.h
index 2baa41e67..ce719629e 100644
--- a/src/thirdparty/SoundTouch/source/FIRFilter.h
+++ b/src/thirdparty/SoundTouch/source/FIRFilter.h
@@ -11,10 +11,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2014-10-08 15:26:57 +0000 (Wed, 08 Oct 2014) $
+// Last changed : $Date: 2015-02-21 21:24:29 +0000 (Sat, 21 Feb 2015) $
// File revision : $Revision: 4 $
//
-// $Id: FIRFilter.h 201 2014-10-08 15:26:57Z oparviai $
+// $Id: FIRFilter.h 202 2015-02-21 21:24:29Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -65,10 +65,6 @@ protected:
// Memory for filter coefficients
SAMPLETYPE *filterCoeffs;
- // Memory for keeping temporary sums in multichannel processing
- LONG_SAMPLETYPE *sum;
- uint sumsize;
-
virtual uint evaluateFilterStereo(SAMPLETYPE *dest,
const SAMPLETYPE *src,
uint numSamples) const;
diff --git a/src/thirdparty/SoundTouch/source/PeakFinder.cpp b/src/thirdparty/SoundTouch/source/PeakFinder.cpp
index 0426b4a67..eadf5314e 100644
--- a/src/thirdparty/SoundTouch/source/PeakFinder.cpp
+++ b/src/thirdparty/SoundTouch/source/PeakFinder.cpp
@@ -11,10 +11,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2012-12-28 19:52:47 +0000 (Fri, 28 Dec 2012) $
+// Last changed : $Date: 2015-05-18 15:22:02 +0000 (Mon, 18 May 2015) $
// File revision : $Revision: 4 $
//
-// $Id: PeakFinder.cpp 164 2012-12-28 19:52:47Z oparviai $
+// $Id: PeakFinder.cpp 213 2015-05-18 15:22:02Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -192,11 +192,21 @@ double PeakFinder::getPeakCenter(const float *data, int peakpos) const
gp1 = findGround(data, peakpos, -1);
gp2 = findGround(data, peakpos, 1);
- groundLevel = 0.5f * (data[gp1] + data[gp2]);
peakLevel = data[peakpos];
- // calculate 70%-level of the peak
- cutLevel = 0.70f * peakLevel + 0.30f * groundLevel;
+ if (gp1 == gp2)
+ {
+ // avoid rounding errors when all are equal
+ assert(gp1 == peakpos);
+ cutLevel = groundLevel = peakLevel;
+ } else {
+ // get average of the ground levels
+ groundLevel = 0.5f * (data[gp1] + data[gp2]);
+
+ // calculate 70%-level of the peak
+ cutLevel = 0.70f * peakLevel + 0.30f * groundLevel;
+ }
+
// find mid-level crossings
crosspos1 = findCrossingLevel(data, cutLevel, peakpos, -1);
crosspos2 = findCrossingLevel(data, cutLevel, peakpos, 1);
diff --git a/src/thirdparty/SoundTouch/source/TDStretch.cpp b/src/thirdparty/SoundTouch/source/TDStretch.cpp
index e110413be..9f9f40aa4 100644
--- a/src/thirdparty/SoundTouch/source/TDStretch.cpp
+++ b/src/thirdparty/SoundTouch/source/TDStretch.cpp
@@ -13,10 +13,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2014-04-06 15:57:21 +0000 (Sun, 06 Apr 2014) $
+// Last changed : $Date: 2015-02-22 15:07:12 +0000 (Sun, 22 Feb 2015) $
// File revision : $Revision: 1.12 $
//
-// $Id: TDStretch.cpp 195 2014-04-06 15:57:21Z oparviai $
+// $Id: TDStretch.cpp 205 2015-02-22 15:07:12Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -292,9 +292,9 @@ inline void TDStretch::overlap(SAMPLETYPE *pOutput, const SAMPLETYPE *pInput, ui
int TDStretch::seekBestOverlapPositionFull(const SAMPLETYPE *refPos)
{
int bestOffs;
- double bestCorr, corr;
- double norm;
+ double bestCorr;
int i;
+ double norm;
bestCorr = FLT_MIN;
bestOffs = 0;
@@ -302,14 +302,22 @@ int TDStretch::seekBestOverlapPositionFull(const SAMPLETYPE *refPos)
// Scans for the best correlation value by testing each possible position
// over the permitted range.
bestCorr = calcCrossCorr(refPos, pMidBuffer, norm);
+
+ #pragma omp parallel for
for (i = 1; i < seekLength; i ++)
{
- // Calculates correlation value for the mixing position corresponding
- // to 'i'. Now call "calcCrossCorrAccumulate" that is otherwise same as
- // "calcCrossCorr", but saves time by reusing & updating previously stored
+ double corr;
+ // Calculates correlation value for the mixing position corresponding to 'i'
+#ifdef _OPENMP
+ // in parallel OpenMP mode, can't use norm accumulator version as parallel executor won't
+ // iterate the loop in sequential order
+ corr = calcCrossCorr(refPos + channels * i, pMidBuffer, norm);
+#else
+ // In non-parallel version call "calcCrossCorrAccumulate" that is otherwise same
+ // as "calcCrossCorr", but saves time by reusing & updating previously stored
// "norm" value
corr = calcCrossCorrAccumulate(refPos + channels * i, pMidBuffer, norm);
-
+#endif
// heuristic rule to slightly favour values close to mid of the range
double tmp = (double)(2 * i - seekLength) / (double)seekLength;
corr = ((corr + 0.1) * (1.0 - 0.25 * tmp * tmp));
@@ -317,8 +325,15 @@ int TDStretch::seekBestOverlapPositionFull(const SAMPLETYPE *refPos)
// Checks for the highest correlation value
if (corr > bestCorr)
{
- bestCorr = corr;
- bestOffs = i;
+ // For optimal performance, enter critical section only in case that best value found.
+ // in such case repeat 'if' condition as it's possible that parallel execution may have
+ // updated the bestCorr value in the mean time
+ #pragma omp critical
+ if (corr > bestCorr)
+ {
+ bestCorr = corr;
+ bestOffs = i;
+ }
}
}
// clear cross correlation routine state if necessary (is so e.g. in MMX routines).
@@ -881,9 +896,10 @@ void TDStretch::calculateOverlapLength(int overlapInMsec)
/// Calculate cross-correlation
-double TDStretch::calcCrossCorr(const float *mixingPos, const float *compare, double &norm) const
+double TDStretch::calcCrossCorr(const float *mixingPos, const float *compare, double &anorm) const
{
double corr;
+ double norm;
int i;
corr = norm = 0;
@@ -905,6 +921,7 @@ double TDStretch::calcCrossCorr(const float *mixingPos, const float *compare, do
mixingPos[i + 3] * mixingPos[i + 3];
}
+ anorm = norm;
return corr / sqrt((norm < 1e-9 ? 1.0 : norm));
}
diff --git a/src/thirdparty/SoundTouch/source/mmx_optimized.cpp b/src/thirdparty/SoundTouch/source/mmx_optimized.cpp
index ab8dda821..c4ff80ed6 100644
--- a/src/thirdparty/SoundTouch/source/mmx_optimized.cpp
+++ b/src/thirdparty/SoundTouch/source/mmx_optimized.cpp
@@ -20,10 +20,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2014-01-07 18:25:40 +0000 (Tue, 07 Jan 2014) $
+// Last changed : $Date: 2015-02-22 15:10:38 +0000 (Sun, 22 Feb 2015) $
// File revision : $Revision: 4 $
//
-// $Id: mmx_optimized.cpp 184 2014-01-07 18:25:40Z oparviai $
+// $Id: mmx_optimized.cpp 206 2015-02-22 15:10:38Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -287,6 +287,7 @@ void TDStretchMMX::overlapStereo(short *output, const short *input) const
FIRFilterMMX::FIRFilterMMX() : FIRFilter()
{
+ filterCoeffsAlign = NULL;
filterCoeffsUnalign = NULL;
}
diff --git a/src/thirdparty/SoundTouch/source/sse_optimized.cpp b/src/thirdparty/SoundTouch/source/sse_optimized.cpp
index a2124696a..962dff056 100644
--- a/src/thirdparty/SoundTouch/source/sse_optimized.cpp
+++ b/src/thirdparty/SoundTouch/source/sse_optimized.cpp
@@ -23,10 +23,10 @@
///
////////////////////////////////////////////////////////////////////////////////
//
-// Last changed : $Date: 2014-01-07 18:25:40 +0000 (Tue, 07 Jan 2014) $
+// Last changed : $Date: 2015-02-21 21:24:29 +0000 (Sat, 21 Feb 2015) $
// File revision : $Revision: 4 $
//
-// $Id: sse_optimized.cpp 184 2014-01-07 18:25:40Z oparviai $
+// $Id: sse_optimized.cpp 202 2015-02-21 21:24:29Z oparviai $
//
////////////////////////////////////////////////////////////////////////////////
//
@@ -71,7 +71,7 @@ using namespace soundtouch;
#include <math.h>
// Calculates cross correlation of two buffers
-double TDStretchSSE::calcCrossCorr(const float *pV1, const float *pV2, double &norm) const
+double TDStretchSSE::calcCrossCorr(const float *pV1, const float *pV2, double &anorm) const
{
int i;
const float *pVec1;
@@ -141,7 +141,8 @@ double TDStretchSSE::calcCrossCorr(const float *pV1, const float *pV2, double &n
// return value = vSum[0] + vSum[1] + vSum[2] + vSum[3]
float *pvNorm = (float*)&vNorm;
- norm = (pvNorm[0] + pvNorm[1] + pvNorm[2] + pvNorm[3]);
+ float norm = (pvNorm[0] + pvNorm[1] + pvNorm[2] + pvNorm[3]);
+ anorm = norm;
float *pvSum = (float*)&vSum;
return (double)(pvSum[0] + pvSum[1] + pvSum[2] + pvSum[3]) / sqrt(norm < 1e-9 ? 1.0 : norm);
@@ -258,14 +259,17 @@ uint FIRFilterSSE::evaluateFilterStereo(float *dest, const float *source, uint n
assert(((ulongptr)filterCoeffsAlign) % 16 == 0);
// filter is evaluated for two stereo samples with each iteration, thus use of 'j += 2'
+ #pragma omp parallel for
for (j = 0; j < count; j += 2)
{
const float *pSrc;
+ float *pDest;
const __m128 *pFil;
__m128 sum1, sum2;
uint i;
- pSrc = (const float*)source; // source audio data
+ pSrc = (const float*)source + j * 2; // source audio data
+ pDest = dest + j * 2; // destination audio data
pFil = (const __m128*)filterCoeffsAlign; // filter coefficients. NOTE: Assumes coefficients
// are aligned to 16-byte boundary
sum1 = sum2 = _mm_setzero_ps();
@@ -298,12 +302,10 @@ uint FIRFilterSSE::evaluateFilterStereo(float *dest, const float *source, uint n
// to sum the two hi- and lo-floats of these registers together.
// post-shuffle & add the filtered values and store to dest.
- _mm_storeu_ps(dest, _mm_add_ps(
+ _mm_storeu_ps(pDest, _mm_add_ps(
_mm_shuffle_ps(sum1, sum2, _MM_SHUFFLE(1,0,3,2)), // s2_1 s2_0 s1_3 s1_2
_mm_shuffle_ps(sum1, sum2, _MM_SHUFFLE(3,2,1,0)) // s2_3 s2_2 s1_1 s1_0
));
- source += 4;
- dest += 4;
}
// Ideas for further improvement:
diff --git a/src/thirdparty/ZenLib/ZenLib/Conf.h b/src/thirdparty/ZenLib/ZenLib/Conf.h
index 3eee0543d..b1d67c54e 100644
--- a/src/thirdparty/ZenLib/ZenLib/Conf.h
+++ b/src/thirdparty/ZenLib/ZenLib/Conf.h
@@ -178,7 +178,11 @@
//---------------------------------------------------------------------------
//(-1) is known to be the MAX of an unsigned int but GCC complains about it
-#include <new>
+#ifdef __cplusplus
+ #include <new> //for size_t
+#else /* __cplusplus */
+ #include <stddef.h> //for size_t
+#endif /* __cplusplus */
#include <cstring> //size_t
namespace ZenLib
{
diff --git a/src/thirdparty/ZenLib/ZenLib/Dir.cpp b/src/thirdparty/ZenLib/ZenLib/Dir.cpp
index 3eac23825..dca9dc7c8 100644
--- a/src/thirdparty/ZenLib/ZenLib/Dir.cpp
+++ b/src/thirdparty/ZenLib/ZenLib/Dir.cpp
@@ -45,6 +45,97 @@
namespace ZenLib
{
+//---------------------------------------------------------------------------
+// Debug
+#ifdef ZENLIB_DEBUG
+ #include <stdio.h>
+ #include <windows.h>
+ namespace ZenLib_Dir_Debug
+ {
+ FILE* F;
+ std::string Debug;
+ SYSTEMTIME st_In;
+
+ void Debug_Open(bool Out)
+ {
+ F=fopen("C:\\Temp\\ZenLib_Debug.txt", "a+t");
+ Debug.clear();
+ SYSTEMTIME st;
+ GetLocalTime( &st );
+
+ char Duration[100];
+ if (Out)
+ {
+ FILETIME ft_In;
+ if (SystemTimeToFileTime(&st_In, &ft_In))
+ {
+ FILETIME ft_Out;
+ if (SystemTimeToFileTime(&st, &ft_Out))
+ {
+ ULARGE_INTEGER UI_In;
+ UI_In.HighPart=ft_In.dwHighDateTime;
+ UI_In.LowPart=ft_In.dwLowDateTime;
+
+ ULARGE_INTEGER UI_Out;
+ UI_Out.HighPart=ft_Out.dwHighDateTime;
+ UI_Out.LowPart=ft_Out.dwLowDateTime;
+
+ ULARGE_INTEGER UI_Diff;
+ UI_Diff.QuadPart=UI_Out.QuadPart-UI_In.QuadPart;
+
+ FILETIME ft_Diff;
+ ft_Diff.dwHighDateTime=UI_Diff.HighPart;
+ ft_Diff.dwLowDateTime=UI_Diff.LowPart;
+
+ SYSTEMTIME st_Diff;
+ if (FileTimeToSystemTime(&ft_Diff, &st_Diff))
+ {
+ sprintf(Duration, "%02hd:%02hd:%02hd.%03hd", st_Diff.wHour, st_Diff.wMinute, st_Diff.wSecond, st_Diff.wMilliseconds);
+ }
+ else
+ strcpy(Duration, " ");
+ }
+ else
+ strcpy(Duration, " ");
+
+ }
+ else
+ strcpy(Duration, " ");
+ }
+ else
+ {
+ st_In=st;
+ strcpy(Duration, " ");
+ }
+
+ fprintf(F," %02hd:%02hd:%02hd.%03hd %s", st.wHour, st.wMinute, st.wSecond, st.wMilliseconds, Duration);
+ }
+
+ void Debug_Close()
+ {
+ Debug += "\r\n";
+ fwrite(Debug.c_str(), Debug.size(), 1, F); \
+ fclose(F);
+ }
+ }
+ using namespace ZenLib_Dir_Debug;
+
+ #define ZENLIB_DEBUG1(_NAME,_TOAPPEND) \
+ Debug_Open(false); \
+ Debug+=", ";Debug+=_NAME; \
+ _TOAPPEND; \
+ Debug_Close();
+
+ #define ZENLIB_DEBUG2(_NAME,_TOAPPEND) \
+ Debug_Open(true); \
+ Debug+=", ";Debug+=_NAME; \
+ _TOAPPEND; \
+ Debug_Close();
+#else // ZENLIB_DEBUG
+ #define ZENLIB_DEBUG1(_NAME,_TOAPPEND)
+ #define ZENLIB_DEBUG2(_NAME,_TOAPPEND)
+#endif // ZENLIB_DEBUG
+
//***************************************************************************
// Constructor/Destructor
//***************************************************************************
@@ -56,6 +147,9 @@ namespace ZenLib
ZtringList Dir::GetAllFileNames(const Ztring &Dir_Name_, dirlist_t Options)
{
+ ZENLIB_DEBUG1( "Dir GetAllFileNames",
+ Debug+=", Dir_Name="; Debug+=Ztring(Dir_Name_).To_UTF8(); Debug+=", Options="; Debug +=Ztring::ToZtring(Options).To_UTF8())
+
ZtringList ToReturn;
Ztring Dir_Name=Dir_Name_;
@@ -117,7 +211,12 @@ ZtringList Dir::GetAllFileNames(const Ztring &Dir_Name_, dirlist_t Options)
#endif //UNICODE
if (hFind==INVALID_HANDLE_VALUE)
+ {
+ ZENLIB_DEBUG2( "Dir GetAllFileNames",
+ Debug+=", returns with files count="; Debug +=Ztring::ToZtring(ToReturn.size()).To_UTF8())
+
return ZtringList();
+ }
BOOL ReturnValue;
do
@@ -210,6 +309,9 @@ ZtringList Dir::GetAllFileNames(const Ztring &Dir_Name_, dirlist_t Options)
#endif
#endif //ZENLIB_USEWX
+ ZENLIB_DEBUG2( "Dir GetAllFileNames",
+ Debug+=", files count="; Debug +=Ztring::ToZtring(ToReturn.size()).To_UTF8())
+
return ToReturn;
}
@@ -220,6 +322,9 @@ ZtringList Dir::GetAllFileNames(const Ztring &Dir_Name_, dirlist_t Options)
//---------------------------------------------------------------------------
bool Dir::Exists(const Ztring &File_Name)
{
+ ZENLIB_DEBUG1( "Dir Exists",
+ Debug+=", Dir_Name="; Debug+=Ztring(File_Name).To_UTF8();)
+
#ifdef ZENLIB_USEWX
wxFileName FN(File_Name.c_str());
return FN.DirExists();
@@ -230,6 +335,10 @@ bool Dir::Exists(const Ztring &File_Name)
#else
DWORD FileAttributes=GetFileAttributes(File_Name.c_str());
#endif //UNICODE
+
+ ZENLIB_DEBUG2( "Dir Exists",
+ Debug+=", returns "; Debug +=Ztring::ToZtring(((FileAttributes!=INVALID_FILE_ATTRIBUTES) && (FileAttributes&FILE_ATTRIBUTE_DIRECTORY))?1:0).To_UTF8())
+
return ((FileAttributes!=INVALID_FILE_ATTRIBUTES) && (FileAttributes&FILE_ATTRIBUTE_DIRECTORY));
#else //WINDOWS
struct stat buffer;
@@ -263,6 +372,161 @@ bool Dir::Create(const Ztring &File_Name)
}
//***************************************************************************
+// GetAllFileNames
+//***************************************************************************
+
+#ifdef WINDOWS
+class GetAllFileNames_Private
+{
+public:
+ Ztring Dir_Name;
+ Ztring Path;
+ Dir::dirlist_t Options;
+ HANDLE hFind;
+ #ifdef UNICODE
+ WIN32_FIND_DATAW FindFileDataW;
+ #else
+ WIN32_FIND_DATA FindFileData;
+ #endif //UNICODE
+
+ GetAllFileNames_Private()
+ : hFind(INVALID_HANDLE_VALUE)
+ {
+ }
+};
+
+//---------------------------------------------------------------------------
+GetAllFileNames::GetAllFileNames()
+ : p(NULL)
+{
+}
+
+//---------------------------------------------------------------------------
+GetAllFileNames::~GetAllFileNames()
+{
+ Close();
+}
+
+//---------------------------------------------------------------------------
+void GetAllFileNames::Start (const Ztring &Dir_Name_, Dir::dirlist_t Options_)
+{
+ ZENLIB_DEBUG1( "GetAllFileNames Start",
+ Debug+=", Dir_Name="; Debug+=Ztring(Dir_Name_).To_UTF8(); Debug+=", Options="; Debug +=Ztring::ToZtring(Options_).To_UTF8())
+
+ delete p; p=new GetAllFileNames_Private;
+ p->Dir_Name=Dir_Name_;
+ p->Options=Options_;
+
+ #ifdef WINDOWS
+ //Is a dir?
+ if (Dir::Exists(p->Dir_Name))
+ p->Dir_Name+=__T("\\*");
+
+ //Path
+ p->Path=FileName::Path_Get(p->Dir_Name);
+ if (p->Path.empty())
+ {
+ DWORD Path_Size=GetFullPathName(p->Dir_Name.c_str(), 0, NULL, NULL);
+ Char* PathTemp=new Char[Path_Size+1];
+ if (GetFullPathName(p->Dir_Name.c_str(), Path_Size+1, PathTemp, NULL))
+ p->Path=FileName::Path_Get(PathTemp);
+ delete [] PathTemp;
+ }
+ #else //WINDOWS
+ #endif
+
+ ZENLIB_DEBUG2( "GetAllFileNames Start",
+ )
+}
+
+bool GetAllFileNames::Next (Ztring& Name)
+{
+ if (!p)
+ return false;
+
+ ZENLIB_DEBUG1( "GetAllFileNames Next",
+ Debug+=", Dir_Name="; Debug+=Ztring(p->Dir_Name).To_UTF8())
+
+ #ifdef WINDOWS
+ for (;;)
+ {
+ if (p->hFind==INVALID_HANDLE_VALUE)
+ {
+ #ifdef UNICODE
+ p->hFind=FindFirstFileW(p->Dir_Name.c_str(), &p->FindFileDataW);
+ #else
+ p->hFind=FindFirstFile(p->Dir_Name.c_str(), &p->FindFileData);
+ #endif //UNICODE
+
+ if (p->hFind==INVALID_HANDLE_VALUE)
+ break;
+ }
+ else
+ {
+ BOOL ReturnValue;
+ #ifdef UNICODE
+ ReturnValue=FindNextFileW(p->hFind, &p->FindFileDataW);
+ #else
+ ReturnValue=FindNextFile(p->hFind, &p->FindFileData);
+ #endif //UNICODE
+ if (!ReturnValue)
+ break;
+ }
+
+ #ifdef UNICODE
+ Ztring File_Name(p->FindFileDataW.cFileName);
+ #else
+ Ztring File_Name(p->FindFileData.cFileName);
+ #endif //UNICODE
+ if (File_Name!=__T(".") && File_Name!=__T("..")) //Avoid . an ..
+ {
+ bool IsOk=false;
+ #ifdef UNICODE
+ if (p->FindFileDataW.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
+ #else
+ if (p->FindFileData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
+ #endif //UNICODE
+ {
+ if (p->Options&Dir::Include_Dirs)
+ IsOk=true; //A dir
+ }
+ else if ((p->Options&Dir::Include_Files) && ((p->Options&Dir::Include_Hidden) || (!File_Name.empty() && File_Name[0]!=__T('.'))))
+ IsOk=true; //A file
+ if (IsOk)
+ {
+ Name=p->Path+__T("\\")+File_Name;
+
+ ZENLIB_DEBUG2( "GetAllFileNames Next",
+ Debug+=", File_Name="; Debug +=Name.To_UTF8())
+
+ return true;
+ }
+ }
+ }
+ #else //WINDOWS
+ #endif
+
+ Close();
+ return false;
+}
+
+void GetAllFileNames::Close ()
+{
+ if (!p)
+ return;
+
+ ZENLIB_DEBUG1( "GetAllFileNames Close",
+ Debug+=", Dir_Name="; Debug+=Ztring(p->Dir_Name).To_UTF8())
+
+ FindClose(p->hFind); p->hFind=INVALID_HANDLE_VALUE;
+ delete p; p=NULL;
+
+ ZENLIB_DEBUG2( "GetAllFileNames Close",
+ )
+}
+#endif //WINDOWS
+
+//***************************************************************************
//
//***************************************************************************
diff --git a/src/thirdparty/ZenLib/ZenLib/Dir.h b/src/thirdparty/ZenLib/ZenLib/Dir.h
index 76f3d89f4..d01d37c3c 100644
--- a/src/thirdparty/ZenLib/ZenLib/Dir.h
+++ b/src/thirdparty/ZenLib/ZenLib/Dir.h
@@ -50,6 +50,25 @@ public :
static bool Create(const Ztring &Dir_Name);
};
+#ifdef WINDOWS
+class GetAllFileNames_Private;
+class GetAllFileNames
+{
+public:
+ //Constructor/Destructor
+ GetAllFileNames();
+ ~GetAllFileNames();
+
+ //
+ void Start (const Ztring &Dir_Name, Dir::dirlist_t Options=(Dir::dirlist_t)(Dir::Include_Files|Dir::Parse_SubDirs));
+ bool Next (Ztring& Name);
+ void Close ();
+
+private:
+ GetAllFileNames_Private* p;
+};
+#endif //WINDOWS
+
} //NameSpace
#endif
diff --git a/src/thirdparty/ZenLib/ZenLib/File.cpp b/src/thirdparty/ZenLib/ZenLib/File.cpp
index aea864d57..eaa67b5cc 100644
--- a/src/thirdparty/ZenLib/ZenLib/File.cpp
+++ b/src/thirdparty/ZenLib/ZenLib/File.cpp
@@ -51,6 +51,97 @@
namespace ZenLib
{
+//---------------------------------------------------------------------------
+// Debug
+#ifdef ZENLIB_DEBUG
+ #include <stdio.h>
+ #include <windows.h>
+ namespace ZenLib_File_Debug
+ {
+ FILE* F;
+ std::string Debug;
+ SYSTEMTIME st_In;
+
+ void Debug_Open(bool Out)
+ {
+ F=fopen("C:\\Temp\\ZenLib_Debug.txt", "a+t");
+ Debug.clear();
+ SYSTEMTIME st;
+ GetLocalTime( &st );
+
+ char Duration[100];
+ if (Out)
+ {
+ FILETIME ft_In;
+ if (SystemTimeToFileTime(&st_In, &ft_In))
+ {
+ FILETIME ft_Out;
+ if (SystemTimeToFileTime(&st, &ft_Out))
+ {
+ ULARGE_INTEGER UI_In;
+ UI_In.HighPart=ft_In.dwHighDateTime;
+ UI_In.LowPart=ft_In.dwLowDateTime;
+
+ ULARGE_INTEGER UI_Out;
+ UI_Out.HighPart=ft_Out.dwHighDateTime;
+ UI_Out.LowPart=ft_Out.dwLowDateTime;
+
+ ULARGE_INTEGER UI_Diff;
+ UI_Diff.QuadPart=UI_Out.QuadPart-UI_In.QuadPart;
+
+ FILETIME ft_Diff;
+ ft_Diff.dwHighDateTime=UI_Diff.HighPart;
+ ft_Diff.dwLowDateTime=UI_Diff.LowPart;
+
+ SYSTEMTIME st_Diff;
+ if (FileTimeToSystemTime(&ft_Diff, &st_Diff))
+ {
+ sprintf(Duration, "%02hd:%02hd:%02hd.%03hd", st_Diff.wHour, st_Diff.wMinute, st_Diff.wSecond, st_Diff.wMilliseconds);
+ }
+ else
+ strcpy(Duration, " ");
+ }
+ else
+ strcpy(Duration, " ");
+
+ }
+ else
+ strcpy(Duration, " ");
+ }
+ else
+ {
+ st_In=st;
+ strcpy(Duration, " ");
+ }
+
+ fprintf(F," %02hd:%02hd:%02hd.%03hd %s", st.wHour, st.wMinute, st.wSecond, st.wMilliseconds, Duration);
+ }
+
+ void Debug_Close()
+ {
+ Debug += "\r\n";
+ fwrite(Debug.c_str(), Debug.size(), 1, F); \
+ fclose(F);
+ }
+ }
+ using namespace ZenLib_File_Debug;
+
+ #define ZENLIB_DEBUG1(_NAME,_TOAPPEND) \
+ Debug_Open(false); \
+ Debug+=", ";Debug+=_NAME; \
+ _TOAPPEND; \
+ Debug_Close();
+
+ #define ZENLIB_DEBUG2(_NAME,_TOAPPEND) \
+ Debug_Open(true); \
+ Debug+=", ";Debug+=_NAME; \
+ _TOAPPEND; \
+ Debug_Close();
+#else // ZENLIB_DEBUG
+ #define ZENLIB_DEBUG1(_NAME,_TOAPPEND)
+ #define ZENLIB_DEBUG2(_NAME,_TOAPPEND)
+#endif // ZENLIB_DEBUG
+
//***************************************************************************
// Constructor/Destructor
//***************************************************************************
@@ -102,6 +193,9 @@ bool File::Open (const tstring &File_Name_, access_t Access)
{
Close();
+ ZENLIB_DEBUG1( "File Open",
+ Debug+=", File_Name="; Debug +=Ztring(File_Name_).To_UTF8();)
+
File_Name=File_Name_;
#ifdef ZENLIB_USEWX
@@ -174,6 +268,7 @@ bool File::Open (const tstring &File_Name_, access_t Access)
#else
File_Handle=CreateFile(File_Name.c_str(), dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, 0, NULL);
#endif //UNICODE
+ #if 0 //Disabled
if (File_Handle==INVALID_HANDLE_VALUE)
{
//Sometimes the file is locked for few milliseconds, we try again later
@@ -198,9 +293,18 @@ bool File::Open (const tstring &File_Name_, access_t Access)
#endif //UNICODE
}
}
+ #endif //0
if (File_Handle==INVALID_HANDLE_VALUE)
+ {
+ ZENLIB_DEBUG2( "File Open",
+ Debug+=", returns 0";)
+
//File is not openable
return false;
+ }
+
+ ZENLIB_DEBUG2( "File Open",
+ Debug+=", returns 1";)
//Append
if (Access==Access_Write_Append)
@@ -216,6 +320,9 @@ bool File::Create (const Ztring &File_Name_, bool OverWrite)
{
Close();
+ ZENLIB_DEBUG1( "File Create",
+ Debug+=", File_Name="; Debug +=Ztring(File_Name_).To_UTF8();)
+
File_Name=File_Name_;
#ifdef ZENLIB_USEWX
@@ -278,6 +385,7 @@ bool File::Create (const Ztring &File_Name_, bool OverWrite)
#else
File_Handle=CreateFile(File_Name.c_str(), dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, 0, NULL);
#endif //UNICODE
+ #if 0 //Disabled
if (File_Handle==INVALID_HANDLE_VALUE)
{
//Sometime the file is locked for few milliseconds, we try again later
@@ -288,9 +396,19 @@ bool File::Create (const Ztring &File_Name_, bool OverWrite)
File_Handle=CreateFile(File_Name.c_str(), dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, 0, NULL);
#endif //UNICODE
}
+ #endif //0
if (File_Handle==INVALID_HANDLE_VALUE)
+ {
+ ZENLIB_DEBUG2( "File Create",
+ Debug+=", returns 0";)
+
//File is not openable
return false;
+ }
+
+ ZENLIB_DEBUG2( "File Create",
+ Debug+=", returns 1";)
+
return true;
#endif
#endif //ZENLIB_USEWX
@@ -299,6 +417,24 @@ bool File::Create (const Ztring &File_Name_, bool OverWrite)
//---------------------------------------------------------------------------
void File::Close ()
{
+ #ifdef ZENLIB_DEBUG
+ bool isOpen=false;
+ #ifdef ZENLIB_USEWX
+ if (File_Handle!=NULL)
+ #else //ZENLIB_USEWX
+ #ifdef ZENLIB_STANDARD
+ if (File_Handle!=NULL)
+ #elif defined WINDOWS
+ if (File_Handle!=INVALID_HANDLE_VALUE)
+ #endif
+ #endif //ZENLIB_USEWX
+ {
+ ZENLIB_DEBUG1( "File Close",
+ Debug+=", File_Name="; Debug+=Ztring(File_Name).To_UTF8();)
+ isOpen=true;
+ }
+ #endif
+
#ifdef ZENLIB_USEWX
delete (wxFile*)File_Handle; File_Handle=NULL;
#else //ZENLIB_USEWX
@@ -311,6 +447,14 @@ void File::Close ()
#endif //ZENLIB_USEWX
Position=(int64u)-1;
Size=(int64u)-1;
+
+ #ifdef ZENLIB_DEBUG
+ if (isOpen)
+ {
+ ZENLIB_DEBUG2( "File Close",
+ )
+ }
+ #endif
}
//***************************************************************************
@@ -320,6 +464,9 @@ void File::Close ()
//---------------------------------------------------------------------------
size_t File::Read (int8u* Buffer, size_t Buffer_Size_Max)
{
+ ZENLIB_DEBUG1( "File Read",
+ Debug+=", File_Name="; Debug+=Ztring(File_Name).To_UTF8(); Debug+=", MaxSize="; Debug +=Ztring::ToZtring(Buffer_Size_Max).To_UTF8())
+
#ifdef ZENLIB_USEWX
if (File_Handle==NULL)
#else //ZENLIB_USEWX
@@ -353,10 +500,18 @@ size_t File::Read (int8u* Buffer, size_t Buffer_Size_Max)
if (ReadFile(File_Handle, Buffer, (DWORD)Buffer_Size_Max, &Buffer_Size, NULL))
{
Position+=Buffer_Size;
+
+ ZENLIB_DEBUG2( "File Read",
+ Debug+=", new position ";Debug+=Ztring::ToZtring(Position).To_UTF8();;Debug+=", returns ";Debug+=Ztring::ToZtring((int64u)Buffer_Size).To_UTF8();)
+
return Buffer_Size;
}
else
+ {
+ ZENLIB_DEBUG2( "File Read",
+ Debug+=", returns 0";)
return 0;
+ }
#endif
#endif //ZENLIB_USEWX
}
@@ -457,6 +612,9 @@ size_t File::Write (const Ztring &ToWrite)
//---------------------------------------------------------------------------
bool File::GoTo (int64s Position_ToMove, move_t MoveMethod)
{
+ ZENLIB_DEBUG1( "File GoTo",
+ Debug+=", File_Name="; Debug+=Ztring(File_Name).To_UTF8(); Debug+="File GoTo: "; Debug +=Ztring(File_Name).To_UTF8(); Debug+=", MoveMethod="; Debug +=Ztring::ToZtring(MoveMethod).To_UTF8(); Debug+=", MaxSize="; Debug +=Ztring::ToZtring(Position_ToMove).To_UTF8())
+
#ifdef ZENLIB_USEWX
if (File_Handle==NULL)
#else //ZENLIB_USEWX
@@ -497,7 +655,16 @@ bool File::GoTo (int64s Position_ToMove, move_t MoveMethod)
#elif defined WINDOWS
LARGE_INTEGER GoTo;
GoTo.QuadPart=Position_ToMove;
- return SetFilePointerEx(File_Handle, GoTo, NULL, MoveMethod)!=0;
+ BOOL i=SetFilePointerEx(File_Handle, GoTo, NULL, MoveMethod);
+
+ #ifdef ZENLIB_DEBUG
+ LARGE_INTEGER Temp; Temp.QuadPart=0;
+ SetFilePointerEx(File_Handle, Temp, &Temp, FILE_CURRENT);
+ ZENLIB_DEBUG2( "File GoTo",
+ Debug+=", new position ";Debug+=Ztring::ToZtring(Temp.QuadPart).To_UTF8();Debug+=", returns ";Debug+=i?'1':'0';)
+ #endif //ZENLIB_DEBUG
+
+ return i?true:false;
#endif
#endif //ZENLIB_USEWX
}
@@ -508,6 +675,9 @@ int64u File::Position_Get ()
if (Position!=(int64u)-1)
return Position;
+ ZENLIB_DEBUG1( "File Position_Get",
+ Debug+=", File_Name="; Debug+=Ztring(File_Name).To_UTF8())
+
#ifdef ZENLIB_USEWX
if (File_Handle==NULL)
#else //ZENLIB_USEWX
@@ -529,6 +699,10 @@ int64u File::Position_Get ()
LARGE_INTEGER GoTo; GoTo.QuadPart=0;
GoTo.LowPart=SetFilePointer(File_Handle, GoTo.LowPart, &GoTo.HighPart, FILE_CURRENT);
Position=GoTo.QuadPart;
+
+ ZENLIB_DEBUG2( "File GoTo",
+ Debug+=", new position ";Debug+=Ztring::ToZtring(GoTo.QuadPart).To_UTF8();Debug+=", returns 1";)
+
return Position;
#endif
#endif //ZENLIB_USEWX
@@ -789,6 +963,9 @@ Ztring File::Modified_Get(const Ztring &File_Name)
//---------------------------------------------------------------------------
bool File::Exists(const Ztring &File_Name)
{
+ ZENLIB_DEBUG1( "File Exists",
+ Debug+=", File_Name="; Debug+=Ztring(File_Name).To_UTF8())
+
#ifdef ZENLIB_USEWX
wxFileName FN(File_Name.c_str());
return FN.FileExists();
@@ -812,6 +989,10 @@ bool File::Exists(const Ztring &File_Name)
#else
DWORD FileAttributes=GetFileAttributes(File_Name.c_str());
#endif //UNICODE
+
+ ZENLIB_DEBUG2( "File Exists",
+ Debug+=", File_Name="; Debug+=Ztring::ToZtring(((FileAttributes!=INVALID_FILE_ATTRIBUTES) && !(FileAttributes&FILE_ATTRIBUTE_DIRECTORY))?1:0).To_UTF8())
+
return ((FileAttributes!=INVALID_FILE_ATTRIBUTES) && !(FileAttributes&FILE_ATTRIBUTE_DIRECTORY));
#endif
#endif //ZENLIB_USEWX
diff --git a/src/thirdparty/ZenLib/ZenLib/MemoryUtils.h b/src/thirdparty/ZenLib/ZenLib/MemoryUtils.h
index 63bf199e9..cebad594a 100644
--- a/src/thirdparty/ZenLib/ZenLib/MemoryUtils.h
+++ b/src/thirdparty/ZenLib/ZenLib/MemoryUtils.h
@@ -32,7 +32,7 @@ namespace ZenLib
//-----------------------------------------------------------------------
// Arbitrary size - To Unaligned
- #define memcpy_Unaligned_Unaligned memcpy
+ #define memcpy_Unaligned_Unaligned memcpy
#define memcpy_Aligned128_Unaligned memcpy
//-----------------------------------------------------------------------
@@ -70,7 +70,7 @@ namespace ZenLib
{
return _aligned_malloc (size, 16); //aligned_alloc in C11
}
-
+
inline void free_Aligned128 ( void *ptr )
{
_aligned_free (ptr); //free in C11
diff --git a/src/thirdparty/ZenLib/ZenLib/Utils.cpp b/src/thirdparty/ZenLib/ZenLib/Utils.cpp
index bc65f7027..e272ead3a 100644
--- a/src/thirdparty/ZenLib/ZenLib/Utils.cpp
+++ b/src/thirdparty/ZenLib/ZenLib/Utils.cpp
@@ -666,7 +666,7 @@ float32 BigEndian2float16(const char* Liste)
//significand 10 bit
//Retrieving data
- int32u Integer=BigEndian2int32u(Liste);
+ int16u Integer=BigEndian2int16u(Liste);
//Retrieving elements
bool Sign =(Integer&0x8000)?true:false;
@@ -676,7 +676,7 @@ float32 BigEndian2float16(const char* Liste)
//Some computing
if (Exponent==0 || Exponent==0xFF)
return 0; //These are denormalised numbers, NANs, and other horrible things
- Exponent-=0x7F; //Bias
+ Exponent-=0x0F; //Bias
float64 Answer=(((float64)Mantissa)/8388608+1.0)*std::pow((float64)2, (int)Exponent); //(1+Mantissa) * 2^Exponent
if (Sign)
Answer=-Answer;
diff --git a/src/thirdparty/ZenLib/ZenLib/int128s.h b/src/thirdparty/ZenLib/ZenLib/int128s.h
index e387c87b5..c179838d4 100644
--- a/src/thirdparty/ZenLib/ZenLib/int128s.h
+++ b/src/thirdparty/ZenLib/ZenLib/int128s.h
@@ -28,7 +28,11 @@
#include <exception>
#include <cstdlib>
#include <cstdio>
-#include <new>
+#ifdef __cplusplus
+ #include <new> //for size_t
+#else /* __cplusplus */
+ #include <stddef.h> //for size_t
+#endif /* __cplusplus */
#include "ZenLib/Conf.h"
namespace ZenLib
diff --git a/src/thirdparty/lcms2/library b/src/thirdparty/lcms2/library
-Subproject 81746818cd6df89b7a62dbcfc4861d12dbc9c4f
+Subproject 6e33faabae068b21a1c1d18a1297917b6bb1a11
diff --git a/src/thirdparty/sizecbar/scbarg.cpp b/src/thirdparty/sizecbar/scbarg.cpp
index 3cec57a02..4e2677378 100644
--- a/src/thirdparty/sizecbar/scbarg.cpp
+++ b/src/thirdparty/sizecbar/scbarg.cpp
@@ -78,6 +78,12 @@ void CSizingControlBarG::NcCalcClient(LPRECT pRc, UINT nDockBarID)
return;
CRect rc(pRc); // the client rect as calculated by the base class
+ //mpc-hc custom code start
+ // Work in screen coordinates before converting back to
+ // client coordinates to account for possible RTL layout
+ GetParent()->ClientToScreen(rcBar);
+ GetParent()->ClientToScreen(rc);
+ //mpc-hc custom code end
BOOL bHorz = (nDockBarID == AFX_IDW_DOCKBAR_TOP) ||
(nDockBarID == AFX_IDW_DOCKBAR_BOTTOM);
@@ -96,6 +102,12 @@ void CSizingControlBarG::NcCalcClient(LPRECT pRc, UINT nDockBarID)
m_biHide.Move(ptOrgBtn - rcBar.TopLeft());
+ //mpc-hc custom code start
+ // Work in screen coordinates before converting back to
+ // client coordinates to account for possible RTL layout
+ GetParent()->ScreenToClient(&rc);
+ //mpc-hc custom code end
+
*pRc = rc;
}
@@ -144,6 +156,12 @@ LRESULT CSizingControlBarG::OnNcHitTest(CPoint point)
if (nRet != HTCLIENT)
return nRet;
+ //mpc-hc custom code start
+ // Convert to client coordinates to account for possible RTL layout
+ ScreenToClient(&rcBar);
+ ScreenToClient(&point);
+ //mpc-hc custom code end
+
CRect rc = m_biHide.GetRect();
rc.OffsetRect(rcBar.TopLeft());
if (rc.PtInRect(point))
@@ -214,7 +232,11 @@ void CSCBButton::Paint(CDC* pDC)
font.CreatePointFont(pointsize, _T("Marlett"));
CFont* oldfont = pDC->SelectObject(&font);
- pDC->TextOut(ptOrg.x + 2, ptOrg.y + 2, CString(_T("r"))); // x-like
+ //mpc-hc custom code start
+ // TextOut is affected by the layout so we need to account for that
+ DWORD dwLayout = pDC->GetLayout();
+ pDC->TextOut(ptOrg.x + (dwLayout == LAYOUT_LTR ? 2 : -1), ptOrg.y + 2, CString(_T("r"))); // x-like
+ //mpc-hc custom code end
pDC->SelectObject(oldfont);
pDC->SetBkMode(nPrevBkMode);
diff --git a/src/thirdparty/sizecbar/sizecbar.cpp b/src/thirdparty/sizecbar/sizecbar.cpp
index e6d794b20..e6904e290 100644
--- a/src/thirdparty/sizecbar/sizecbar.cpp
+++ b/src/thirdparty/sizecbar/sizecbar.cpp
@@ -411,7 +411,12 @@ void CSizingControlBar::OnMouseMove(UINT nFlags, CPoint point)
CPoint ptScreen = point;
ClientToScreen(&ptScreen);
- OnTrackUpdateSize(ptScreen);
+ //mpc-hc custom code start
+ // Switch to parent window client coordinates to account for possible RTL layout
+ CPoint ptParentClient = ptScreen;
+ GetParentFrame()->ScreenToClient(&ptParentClient);
+ OnTrackUpdateSize(ptParentClient);
+ //mpc-hc custom code end
}
baseCSizingControlBar::OnMouseMove(nFlags, point);
@@ -474,6 +479,11 @@ void CSizingControlBar::OnNcCalcSize(BOOL bCalcValidRects,
void CSizingControlBar::NcCalcClient(LPRECT pRc, UINT nDockBarID)
{
CRect rc(pRc);
+ //mpc-hc custom code start
+ // Work in screen coordinates before converting back to
+ // client coordinates to account for possible RTL layout
+ GetParent()->ClientToScreen(&rc);
+ //mpc-hc custom code end
rc.DeflateRect(3, 5, 3, 3);
if (nDockBarID != AFX_IDW_DOCKBAR_FLOAT)
@@ -503,6 +513,12 @@ void CSizingControlBar::NcCalcClient(LPRECT pRc, UINT nDockBarID)
(m_dwSCBStyle & SCBS_EDGERIGHT) ? m_cxEdge : 0,
(m_dwSCBStyle & SCBS_EDGEBOTTOM) ? m_cxEdge : 0);
+ //mpc-hc custom code start
+ // Work in screen coordinates before converting back to
+ // client coordinates to account for possible RTL layout
+ GetParent()->ScreenToClient(&rc);
+ //mpc-hc custom code end
+
*pRc = rc;
}
@@ -513,8 +529,14 @@ void CSizingControlBar::OnNcPaint()
CRect rcClient, rcBar;
GetClientRect(rcClient);
- ClientToScreen(rcClient);
+ //mpc-hc custom code start
+ //ClientToScreen(rcClient);
+ //mpc-hc custom code end
GetWindowRect(rcBar);
+ //mpc-hc custom code start
+ // Convert to client coordinates to account for possible RTL layout
+ ScreenToClient(rcBar);
+ //mpc-hc custom code end
rcClient.OffsetRect(-rcBar.TopLeft());
rcBar.OffsetRect(-rcBar.TopLeft());
@@ -574,6 +596,12 @@ LRESULT CSizingControlBar::OnNcHitTest(CPoint point)
CRect rcBar, rcEdge;
GetWindowRect(rcBar);
+ //mpc-hc custom code start
+ // Convert to client coordinates to account for possible RTL layout
+ ScreenToClient(&rcBar);
+ ScreenToClient(&point);
+ //mpc-hc custom code end
+
if (!IsFloating())
for (int i = 0; i < 4; i++)
if (GetEdgeRect(rcBar, GetEdgeHTCode(i), rcEdge))
@@ -619,6 +647,11 @@ void CSizingControlBar::OnClose()
void CSizingControlBar::StartTracking(UINT nHitTest, CPoint point)
{
+ //mpc-hc custom code start
+ // Convert to client coordinates to account for possible RTL layout
+ GetParentFrame()->ScreenToClient(&point);
+ //mpc-hc custom code end
+
SetCapture();
// make sure no updates are pending
@@ -635,6 +668,10 @@ void CSizingControlBar::StartTracking(UINT nHitTest, CPoint point)
CRect rcBar, rcEdge;
GetWindowRect(rcBar);
+ //mpc-hc custom code start
+ // Convert to client coordinates to account for possible RTL layout
+ GetParent()->ScreenToClient(&rcBar);
+ //mpc-hc custom code end
GetEdgeRect(rcBar, m_htEdge, rcEdge);
m_nTrackEdgeOfs = m_nTrackPosOld -
(bHorzTracking ? rcEdge.CenterPoint().x : rcEdge.CenterPoint().y);
diff --git a/src/thirdparty/unrar/archive.cpp b/src/thirdparty/unrar/archive.cpp
index 9e9e72424..7ca0b7461 100644
--- a/src/thirdparty/unrar/archive.cpp
+++ b/src/thirdparty/unrar/archive.cpp
@@ -234,6 +234,7 @@ bool Archive::IsArchive(bool EnableBroken)
{
SaveFilePos SavePos(*this);
int64 SaveCurBlockPos=CurBlockPos,SaveNextBlockPos=NextBlockPos;
+ HEADER_TYPE SaveCurHeaderType=CurHeaderType;
while (ReadHeader()!=0)
{
@@ -250,6 +251,7 @@ bool Archive::IsArchive(bool EnableBroken)
}
CurBlockPos=SaveCurBlockPos;
NextBlockPos=SaveNextBlockPos;
+ CurHeaderType=SaveCurHeaderType;
}
if (!Volume || FirstVolume)
wcscpy(FirstVolumeName,FileName);
diff --git a/src/thirdparty/unrar/archive.hpp b/src/thirdparty/unrar/archive.hpp
index 1d8444bfb..522709608 100644
--- a/src/thirdparty/unrar/archive.hpp
+++ b/src/thirdparty/unrar/archive.hpp
@@ -85,8 +85,8 @@ class Archive:public File
void AddSubData(byte *SrcData,uint64 DataSize,File *SrcFile,
const wchar *Name,uint Flags);
bool ReadSubData(Array<byte> *UnpData,File *DestFile);
- HEADER_TYPE GetHeaderType() {return(CurHeaderType);};
- RAROptions* GetRAROptions() {return(Cmd);}
+ HEADER_TYPE GetHeaderType() {return CurHeaderType;};
+ RAROptions* GetRAROptions() {return Cmd;}
void SetSilentOpen(bool Mode) {SilentOpen=Mode;}
#ifdef USE_QOPEN
bool Open(const wchar *Name,uint Mode=FMF_READ);
diff --git a/src/thirdparty/unrar/arcread.cpp b/src/thirdparty/unrar/arcread.cpp
index e4c3f87d5..047289b7a 100644
--- a/src/thirdparty/unrar/arcread.cpp
+++ b/src/thirdparty/unrar/arcread.cpp
@@ -44,10 +44,10 @@ size_t Archive::SearchBlock(HEADER_TYPE HeaderType)
if ((++Count & 127)==0)
Wait();
if (GetHeaderType()==HeaderType)
- return(Size);
+ return Size;
SeekToNext();
}
- return(0);
+ return 0;
}
@@ -128,7 +128,7 @@ size_t Archive::ReadHeader15()
if (Read(Salt,SIZE_SALT30)!=SIZE_SALT30)
{
UnexpEndArcMsg();
- return(0);
+ return 0;
}
HeadersCrypt.SetCryptKeys(false,CRYPT_RAR30,&Cmd->Password,Salt,NULL,0,NULL,NULL);
Raw.SetCrypt(&HeadersCrypt);
@@ -155,7 +155,7 @@ size_t Archive::ReadHeader15()
if (ShortBlock.HeadSize<SIZEOF_SHORTBLOCKHEAD)
{
BrokenHeaderMsg();
- return(0);
+ return 0;
}
// For simpler further processing we map header types common
@@ -562,7 +562,7 @@ size_t Archive::ReadHeader50()
if (Decrypt)
{
#if defined(SHELL_EXT) || defined(RAR_NOCRYPT)
- return(0);
+ return 0;
#else
RequestArcPassword();
@@ -570,7 +570,7 @@ size_t Archive::ReadHeader50()
if (Read(HeadersInitV,SIZE_INITV)!=SIZE_INITV)
{
UnexpEndArcMsg();
- return(0);
+ return 0;
}
byte PswCheck[SIZE_PSWCHECK];
@@ -886,7 +886,8 @@ void Archive::RequestArcPassword()
ErrHandler.Exit(RARX_USERBREAK);
}
#else
- if (!uiGetPassword(UIPASSWORD_ARCHIVE,FileName,&Cmd->Password))
+ if (!uiGetPassword(UIPASSWORD_ARCHIVE,FileName,&Cmd->Password) ||
+ !Cmd->Password.IsSet())
{
Close();
uiMsg(UIERROR_INCERRCOUNT);
@@ -1168,7 +1169,7 @@ size_t Archive::ReadHeader14()
NextBlockPos=CurBlockPos+FileHead.HeadSize+FileHead.PackSize;
CurHeaderType=HEAD_FILE;
}
- return(NextBlockPos>CurBlockPos ? Raw.Size():0);
+ return NextBlockPos>CurBlockPos ? Raw.Size() : 0;
}
#endif
diff --git a/src/thirdparty/unrar/cmddata.cpp b/src/thirdparty/unrar/cmddata.cpp
index b56410ae9..3f84cc373 100644
--- a/src/thirdparty/unrar/cmddata.cpp
+++ b/src/thirdparty/unrar/cmddata.cpp
@@ -616,6 +616,8 @@ void CommandData::ProcessSwitch(const wchar *Switch)
#ifdef SAVE_LINKS
case 'L':
SaveSymLinks=true;
+ if (toupperw(Switch[2])=='A')
+ AbsoluteLinks=true;
break;
#endif
case 'R':
@@ -958,7 +960,7 @@ void CommandData::OutHelp(RAR_EXIT ExitCode)
MCHelpSwCm,MCHelpSwCFGm,MCHelpSwCL,MCHelpSwCU,
MCHelpSwDH,MCHelpSwEP,MCHelpSwEP3,MCHelpSwF,MCHelpSwIDP,MCHelpSwIERR,
MCHelpSwINUL,MCHelpSwIOFF,MCHelpSwKB,MCHelpSwN,MCHelpSwNa,MCHelpSwNal,
- MCHelpSwO,MCHelpSwOC,MCHelpSwOR,MCHelpSwOW,MCHelpSwP,
+ MCHelpSwO,MCHelpSwOC,MCHelpSwOL,MCHelpSwOR,MCHelpSwOW,MCHelpSwP,
MCHelpSwPm,MCHelpSwR,MCHelpSwRI,MCHelpSwSC,MCHelpSwSL,MCHelpSwSM,
MCHelpSwTA,MCHelpSwTB,MCHelpSwTN,MCHelpSwTO,MCHelpSwTS,MCHelpSwU,
MCHelpSwVUnr,MCHelpSwVER,MCHelpSwVP,MCHelpSwX,MCHelpSwXa,MCHelpSwXal,
@@ -1157,8 +1159,11 @@ bool CommandData::SizeCheck(int64 Size)
-int CommandData::IsProcessFile(FileHeader &FileHead,bool *ExactMatch,int MatchType)
+int CommandData::IsProcessFile(FileHeader &FileHead,bool *ExactMatch,int MatchType,
+ wchar *MatchedArg,uint MatchedArgSize)
{
+ if (MatchedArg!=NULL && MatchedArgSize>0)
+ *MatchedArg=0;
if (wcslen(FileHead.FileName)>=NM)
return 0;
bool Dir=FileHead.Dir;
@@ -1179,6 +1184,8 @@ int CommandData::IsProcessFile(FileHeader &FileHead,bool *ExactMatch,int MatchTy
{
if (ExactMatch!=NULL)
*ExactMatch=wcsicompc(ArgName,FileHead.FileName)==0;
+ if (MatchedArg!=NULL)
+ wcsncpyz(MatchedArg,ArgName,MatchedArgSize);
return StringCount;
}
return 0;
diff --git a/src/thirdparty/unrar/cmddata.hpp b/src/thirdparty/unrar/cmddata.hpp
index 3ed4ef1d8..d2cdbb94d 100644
--- a/src/thirdparty/unrar/cmddata.hpp
+++ b/src/thirdparty/unrar/cmddata.hpp
@@ -37,7 +37,8 @@ class CommandData:public RAROptions
bool TimeCheck(RarTime &ft);
bool SizeCheck(int64 Size);
bool AnyFiltersActive();
- int IsProcessFile(FileHeader &FileHead,bool *ExactMatch=NULL,int MatchType=MATCH_WILDSUBPATH);
+ int IsProcessFile(FileHeader &FileHead,bool *ExactMatch=NULL,int MatchType=MATCH_WILDSUBPATH,
+ wchar *MatchedArg=NULL,uint MatchedArgSize=0);
void ProcessCommand();
void AddArcName(const wchar *Name);
bool GetArcName(wchar *Name,int MaxSize);
diff --git a/src/thirdparty/unrar/dll.rc b/src/thirdparty/unrar/dll.rc
index 1481d7632..fa7ab25cb 100644
--- a/src/thirdparty/unrar/dll.rc
+++ b/src/thirdparty/unrar/dll.rc
@@ -2,8 +2,8 @@
#include <commctrl.h>
VS_VERSION_INFO VERSIONINFO
-FILEVERSION 5, 20, 100, 1433
-PRODUCTVERSION 5, 20, 100, 1433
+FILEVERSION 5, 21, 100, 1510
+PRODUCTVERSION 5, 21, 100, 1510
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
{
@@ -14,9 +14,9 @@ FILETYPE VFT_APP
VALUE "CompanyName", "Alexander Roshal\0"
VALUE "ProductName", "RAR decompression library\0"
VALUE "FileDescription", "RAR decompression library\0"
- VALUE "FileVersion", "5.20.0\0"
- VALUE "ProductVersion", "5.20.0\0"
- VALUE "LegalCopyright", "Copyright © Alexander Roshal 1993-2014\0"
+ VALUE "FileVersion", "5.21.0\0"
+ VALUE "ProductVersion", "5.21.0\0"
+ VALUE "LegalCopyright", "Copyright © Alexander Roshal 1993-2015\0"
VALUE "OriginalFilename", "Unrar.dll\0"
}
}
diff --git a/src/thirdparty/unrar/extinfo.cpp b/src/thirdparty/unrar/extinfo.cpp
index 141967f2a..01827eba0 100644
--- a/src/thirdparty/unrar/extinfo.cpp
+++ b/src/thirdparty/unrar/extinfo.cpp
@@ -60,14 +60,45 @@ void SetExtraInfo(CommandData *Cmd,Archive &Arc,wchar *Name)
+bool IsRelativeSymlinkSafe(const wchar *SrcName,const wchar *TargetName)
+{
+ if (IsFullRootPath(SrcName))
+ return false;
+ int AllowedDepth=0;
+ while (*SrcName!=0)
+ {
+ if (IsPathDiv(SrcName[0]) && SrcName[1]!=0 && !IsPathDiv(SrcName[1]))
+ {
+ bool Dot=SrcName[1]=='.' && (IsPathDiv(SrcName[2]) || SrcName[2]==0);
+ bool Dot2=SrcName[1]=='.' && SrcName[2]=='.' && (IsPathDiv(SrcName[3]) || SrcName[3]==0);
+ if (!Dot && !Dot2)
+ AllowedDepth++;
+ }
+ SrcName++;
+ }
+ if (IsFullRootPath(TargetName)) // Catch root dir based /path/file paths.
+ return false;
+ for (int Pos=0;*TargetName!=0;Pos++)
+ {
+ bool Dot2=TargetName[0]=='.' && TargetName[1]=='.' &&
+ (IsPathDiv(TargetName[2]) || TargetName[2]==0) &&
+ (Pos==0 || IsPathDiv(*(TargetName-1)));
+ if (Dot2)
+ AllowedDepth--;
+ TargetName++;
+ }
+ return AllowedDepth>=0;
+}
+
+
bool ExtractSymlink(CommandData *Cmd,ComprDataIO &DataIO,Archive &Arc,const wchar *LinkName)
{
#if defined(SAVE_LINKS) && defined(_UNIX)
// For RAR 3.x archives we process links even in test mode to skip link data.
if (Arc.Format==RARFMT15)
- return ExtractUnixLink30(DataIO,Arc,LinkName);
+ return ExtractUnixLink30(Cmd,DataIO,Arc,LinkName);
if (Arc.Format==RARFMT50)
- return ExtractUnixLink50(LinkName,&Arc.FileHead);
+ return ExtractUnixLink50(Cmd,LinkName,&Arc.FileHead);
#elif defined _WIN_ALL
// RAR 5.0 archives store link information in file header, so there is
// no need to additionally test it if we do not create a file.
diff --git a/src/thirdparty/unrar/extinfo.hpp b/src/thirdparty/unrar/extinfo.hpp
index 224564da8..b974bf489 100644
--- a/src/thirdparty/unrar/extinfo.hpp
+++ b/src/thirdparty/unrar/extinfo.hpp
@@ -1,6 +1,7 @@
#ifndef _RAR_EXTINFO_
#define _RAR_EXTINFO_
+bool IsRelativeSymlinkSafe(const wchar *SrcName,const wchar *TargetName);
bool ExtractSymlink(CommandData *Cmd,ComprDataIO &DataIO,Archive &Arc,const wchar *LinkName);
#ifdef _UNIX
void SetUnixOwner(Archive &Arc,const wchar *FileName);
diff --git a/src/thirdparty/unrar/extract.cpp b/src/thirdparty/unrar/extract.cpp
index cab669fe9..a24eb9405 100644
--- a/src/thirdparty/unrar/extract.cpp
+++ b/src/thirdparty/unrar/extract.cpp
@@ -213,6 +213,8 @@ bool CmdExtract::ExtractCurrentFile(Archive &Arc,size_t HeaderSize,bool &Repeat)
#ifdef NOVOLUME
return false;
#else
+ // Supposing we unpack an old RAR volume without end of archive record
+ // and last file is not split between volumes.
if (!MergeArchive(Arc,&DataIO,false,Command))
{
ErrHandler.SetErrorCode(RARX_WARNING);
@@ -257,17 +259,19 @@ bool CmdExtract::ExtractCurrentFile(Archive &Arc,size_t HeaderSize,bool &Repeat)
int MatchType=MATCH_WILDSUBPATH;
bool EqualNames=false;
- int MatchNumber=Cmd->IsProcessFile(Arc.FileHead,&EqualNames,MatchType);
- bool ExactMatch=MatchNumber!=0;
+ wchar MatchedArg[NM];
+ int MatchNumber=Cmd->IsProcessFile(Arc.FileHead,&EqualNames,MatchType,MatchedArg,ASIZE(MatchedArg));
+ bool MatchFound=MatchNumber!=0;
#ifndef SFX_MODULE
- if (*Cmd->ArcPath==0 && Cmd->ExclPath==EXCL_BASEPATH && ExactMatch)
+ if (Cmd->ExclPath==EXCL_BASEPATH)
{
- Cmd->FileArgs.Rewind();
- if (Cmd->FileArgs.GetString(Cmd->ArcPath,ASIZE(Cmd->ArcPath),MatchNumber-1))
- *PointToName(Cmd->ArcPath)=0;
+ wcsncpyz(Cmd->ArcPath,MatchedArg,ASIZE(Cmd->ArcPath));
+ *PointToName(Cmd->ArcPath)=0;
+ if (IsWildcard(Cmd->ArcPath)) // Cannot correctly process path*\* masks here.
+ *Cmd->ArcPath=0;
}
#endif
- if (ExactMatch && !EqualNames)
+ if (MatchFound && !EqualNames)
AllMatchesExact=false;
Arc.ConvertAttributes();
@@ -309,17 +313,17 @@ bool CmdExtract::ExtractCurrentFile(Archive &Arc,size_t HeaderSize,bool &Repeat)
if (Cmd->VersionControl!=1 && !EqualNames)
{
if (Cmd->VersionControl==0)
- ExactMatch=false;
+ MatchFound=false;
int Version=ParseVersionFileName(ArcFileName,false);
if (Cmd->VersionControl-1==Version)
ParseVersionFileName(ArcFileName,true);
else
- ExactMatch=false;
+ MatchFound=false;
}
}
else
if (!Arc.IsArcDir() && Cmd->VersionControl>1)
- ExactMatch=false;
+ MatchFound=false;
DataIO.UnpVolume=Arc.FileHead.SplitAfter;
DataIO.NextVolumeMissing=false;
@@ -330,9 +334,9 @@ bool CmdExtract::ExtractCurrentFile(Archive &Arc,size_t HeaderSize,bool &Repeat)
bool SkipSolid=false;
#ifndef SFX_MODULE
- if (FirstFile && (ExactMatch || Arc.Solid) && Arc.FileHead.SplitBefore)
+ if (FirstFile && (MatchFound || Arc.Solid) && Arc.FileHead.SplitBefore)
{
- if (ExactMatch)
+ if (MatchFound)
{
uiMsg(UIERROR_NEEDPREVVOL,Arc.FileName,ArcFileName);
#ifdef RARDLL
@@ -340,13 +344,13 @@ bool CmdExtract::ExtractCurrentFile(Archive &Arc,size_t HeaderSize,bool &Repeat)
#endif
ErrHandler.SetErrorCode(RARX_OPEN);
}
- ExactMatch=false;
+ MatchFound=false;
}
FirstFile=false;
#endif
- if (ExactMatch || (SkipSolid=Arc.Solid)!=0)
+ if (MatchFound || (SkipSolid=Arc.Solid)!=0)
{
// First common call of uiStartFileExtract. It is done before overwrite
// prompts, so if SkipSolid state is changed below, we'll need to make
@@ -383,9 +387,13 @@ bool CmdExtract::ExtractCurrentFile(Archive &Arc,size_t HeaderSize,bool &Repeat)
if (Arc.FileHead.Encrypted)
{
+ // Stop archive extracting if user cancelled a password prompt.
#ifdef RARDLL
if (!ExtrDllGetPassword())
+ {
+ Cmd->DllError=ERAR_MISSING_PASSWORD;
return false;
+ }
#else
if (!ExtrGetPassword(Arc,ArcFileName))
{
@@ -394,6 +402,9 @@ bool CmdExtract::ExtractCurrentFile(Archive &Arc,size_t HeaderSize,bool &Repeat)
}
#endif
// Skip only the current encrypted file if empty password is entered.
+ // Actually our "cancel" code above intercepts empty passwords too now,
+ // so we keep the code below just in case we'll decide process empty
+ // and cancelled passwords differently sometimes.
if (!Cmd->Password.IsSet())
{
ErrHandler.SetErrorCode(RARX_WARNING);
@@ -406,13 +417,7 @@ bool CmdExtract::ExtractCurrentFile(Archive &Arc,size_t HeaderSize,bool &Repeat)
#ifdef RARDLL
if (*Cmd->DllDestName!=0)
- {
wcsncpyz(DestFileName,Cmd->DllDestName,ASIZE(DestFileName));
-
-// Do we need this code?
-// if (Cmd->DllOpMode!=RAR_EXTRACT)
-// ExtrFile=false;
- }
#endif
if (!CheckUnpVer(Arc,ArcFileName))
@@ -711,7 +716,7 @@ bool CmdExtract::ExtractCurrentFile(Archive &Arc,size_t HeaderSize,bool &Repeat)
}
}
}
- if (ExactMatch)
+ if (MatchFound)
MatchedArgs++;
if (DataIO.NextVolumeMissing)
return false;
@@ -882,8 +887,10 @@ bool CmdExtract::ExtrGetPassword(Archive &Arc,const wchar *ArcFileName)
{
if (!Cmd->Password.IsSet())
{
- if (!uiGetPassword(UIPASSWORD_FILE,ArcFileName,&Cmd->Password))
+ if (!uiGetPassword(UIPASSWORD_FILE,ArcFileName,&Cmd->Password) || !Cmd->Password.IsSet())
{
+ // Suppress "test is ok" message in GUI if user entered
+ // an empty password or cancelled a password prompt.
uiMsg(UIERROR_INCERRCOUNT);
return false;
diff --git a/src/thirdparty/unrar/filcreat.cpp b/src/thirdparty/unrar/filcreat.cpp
index 8b20b3fa9..6717eee90 100644
--- a/src/thirdparty/unrar/filcreat.cpp
+++ b/src/thirdparty/unrar/filcreat.cpp
@@ -45,7 +45,6 @@ bool FileCreate(RAROptions *Cmd,File *NewFile,wchar *Name,size_t MaxNameSize,
uint FileMode=WriteOnly ? FMF_WRITE|FMF_SHAREREAD:FMF_UPDATE|FMF_SHAREREAD;
if (NewFile!=NULL && NewFile->Create(Name,FileMode))
return true;
- PrepareToDelete(Name);
CreatePath(Name,true);
return NewFile!=NULL ? NewFile->Create(Name,FileMode):DelFile(Name);
}
diff --git a/src/thirdparty/unrar/file.cpp b/src/thirdparty/unrar/file.cpp
index 8fba34adb..185474c25 100644
--- a/src/thirdparty/unrar/file.cpp
+++ b/src/thirdparty/unrar/file.cpp
@@ -281,10 +281,10 @@ bool File::Rename(const wchar *NewName)
}
-void File::Write(const void *Data,size_t Size)
+bool File::Write(const void *Data,size_t Size)
{
if (Size==0)
- return;
+ return true;
if (HandleType==FILE_HANDLESTD)
{
#ifdef _WIN_ALL
@@ -301,9 +301,10 @@ void File::Write(const void *Data,size_t Size)
}
#endif
}
+ bool Success;
while (1)
{
- bool Success=false;
+ Success=false;
#ifdef _WIN_ALL
DWORD Written=0;
if (HandleType!=FILE_HANDLENORMAL)
@@ -352,6 +353,7 @@ void File::Write(const void *Data,size_t Size)
break;
}
LastWrite=true;
+ return Success; // It can return false only if AllowExceptions is disabled.
}
diff --git a/src/thirdparty/unrar/file.hpp b/src/thirdparty/unrar/file.hpp
index 93aac89f3..0d6534ff7 100644
--- a/src/thirdparty/unrar/file.hpp
+++ b/src/thirdparty/unrar/file.hpp
@@ -80,7 +80,7 @@ class File
bool Close();
bool Delete();
bool Rename(const wchar *NewName);
- void Write(const void *Data,size_t Size);
+ bool Write(const void *Data,size_t Size);
virtual int Read(void *Data,size_t Size);
int DirectRead(void *Data,size_t Size);
virtual void Seek(int64 Offset,int Method);
diff --git a/src/thirdparty/unrar/filestr.cpp b/src/thirdparty/unrar/filestr.cpp
index a87384f24..5fa946a4d 100644
--- a/src/thirdparty/unrar/filestr.cpp
+++ b/src/thirdparty/unrar/filestr.cpp
@@ -38,16 +38,20 @@ bool ReadTextFile(
unsigned int DataSize=0,ReadSize;
const int ReadBlock=4096;
- Array<char> Data(ReadBlock+3);
+
+ // Our algorithm below needs at least two trailing zeroes after data.
+ // So for Unicode we provide 2 Unicode zeroes and one more byte
+ // in case read Unicode data contains uneven number of bytes.
+ const size_t ZeroPadding=5;
+
+ Array<char> Data(ReadBlock+ZeroPadding);
while ((ReadSize=SrcFile.Read(&Data[DataSize],ReadBlock))!=0)
{
DataSize+=ReadSize;
- Data.Add(ReadSize);
+ Data.Add(ReadSize); // Always have ReadBlock available for next data.
}
-
- // Add trailing Unicode zero after text data. We add 3 bytes instead of 2
- // in case read Unicode data contains uneven number of bytes.
- memset(&Data[DataSize],0,3);
+
+ memset(&Data[DataSize],0,ZeroPadding); // Provide at least 2 Unicode zero bytes.
Array<wchar> WideStr;
diff --git a/src/thirdparty/unrar/loclang.hpp b/src/thirdparty/unrar/loclang.hpp
index fb560713a..52bcafe92 100644
--- a/src/thirdparty/unrar/loclang.hpp
+++ b/src/thirdparty/unrar/loclang.hpp
@@ -99,7 +99,7 @@
#define MCHelpSwOC L"\n oc Set NTFS Compressed attribute"
#define MCHelpSwOH L"\n oh Save hard links as the link instead of the file"
#define MCHelpSwOI L"\n oi[0-4][:min] Save identical files as references"
-#define MCHelpSwOL L"\n ol Save symbolic links as the link instead of the file"
+#define MCHelpSwOL L"\n ol[a] Process symbolic links as the link [absolute paths]"
#define MCHelpSwOR L"\n or Rename files automatically"
#define MCHelpSwOS L"\n os Save NTFS streams"
#define MCHelpSwOW L"\n ow Save or restore file owner and group"
diff --git a/src/thirdparty/unrar/options.hpp b/src/thirdparty/unrar/options.hpp
index ba9c0ca82..a6ec227f0 100644
--- a/src/thirdparty/unrar/options.hpp
+++ b/src/thirdparty/unrar/options.hpp
@@ -132,6 +132,7 @@ class RAROptions
bool ProcessOwners;
bool SaveSymLinks;
bool SaveHardLinks;
+ bool AbsoluteLinks;
int Priority;
int SleepTime;
bool KeepBroken;
diff --git a/src/thirdparty/unrar/os.hpp b/src/thirdparty/unrar/os.hpp
index 84f8fc92a..1b0813f6c 100644
--- a/src/thirdparty/unrar/os.hpp
+++ b/src/thirdparty/unrar/os.hpp
@@ -79,6 +79,7 @@
#include <time.h>
#include <signal.h>
+
#define SAVE_LINKS
#define ENABLE_ACCESS
@@ -154,6 +155,7 @@
#include <utime.h>
#include <locale.h>
+
#ifdef S_IFLNK
#define SAVE_LINKS
#endif
diff --git a/src/thirdparty/unrar/pathfn.cpp b/src/thirdparty/unrar/pathfn.cpp
index bfd3b588e..b6e220eee 100644
--- a/src/thirdparty/unrar/pathfn.cpp
+++ b/src/thirdparty/unrar/pathfn.cpp
@@ -29,7 +29,7 @@ wchar* ConvertPath(const wchar *SrcPath,wchar *DestPath)
while (*DestPtr!=0)
{
const wchar *s=DestPtr;
- if (s[0] && IsDriveDiv(s[1]))
+ if (s[0]!=0 && IsDriveDiv(s[1]))
s+=2;
if (s[0]=='\\' && s[1]=='\\')
{
@@ -541,6 +541,12 @@ bool IsFullPath(const wchar *Path)
}
+bool IsFullRootPath(const wchar *Path)
+{
+ return IsFullPath(Path) || IsPathDiv(Path[0]);
+}
+
+
bool IsDiskLetter(const wchar *Path)
{
wchar Letter=etoupperw(Path[0]);
diff --git a/src/thirdparty/unrar/pathfn.hpp b/src/thirdparty/unrar/pathfn.hpp
index fabb29340..ae1f8c2e8 100644
--- a/src/thirdparty/unrar/pathfn.hpp
+++ b/src/thirdparty/unrar/pathfn.hpp
@@ -56,6 +56,7 @@ inline void SlashToNative(const wchar *SrcName,wchar *DestName,size_t MaxLength)
void ConvertNameToFull(const wchar *Src,wchar *Dest,size_t MaxSize);
bool IsFullPath(const wchar *Path);
+bool IsFullRootPath(const wchar *Path);
bool IsDiskLetter(const wchar *Path);
void GetPathRoot(const wchar *Path,wchar *Root,size_t MaxSize);
int ParseVersionFileName(wchar *Name,bool Truncate);
diff --git a/src/thirdparty/unrar/strfn.cpp b/src/thirdparty/unrar/strfn.cpp
index f83482fb2..e234da834 100644
--- a/src/thirdparty/unrar/strfn.cpp
+++ b/src/thirdparty/unrar/strfn.cpp
@@ -19,7 +19,7 @@ void IntToExt(const char *Src,char *Dest,size_t DestSize)
Dest[DestSize-1]=0;
#elif defined(_ANDROID)
wchar DestW[NM];
- UnkToWide(Src,DestW,ASIZE(DestW));
+ JniCharToWide(Src,DestW,ASIZE(DestW),true);
WideToChar(DestW,Dest,DestSize);
#else
if (Dest!=Src)
diff --git a/src/thirdparty/unrar/timefn.cpp b/src/thirdparty/unrar/timefn.cpp
index 3fa535f4c..ba9f49686 100644
--- a/src/thirdparty/unrar/timefn.cpp
+++ b/src/thirdparty/unrar/timefn.cpp
@@ -223,7 +223,7 @@ void RarTime::GetText(wchar *DateStr,size_t MaxSize,bool FullYear,bool FullMS)
RarLocalTime lt;
GetLocal(&lt);
if (FullMS)
- swprintf(DateStr,MaxSize,L"%u-%02u-%02u %02u:%02u,%03u",lt.Year,lt.Month,lt.Day,lt.Hour,lt.Minute,lt.Reminder/10000);
+ swprintf(DateStr,MaxSize,L"%u-%02u-%02u %02u:%02u:%02u,%03u",lt.Year,lt.Month,lt.Day,lt.Hour,lt.Minute,lt.Second,lt.Reminder/10000);
else
if (FullYear)
swprintf(DateStr,MaxSize,L"%02u-%02u-%u %02u:%02u",lt.Day,lt.Month,lt.Year,lt.Hour,lt.Minute);
diff --git a/src/thirdparty/unrar/uicommon.cpp b/src/thirdparty/unrar/uicommon.cpp
index 7238c1936..5be551a42 100644
--- a/src/thirdparty/unrar/uicommon.cpp
+++ b/src/thirdparty/unrar/uicommon.cpp
@@ -22,11 +22,18 @@ UIASKREP_RESULT uiAskReplaceEx(RAROptions *Cmd,wchar *Name,size_t MaxNameSize,in
// This check must be after OVERWRITE_AUTORENAME processing or -y switch
// would override -or.
if (Cmd->AllYes || Cmd->Overwrite==OVERWRITE_ALL)
+ {
+ PrepareToDelete(Name);
return UIASKREP_R_REPLACE;
+ }
wchar NewName[NM];
wcsncpyz(NewName,Name,ASIZE(NewName));
UIASKREP_RESULT Choice=uiAskReplace(NewName,ASIZE(NewName),FileSize,FileTime,Flags);
+
+ if (Choice==UIASKREP_R_REPLACE || Choice==UIASKREP_R_REPLACEALL)
+ PrepareToDelete(Name);
+
if (Choice==UIASKREP_R_REPLACEALL)
{
Cmd->Overwrite=OVERWRITE_ALL;
diff --git a/src/thirdparty/unrar/uiconsole.cpp b/src/thirdparty/unrar/uiconsole.cpp
index b9129c4f7..ba7550c6b 100644
--- a/src/thirdparty/unrar/uiconsole.cpp
+++ b/src/thirdparty/unrar/uiconsole.cpp
@@ -9,10 +9,17 @@ UIASKREP_RESULT uiAskReplace(wchar *Name,size_t MaxNameSize,int64 FileSize,RarTi
itoa(ExistingFD.Size,SizeText1);
ExistingFD.mtime.GetText(DateStr1,ASIZE(DateStr1),true,false);
- itoa(FileSize,SizeText2);
- FileTime->GetText(DateStr2,ASIZE(DateStr2),true,false);
-
- eprintf(St(MAskReplace),Name,SizeText1,DateStr1,SizeText2,DateStr2);
+ if (FileSize==INT64NDF || FileTime==NULL)
+ {
+ eprintf(L"\n");
+ eprintf(St(MAskOverwrite),Name);
+ }
+ else
+ {
+ itoa(FileSize,SizeText2);
+ FileTime->GetText(DateStr2,ASIZE(DateStr2),true,false);
+ eprintf(St(MAskReplace),Name,SizeText1,DateStr1,SizeText2,DateStr2);
+ }
bool AllowRename=(Flags & UIASKREP_F_NORENAME)==0;
int Choice=0;
diff --git a/src/thirdparty/unrar/ulinks.cpp b/src/thirdparty/unrar/ulinks.cpp
index b51ff6282..c6d2f874a 100644
--- a/src/thirdparty/unrar/ulinks.cpp
+++ b/src/thirdparty/unrar/ulinks.cpp
@@ -30,7 +30,13 @@ static bool UnixSymlink(const char *Target,const wchar *LinkName,RarTime *ftm,Ra
}
-bool ExtractUnixLink30(ComprDataIO &DataIO,Archive &Arc,const wchar *LinkName)
+static bool IsFullPath(const char *PathA) // Unix ASCII version.
+{
+ return *PathA==CPATHDIVIDER;
+}
+
+
+bool ExtractUnixLink30(CommandData *Cmd,ComprDataIO &DataIO,Archive &Arc,const wchar *LinkName)
{
char Target[NM];
if (IsLink(Arc.FileHead.FileAttr))
@@ -48,13 +54,16 @@ bool ExtractUnixLink30(ComprDataIO &DataIO,Archive &Arc,const wchar *LinkName)
if (!DataIO.UnpHash.Cmp(&Arc.FileHead.FileHash,Arc.FileHead.UseHashKey ? Arc.FileHead.HashKey:NULL))
return true;
+ if (!Cmd->AbsoluteLinks && (IsFullPath(Target) ||
+ !IsRelativeSymlinkSafe(Arc.FileHead.FileName,Arc.FileHead.RedirName)))
+ return false;
return UnixSymlink(Target,LinkName,&Arc.FileHead.mtime,&Arc.FileHead.atime);
}
return false;
}
-bool ExtractUnixLink50(const wchar *Name,FileHeader *hd)
+bool ExtractUnixLink50(CommandData *Cmd,const wchar *Name,FileHeader *hd)
{
char Target[NM];
WideToChar(hd->RedirName,Target,ASIZE(Target));
@@ -68,5 +77,8 @@ bool ExtractUnixLink50(const wchar *Name,FileHeader *hd)
return false;
DosSlashToUnix(Target,Target,ASIZE(Target));
}
+ if (!Cmd->AbsoluteLinks && (IsFullPath(Target) ||
+ !IsRelativeSymlinkSafe(hd->FileName,hd->RedirName)))
+ return false;
return UnixSymlink(Target,Name,&hd->mtime,&hd->atime);
}
diff --git a/src/thirdparty/unrar/unpack50.cpp b/src/thirdparty/unrar/unpack50.cpp
index d1188ee85..7821a3e6b 100644
--- a/src/thirdparty/unrar/unpack50.cpp
+++ b/src/thirdparty/unrar/unpack50.cpp
@@ -570,7 +570,7 @@ bool Unpack::ReadTables(BitInput &Inp,UnpackBlockHeader &Header,UnpackBlockTable
else
{
ZeroCount+=2;
- while (ZeroCount-- > 0 && I<sizeof(BitLength)/sizeof(BitLength[0]))
+ while (ZeroCount-- > 0 && I<ASIZE(BitLength))
BitLength[I++]=0;
I--;
}
@@ -587,7 +587,7 @@ bool Unpack::ReadTables(BitInput &Inp,UnpackBlockHeader &Header,UnpackBlockTable
{
if (!Inp.ExternalBuffer && Inp.InAddr>ReadTop-5)
if (!UnpReadBuf())
- return(false);
+ return false;
int Number=DecodeNumber(Inp,&Tables.BD);
if (Number<16)
{
@@ -633,12 +633,12 @@ bool Unpack::ReadTables(BitInput &Inp,UnpackBlockHeader &Header,UnpackBlockTable
}
}
if (!Inp.ExternalBuffer && Inp.InAddr>ReadTop)
- return(false);
+ return false;
MakeDecodeTables(&Table[0],&Tables.LD,NC);
MakeDecodeTables(&Table[NC],&Tables.DD,DC);
MakeDecodeTables(&Table[NC+DC],&Tables.LDD,LDC);
MakeDecodeTables(&Table[NC+DC+LDC],&Tables.RD,RC);
- return(true);
+ return true;
}
diff --git a/src/thirdparty/unrar/unpack50mt.cpp b/src/thirdparty/unrar/unpack50mt.cpp
index 6015379cc..9925cf2b8 100644
--- a/src/thirdparty/unrar/unpack50mt.cpp
+++ b/src/thirdparty/unrar/unpack50mt.cpp
@@ -80,6 +80,10 @@ void Unpack::Unpack5MT(bool Solid)
bool Done=false;
while (!Done)
{
+ // Data amount, which is guaranteed to fit block header and tables,
+ // so we can safely read them without additional checks.
+ const int TooSmallToProcess=1024;
+
int ReadSize=UnpIO->UnpRead(ReadBufMT+DataSize,(UNP_READ_SIZE_MT-DataSize)&~0xf);
if (ReadSize<0)
break;
@@ -87,13 +91,14 @@ void Unpack::Unpack5MT(bool Solid)
if (DataSize==0)
break;
+ // First read chunk can be small if we are near the end of volume
+ // and we want it to fit block header and tables.
+ if (ReadSize>0 && DataSize<TooSmallToProcess)
+ continue;
+
bool BufferProcessed=false;
while (BlockStart<DataSize && !Done)
{
- // Data amount, which is guaranteed to fit block header and tables,
- // so we can safely read them without additional checks.
- const int TooSmallToProcess=1024;
-
uint BlockNumber=0,BlockNumberMT=0;
while (BlockNumber<MaxUserThreads*UNP_BLOCKS_PER_THREAD)
{
diff --git a/src/thirdparty/unrar/version.hpp b/src/thirdparty/unrar/version.hpp
index 3a36f22b3..8518b5516 100644
--- a/src/thirdparty/unrar/version.hpp
+++ b/src/thirdparty/unrar/version.hpp
@@ -1,6 +1,6 @@
#define RARVER_MAJOR 5
-#define RARVER_MINOR 20
+#define RARVER_MINOR 21
#define RARVER_BETA 0
-#define RARVER_DAY 2
-#define RARVER_MONTH 12
-#define RARVER_YEAR 2014
+#define RARVER_DAY 15
+#define RARVER_MONTH 2
+#define RARVER_YEAR 2015
diff --git a/src/thirdparty/unrar/win32lnk.cpp b/src/thirdparty/unrar/win32lnk.cpp
index f911be98e..b291056f0 100644
--- a/src/thirdparty/unrar/win32lnk.cpp
+++ b/src/thirdparty/unrar/win32lnk.cpp
@@ -40,23 +40,6 @@ bool CreateReparsePoint(CommandData *Cmd,const wchar *Name,FileHeader *hd)
PrivSet=true;
}
- CreatePath(Name,true);
-
- // 'DirTarget' check is important for Unix symlinks to directories.
- // Unix symlinks do not have their own 'directory' attribute.
- if (hd->Dir || hd->DirTarget)
- {
- if (!CreateDirectory(Name,NULL))
- return false;
- }
- else
- {
- HANDLE hFile=CreateFile(Name,GENERIC_WRITE,0,NULL,CREATE_NEW,FILE_ATTRIBUTE_NORMAL,NULL);
- if (hFile == INVALID_HANDLE_VALUE)
- return false;
- CloseHandle(hFile);
- }
-
const DWORD BufSize=sizeof(REPARSE_DATA_BUFFER)+2*NM+1024;
Array<byte> Buf(BufSize);
REPARSE_DATA_BUFFER *rdb=(REPARSE_DATA_BUFFER *)&Buf[0];
@@ -79,6 +62,26 @@ bool CreateReparsePoint(CommandData *Cmd,const wchar *Name,FileHeader *hd)
size_t PrintLength=wcslen(PrintName);
bool AbsPath=WinPrefix;
+ if (!Cmd->AbsoluteLinks && (AbsPath || !IsRelativeSymlinkSafe(hd->FileName,hd->RedirName)))
+ return false;
+
+ CreatePath(Name,true);
+
+ // 'DirTarget' check is important for Unix symlinks to directories.
+ // Unix symlinks do not have their own 'directory' attribute.
+ if (hd->Dir || hd->DirTarget)
+ {
+ if (!CreateDirectory(Name,NULL))
+ return false;
+ }
+ else
+ {
+ HANDLE hFile=CreateFile(Name,GENERIC_WRITE,0,NULL,CREATE_NEW,FILE_ATTRIBUTE_NORMAL,NULL);
+ if (hFile == INVALID_HANDLE_VALUE)
+ return false;
+ CloseHandle(hFile);
+ }
+
if (hd->RedirType==FSREDIR_JUNCTION)
{
diff --git a/src/thirdparty/versions.txt b/src/thirdparty/versions.txt
index 807716792..b2ced440e 100644
--- a/src/thirdparty/versions.txt
+++ b/src/thirdparty/versions.txt
@@ -1,19 +1,19 @@
Project Version
----------------------------------------
-CSizingControlBar 2.45
-LAV Filters 0.63-58-5f45b57 (custom build based on 0.63-52-17b2dae)
-Little CMS 2.7 (git 8174681)
+CSizingControlBar 2.45 (modified)
+LAV Filters 0.65-13-79ba86d (custom build based on 0.65-9-5c5ff95)
+Little CMS 2.7 (git 6e33faa)
Logitech SDK 3.01 (driver 8.00.100)
-MediaInfoLib 0.7.71
+MediaInfoLib 0.7.73
Mhook 2.3 (modified)
MultiMon 28 Aug '03 (modified)
QuickTime SDK 7.3
RARFileSource 0.9.3 (modified)
RealMedia SDK -
ResizableLib 1.3
-SoundTouch 1.8.0 r201
+SoundTouch 1.9.0
TreePropSheet 7 Mar '03 (modified)
-UnRAR 5.2.3
+UnRAR 5.2.7
VirtualDub 1.10.4
-ZenLib 0.4.29 r498
+ZenLib 0.4.31
zlib 1.2.8