Commit Graph

57 Commits

Author SHA1 Message Date
Steve Lhomme
aab35dacc9 v1/v2: EBML_SEM_INFO() is not necessary anymore with EBML_CTX_IDX_INFO()
v2: clean EbmlSemantic

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@96 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-04-09 10:06:35 +00:00
Steve Lhomme
1fdcc6ae21 v1: fix the non-strict API calls compilation
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@95 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-04-09 06:38:21 +00:00
Moritz Bunkus
b3985c4976 Fixed a warning about using NULL in calculations
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@94 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-04-08 20:00:23 +00:00
Moritz Bunkus
4134860d67 Fixed a warning about wrong initialization order
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@93 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-04-08 19:58:29 +00:00
Steve Lhomme
66ccb761d8 use DECLARE_EBML_*** in the legacy code too
add a EBML_CTX_IDX() macro to avoid direct access to MyTable

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@92 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-04-08 16:36:43 +00:00
Steve Lhomme
d0c70fd901 add a EBML_CLASS_CALLBACK() macro when the EbmlCallback pointer is used directly
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@89 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-04-08 16:19:17 +00:00
Steve Lhomme
a2d9c1e0d6 add EBML_CLASS_SEMCONTEXT() for a more generic way to describe a global context callback
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@88 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-04-08 16:05:15 +00:00
Steve Lhomme
9ced122b2f new macro to define the old EbmlSemanticContext if it's not done elsewhere
+ add some missing SEMANTIC start/end

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@86 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-04-07 16:12:16 +00:00
Steve Lhomme
5dd210bfdc use a macro to define the semantic tables as the v2 library uses a slightly different table format
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@85 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-04-07 16:09:02 +00:00
Steve Lhomme
2b635aa5ac EBML_CLASS_CONTEXT() is a contraction of EBML_INFO_CONTEXT(EBML_INFO())
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@84 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-04-07 16:02:07 +00:00
Steve Lhomme
4d9242a8e6 replace DEFINE_MKX_MASTER_NOBODY() with DEFINE_MKX_MASTER_CONS() for better consistency
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@83 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-04-07 15:59:32 +00:00
Steve Lhomme
e4aa562e22 mark ValidateSize() as virtual (as a reminder)
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@82 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-04-07 09:43:00 +00:00
Steve Lhomme
350e192617 by default the any size is OK for Binary elements
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@81 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-04-07 09:41:09 +00:00
Steve Lhomme
07d6f46f78 move the default values in the .cpp files via the new declaration macros
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@77 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-04-06 17:20:14 +00:00
Steve Lhomme
2f079f185e more macro to simplify the class declaration
put the default value constructor in the C++ files

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@76 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-04-06 17:16:54 +00:00
Steve Lhomme
7b4779fe5f fix compilation when EBML_STRICT_API is not defined
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@74 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-04-06 07:21:44 +00:00
Steve Lhomme
2161be7870 clean the EBML context creation macro
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@69 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-04-05 15:52:08 +00:00
Steve Lhomme
071c70631d more options for the EBML master definitions
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@67 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-04-03 06:14:04 +00:00
Steve Lhomme
91b9d8cc7e libebml: add macros to simplify the EBML class item definitions (ID, ClassInfo, SemanticContext)
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@66 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-04-03 06:13:02 +00:00
Moritz Bunkus
0b3faddd90 Don't hide virtual members of the base class
'SetDefaultSize(int)' in the derived class hides 'virtual
SetDefault(uint64)' in the base class: The name matches but the
signature is different, and the 'virtual' keyword is missing.


git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@63 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-28 00:06:39 +00:00
Moritz Bunkus
d7b335f0a8 Properly compare elements
If you have "virtual operator <" in a base class and a derived
class and each takes a reference of its own class as an arugment
then the function in the derived class hides the one in the base
class and does not override is as the signatures do not match:

class base {
public:
  bool virtual operator <(const base &cmp);
};
class derived: public base {
public:
  bool virtual operator <(const derived &cmp);
};

If two instances of base are compared then base::operator< is called:

base *p1, *p2;
if (*p1 < *p2) // calls base::operator<


git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@61 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-27 23:07:20 +00:00
Moritz Bunkus
1de5badd44 Made changing the tool paths easier. Do not refuse to build with a mingw compiler.
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@56 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-23 15:55:17 +00:00
Moritz Bunkus
35942a7134 Make the ranlib and ar executables configurable. Support for setting the cross-compilation tool names easily.
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@53 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-23 15:08:11 +00:00
Moritz Bunkus
a65901063d Fix Endianess detection on Linux.
Some platforms like MIPS can come either in little or
in big endian. Therefore a static decision based on the
system used is invalid. The header file endian.h should
be used for systems on which it is available. At the moment
this is at least Linux.

