|
Packit |
a38265 |
/*
|
|
Packit |
a38265 |
Copyright (C) 2009 Annodex Association
|
|
Packit |
a38265 |
|
|
Packit |
a38265 |
Redistribution and use in source and binary forms, with or without
|
|
Packit |
a38265 |
modification, are permitted provided that the following conditions
|
|
Packit |
a38265 |
are met:
|
|
Packit |
a38265 |
|
|
Packit |
a38265 |
- Redistributions of source code must retain the above copyright
|
|
Packit |
a38265 |
notice, this list of conditions and the following disclaimer.
|
|
Packit |
a38265 |
|
|
Packit |
a38265 |
- Redistributions in binary form must reproduce the above copyright
|
|
Packit |
a38265 |
notice, this list of conditions and the following disclaimer in the
|
|
Packit |
a38265 |
documentation and/or other materials provided with the distribution.
|
|
Packit |
a38265 |
|
|
Packit |
a38265 |
- Neither the name of the Annodex Association nor the names of its
|
|
Packit |
a38265 |
contributors may be used to endorse or promote products derived from
|
|
Packit |
a38265 |
this software without specific prior written permission.
|
|
Packit |
a38265 |
|
|
Packit |
a38265 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
Packit |
a38265 |
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
Packit |
a38265 |
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
|
Packit |
a38265 |
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE ASSOCIATION OR
|
|
Packit |
a38265 |
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
Packit |
a38265 |
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
Packit |
a38265 |
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
Packit |
a38265 |
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
Packit |
a38265 |
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
Packit |
a38265 |
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
Packit |
a38265 |
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
Packit |
a38265 |
*/
|
|
Packit |
a38265 |
|
|
Packit |
a38265 |
#ifndef __OGGZ_PACKET_H__
|
|
Packit |
a38265 |
#define __OGGZ_PACKET_H__
|
|
Packit |
a38265 |
|
|
Packit |
a38265 |
/** \file
|
|
Packit |
a38265 |
* Packet positioning
|
|
Packit |
a38265 |
*
|
|
Packit |
a38265 |
* oggz_packet derives from ogg_packet, and includes position information.
|
|
Packit |
a38265 |
*/
|
|
Packit |
a38265 |
|
|
Packit |
a38265 |
/************************************************************
|
|
Packit |
a38265 |
* OggzPacket
|
|
Packit |
a38265 |
*/
|
|
Packit |
a38265 |
|
|
Packit |
a38265 |
/**
|
|
Packit |
a38265 |
* The position of an oggz_packet.
|
|
Packit |
a38265 |
*/
|
|
Packit |
a38265 |
typedef struct {
|
|
Packit |
a38265 |
/**
|
|
Packit |
a38265 |
* Granulepos calculated by inspection of codec data.
|
|
Packit |
a38265 |
* -1 if unknown
|
|
Packit |
a38265 |
*/
|
|
Packit |
a38265 |
ogg_int64_t calc_granulepos;
|
|
Packit |
a38265 |
|
|
Packit |
a38265 |
/**
|
|
Packit |
a38265 |
* Byte offset of the start of the page on which this
|
|
Packit |
a38265 |
* packet begins.
|
|
Packit |
a38265 |
*/
|
|
Packit |
a38265 |
oggz_off_t begin_page_offset;
|
|
Packit |
a38265 |
|
|
Packit |
a38265 |
/**
|
|
Packit |
a38265 |
* Byte offset of the start of the page on which this
|
|
Packit |
a38265 |
* packet ends.
|
|
Packit |
a38265 |
*/
|
|
Packit |
a38265 |
oggz_off_t end_page_offset;
|
|
Packit |
a38265 |
|
|
Packit |
a38265 |
/** Number of pages this packet spans. */
|
|
Packit |
a38265 |
int pages;
|
|
Packit |
a38265 |
|
|
Packit |
a38265 |
/**
|
|
Packit |
a38265 |
* Index into begin_page's lacing values
|
|
Packit |
a38265 |
* for the segment that begins this packet.
|
|
Packit |
a38265 |
* NB. if begin_page is continued then the first
|
|
Packit |
a38265 |
* of these packets will not be reported by
|
|
Packit |
a38265 |
* ogg_sync_packetout() after a seek.
|
|
Packit |
a38265 |
* -1 if unknown.
|
|
Packit |
a38265 |
*/
|
|
Packit |
a38265 |
int begin_segment_index;
|
|
Packit |
a38265 |
} oggz_position;
|
|
Packit |
a38265 |
|
|
Packit |
a38265 |
/**
|
|
Packit |
a38265 |
* An ogg_packet and its position in the stream.
|
|
Packit |
a38265 |
*/
|
|
Packit |
a38265 |
typedef struct {
|
|
Packit |
a38265 |
/** The ogg_packet structure, defined in <ogg/ogg.h> */
|
|
Packit |
a38265 |
ogg_packet op;
|
|
Packit |
a38265 |
|
|
Packit |
a38265 |
/** Its position */
|
|
Packit |
a38265 |
oggz_position pos;
|
|
Packit |
a38265 |
} oggz_packet;
|
|
Packit |
a38265 |
|
|
Packit |
a38265 |
#endif /* __OGGZ_PACKET_H__ */
|