Changeset 323
- Timestamp:
- 02/02/07 00:39:58 (2 years ago)
- Files:
-
- trunk/MatroskaImport.h (modified) (2 diffs)
- trunk/MatroskaImportPrivate.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/MatroskaImport.h
r265 r323 36 36 #include <matroska/KaxChapters.h> 37 37 #include <matroska/KaxBlock.h> 38 #include <matroska/KaxAttachments.h> 38 39 39 40 using namespace libmatroska; … … 156 157 void ReadChapters(KaxChapters &chapterEntries); 157 158 159 // Activates any attached fonts, ignores other attachment types for now 160 void ReadAttachments(KaxAttachments &attachments); 161 158 162 // These three are called from ReadTracks to set up a track of the specific type, 159 163 // modifying the MatroskaTrack structure to reflect the newly create track. trunk/MatroskaImportPrivate.cpp
r316 r323 39 39 #include <matroska/KaxCluster.h> 40 40 #include <matroska/KaxBlock.h> 41 #include <matroska/KaxAttachments.h> 42 #include <matroska/KaxAttached.h> 41 43 42 44 #include "MatroskaImport.h" … … 114 116 el_l1->Read(*aStream, KaxChapters::ClassInfos.Context, upperLevel, dummyElt, true); 115 117 ReadChapters(*static_cast<KaxChapters *>(el_l1)); 118 119 } else if (EbmlId(*el_l1) == KaxAttachments::ClassInfos.GlobalId) { 120 el_l1->Read(*aStream, KaxAttachments::ClassInfos.Context, upperLevel, dummyElt, true); 121 ReadAttachments(*static_cast<KaxAttachments *>(el_l1)); 116 122 117 123 } else if (EbmlId(*el_l1) == KaxCluster::ClassInfos.GlobalId) { … … 568 574 } 569 575 576 void MatroskaImport::ReadAttachments(KaxAttachments &attachments) 577 { 578 KaxAttached *attachedFile = FindChild<KaxAttached>(attachments); 579 580 while (attachedFile && attachedFile->GetSize() > 0) { 581 string fileMimeType = GetChild<KaxMimeType>(*attachedFile); 582 583 if (fileMimeType == "application/x-truetype-font") { 584 KaxFileData & fontData = GetChild<KaxFileData>(*attachedFile); 585 586 if (fontData.GetSize()) { 587 ATSFontContainerRef container; 588 ATSFontActivateFromMemory(fontData.GetBuffer(), fontData.GetSize(), kATSFontContextLocal, 589 kATSFontFormatUnspecified, NULL, kATSOptionFlagsDefault, &container); 590 } 591 } 592 593 attachedFile = &GetNextChild<KaxAttached>(attachments, *attachedFile); 594 } 595 } 596 570 597 void MatroskaImport::ImportCluster(KaxCluster &cluster, bool addToTrack) 571 598 {
