Compare commits
24 Commits
libwebm-1.
...
libwebm-1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6623441ee8 | ||
|
|
3ba8df9a64 | ||
|
|
bebe4accb8 | ||
|
|
93263f0b4a | ||
|
|
e1e757f919 | ||
|
|
6c45ab2d4c | ||
|
|
cb7b24880f | ||
|
|
157775ac74 | ||
|
|
fd1d8006f0 | ||
|
|
9203d2dcd1 | ||
|
|
be2f81abca | ||
|
|
cb5414a42a | ||
|
|
2ce6965b2d | ||
|
|
8db600e1c9 | ||
|
|
85353469f8 | ||
|
|
d97f236f81 | ||
|
|
790f639f2f | ||
|
|
91dbee4b6e | ||
|
|
1e6c5cbaf7 | ||
|
|
c62b9f8a21 | ||
|
|
5dd6000dc7 | ||
|
|
3ea595b132 | ||
|
|
14e42cf98b | ||
|
|
30bf3472bf |
28
RELEASE.TXT
28
RELEASE.TXT
@@ -1,3 +1,29 @@
|
|||||||
|
1.0.0.5
|
||||||
|
* Handled case when no duration
|
||||||
|
* Handled empty clusters
|
||||||
|
* Handled empty clusters when seeking
|
||||||
|
* Implemented check lacing bits
|
||||||
|
|
||||||
|
1.0.0.4
|
||||||
|
* Made Cues member variables mutables
|
||||||
|
* Defined against badly-formatted cue points
|
||||||
|
* Segment::GetCluster returns CuePoint too
|
||||||
|
* Separated cue-based searches
|
||||||
|
|
||||||
|
1.0.0.3
|
||||||
|
* Added Block::GetOffset() to get a frame's offset in a block
|
||||||
|
* Changed cluster count type from size_t to long
|
||||||
|
* Parsed SeekHead to find cues
|
||||||
|
* Allowed seeking beyond end of cluster cache
|
||||||
|
* Added not to attempt to reparse cues element
|
||||||
|
* Restructured Segment::LoadCluster
|
||||||
|
* Marked position of cues without parsing cues element
|
||||||
|
* Allowed cue points to be loaded incrementally
|
||||||
|
* Implemented to load lazily cue points as they're searched
|
||||||
|
* Merged Cues::LoadCuePoint into Cues::Find
|
||||||
|
* Lazy init cues
|
||||||
|
* Loaded cue point during find
|
||||||
|
|
||||||
1.0.0.2
|
1.0.0.2
|
||||||
* added support for Cues element
|
* added support for Cues element
|
||||||
* seeking was improved
|
* seeking was improved
|
||||||
@@ -5,4 +31,4 @@
|
|||||||
1.0.0.1
|
1.0.0.1
|
||||||
* fixed item 141
|
* fixed item 141
|
||||||
* added item 142
|
* added item 142
|
||||||
* added this file, RELEASE.TXT, to repository
|
* added this file, RELEASE.TXT, to repository
|
||||||
|
|||||||
800
mkvparser.cpp
800
mkvparser.cpp
File diff suppressed because it is too large
Load Diff
@@ -37,7 +37,7 @@ short Unserialize2SInt(IMkvReader*, long long);
|
|||||||
signed char Unserialize1SInt(IMkvReader*, long long);
|
signed char Unserialize1SInt(IMkvReader*, long long);
|
||||||
bool Match(IMkvReader*, long long&, unsigned long, long long&);
|
bool Match(IMkvReader*, long long&, unsigned long, long long&);
|
||||||
bool Match(IMkvReader*, long long&, unsigned long, char*&);
|
bool Match(IMkvReader*, long long&, unsigned long, char*&);
|
||||||
bool Match(IMkvReader*, long long&, unsigned long,unsigned char*&, size_t&);
|
bool Match(IMkvReader*, long long&, unsigned long, unsigned char*&, size_t&);
|
||||||
bool Match(IMkvReader*, long long&, unsigned long, double&);
|
bool Match(IMkvReader*, long long&, unsigned long, double&);
|
||||||
bool Match(IMkvReader*, long long&, unsigned long, short&);
|
bool Match(IMkvReader*, long long&, unsigned long, short&);
|
||||||
|
|
||||||
@@ -80,6 +80,7 @@ public:
|
|||||||
long long GetTime(const Cluster*) const; //absolute, and scaled (ns)
|
long long GetTime(const Cluster*) const; //absolute, and scaled (ns)
|
||||||
bool IsKey() const;
|
bool IsKey() const;
|
||||||
void SetKey(bool);
|
void SetKey(bool);
|
||||||
|
bool IsInvisible() const;
|
||||||
|
|
||||||
int GetFrameCount() const; //to index frames: [0, count)
|
int GetFrameCount() const; //to index frames: [0, count)
|
||||||
|
|
||||||
@@ -91,26 +92,15 @@ public:
|
|||||||
long Read(IMkvReader*, unsigned char*) const;
|
long Read(IMkvReader*, unsigned char*) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#if 0
|
|
||||||
long long GetOffset() const;
|
|
||||||
long GetSize() const;
|
|
||||||
long Read(IMkvReader*, unsigned char*) const;
|
|
||||||
#else
|
|
||||||
const Frame& GetFrame(int frame_index) const;
|
const Frame& GetFrame(int frame_index) const;
|
||||||
#endif
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
long long m_track; //Track::Number()
|
long long m_track; //Track::Number()
|
||||||
short m_timecode; //relative to cluster
|
short m_timecode; //relative to cluster
|
||||||
unsigned char m_flags;
|
unsigned char m_flags;
|
||||||
|
|
||||||
#if 0
|
|
||||||
long long m_frameOff;
|
|
||||||
long m_frameSize;
|
|
||||||
#else
|
|
||||||
Frame* m_frames;
|
Frame* m_frames;
|
||||||
int m_frame_count;
|
int m_frame_count;
|
||||||
#endif
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -209,6 +199,7 @@ public:
|
|||||||
|
|
||||||
long long GetType() const;
|
long long GetType() const;
|
||||||
long long GetNumber() const;
|
long long GetNumber() const;
|
||||||
|
unsigned long long GetUid() const;
|
||||||
const char* GetNameAsUTF8() const;
|
const char* GetNameAsUTF8() const;
|
||||||
const char* GetCodecNameAsUTF8() const;
|
const char* GetCodecNameAsUTF8() const;
|
||||||
const char* GetCodecId() const;
|
const char* GetCodecId() const;
|
||||||
@@ -227,7 +218,7 @@ public:
|
|||||||
{
|
{
|
||||||
long long type;
|
long long type;
|
||||||
long long number;
|
long long number;
|
||||||
long long uid;
|
unsigned long long uid;
|
||||||
char* nameAsUTF8;
|
char* nameAsUTF8;
|
||||||
char* codecId;
|
char* codecId;
|
||||||
unsigned char* codecPrivate;
|
unsigned char* codecPrivate;
|
||||||
@@ -243,6 +234,7 @@ public:
|
|||||||
long GetFirst(const BlockEntry*&) const;
|
long GetFirst(const BlockEntry*&) const;
|
||||||
long GetNext(const BlockEntry* pCurr, const BlockEntry*& pNext) const;
|
long GetNext(const BlockEntry* pCurr, const BlockEntry*& pNext) const;
|
||||||
virtual bool VetEntry(const BlockEntry*) const = 0;
|
virtual bool VetEntry(const BlockEntry*) const = 0;
|
||||||
|
virtual long Seek(long long time_ns, const BlockEntry*&) const = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Track(Segment*, const Info&);
|
Track(Segment*, const Info&);
|
||||||
@@ -254,7 +246,7 @@ protected:
|
|||||||
EOSBlock();
|
EOSBlock();
|
||||||
|
|
||||||
bool EOS() const;
|
bool EOS() const;
|
||||||
Cluster* GetCluster() const;
|
const Cluster* GetCluster() const;
|
||||||
size_t GetIndex() const;
|
size_t GetIndex() const;
|
||||||
const Block* GetBlock() const;
|
const Block* GetBlock() const;
|
||||||
bool IsBFrame() const;
|
bool IsBFrame() const;
|
||||||
@@ -277,6 +269,7 @@ public:
|
|||||||
double GetFrameRate() const;
|
double GetFrameRate() const;
|
||||||
|
|
||||||
bool VetEntry(const BlockEntry*) const;
|
bool VetEntry(const BlockEntry*) const;
|
||||||
|
long Seek(long long time_ns, const BlockEntry*&) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
long long m_width;
|
long long m_width;
|
||||||
@@ -297,6 +290,7 @@ public:
|
|||||||
long long GetChannels() const;
|
long long GetChannels() const;
|
||||||
long long GetBitDepth() const;
|
long long GetBitDepth() const;
|
||||||
bool VetEntry(const BlockEntry*) const;
|
bool VetEntry(const BlockEntry*) const;
|
||||||
|
long Seek(long long time_ns, const BlockEntry*&) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
double m_rate;
|
double m_rate;
|
||||||
@@ -472,12 +466,14 @@ public:
|
|||||||
const BlockEntry* GetFirst() const;
|
const BlockEntry* GetFirst() const;
|
||||||
const BlockEntry* GetLast() const;
|
const BlockEntry* GetLast() const;
|
||||||
const BlockEntry* GetNext(const BlockEntry*) const;
|
const BlockEntry* GetNext(const BlockEntry*) const;
|
||||||
const BlockEntry* GetEntry(const Track*) const;
|
const BlockEntry* GetEntry(const Track*, long long ns = -1) const;
|
||||||
const BlockEntry* GetEntry(
|
const BlockEntry* GetEntry(
|
||||||
const CuePoint&,
|
const CuePoint&,
|
||||||
const CuePoint::TrackPosition&) const;
|
const CuePoint::TrackPosition&) const;
|
||||||
const BlockEntry* GetMaxKey(const VideoTrack*) const;
|
const BlockEntry* GetMaxKey(const VideoTrack*) const;
|
||||||
|
|
||||||
|
static bool HasBlockEntries(const Segment*, long long);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Cluster(Segment*, long, long long off);
|
Cluster(Segment*, long, long long off);
|
||||||
|
|
||||||
@@ -490,7 +486,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
mutable long long m_timecode;
|
mutable long long m_timecode;
|
||||||
mutable BlockEntry** m_entries;
|
mutable BlockEntry** m_entries;
|
||||||
mutable size_t m_entriesCount;
|
mutable long m_entries_count;
|
||||||
|
|
||||||
void Load() const;
|
void Load() const;
|
||||||
void LoadBlockEntries() const;
|
void LoadBlockEntries() const;
|
||||||
@@ -503,6 +499,8 @@ private:
|
|||||||
class Segment
|
class Segment
|
||||||
{
|
{
|
||||||
friend class Cues;
|
friend class Cues;
|
||||||
|
friend class VideoTrack;
|
||||||
|
friend class AudioTrack;
|
||||||
|
|
||||||
Segment(const Segment&);
|
Segment(const Segment&);
|
||||||
Segment& operator=(const Segment&);
|
Segment& operator=(const Segment&);
|
||||||
@@ -521,10 +519,12 @@ public:
|
|||||||
|
|
||||||
long Load(); //loads headers and all clusters
|
long Load(); //loads headers and all clusters
|
||||||
|
|
||||||
//for incremental loading (splitter)
|
//for incremental loading
|
||||||
long long Unparsed() const;
|
long long Unparsed() const;
|
||||||
long long ParseHeaders(); //stops when first cluster is found
|
long long ParseHeaders(); //stops when first cluster is found
|
||||||
long LoadCluster(); //loads one cluster
|
//long FindNextCluster(long long& pos, long& size) const;
|
||||||
|
long LoadCluster(long long& pos, long& size); //load one cluster
|
||||||
|
long LoadCluster();
|
||||||
|
|
||||||
//This pair parses one cluster, but only changes the state of the
|
//This pair parses one cluster, but only changes the state of the
|
||||||
//segment object when the cluster is actually added to the index.
|
//segment object when the cluster is actually added to the index.
|
||||||
@@ -543,7 +543,7 @@ public:
|
|||||||
const Cluster* GetNext(const Cluster*);
|
const Cluster* GetNext(const Cluster*);
|
||||||
|
|
||||||
const Cluster* FindCluster(long long time_nanoseconds) const;
|
const Cluster* FindCluster(long long time_nanoseconds) const;
|
||||||
const BlockEntry* Seek(long long time_nanoseconds, const Track*) const;
|
//const BlockEntry* Seek(long long time_nanoseconds, const Track*) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
@@ -569,7 +569,14 @@ private:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
} //end namespace mkvparser
|
} //end namespace mkvparser
|
||||||
|
|
||||||
|
inline long mkvparser::Segment::LoadCluster()
|
||||||
|
{
|
||||||
|
long long pos;
|
||||||
|
long size;
|
||||||
|
|
||||||
|
return LoadCluster(pos, size);
|
||||||
|
}
|
||||||
|
|
||||||
#endif //MKVPARSER_HPP
|
#endif //MKVPARSER_HPP
|
||||||
|
|||||||
@@ -43,13 +43,13 @@
|
|||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
|
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="false"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="3"
|
RuntimeLibrary="1"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="4"
|
||||||
Detect64BitPortabilityProblems="false"
|
Detect64BitPortabilityProblems="false"
|
||||||
DebugInformationFormat="4"
|
DebugInformationFormat="1"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
|||||||
28
sample.cpp
28
sample.cpp
@@ -148,14 +148,14 @@ int main(int argc, char* argv[])
|
|||||||
if (pTrack == NULL)
|
if (pTrack == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const long long trackType_ = pTrack->GetType();
|
const long long trackType = pTrack->GetType();
|
||||||
unsigned long trackType = static_cast<unsigned long>(trackType_);
|
const long long trackNumber = pTrack->GetNumber();
|
||||||
|
const unsigned long long trackUid = pTrack->GetUid();
|
||||||
unsigned long trackNumber = pTrack->GetNumber();
|
|
||||||
const wchar_t* const pTrackName = utf8towcs(pTrack->GetNameAsUTF8());
|
const wchar_t* const pTrackName = utf8towcs(pTrack->GetNameAsUTF8());
|
||||||
|
|
||||||
printf("\t\tTrack Type\t\t: %ld\n", trackType);
|
printf("\t\tTrack Type\t\t: %ld\n", trackType);
|
||||||
printf("\t\tTrack Number\t\t: %ld\n", trackNumber);
|
printf("\t\tTrack Number\t\t: %ld\n", trackNumber);
|
||||||
|
printf("\t\tTrack Uid\t\t: %lld\n", trackUid);
|
||||||
|
|
||||||
if (pTrackName == NULL)
|
if (pTrackName == NULL)
|
||||||
printf("\t\tTrack Name\t\t: NULL\n");
|
printf("\t\tTrack Name\t\t: NULL\n");
|
||||||
@@ -220,7 +220,7 @@ int main(int argc, char* argv[])
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
mkvparser::Cluster* pCluster = pSegment->GetFirst();
|
const mkvparser::Cluster* pCluster = pSegment->GetFirst();
|
||||||
|
|
||||||
while ((pCluster != NULL) && !pCluster->EOS())
|
while ((pCluster != NULL) && !pCluster->EOS())
|
||||||
{
|
{
|
||||||
@@ -235,18 +235,26 @@ int main(int argc, char* argv[])
|
|||||||
while ((pBlockEntry != NULL) && !pBlockEntry->EOS())
|
while ((pBlockEntry != NULL) && !pBlockEntry->EOS())
|
||||||
{
|
{
|
||||||
const Block* const pBlock = pBlockEntry->GetBlock();
|
const Block* const pBlock = pBlockEntry->GetBlock();
|
||||||
const unsigned long trackNum = pBlock->GetTrackNumber();
|
const long long trackNum = pBlock->GetTrackNumber();
|
||||||
const Track* const pTrack = pTracks->GetTrackByNumber(trackNum);
|
const unsigned long tn = static_cast<unsigned long>(trackNum);
|
||||||
|
const Track* const pTrack = pTracks->GetTrackByNumber(tn);
|
||||||
const long long trackType = pTrack->GetType();
|
const long long trackType = pTrack->GetType();
|
||||||
const long size = pBlock->GetSize();
|
const int frameCount = pBlock->GetFrameCount();
|
||||||
const long long time_ns = pBlock->GetTime(pCluster);
|
const long long time_ns = pBlock->GetTime(pCluster);
|
||||||
|
|
||||||
printf("\t\t\tBlock\t\t:%s,%15ld,%s,%15lld\n",
|
printf("\t\t\tBlock\t\t:%s,%s,%15lld\n",
|
||||||
(trackType == VIDEO_TRACK) ? "V" : "A",
|
(trackType == VIDEO_TRACK) ? "V" : "A",
|
||||||
size,
|
|
||||||
pBlock->IsKey() ? "I" : "P",
|
pBlock->IsKey() ? "I" : "P",
|
||||||
time_ns);
|
time_ns);
|
||||||
|
|
||||||
|
for (int i = 0; i < frameCount; ++i)
|
||||||
|
{
|
||||||
|
const Block::Frame& theFrame = pBlock->GetFrame(i);
|
||||||
|
const long size = theFrame.len;
|
||||||
|
const long long offset = theFrame.pos;
|
||||||
|
printf("\t\t\t %15ld,%15lx\n", size, offset);
|
||||||
|
}
|
||||||
|
|
||||||
pBlockEntry = pCluster->GetNext(pBlockEntry);
|
pBlockEntry = pCluster->GetNext(pBlockEntry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -43,13 +43,13 @@
|
|||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="..\"
|
AdditionalIncludeDirectories="..\"
|
||||||
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
|
||||||
MinimalRebuild="true"
|
MinimalRebuild="false"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="3"
|
RuntimeLibrary="1"
|
||||||
UsePrecompiledHeader="0"
|
UsePrecompiledHeader="0"
|
||||||
WarningLevel="3"
|
WarningLevel="4"
|
||||||
Detect64BitPortabilityProblems="false"
|
Detect64BitPortabilityProblems="false"
|
||||||
DebugInformationFormat="4"
|
DebugInformationFormat="1"
|
||||||
/>
|
/>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCManagedResourceCompilerTool"
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
|||||||
Reference in New Issue
Block a user