Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the proper name for EbmlSemanticContext exports #135

Merged
merged 4 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 36 additions & 53 deletions matroska/KaxContexts.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
28 changes: 14 additions & 14 deletions test/ebml/test00.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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");
Expand All @@ -172,18 +172,18 @@ 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)) {
KaxFileName & tmp = *static_cast<KaxFileName*>(ElementLevel3);
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;
}
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion test/mux/test8.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down