Compare commits

...

13 Commits

Author SHA1 Message Date
matthewjheaney
024ad97571 set version to 1.0.0.3
Change-Id: I629400289383482462dac5d0b00f9f615d83db89
2010-10-08 20:19:47 -04:00
matthewjheaney
8f2a2e04d7 load cue point during find
Change-Id: Ied0ea43c85cba47af61c0f60698df18c58389d0c
2010-10-08 20:08:15 -04:00
matthewjheaney
9105d61514 lazy init cues
Change-Id: I20e923bcc4be0dd607fb66a63c4f94b96854573e
2010-10-08 19:35:32 -04:00
matthewjheaney
77f61bdd68 merged Cues::LoadCuePoint into Cues::Find
Change-Id: I7b90dd076418b75e54b1d77bb4a934220019e9df
2010-10-08 19:06:20 -04:00
matthewjheaney
485b6e8125 lazy load cue points as they're searched
Change-Id: Ifa767e579624f4da06670bf791a85cbee4336682
2010-10-08 18:26:44 -04:00
matthewjheaney
1d0c804fb9 allow cue points to be loaded incrementally
Change-Id: I6c10647c8885d9dcb0d6cb10dd2d6ba94a04ea38
2010-10-07 19:07:48 -04:00
matthewjheaney
b607880184 mark position of cues without parsing cues element
Change-Id: I351ecca9dd82be95f8ef46f967983e612846ce87
2010-10-07 14:33:38 -04:00
matthewjheaney
d2688d316d restructured Segment::LoadCluster
Change-Id: Iaf792807445f3866f4ace4cc5663eb6396ac34be
2010-10-06 12:13:33 -04:00
matthewjheaney
885d2e1ef8 do not attempt to reparse cues element
Change-Id: Iebab4960f849fa65ecded360f73c0df8ebac4cc5
2010-10-05 20:42:28 -04:00
matthewjheaney
1cf3a81c78 allow seeking beyond end of cluster cache
Change-Id: I254039af3cb72039b5204f52d0dd613f7a47782d
2010-10-05 20:18:19 -04:00
matthewjheaney
6efbd56948 parse SeekHead to find Cues
Change-Id: I08334e48c587e08392c29dfa4118eb92eca7c25d
2010-10-05 14:12:15 -04:00
matthewjheaney
f56533b30e changed cluster count type from size_t to long
Change-Id: I1957e20b7f565d8e43ee3f983eaceb67f2ddf3cd
2010-10-04 13:55:03 -04:00
Jeff Koppi
ec2b951a78 Add Block::GetOffset() accessor.
Change-Id: I6172c412a8b2b093a365d634e48fcd7a09363111

