Home | History | Annotate | Download | only in libwebm

Lines Matching refs:Cluster

618   Cluster** i = m_clusters;
619 Cluster** j = m_clusters + count;
622 Cluster* const p = *i++;
808 if (id == 0x0F43B675) // Cluster ID
953 long long cluster_size = -1; // size of cluster payload
1040 #if 0 // commented-out, to support incremental cluster parsing
1062 if (id != 0x0F43B675) { // Cluster ID
1070 // We have a cluster.
1080 assert(cluster_off >= 0); // have cluster
1085 status = Cluster::HasBlockEntries(this, cluster_off, pos_, len_);
1099 // pos ptr past the most recent cluster parsed, and then
1100 // starts from there to parse the next cluster. If we
1101 // don't know the size of the current cluster, then we
1103 // for the cluster (or cues) ID to terminate the parse.
1105 // a way to create the curr cluster object immediately.
1106 // The pity is that cluster::parse can determine its own
1112 // As we're parsing the blocks in the curr cluster
1113 //(in cluster::parse), we should have some way to signal
1128 Cluster* const pCluster = m_clusters[idx];
1183 Cluster* const pCluster = Cluster::Create(this, idx, cluster_off);
1204 return 0; // partial success, since we have a new cluster
1214 const long long payload_pos = pos; //absolute pos of cluster payload
1216 for (;;) { //determine cluster size
1252 //that we have exhausted the sub-element's inside the cluster
1255 if (id == 0x0F43B675) //Cluster ID
1320 } //determine cluster size
1325 pos = payload_pos; //reset and re-parse original cluster
1332 Cluster* const pCluster = m_clusters[idx];
1346 return 2; //try to find another cluster
1363 //We have already consumed the (cluster) ID and size fields.
1365 //of this cluster, until we discover the boundary.
1380 for (;;) { //determine cluster size
1426 //that we have exhausted the sub-element's inside the cluster
1429 if ((id == 0x0F43B675) || (id == 0x0C53BB6B)) { //Cluster ID or Cues ID
1497 } //determine cluster size
1514 assert(status > 0); // nothing left to parse of this cluster
1530 void Segment::AppendCluster(Cluster* pCluster) {
1545 Cluster** const qq = new Cluster* [n];
1546 Cluster** q = qq;
1548 Cluster** p = m_clusters;
1549 Cluster** const pp = p + count;
1563 Cluster** const p = m_clusters + m_clusterCount;
1567 Cluster** q = p + m_clusterPreloadCount;
1571 Cluster** const qq = q - 1;
1586 void Segment::PreloadCluster(Cluster* pCluster, ptrdiff_t idx) {
1599 Cluster** const qq = new Cluster* [n];
1600 Cluster** q = qq;
1602 Cluster** p = m_clusters;
1603 Cluster** const pp = p + count;
1616 Cluster** const p = m_clusters + idx;
1618 Cluster** q = m_clusters + count;
1623 Cluster** const qq = q - 1;
2591 Cluster** const ii = m_clusters;
2592 Cluster** i = ii;
2596 Cluster** const jj = ii + count;
2597 Cluster** j = jj;
2605 Cluster** const k = i + (j - i) / 2;
2608 Cluster* const pCluster = *k;
2627 // assert(Cluster::HasBlockEntries(this, tp.m_pos));
2629 Cluster* const pCluster = Cluster::Create(this, -1, tp.m_pos); //, -1);
2642 const Cluster* Segment::FindOrPreloadCluster(long long requested_pos) {
2646 Cluster** const ii = m_clusters;
2647 Cluster** i = ii;
2651 Cluster** const jj = ii + count;
2652 Cluster** j = jj;
2660 Cluster** const k = i + (j - i) / 2;
2663 Cluster* const pCluster = *k;
2682 // assert(Cluster::HasBlockEntries(this, tp.m_pos));
2684 Cluster* const pCluster = Cluster::Create(this, -1, requested_pos);
2934 const Cluster* Segment::GetFirst() const {
2938 Cluster* const pCluster = m_clusters[0];
2944 const Cluster* Segment::GetLast() const {
2950 Cluster* const pCluster = m_clusters[idx];
2958 const Cluster* Segment::GetNext(const Cluster* pCurr) {
2975 Cluster* const pNext = m_clusters[idx];
3000 assert(id == 0x0F43B675); // Cluster ID
3034 const long long idpos = pos; // pos of next (potential) cluster
3057 if (id == 0x0F43B675) { // Cluster ID
3063 const long status = Cluster::HasBlockEntries(this, off_next_, pos_, len_);
3079 Cluster** const ii = m_clusters + m_clusterCount;
3080 Cluster** i = ii;
3082 Cluster** const jj = ii + m_clusterPreloadCount;
3083 Cluster** j = jj;
3091 Cluster** const k = i + (j - i) / 2;
3094 Cluster* const pNext = *k;
3114 Cluster* const pNext = Cluster::Create(this, -1, off_next);
3127 long Segment::ParseNext(const Cluster* pCurr, const Cluster*& pResult,
3145 // curr cluster is last among loaded
3175 // interrogate curr cluster
3203 if (id != 0x0F43B675) // weird: not Cluster ID
3248 pos += size; // consume payload (that is, the current cluster)
3252 // cluster isn't interesting. That is, we don't bother checking
3253 // whether the payload of the curr cluster is less than what
3256 // cluster, and really does want the next cluster.
3259 // pos now points to just beyond the last fully-loaded cluster
3269 long Segment::DoParseNext(const Cluster*& pResult, long long& pos, long& len) {
3281 // Parse next cluster. This is strictly a parsing activity.
3282 // Creation of a new cluster object happens later, after the
3390 if (id != 0x0F43B675) { // not a Cluster ID
3400 #if 0 // this is commented-out to support incremental cluster parsing
3407 // We have a cluster.
3417 assert(off_next > 0); // have cluster
3419 // We have parsed the next cluster.
3420 // We have not created a cluster object yet. What we need
3422 //(in which case, an object for this cluster has already been
3423 // created), and if not, create a new cluster object.
3425 Cluster** const ii = m_clusters + m_clusterCount;
3426 Cluster** i = ii;
3428 Cluster** const jj = ii + m_clusterPreloadCount;
3429 Cluster** j = jj;
3437 Cluster** const k = i + (j - i) / 2;
3440 const Cluster* const pNext = *k;
3462 status = Cluster::HasBlockEntries(this, off_next, pos_, len_);
3472 Cluster* const pNext = Cluster::Create(this,
3492 const long long payload_pos = pos; // absolute pos of cluster payload
3494 for (;;) { // determine cluster size
3529 // that we have exhausted the sub-element's inside the cluster
3532 if (id == 0x0F43B675) // Cluster ID
3583 } // determine cluster size
3588 pos = payload_pos; // reset and re-parse original cluster
3594 return 2; // try to find a cluster that follows next
3597 const Cluster* Segment::FindCluster(long long time_ns) const {
3602 Cluster* const pCluster = m_clusters[0];
3610 // Binary search of cluster array
3624 Cluster* const pCluster = m_clusters[k];
3644 Cluster* const pCluster = m_clusters[k];
3662 Cluster** const i = m_clusters;
3666 Cluster* const pCluster = *i;
3675 Cluster** const j = i + m_clusterCount;
3681 //straight cluster search is good enough (we assume).
3683 Cluster** lo = i;
3684 Cluster** hi = j;
3693 Cluster** const mid = lo + (hi - lo) / 2;
3696 Cluster* const pCluster = *mid;
3717 Cluster* const pCluster = *--lo;
3726 //landed on empty cluster (no entries)
3734 Cluster** lo = i;
3735 Cluster** hi = j;
3744 Cluster** const mid = lo + (hi - lo) / 2;
3747 Cluster* const pCluster = *mid;
3764 Cluster* pCluster = *--lo;
3789 //weird: we're on the first cluster, but no keyframe found
3800 Cluster*& pCluster,
3819 //so we now need to search for the cluster having
4988 const Cluster* pCluster = m_pSegment->GetFirst();
5018 if (pBlockEntry == 0) { // empty cluster
5071 const Cluster* pCluster = pCurrEntry->GetCluster();
5118 // caller to (pre)load another cluster, which he does, but then he
5123 // caller to be smarter when he loads another cluster: don't call
5124 // us back until you have a cluster that contains a block from this
5126 // would have to scan the each cluster as it's loaded, so that
5138 if (pNextEntry == NULL) // empty cluster
5183 const Cluster* pCluster = pResult->GetCluster();
5190 Cluster** const clusters = m_pSegment->m_clusters;
5196 Cluster** const i = clusters + pCluster->GetIndex();
5201 Cluster** const j = clusters + count;
5203 Cluster** lo = i;
5204 Cluster** hi = j;
5212 Cluster** const mid = lo + (hi - lo) / 2;
5244 // landed on empty cluster (no entries)
5439 const Cluster* pCluster = pResult->GetCluster();
5446 Cluster** const clusters = m_pSegment->m_clusters;
5452 Cluster** const i = clusters + pCluster->GetIndex();
5457 Cluster** const j = clusters + count;
5459 Cluster** lo = i;
5460 Cluster** hi = j;
5468 Cluster** const mid = lo + (hi - lo) / 2;
5506 //We need to handle the case when a cluster
5508 //the largest keyframe on the cluster isn't
5519 // weird: we're on the first cluster, but no keyframe found
6010 long long Cluster::Unparsed() const
6028 long Cluster::Load(long long& pos, long& len) const {
6079 if (id_ != 0x0F43B675) // Cluster ID
6084 // read cluster size
6170 // that we have exhausted the sub-element's inside the cluster
6173 if (id == 0x0F43B675) // Cluster ID
6269 long Cluster::Parse(long long& pos, long& len) const {
6340 // that we have exhausted the sub-element's inside the cluster
6343 if ((id == 0x0F43B675) || (id == 0x0C53BB6B)) { // Cluster or Cues ID
6413 Cluster* const this_ = const_cast<Cluster*>(this);
6456 long Cluster::ParseSimpleBlock(long long block_size, long long& pos,
6507 //header, there are still blocks in the cluster with that track
6585 long Cluster::ParseBlockGroup(long long payload_size, long long& pos,
6740 //header, there are still blocks in the cluster with that track
6822 long Cluster::GetEntry(long index, const mkvparser::BlockEntry*& pEntry) const {
6844 if (m_element_size < 0) // we don't know cluster end yet
6855 Cluster* Cluster::Create(Segment* pSegment, long idx, long long off)
6863 Cluster* const pCluster = new Cluster(pSegment, idx, element_start);
6870 Cluster::Cluster()
6882 Cluster::Cluster(Segment* pSegment, long idx, long long element_start
6895 Cluster::~Cluster() {
6912 bool Cluster::EOS() const { return (m_pSegment == NULL); }
6914 long Cluster::GetIndex() const { return m_index; }
6916 long long Cluster::GetPosition() const {
6923 long long Cluster::GetElementSize() const { return m_element_size; }
6926 bool Cluster::HasBlockEntries(
6943 assert(id == 0x0F43B675); //Cluster ID
6987 long Cluster::HasBlockEntries(
7008 return 0; // we don't even have a complete cluster
7043 if (id != 0x0F43B675) // weird: not cluster ID
7046 pos += len; // consume Cluster ID field
7078 return 0; // cluster does not have entries
7095 return 0; // cluster does not have any entries
7128 // that we have exhausted the sub-element's inside the cluster
7131 if (id == 0x0F43B675) // Cluster ID
7181 return E_FILE_FORMAT_INVALID; // not supported inside cluster
7197 long long Cluster::GetTimeCode() const {
7209 long long Cluster::GetTime() const {
7226 long long Cluster::GetFirstTime() const {
7234 if (pEntry == NULL) // empty cluster
7243 long long Cluster::GetLastTime() const {
7251 if (pEntry == NULL) // empty cluster
7260 long Cluster::CreateBlock(long long id,
7305 long Cluster::CreateBlockGroup(long long start_offset, long long size,
7405 long Cluster::CreateSimpleBlock(long long st, long long sz) {
7436 long Cluster::GetFirst(const BlockEntry*& pFirst) const {
7448 if (m_entries_count <= 0) { // empty cluster
7462 long Cluster::GetLast(const BlockEntry*& pLast) const {
7493 long Cluster::GetNext(const BlockEntry* pCurr, const BlockEntry*& pNext) const {
7531 long Cluster::GetEntryCount() const { return m_entries_count; }
7533 const BlockEntry* Cluster::GetEntry(const Track* pTrack,
7537 if (m_pSegment == NULL) // this is the special EOS cluster
7648 const BlockEntry* Cluster::GetEntry(const CuePoint& cp,
7841 const BlockEntry* Cluster::GetMaxKey(const VideoTrack* pTrack) const
7876 BlockEntry::BlockEntry(Cluster* p, long idx) : m_pCluster(p), m_index(idx) {}
7882 const Cluster* BlockEntry::GetCluster() const { return m_pCluster; }
7886 SimpleBlock::SimpleBlock(Cluster* pCluster, long idx, long long start,
7896 BlockGroup::BlockGroup(Cluster* pCluster, long idx, long long block_start,
7954 long Block::Parse(const Cluster* pCluster) {
8284 long long Block::GetTimeCode(const Cluster* pCluster) const {
8296 long long Block::GetTime(const Cluster* pCluster) const {