Compare commits

...

15 Commits

Author SHA1 Message Date
matthewjheaney
bebe4accb8 changed version to 1.0.0.9
Change-Id: Iee4ba7605e191290e99a9424b76e57d6f0e965c2
2010-12-07 13:58:49 -05:00
matthewjheaney
93263f0b4a return error when no segment id found
Change-Id: I291335dc726171f7eb3820b9ade2d261a33500ff
2010-12-03 11:57:53 -05:00
matthewjheaney
e1e757f919 LoadCluster passes back posn and size
Change-Id: I91b3c2234f7621139a5cae2d71af7301a30c027e
2010-11-30 12:49:20 -05:00
matthewjheaney
6c45ab2d4c parse seek head only when source available
Change-Id: Iba3b9e46d0cb28fd91a2a7062c6aa4bac3f72c0c
2010-11-29 17:11:38 -05:00
matthewjheaney
cb7b24880f LoadCluster now checks for underflow
Change-Id: I5a1ad57753657f71075d0ad8ca39841e7aae9e57
2010-11-29 16:03:44 -05:00
matthewjheaney
157775ac74 fixed bug: was searching outside array bounds
Change-Id: If02466f240dc2a00b2a9a8f75b0ffa27a8984ec0
2010-11-22 16:29:40 -05:00
matthewjheaney
fd1d8006f0 moved seek function from segment to track
Change-Id: Ie34549cea4c5d961b6cc04ef229a3eadc1f0ee3b
2010-11-22 15:57:25 -05:00
matthewjheaney
9203d2dcd1 set version to 1.0.0.8
Change-Id: If4bd0d73f72cb819dee9d985fe8f64490c3ab206
2010-11-19 14:55:56 -05:00
matthewjheaney
be2f81abca filter out empty clusters
Change-Id: Iad4da9d55c1cfc332042d0017bd5d77e9ad511b6
2010-11-18 19:28:50 -05:00
matthewjheaney
cb5414a42a changed semantics of m_entries_count
Change-Id: I114b1482239cced838932f35ca4b5ae380f0d022
2010-11-18 17:30:12 -05:00
matthewjheaney
2ce6965b2d GetEntry now accepts a time
Change-Id: I850cfa1deaae465b91c9f65b774ad49cce9e8b8d
2010-11-17 14:27:55 -05:00
Hwasoo Lee
8db600e1c9 handled unknown size of segment for live stream
Change-Id: I7dcc08e38c6cd31a55693b39ace414c14399d1b5
2010-11-16 16:17:10 -05:00
Hwasoo Lee
85353469f8 updated the project files
Change-Id: Ia949818a03663b4b4e3595e60183213de8e98100
2010-11-16 14:56:55 -05:00
Hwasoo Lee
d97f236f81 fixed the issue 234
Change-Id: Ie527263ae2862426e8c58fce13b34da4c792cc01
2010-11-16 14:54:14 -05:00
matthewjheaney
790f639f2f ignore empty clusters when getting first block
Change-Id: I9278efcacc3ea5dcfa584cb0937e39a4004e6947
2010-11-15 21:22:57 -05:00
5 changed files with 627 additions and 200 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -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&);
@@ -209,6 +209,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 +228,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 +244,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&);
@@ -277,6 +279,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 +300,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 +476,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 +496,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 +509,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 +529,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 +553,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 +579,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

View File

@@ -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"

View File

@@ -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");
@@ -235,8 +235,9 @@ 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 int frameCount = pBlock->GetFrameCount(); const int frameCount = pBlock->GetFrameCount();
const long long time_ns = pBlock->GetTime(pCluster); const long long time_ns = pBlock->GetTime(pCluster);
@@ -250,7 +251,7 @@ int main(int argc, char* argv[])
{ {
const Block::Frame& theFrame = pBlock->GetFrame(i); const Block::Frame& theFrame = pBlock->GetFrame(i);
const long size = theFrame.len; const long size = theFrame.len;
const long offset = theFrame.pos; const long long offset = theFrame.pos;
printf("\t\t\t %15ld,%15lx\n", size, offset); printf("\t\t\t %15ld,%15lx\n", size, offset);
} }

View File

@@ -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"