Patch by Frank Neufingerl <fneufingerl@psi.de>

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@51 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-23 13:35:44 +00:00
Moritz Bunkus
22a45d1ac3 EbmlDummy elements do not have or need a Create method.
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@50 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-23 13:13:53 +00:00
Moritz Bunkus
b1d8a72e40 Include the cassert header if the asser() function is used
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@49 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-23 12:41:23 +00:00
Moritz Bunkus
63bd8b00e4 OpenSolaris knows (u)int64_t nowadays.
Also the standard int64_t type is typedefed as
"long int" with OpenSolaris 64bit gcc making it
incompatible with a "long long int" typedefed
int64.

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@48 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-23 11:58:36 +00:00
Moritz Bunkus
175a40e9c3 Always include inttypes.h on Linux-like systems
inttypes.h has been standard for a long time.
Also EbmlCrc32.h needs the uintptr_t type
which is declared in inttypes.h.

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@47 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-23 11:57:00 +00:00
Moritz Bunkus
b8187152d2 Fix member initialization order
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@46 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-23 11:53:34 +00:00
Steve Lhomme
3171db6ec6 introduce filepos_t for all the file position values (depends wether the system can handle 32 bits or 64 bits offsets)
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@44 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-19 15:35:26 +00:00
Steve Lhomme
bbe172eb50 no need to copy the string before copying it again
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@41 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-19 15:29:02 +00:00
Steve Lhomme
52c36a7d3f use a macro for the EbmlMaster iterator as it may differ between versions of libebml
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@39 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-18 17:08:57 +00:00
Steve Lhomme
55ac9a0532 add a EBML_SEM_CREATE() macro for older code using GetCallback directly
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@33 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-18 10:45:44 +00:00
Steve Lhomme
ff7409f9d5 cleaning
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@32 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-17 18:35:03 +00:00
Steve Lhomme
42f3a6229a the internal GetData() is the same as GetBuffer()
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@31 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-17 18:34:22 +00:00
Steve Lhomme
baa61c54cb factorize some common macros
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@26 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-17 10:30:26 +00:00
Steve Lhomme
cd5d717fb9 move some of the <cassert> includes and assert() calls out of the include files
+ the DefaultValue() methods return const objects

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@25 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-17 10:29:32 +00:00
Steve Lhomme
8b4a54c88f if USE_EBML_STRICT_API is defined in the project EBML_STRICT_API is defined internally and externally
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@24 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-17 10:27:15 +00:00
Steve Lhomme
71367a12c9 new macros to hide the internal variables of the context classes
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@23 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-17 10:26:39 +00:00
Steve Lhomme
d9dd385f9f macro moving
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@22 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-17 10:25:15 +00:00
Steve Lhomme
1b66de687a fix a recursive call issue
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@21 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-17 10:24:35 +00:00
Steve Lhomme
66f1b56fba disable access to internal values when EBML_STRICT_API is defined
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@20 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-15 16:21:50 +00:00
Steve Lhomme
c331b9b443 use the new CreateElement() virtual method instead than doing it through the Generic() call
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@19 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-15 16:20:08 +00:00
Steve Lhomme
995bc139c4 update the copyright notice to 2010
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@18 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-15 16:19:18 +00:00
Steve Lhomme
4bea9a04da fix a double implementation
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@17 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-15 16:12:06 +00:00
Steve Lhomme
89abd52a34 add a macro to define all the pure virtual methods in a "concrete" EBML class (that correspond to an item in EBML streams)
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@16 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-15 16:11:24 +00:00
Steve Lhomme
de3185abde add macros to access the EbmlId internal variables
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@15 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-15 16:08:31 +00:00
Steve Lhomme
cd378f23ff add some macros to access the EBML ID/Context and use them
git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@14 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-15 16:07:14 +00:00
Steve Lhomme
9122d30f15 use the new accessors internally
+ make the new accessors inline

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@13 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-15 16:03:51 +00:00
Steve Lhomme
289a1c2e86 the EbmlBinary GetSize() is the same as the parent class (EbmlElement) one
+ add an internal Accessor API

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/libebml@12 a6f86f6d-0131-4f8e-9e7b-e335508773d5
2010-03-15 16:00:29 +00:00