Lines Matching refs:page

132     ssize_t readPage(off64_t offset, Page *page);
355 // Given the offset of the "current" page, find the page immediately preceding
357 // To do this we back up from the "current" page's offset until we find any
358 // page preceding it and then scan forward to just before the current page.
376 // We are at the last page and didn't back off enough;
389 // We did not find a page preceding this one.
475 // We found the page we wanted to seek to, but we'll also need
476 // the page preceding it to determine how many valid samples are on
477 // this page.
489 // XXX what if new page continues packet from last???
494 ssize_t MyOggExtractor::readPage(off64_t offset, Page *page) {
521 page->mFlags = header[5];
523 if (page->mFlags & ~7) {
528 page->mGranulePosition = U64LE_AT(&header[6]);
532 page->mGranulePosition, page->mGranulePosition);
535 page->mSerialNo = U32LE_AT(&header[14]);
536 page->mPageNo = U32LE_AT(&header[18]);
538 page->mNumSegments = header[26];
540 offset + sizeof(header), page->mLace, page->mNumSegments)
541 < (ssize_t)page->mNumSegments) {
546 for (size_t i = 0; i < page->mNumSegments; ++i) {
547 totalSize += page->mLace[i];
552 for (size_t i = 0; i < page->mNumSegments; ++i) {
554 sprintf(x, "%s%u", i > 0 ? ", " : "", (unsigned)page->mLace[i]);
559 ALOGV("%c %s", page->mFlags & 1 ? '+' : ' ', tmp.string());
562 return sizeof(header) + page->mNumSegments + totalSize;
568 // the number of samples on the first page from the granule position
569 // (position of last complete sample) of the first page. This happens
570 // the first time before we attempt to read a packet from the first page.
603 // Calculate timestamps by accumulating durations starting from the first sample of a page;
604 // We assume that we only seek to page boundaries.
606 // first packet in page
794 // This page does not continue the packet, i.e. the packet
841 // The granule position of the final page in the stream will
858 Page page;
860 while ((pageSize = readPage(offset, &page)) > 0) {
867 entry.mTimeUs = getTimeUsOfGranule(page.mGranulePosition);