Added accessor for Block, to query offset value.
2010-10-01 17:21:28 -04:00
2 changed files with 1064 additions and 417 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -80,6 +80,7 @@ public:
bool IsKey() const; bool IsKey() const;
void SetKey(bool); void SetKey(bool);
long long GetOffset() const;
long GetSize() const; long GetSize() const;
long Read(IMkvReader*, unsigned char*) const; long Read(IMkvReader*, unsigned char*) const;
@@ -336,11 +337,15 @@ private:
class CuePoint class CuePoint
{ {
CuePoint(const CuePoint&);
CuePoint& operator=(const CuePoint&);
public: public:
CuePoint(); explicit CuePoint(long long);
~CuePoint(); ~CuePoint();
void Parse(IMkvReader*, long long start, long long size); //void Parse(IMkvReader*, long long start, long long size);
void Load(IMkvReader*, long long);
long long GetTimeCode() const; //absolute but unscaled long long GetTimeCode() const; //absolute but unscaled
long long GetTime(Segment*) const; //absolute and scaled (ns units) long long GetTime(Segment*) const; //absolute and scaled (ns units)
@@ -360,6 +365,7 @@ public:
const TrackPosition* Find(const Track*) const; const TrackPosition* Find(const Track*) const;
private: private:
//long long m_pos;
long long m_timecode; long long m_timecode;
TrackPosition* m_track_positions; TrackPosition* m_track_positions;
size_t m_track_positions_count; size_t m_track_positions_count;
@@ -386,15 +392,37 @@ public:
const CuePoint*&, const CuePoint*&,
const CuePoint::TrackPosition*&) const; const CuePoint::TrackPosition*&) const;
#if 0
bool FindNext( //upper_bound of time_ns bool FindNext( //upper_bound of time_ns
long long time_ns, long long time_ns,
const Track*, const Track*,
const CuePoint*&, const CuePoint*&,
const CuePoint::TrackPosition*&) const; const CuePoint::TrackPosition*&) const;
#endif
#if 0
const CuePoint* GetFirst() const;
const CuePoint* GetLast() const;
#endif
bool LoadCuePoint();
#if 0
const CuePoint* LoadCuePoint(
long long time_ns,
const Track*,
const CuePoint::TrackPosition*&) const;
#endif
private: private:
CuePoint* m_cue_points; void Init();
size_t m_cue_points_count; void PreloadCuePoint(size_t&, long long);
CuePoint** m_cue_points;
//size_t m_cue_points_size;
size_t m_count;
size_t m_preload_count;
long long m_pos;
}; };
@@ -406,10 +434,10 @@ class Cluster
public: public:
Segment* const m_pSegment; Segment* const m_pSegment;
const size_t m_index; long m_index;
public: public:
static Cluster* Parse(Segment*, size_t, long long off); static Cluster* Parse(Segment*, long, long long off);
Cluster(); //EndOfStream Cluster(); //EndOfStream
~Cluster(); ~Cluster();
@@ -430,7 +458,7 @@ public:
const BlockEntry* GetMaxKey(const VideoTrack*); const BlockEntry* GetMaxKey(const VideoTrack*);
protected: protected:
Cluster(Segment*, size_t, long long off); Cluster(Segment*, long, long long off);
public: public:
long long m_pos; long long m_pos;
@@ -438,7 +466,7 @@ public:
private: private:
long long m_timecode; long long m_timecode;
BlockEntry** m_pEntries; BlockEntry** m_entries;
size_t m_entriesCount; size_t m_entriesCount;
void Load(); void Load();
@@ -466,14 +494,19 @@ public:
static long long CreateInstance(IMkvReader*, long long, Segment*&); static long long CreateInstance(IMkvReader*, long long, Segment*&);
~Segment(); ~Segment();
//for big-bang loading (source filter) long Load(); //loads headers and all clusters
long Load();
//for incremental loading (splitter) //for incremental loading (splitter)
long long Unparsed() const; long long Unparsed() const;
long long ParseHeaders(); long long ParseHeaders(); //stops when first cluster is found
long LoadCluster(); //loads one cluster
#if 0
//This pair parses one cluster, but only changes the state of the
//segment object when the cluster is actually added to the index.
long ParseCluster(Cluster*&, long long& newpos) const; long ParseCluster(Cluster*&, long long& newpos) const;
bool AddCluster(Cluster*, long long); bool AddCluster(Cluster*, long long);
#endif
Tracks* GetTracks() const; Tracks* GetTracks() const;
const SegmentInfo* GetInfo() const; const SegmentInfo* GetInfo() const;
@@ -495,23 +528,25 @@ public:
Cluster*&, Cluster*&,
const BlockEntry*&); const BlockEntry*&);
const Cues* GetCues() const; Cues* GetCues() const;
private: private:
long long m_pos; //absolute file posn; what has been consumed so far long long m_pos; //absolute file posn; what has been consumed so far
SegmentInfo* m_pInfo; SegmentInfo* m_pInfo;
Tracks* m_pTracks; Tracks* m_pTracks;
Cues* m_pCues; Cues* m_pCues;
Cluster** m_clusters; Cluster** m_clusters;
size_t m_clusterCount; //number of entries long m_clusterCount; //number of entries for which m_index >= 0
size_t m_clusterSize; //array size long m_clusterPreloadCount; //number of entries for which m_index < 0
long m_clusterSize; //array size
void AppendCluster(Cluster*); void AppendCluster(Cluster*);
void PreloadCluster(Cluster*, ptrdiff_t);
//void ParseSeekHead(long long pos, long long size, size_t*); void ParseSeekHead(long long pos, long long size);
//void ParseSeekEntry(long long pos, long long size, size_t*); void ParseSeekEntry(long long pos, long long size);
//void ParseSecondarySeekHead(long long off, size_t*); void ParseCues(long long);
void ParseCues(long long off);
bool SearchCues( bool SearchCues(
long long time_ns, long long time_ns,