Skip to content

Commit

Permalink
Make Prev/Next Segment UID classes standalone
Browse files Browse the repository at this point in the history
They are not KaxSegmentUID as they don't have the same ID.
If we need a special class for Segment UIDs (including chapter ones) we
should use a proper class/interface.

Eventually this should be moved into KaxSemantic like KaxSegmentUID.
  • Loading branch information
robUx4 committed Dec 19, 2023
1 parent b45e150 commit 4a16ee0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
12 changes: 2 additions & 10 deletions matroska/KaxInfoData.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,15 @@ using namespace libebml;
namespace libmatroska {

DECLARE_MKX_CONTEXT(KaxPrevUID)
class MATROSKA_DLL_API KaxPrevUID : public KaxSegmentUID {
DECLARE_MKX_BINARY (KaxPrevUID)
public:
KaxPrevUID() = default;
KaxPrevUID(const KaxPrevUID & ElementToClone) = default;
bool ValidateSize() const override { return IsFiniteSize() && (GetSize() == 16);}

EBML_CONCRETE_CLASS(KaxPrevUID)
};

DECLARE_MKX_CONTEXT(KaxNextUID)
class MATROSKA_DLL_API KaxNextUID : public KaxSegmentUID {
DECLARE_MKX_BINARY (KaxNextUID)
public:
KaxNextUID() = default;
KaxNextUID(const KaxNextUID & ElementToClone) = default;
bool ValidateSize() const override { return IsFiniteSize() && (GetSize() == 16);}

EBML_CONCRETE_CLASS(KaxNextUID)
};

} // namespace libmatroska
Expand Down
4 changes: 2 additions & 2 deletions src/KaxSemantic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ DEFINE_END_SEMANTIC(KaxInfo)
DEFINE_MKX_MASTER(KaxInfo, 0x1549A966, 4, KaxSegment, "Info")
DEFINE_MKX_BINARY (KaxSegmentUID, 0x73A4, 2, KaxInfo, "SegmentUID")
DEFINE_MKX_UNISTRING(KaxSegmentFilename, 0x7384, 2, KaxInfo, "SegmentFilename")
DEFINE_MKX_BINARY_CONS(KaxPrevUID, 0x3CB923, 3, KaxInfo, "PrevUID")
DEFINE_MKX_BINARY(KaxPrevUID, 0x3CB923, 3, KaxInfo, "PrevUID")
DEFINE_MKX_UNISTRING(KaxPrevFilename, 0x3C83AB, 3, KaxInfo, "PrevFilename")
DEFINE_MKX_BINARY_CONS(KaxNextUID, 0x3EB923, 3, KaxInfo, "NextUID")
DEFINE_MKX_BINARY(KaxNextUID, 0x3EB923, 3, KaxInfo, "NextUID")
DEFINE_MKX_UNISTRING(KaxNextFilename, 0x3E83BB, 3, KaxInfo, "NextFilename")
DEFINE_MKX_BINARY (KaxSegmentFamily, 0x4444, 2, KaxInfo, "SegmentFamily")

Expand Down

0 comments on commit 4a16ee0

Please sign in to comment.