From 2df38a5bf858f616ad12f7927acf353e22acb3df Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Tue, 27 Feb 2024 10:10:15 +0100 Subject: [PATCH 1/5] remove unused legacy type definitions --- matroska/KaxTypes.h | 37 ------------------------------------- 1 file changed, 37 deletions(-) diff --git a/matroska/KaxTypes.h b/matroska/KaxTypes.h index bc27398e..b081e7f0 100644 --- a/matroska/KaxTypes.h +++ b/matroska/KaxTypes.h @@ -25,43 +25,6 @@ typedef enum track_type { track_control = 0x20 ///< Control-codes for menus and other stuff } track_type; -/*! - \enum matroska_error_t - \brief a callback that the library use to inform of errors happening - \note this should be used by the libmatroska internals -*/ -typedef enum { - error_null_pointer ///< NULL pointer where something else is expected -} matroska_error_t; - -typedef void *matroska_stream; - -/*! - \var void* matroska_id - \brief UID used to access an Matroska file instance -*/ -typedef void* matroska_id; -/*! - \var void* matroska_track - \brief UID used to access a track -*/ -typedef void* matroska_track; -/*! - \var char* c_string - \brief C-String, ie a buffer with characters terminated by \0 -*/ -typedef char* c_string; -/*! - \var unsigned int matroska_file_mode - \brief A bit buffer, each bit representing a value for the file opening - \todo replace the unsigned int by a sized type (8 or 16 bits) -*/ -typedef char * matroska_file_mode; -/*! - \var void (*matroska_error_callback)(matroska_error_t error_code, char* error_message) - \brief a callback that the library use to inform of errors happening -*/ -typedef void (*matroska_error_callback)(matroska_error_t error_code, char* error_message); namespace libmatroska { From 1fb51119d175691ac09bfe8ae48c19b72c79976b Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Tue, 27 Feb 2024 10:11:27 +0100 Subject: [PATCH 2/5] remove unused header from KaxTypes.h --- matroska/KaxTypes.h | 1 - 1 file changed, 1 deletion(-) diff --git a/matroska/KaxTypes.h b/matroska/KaxTypes.h index b081e7f0..bbd941a8 100644 --- a/matroska/KaxTypes.h +++ b/matroska/KaxTypes.h @@ -8,7 +8,6 @@ #define LIBMATROSKA_TYPES_H #include "matroska/KaxConfig.h" -#include /*! \enum track_type From 9f92041b5b985748494aec548c790a8d754bc2b3 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Tue, 27 Feb 2024 10:13:38 +0100 Subject: [PATCH 3/5] remove KaxTypes.h include from FileKax --- matroska/FileKax.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/matroska/FileKax.h b/matroska/FileKax.h index aad76299..90398ef0 100644 --- a/matroska/FileKax.h +++ b/matroska/FileKax.h @@ -10,7 +10,7 @@ //#include -#include "matroska/KaxTypes.h" +#include "matroska/KaxConfig.h" #include //#include "MainHeader.h" //#include "TrackType.h" From a98025c65263614e22196e82f41b86ee3194dd36 Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Tue, 27 Feb 2024 10:17:23 +0100 Subject: [PATCH 4/5] remove unused FileKax.* It's included in mkvtoolnix but not used. --- CMakeLists.txt | 2 -- matroska/FileKax.h | 42 ------------------------------------------ src/FileKax.cpp | 37 ------------------------------------- test/mux/test6.cpp | 1 - test/mux/test8.cpp | 6 ------ test/tags/test9.cpp | 1 - 6 files changed, 89 deletions(-) delete mode 100644 matroska/FileKax.h delete mode 100644 src/FileKax.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e76378b..d97c2480 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,7 +41,6 @@ if(DEV_MODE) endif() set(libmatroska_SOURCES - src/FileKax.cpp src/KaxAttached.cpp src/KaxAttachments.cpp src/KaxBlock.cpp @@ -57,7 +56,6 @@ set(libmatroska_SOURCES src/KaxVersion.cpp) set(libmatroska_PUBLIC_HEADERS - matroska/FileKax.h matroska/KaxBlockData.h matroska/KaxBlock.h matroska/KaxCluster.h diff --git a/matroska/FileKax.h b/matroska/FileKax.h deleted file mode 100644 index 90398ef0..00000000 --- a/matroska/FileKax.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright © 2002-2010 Steve Lhomme. -// SPDX-License-Identifier: LGPL-2.1-or-later - -/*! - \file - \author Steve Lhomme -*/ -#ifndef LIBMATROSKA_FILE_H -#define LIBMATROSKA_FILE_H - -//#include - -#include "matroska/KaxConfig.h" -#include -//#include "MainHeader.h" -//#include "TrackType.h" -//#include "StreamInfo.h" -//#include "Cluster.h" -//#include "CodecHeader.h" - -namespace libmatroska { - -//class Track; -//class Frame; - -/*! - \class MATROSKA_DLL_API FileMatroska - \brief General container of all the parameters and data of an Matroska file - \todo Handle the filename and next filename - \todo Handle the IOCallback selection/type -*/ -class MATROSKA_DLL_API FileMatroska { - public: - FileMatroska(libebml::IOCallback & output); - ~FileMatroska() = default; - libebml::IOCallback & myFile; - -}; - -} // namespace libmatroska - -#endif // FILE_KAX_HPP diff --git a/src/FileKax.cpp b/src/FileKax.cpp deleted file mode 100644 index ab22726b..00000000 --- a/src/FileKax.cpp +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright © 2002-2003 Steve Lhomme. -// SPDX-License-Identifier: LGPL-2.1-or-later - -/*! - \file - \author Steve Lhomme -*/ -//#include "StdInclude.h" -#include "matroska/FileKax.h" -#include -#include -//#include "Cluster.h" -//#include "Track.h" -//#include "Block.h" -//#include "Frame.h" -//#include "Version.h" - -using namespace libebml; - -namespace libmatroska { - -//typedef Track *TrackID; - -FileMatroska::FileMatroska(IOCallback & output) - :myFile(output) -{ -} - -/* FileMatroska::~FileMatroska() -{ - // if (myCurrCluster != NULL) - // throw 0; // there are some data left to write - // if (myCurrReadCluster != NULL || myCurrReadBlock != NULL) - // throw 0; // there are some data left to write -} */ - -} // namespace libmatroska diff --git a/test/mux/test6.cpp b/test/mux/test6.cpp index 3c32f92c..c571ae9a 100644 --- a/test/mux/test6.cpp +++ b/test/mux/test6.cpp @@ -7,7 +7,6 @@ \author Steve Lhomme */ -#include "matroska/FileKax.h" #include "matroska/KaxSegment.h" #include "matroska/KaxTracks.h" #include "matroska/KaxCluster.h" diff --git a/test/mux/test8.cpp b/test/mux/test8.cpp index c75fc210..436d00ae 100644 --- a/test/mux/test8.cpp +++ b/test/mux/test8.cpp @@ -8,7 +8,6 @@ */ #include "matroska/KaxSegment.h" -#include "matroska/FileKax.h" #include "matroska/KaxContexts.h" #include "matroska/KaxTracks.h" #include "matroska/KaxCluster.h" @@ -43,8 +42,6 @@ int main(int argc, char **argv) try { StdIOCallback Cluster_file((argc>=2 ? argv[1] : "muxed.mkv"), MODE_READ); - // create the Matroska file -/// FileKax MuxedFile(Cluster_file); // bool bAllowDummy = false; // don't read elements we don't know bool bAllowDummy = true; // even read elements we don't know (needed for CRC checking) @@ -56,7 +53,6 @@ int main(int argc, char **argv) EbmlElement * ElementLevel3 = nullptr; EbmlElement * ElementLevel4 = nullptr; -/// MuxedFile.ReadHead(); // find the EBML head in the file ElementLevel0 = aStream.FindNextID(EBML_INFO(EbmlHead), 0xFFFFFFFFL); if (ElementLevel0 != NULL) @@ -91,8 +87,6 @@ int main(int argc, char **argv) { if (EbmlId(*ElementLevel0) == EBML_ID(KaxSegment)) { Segment = static_cast(ElementLevel0); -// MuxedFile.ReadTracks(); -// MuxedFile.ReadCodec(); // scan the file for a Tracks element (all previous Level1 elements are discarded) ElementLevel1 = aStream.FindNextElement(EBML_CONTEXT(ElementLevel0), UpperElementLevel, 0, bAllowDummy); diff --git a/test/tags/test9.cpp b/test/tags/test9.cpp index 16d6ebbd..14e7016f 100644 --- a/test/tags/test9.cpp +++ b/test/tags/test9.cpp @@ -7,7 +7,6 @@ \author Moritz Bunkus */ -#include #include #include #include From 471da3a5e49270c83d358385a1aa9b1cee0b27bf Mon Sep 17 00:00:00 2001 From: Steve Lhomme Date: Wed, 28 Feb 2024 09:30:33 +0100 Subject: [PATCH 5/5] remove deprecated KaxCodeDate string --- matroska/KaxVersion.h | 1 - src/KaxVersion.cpp | 5 ----- test/ebml/test00.cpp | 2 +- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/matroska/KaxVersion.h b/matroska/KaxVersion.h index f66573b7..2bd11181 100644 --- a/matroska/KaxVersion.h +++ b/matroska/KaxVersion.h @@ -18,7 +18,6 @@ namespace libmatroska { #define LIBMATROSKA_VERSION 0x020000 extern const MATROSKA_DLL_API std::string KaxCodeVersion; -extern const MATROSKA_DLL_API std::string KaxCodeDate; /*! \todo Improve the CRC/ECC system (backward and forward possible ?) to fit streaming/live writing/simple reading diff --git a/src/KaxVersion.cpp b/src/KaxVersion.cpp index d450d530..34655b31 100644 --- a/src/KaxVersion.cpp +++ b/src/KaxVersion.cpp @@ -12,9 +12,4 @@ namespace libmatroska { const std::string KaxCodeVersion = "2.0.0"; -// Up to version 1.4.4 this library exported a build date string. As -// this made the build non-reproducible, replace it by a placeholder to -// remain binary compatible. -const std::string KaxCodeDate = "Unknown"; - } // namespace libmatroska diff --git a/test/ebml/test00.cpp b/test/ebml/test00.cpp index 09cd46e4..04ba7a45 100644 --- a/test/ebml/test00.cpp +++ b/test/ebml/test00.cpp @@ -37,7 +37,7 @@ const char RW_FILENAME[] = "test.kax"; */ int main(void) { - printf("Test00 :\nEBML %s %s / Matroska %s %s\n", EbmlCodeVersion.c_str(), EbmlCodeDate.c_str(), KaxCodeVersion.c_str(), KaxCodeDate.c_str()); + printf("Test00 :\nEBML %s / Matroska %s\n", EbmlCodeVersion.c_str(), KaxCodeVersion.c_str()); StdIOCallback Ebml_file(RW_FILENAME, ::MODE_CREATE); ///// Writing test