diff --git a/matroska/KaxContexts.h b/matroska/KaxContexts.h index 98b9a4c3..ff1ca912 100644 --- a/matroska/KaxContexts.h +++ b/matroska/KaxContexts.h @@ -15,61 +15,44 @@ using namespace libebml; namespace libmatroska { -extern const EbmlSemanticContext MATROSKA_DLL_API KaxMatroska_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxSegment_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxAttachments_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxAttached_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxFileDescription_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxFileName_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxMimeType_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxFileData_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxChapters_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxCluster_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTags_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTag_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxBlockGroup_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxReferencePriority_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxReferenceBlock_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxReferenceVirtual_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxCues_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxInfo_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxSeekHead_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTracks_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackEntry_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackNumber_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackType_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackFlagEnabled_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackFlagDefault_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackFlagLacing_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackName_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackLanguage_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecID_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecPrivate_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecName_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecSettings_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecInfoURL_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecDownloadURL_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxCodecDecodeAll_Context; -extern const EbmlSemanticContext MATROSKA_DLL_API KaxTrackOverlay_Context; - -#define Context_KaxMatroska KaxMatroska_Context -#define Context_KaxSegment KaxSegment_Context -#define Context_KaxTrackEntry KaxTrackEntry_Context -#define Context_KaxTracks KaxTracks_Context -#define Context_KaxCluster KaxCluster_Context -#define Context_KaxBlockGroup KaxBlockGroup_Context -#define Context_KaxInfo KaxInfo_Context -#define Context_KaxAttached KaxAttached_Context -#define Context_KaxAttachments KaxAttachments_Context -#define Context_KaxChapters KaxChapters_Context -#define Context_KaxCues KaxCues_Context -#define Context_KaxTags KaxTags_Context -#define Context_KaxSeekHead KaxSeekHead_Context -#define Context_KaxTag KaxTag_Context -#define Context_KaxTagCommercial KaxTagCommercial_Context +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxMatroska; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxSegment; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxAttachments; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxAttached; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxFileDescription; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxFileName; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxMimeType; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxFileData; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxChapters; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxCluster; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxTags; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxTag; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxBlockGroup; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxReferencePriority; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxReferenceBlock; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxReferenceVirtual; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxCues; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxInfo; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxSeekHead; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxTracks; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxTrackEntry; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxTrackNumber; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxTrackType; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxTrackFlagEnabled; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxTrackFlagDefault; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxTrackFlagLacing; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxTrackName; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxTrackLanguage; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxCodecID; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxCodecPrivate; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxCodecName; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxCodecSettings; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxCodecInfoURL; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxCodecDownloadURL; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxCodecDecodeAll; +extern const EbmlSemanticContext MATROSKA_DLL_API Context_KaxTrackOverlay; extern MATROSKA_DLL_API const EbmlSemanticContext & GetKaxGlobal_Context(); -//extern MATROSKA_DLL_API const EbmlSemanticContext & GetKaxTagsGlobal_Context(); } // namespace libmatroska diff --git a/test/ebml/test00.cpp b/test/ebml/test00.cpp index c6fb4c2e..edc6791d 100644 --- a/test/ebml/test00.cpp +++ b/test/ebml/test00.cpp @@ -127,7 +127,7 @@ int main(void) } printf("\n"); - ElementLevel0->SkipData(aStream, Context_EbmlHead); + ElementLevel0->SkipData(aStream, EBML_CLASS_SEMCONTEXT(EbmlHead)); if (ElementLevel0 != NULL) delete ElementLevel0; } @@ -145,23 +145,23 @@ int main(void) int bUpperElement = 0; - ElementLevel1 = aStream.FindNextElement(KaxSegment_Context, bUpperElement, 0xFFFFFFFFL, true); + ElementLevel1 = aStream.FindNextElement(EBML_CLASS_SEMCONTEXT(KaxSegment), bUpperElement, 0xFFFFFFFFL, true); while (ElementLevel1 != NULL) { /// \todo switch the type of the element to check if it's one we want to handle, like attachements if (EbmlId(*ElementLevel1) == EBML_ID(KaxAttachments)) { printf("Attachments detected\n"); - ElementLevel2 = aStream.FindNextElement(KaxAttachments_Context, bUpperElement, 0xFFFFFFFFL, true); + ElementLevel2 = aStream.FindNextElement(EBML_CLASS_SEMCONTEXT(KaxAttachments), bUpperElement, 0xFFFFFFFFL, true); while (ElementLevel2 != NULL) { /// \todo switch the type of the element to check if it's one we want to handle, like attachements if (EbmlId(*ElementLevel2) == EBML_ID(KaxAttached)) { printf("Attached file detected\n"); } #ifdef SKIP_ATTACHED - ElementLevel2 = ElementLevel2->SkipData(aStream, KaxAttached_Context); + ElementLevel2 = ElementLevel2->SkipData(aStream, EBML_CLASS_SEMCONTEXT(KaxAttached)); if (ElementLevel2 == NULL) { - ElementLevel2 = aStream.FindNextID(KaxAttachments_Context, bUpperElement, 0xFFFFFFFFL, true); + ElementLevel2 = aStream.FindNextID(EBML_CLASS_SEMCONTEXT(KaxAttachments), bUpperElement, 0xFFFFFFFFL, true); if (bUpperElement) { printf("Upper level1 element found\n"); @@ -172,7 +172,7 @@ int main(void) } #else // SKIP_ATTACHED // Display the filename (if it exists) - ElementLevel3 = aStream.FindNextElement(KaxAttached_Context, bUpperElement, 0xFFFFFFFFL, false); + ElementLevel3 = aStream.FindNextElement(EBML_CLASS_SEMCONTEXT(KaxAttached), bUpperElement, 0xFFFFFFFFL, false); while (ElementLevel3 != NULL) { /// \todo switch the type of the element to check if it's one we want to handle, like attachements if (EbmlId(*ElementLevel3) == EBML_ID(KaxFileName)) { @@ -180,10 +180,10 @@ int main(void) tmp.ReadData(aStream.I_O()); printf("File Name = %s\n", UTFstring(tmp).GetUTF8().c_str()); } else { - ElementLevel3->SkipData(aStream, KaxAttached_Context); + ElementLevel3->SkipData(aStream, EBML_CLASS_SEMCONTEXT(KaxAttached)); } delete ElementLevel3; - ElementLevel3 = aStream.FindNextElement(KaxAttached_Context, bUpperElement, 0xFFFFFFFFL, false); + ElementLevel3 = aStream.FindNextElement(EBML_CLASS_SEMCONTEXT(KaxAttached), bUpperElement, 0xFFFFFFFFL, false); if (bUpperElement) break; } @@ -192,25 +192,25 @@ int main(void) delete ElementLevel2; ElementLevel2 = ElementLevel3; } else { - ElementLevel2->SkipData(aStream, KaxAttached_Context); + ElementLevel2->SkipData(aStream, EBML_CLASS_SEMCONTEXT(KaxAttached)); delete ElementLevel2; - ElementLevel2 = aStream.FindNextElement(KaxAttachments_Context, bUpperElement, 0xFFFFFFFFL, true); + ElementLevel2 = aStream.FindNextElement(EBML_CLASS_SEMCONTEXT(KaxAttachments), bUpperElement, 0xFFFFFFFFL, true); } #endif // SKIP_ATTACHED } } - ElementLevel1->SkipData(aStream, KaxAttachments_Context); + ElementLevel1->SkipData(aStream, EBML_CLASS_SEMCONTEXT(KaxAttachments)); delete ElementLevel1; - ElementLevel1 = aStream.FindNextElement(KaxSegment_Context, bUpperElement, 0xFFFFFFFFL, true); + ElementLevel1 = aStream.FindNextElement(EBML_CLASS_SEMCONTEXT(KaxSegment), bUpperElement, 0xFFFFFFFFL, true); } - ElementLevel0->SkipData(aStream, KaxSegment_Context); + ElementLevel0->SkipData(aStream, EBML_CLASS_SEMCONTEXT(KaxSegment)); if (ElementLevel0 != NULL) delete ElementLevel0; - ElementLevel0 = aStream.FindNextElement(KaxSegment_Context, bUpperElement, 0xFFFFFFFFL, true); + ElementLevel0 = aStream.FindNextElement(EBML_CLASS_SEMCONTEXT(KaxSegment), bUpperElement, 0xFFFFFFFFL, true); } Ebml_Wfile.close(); diff --git a/test/mux/test8.cpp b/test/mux/test8.cpp index 2b2931de..6802fdeb 100644 --- a/test/mux/test8.cpp +++ b/test/mux/test8.cpp @@ -67,7 +67,7 @@ int main(int argc, char **argv) } printf("\n"); - ElementLevel0->SkipData(aStream, Context_EbmlHead); + ElementLevel0->SkipData(aStream, EBML_CLASS_SEMCONTEXT(EbmlHead)); if (ElementLevel0 != NULL) delete ElementLevel0; }