#include <oggpage.h>
Public Types | |
enum | ContainsPacketFlags { DoesNotContainPacket = 0x0000, CompletePacket = 0x0001, BeginsWithPacket = 0x0002, EndsWithPacket = 0x0004 } |
enum | PaginationStrategy { SinglePagePerGroup, Repaginate } |
Public Member Functions | |
Page (File *file, long pageOffset) | |
virtual | ~Page () |
long | fileOffset () const |
const PageHeader * | header () const |
int | firstPacketIndex () const |
void | setFirstPacketIndex (int index) |
ContainsPacketFlags | containsPacket (int index) const |
uint | packetCount () const |
ByteVectorList | packets () const |
int | size () const |
ByteVector | render () const |
Static Public Member Functions | |
List< Page * > | paginate (const ByteVectorList &packets, PaginationStrategy strategy, uint streamSerialNumber, int firstPage, bool firstPacketContinued=false, bool lastPacketCompleted=true, bool containsLastPacket=false) |
Protected Member Functions | |
Page (const ByteVectorList &packets, uint streamSerialNumber, int pageNumber, bool firstPacketContinued=false, bool lastPacketCompleted=true, bool containsLastPacket=false) |
This is an implementation of the pages that make up an Ogg stream. This handles parsing pages and breaking them down into packets and handles the details of packets spanning multiple pages and pages that contiain multiple packets.
In most Xiph.org formats the comments are found in the first few packets, this however is a reasonably complete implementation of Ogg pages that could potentially be useful for non-meta data purposes.
|
When checking to see if a page contains a given packet this set of flags represents the possible values for that packets status in the page.
|
|
Defines a strategy for pagination, or grouping pages into Ogg packets, for use with pagination methods.
|
|
Read an Ogg page from the file at the position pageOffset. |
|
|
|
Creates an Ogg packet based on the data in packets. The page number for each page will be set to pageNumber. |
|
Checks to see if the specified packet is contained in the current page.
|
|
Returns the page's position within the file (in bytes). |
|
Returns the index of the first packet wholly or partially contained in this page.
|
|
Returns a pointer to the header for this page. This pointer will become invalid when the page is deleted. |
|
Returns the number of packets (whole or partial) in this page. |
|
Returns a list of the packets in this page.
|
|
Pack packets into Ogg pages using the strategy for pagination. The page number indicater inside of the rendered packets will start with firstPage and be incremented for each page rendered. containsLastPacket should be set to true if packets contains the last page in the stream and will set the appropriate flag in the last rendered Ogg page's header. streamSerialNumber should be set to the serial number for this stream.
|
|
|
|
Sets the index of the first packet in the page.
|
|
Returns the size of the page in bytes. |