The OggPage class is used to parse OGG pages.
More...
#include <oggpage.h>
|
static std::uint32_t | computeChecksum (std::istream &stream, std::uint64_t startOffset) |
| Computes the actual checksum of the page read from the specified stream at the specified startOffset. More...
|
|
static void | updateChecksum (std::iostream &stream, std::uint64_t startOffset) |
| Updates the checksum of the page read from the specified stream at the specified startOffset. More...
|
|
static std::uint32_t | makeSegmentSizeDenotation (std::ostream &stream, std::uint32_t size) |
| Writes the segment size denotation for the specified segment size to the specified stream. More...
|
|
The OggPage class is used to parse OGG pages.
- See also
- http://www.xiph.org/ogg/doc/framing.html
Definition at line 13 of file oggpage.h.
◆ OggPage() [1/2]
TagParser::OggPage::OggPage |
( |
| ) |
|
|
inline |
Constructs a new OGG page.
Definition at line 56 of file oggpage.h.
◆ OggPage() [2/2]
TagParser::OggPage::OggPage |
( |
std::istream & |
stream, |
|
|
std::uint64_t |
startOffset, |
|
|
std::int32_t |
maxSize |
|
) |
| |
|
inline |
Constructs a new OggPage and instantly parses the header read from the specified stream at the specified startOffset.
Definition at line 72 of file oggpage.h.
◆ absoluteGranulePosition()
std::uint64_t TagParser::OggPage::absoluteGranulePosition |
( |
| ) |
const |
|
inline |
Returns the absolute granule position.
The position specified is the total samples encoded after including all packets finished on this page (packets begun on this page but continuing on to the next page do not count). The rationale here is that the position specified in the frame header of the last page tells how long the data coded by the bitstream is. A truncated stream will still return the proper number of samples that can be decoded fully.
A special value of '-1' (in two's complement) indicates that no packets finish on this page.
Definition at line 142 of file oggpage.h.
◆ checksum()
std::uint32_t TagParser::OggPage::checksum |
( |
| ) |
const |
|
inline |
Returns the page checksum.
32 bit CRC value (direct algorithm, initial val and final XOR = 0, generator polynomial=0x04c11db7). The value is computed over the entire header (with the CRC field in the header set to zero) and then continued over the page. The CRC field is then filled with the computed value.
- See also
- This method returns the checksum denoted by the header. To compute the actual checksum use the computeChecksum() method.
Definition at line 189 of file oggpage.h.
◆ computeChecksum()
std::uint32_t TagParser::OggPage::computeChecksum |
( |
std::istream & |
stream, |
|
|
std::uint64_t |
startOffset |
|
) |
| |
|
static |
Computes the actual checksum of the page read from the specified stream at the specified startOffset.
Definition at line 74 of file oggpage.cpp.
◆ dataOffset()
std::uint64_t TagParser::OggPage::dataOffset |
( |
std::vector< std::uint32_t >::size_type |
segmentIndex = 0 | ) |
const |
|
inline |
Returns the data offset of the segment with the specified segmentIndex.
This is the start offset plus the header size.
- See also
- startOffset()
-
headerSize()
Definition at line 248 of file oggpage.h.
◆ dataSize()
std::uint32_t TagParser::OggPage::dataSize |
( |
| ) |
const |
|
inline |
Returns the data size in byte.
Definition at line 227 of file oggpage.h.
◆ headerSize()
std::uint32_t TagParser::OggPage::headerSize |
( |
| ) |
const |
|
inline |
Returns the header size in byte.
This is 27 plus the number of segment entries in the segment table.
Definition at line 219 of file oggpage.h.
◆ headerTypeFlag()
std::uint8_t TagParser::OggPage::headerTypeFlag |
( |
| ) |
const |
|
inline |
◆ isContinued()
bool TagParser::OggPage::isContinued |
( |
| ) |
const |
|
inline |
Returns whether this page is a continued packed (true) or a fresh packed (false).
Definition at line 110 of file oggpage.h.
◆ isFirstpage()
bool TagParser::OggPage::isFirstpage |
( |
| ) |
const |
|
inline |
Returns whether this page is the first page of the logical bitstream.
Definition at line 118 of file oggpage.h.
◆ isLastPage()
bool TagParser::OggPage::isLastPage |
( |
| ) |
const |
|
inline |
Returns whether this page is the last page of the logical bitstream.
Definition at line 126 of file oggpage.h.
◆ makeSegmentSizeDenotation()
std::uint32_t TagParser::OggPage::makeSegmentSizeDenotation |
( |
std::ostream & |
stream, |
|
|
std::uint32_t |
size |
|
) |
| |
|
static |
Writes the segment size denotation for the specified segment size to the specified stream.
- Returns
- Returns the number of bytes written.
Definition at line 123 of file oggpage.cpp.
◆ matchesStreamSerialNumber()
bool TagParser::OggPage::matchesStreamSerialNumber |
( |
std::uint32_t |
streamSerialNumber | ) |
const |
|
inline |
Returns whether the stream serial number of the current instance matches the specified one.
- See also
- streamSerialNumber()
Definition at line 164 of file oggpage.h.
◆ parseHeader()
void TagParser::OggPage::parseHeader |
( |
std::istream & |
stream, |
|
|
std::uint64_t |
startOffset, |
|
|
std::int32_t |
maxSize |
|
) |
| |
Parses the header read from the specified stream at the specified startOffset.
- Exceptions
-
Definition at line 24 of file oggpage.cpp.
◆ segmentSizes()
const std::vector< std::uint32_t > & TagParser::OggPage::segmentSizes |
( |
| ) |
const |
|
inline |
Returns the sizes of the segments of the page in byte.
The lacing values for each packet segment physically appearing in this page are listed in contiguous order.
Definition at line 209 of file oggpage.h.
◆ segmentTableSize()
std::uint8_t TagParser::OggPage::segmentTableSize |
( |
| ) |
const |
|
inline |
Returns the size of the segment table.
The number of segment entries to appear in the segment table.
Definition at line 199 of file oggpage.h.
◆ sequenceNumber()
std::uint32_t TagParser::OggPage::sequenceNumber |
( |
| ) |
const |
|
inline |
Returns the page sequence number.
Page counter; lets us know if a page is lost (useful where packets span page boundaries).
Definition at line 174 of file oggpage.h.
◆ startOffset()
std::uint64_t TagParser::OggPage::startOffset |
( |
| ) |
const |
|
inline |
Returns the start offset of the page.
The start offset has been specified when calling the parseHeader() method.
Definition at line 83 of file oggpage.h.
◆ streamSerialNumber()
std::uint32_t TagParser::OggPage::streamSerialNumber |
( |
| ) |
const |
|
inline |
Returns the stream serial number.
Ogg allows for separate logical bitstreams to be mixed at page granularity in a physical bitstream. The most common case would be sequential arrangement, but it is possible to interleave pages for two separate bitstreams to be decoded concurrently. The serial number is the means by which pages physical pages are associated with a particular logical stream.
Definition at line 155 of file oggpage.h.
◆ streamStructureVersion()
std::uint8_t TagParser::OggPage::streamStructureVersion |
( |
| ) |
const |
|
inline |
Returns the stream structure version.
Definition at line 91 of file oggpage.h.
◆ totalSize()
std::uint32_t TagParser::OggPage::totalSize |
( |
| ) |
const |
|
inline |
Returns the total size of the page in byte.
Definition at line 235 of file oggpage.h.
◆ updateChecksum()
void TagParser::OggPage::updateChecksum |
( |
std::iostream & |
stream, |
|
|
std::uint64_t |
startOffset |
|
) |
| |
|
static |
Updates the checksum of the page read from the specified stream at the specified startOffset.
Definition at line 111 of file oggpage.cpp.
The documentation for this class was generated from the following files: