zenilib: zenilib/jni/external/libogg/src/framing.c File Reference

zenilib 0.5.3.0

- Main Page
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions | Variables
framing.c File Reference
`#include <stdlib.h>`
`#include <string.h>`
`#include <ogg/ogg.h>`

Go to the source code of this file.

## Functions

static int | _os_body_expand (ogg_stream_state *os, int needed)
static int | _os_lacing_expand (ogg_stream_state *os, int needed)
static int | _packetout (ogg_stream_state *os, ogg_packet *op, int adv)
void | ogg_packet_clear (ogg_packet *op)
int | ogg_page_bos (const ogg_page *og)
void | ogg_page_checksum_set (ogg_page *og)
int | ogg_page_continued (const ogg_page *og)
int | ogg_page_eos (const ogg_page *og)
ogg_int64_t | ogg_page_granulepos (const ogg_page *og)
int | ogg_page_packets (const ogg_page *og)
long | ogg_page_pageno (const ogg_page *og)
int | ogg_page_serialno (const ogg_page *og)
int | ogg_page_version (const ogg_page *og)
int | ogg_stream_check (ogg_stream_state *os)
int | ogg_stream_clear (ogg_stream_state *os)
int | ogg_stream_destroy (ogg_stream_state *os)
int | ogg_stream_eos (ogg_stream_state *os)
int | ogg_stream_flush (ogg_stream_state *os, ogg_page *og)
int | ogg_stream_flush_fill (ogg_stream_state *os, ogg_page *og, int nfill)
static int | ogg_stream_flush_i (ogg_stream_state *os, ogg_page *og, int force, int nfill)
int | ogg_stream_init (ogg_stream_state *os, int serialno)
int | ogg_stream_iovecin (ogg_stream_state *os, ogg_iovec_t *iov, int count, long e_o_s, ogg_int64_t granulepos)
int | ogg_stream_packetin (ogg_stream_state *os, ogg_packet *op)
int | ogg_stream_packetout (ogg_stream_state *os, ogg_packet *op)
int | ogg_stream_packetpeek (ogg_stream_state *os, ogg_packet *op)
int | ogg_stream_pagein (ogg_stream_state *os, ogg_page *og)
int | ogg_stream_pageout (ogg_stream_state *os, ogg_page *og)
int | ogg_stream_pageout_fill (ogg_stream_state *os, ogg_page *og, int nfill)
int | ogg_stream_reset (ogg_stream_state *os)
int | ogg_stream_reset_serialno (ogg_stream_state *os, int serialno)
char * | ogg_sync_buffer (ogg_sync_state *oy, long size)
int | ogg_sync_check (ogg_sync_state *oy)
int | ogg_sync_clear (ogg_sync_state *oy)
int | ogg_sync_destroy (ogg_sync_state *oy)
int | ogg_sync_init (ogg_sync_state *oy)
int | ogg_sync_pageout (ogg_sync_state *oy, ogg_page *og)
long | ogg_sync_pageseek (ogg_sync_state *oy, ogg_page *og)
int | ogg_sync_reset (ogg_sync_state *oy)
int | ogg_sync_wrote (ogg_sync_state *oy, long bytes)

## Variables

static const ogg_uint32_t | crc_lookup [256]

## Function Documentation

static int _os_body_expand | ( | ogg_stream_state * | os,
|  | int | needed
| ) |  |

static

Definition at line 239 of file framing.c.

References _ogg_realloc, ogg_stream_state::body_data, ogg_stream_state::body_fill, ogg_stream_state::body_storage, ogg_stream_clear(), and ret.

Referenced by ogg_stream_iovecin(), and ogg_stream_pagein().

static int _os_lacing_expand | ( | ogg_stream_state * | os,
|  | int | needed
| ) |  |

static

Definition at line 254 of file framing.c.

References _ogg_realloc, ogg_stream_state::granule_vals, ogg_stream_state::lacing_fill, ogg_stream_state::lacing_storage, ogg_stream_state::lacing_vals, ogg_stream_clear(), and ret.

Referenced by ogg_stream_iovecin(), and ogg_stream_pagein().

static int _packetout | ( | ogg_stream_state * | os,
|  | ogg_packet * | op,
|  | int | adv
| ) |  |

static

Definition at line 958 of file framing.c.

References ogg_packet::b_o_s, ogg_stream_state::body_data, ogg_stream_state::body_returned, ogg_packet::bytes, ogg_packet::e_o_s, ogg_stream_state::granule_vals, ogg_packet::granulepos, ogg_stream_state::lacing_packet, ogg_stream_state::lacing_returned, ogg_stream_state::lacing_vals, ogg_packet::packet, ogg_stream_state::packetno, and ogg_packet::packetno.

Referenced by ogg_stream_packetout(), and ogg_stream_packetpeek().

void ogg_packet_clear | ( | ogg_packet * | op | ) |

Definition at line 1022 of file framing.c.

References _ogg_free, memset, and ogg_packet::packet.

int ogg_page_bos | ( | const ogg_page * | og | ) |

Definition at line 37 of file framing.c.

References ogg_page::header.

Referenced by _fetch_and_process_packet(), _fetch_headers(), _initial_pcmoffset(), ogg_stream_pagein(), ov_pcm_seek(), and ov_raw_seek().

void ogg_page_checksum_set | ( | ogg_page * | og | ) |

Definition at line 280 of file framing.c.

References ogg_page::body, ogg_page::body_len, ogg_page::header, ogg_page::header_len, and i.

Referenced by ogg_stream_flush_i(), and ogg_sync_pageseek().

int ogg_page_continued | ( | const ogg_page * | og | ) |

Definition at line 33 of file framing.c.

References ogg_page::header.

Referenced by ogg_stream_pagein(), and ov_pcm_seek_page().

int ogg_page_eos | ( | const ogg_page * | og | ) |

Definition at line 41 of file framing.c.

References ogg_page::header.

Referenced by ogg_stream_pagein(), and ov_raw_seek().

ogg_int64_t ogg_page_granulepos | ( | const ogg_page * | og | ) |

Definition at line 45 of file framing.c.

References ogg_page::header.

Referenced by _get_prev_page_serial(), _initial_pcmoffset(), ogg_stream_pagein(), and ov_pcm_seek_page().

int ogg_page_packets | ( | const ogg_page * | og | ) |

Definition at line 91 of file framing.c.

References ogg_page::header, and i.

long ogg_page_pageno | ( | const ogg_page * | og | ) |

Definition at line 65 of file framing.c.

References ogg_page::header.

Referenced by ogg_stream_pagein().

int ogg_page_serialno | ( | const ogg_page * | og | ) |

Definition at line 58 of file framing.c.

References ogg_page::header.

Referenced by _add_serialno(), _fetch_and_process_packet(), _fetch_headers(), _get_prev_page_serial(), _initial_pcmoffset(), _lookup_page_serialno(), ogg_stream_pagein(), ov_pcm_seek(), ov_pcm_seek_page(), and ov_raw_seek().

int ogg_page_version | ( | const ogg_page * | og | ) |

Definition at line 29 of file framing.c.

References ogg_page::header.

Referenced by ogg_stream_pagein().

int ogg_stream_check | ( | ogg_stream_state * | os | ) |

Definition at line 211 of file framing.c.

References ogg_stream_state::body_data.

Referenced by ogg_stream_eos(), ogg_stream_flush_i(), ogg_stream_iovecin(), ogg_stream_packetout(), ogg_stream_packetpeek(), ogg_stream_pagein(), ogg_stream_pageout(), ogg_stream_pageout_fill(), ogg_stream_reset(), and ogg_stream_reset_serialno().

int ogg_stream_clear | ( | ogg_stream_state * | os | ) |

Definition at line 217 of file framing.c.

References _ogg_free, ogg_stream_state::body_data, ogg_stream_state::granule_vals, ogg_stream_state::lacing_vals, and memset.

Referenced by _os_body_expand(), _os_lacing_expand(), ogg_stream_destroy(), ogg_stream_init(), ov_clear(), and ov_raw_seek().

int ogg_stream_destroy | ( | ogg_stream_state * | os | ) |

Definition at line 228 of file framing.c.

References _ogg_free, and ogg_stream_clear().

int ogg_stream_eos | ( | ogg_stream_state * | os | ) |

Definition at line 559 of file framing.c.

References ogg_stream_state::e_o_s, and ogg_stream_check().

int ogg_stream_flush | ( | ogg_stream_state * | os,
|  | ogg_page * | og
| ) |  |

Definition at line 517 of file framing.c.

References ogg_stream_flush_i().

int ogg_stream_flush_fill | ( | ogg_stream_state * | os,
|  | ogg_page * | og,
|  | int | nfill
| ) |  |

Definition at line 525 of file framing.c.

References ogg_stream_flush_i().

static int ogg_stream_flush_i | ( | ogg_stream_state * | os,
|  | ogg_page * | og,
|  | int | force,
|  | int | nfill
| ) |  |

static

Definition at line 372 of file framing.c.

References ogg_stream_state::b_o_s, ogg_page::body, ogg_stream_state::body_data, ogg_page::body_len, ogg_stream_state::body_returned, ogg_stream_state::e_o_s, ogg_stream_state::granule_vals, ogg_page::header, ogg_stream_state::header, ogg_stream_state::header_fill, ogg_page::header_len, i, ogg_stream_state::lacing_fill, ogg_stream_state::lacing_vals, memcpy, memmove, ogg_page_checksum_set(), ogg_stream_check(), ogg_stream_state::pageno, and ogg_stream_state::serialno.

Referenced by ogg_stream_flush(), ogg_stream_flush_fill(), ogg_stream_pageout(), and ogg_stream_pageout_fill().

int ogg_stream_init | ( | ogg_stream_state * | os,
|  | int | serialno
| ) |  |

Definition at line 188 of file framing.c.

References _ogg_malloc, ogg_stream_state::body_data, ogg_stream_state::body_storage, ogg_stream_state::granule_vals, ogg_stream_state::lacing_storage, ogg_stream_state::lacing_vals, memset, ogg_stream_clear(), and ogg_stream_state::serialno.

Referenced by _ov_open1(), and ov_raw_seek().

int ogg_stream_iovecin | ( | ogg_stream_state * | os,
|  | ogg_iovec_t * | iov,
|  | int | count,
|  | long | e_o_s,
|  | ogg_int64_t | granulepos
| ) |  |

Definition at line 304 of file framing.c.

References _os_body_expand(), _os_lacing_expand(), ogg_stream_state::body_data, ogg_stream_state::body_fill, ogg_stream_state::body_returned, ogg_stream_state::e_o_s, ogg_stream_state::granule_vals, ogg_stream_state::granulepos, i, int, ogg_iovec_t::iov_base, ogg_iovec_t::iov_len, ogg_stream_state::lacing_fill, ogg_stream_state::lacing_vals, memcpy, memmove, ogg_stream_check(), and ogg_stream_state::packetno.

Referenced by ogg_stream_packetin().

int ogg_stream_packetin | ( | ogg_stream_state * | os,
|  | ogg_packet * | op
| ) |  |

Definition at line 362 of file framing.c.

References ogg_packet::bytes, ogg_packet::e_o_s, ogg_packet::granulepos, ogg_iovec_t::iov_base, ogg_iovec_t::iov_len, ogg_stream_iovecin(), and ogg_packet::packet.

int ogg_stream_packetout | ( | ogg_stream_state * | os,
|  | ogg_packet * | op
| ) |  |

Definition at line 1012 of file framing.c.

References _packetout(), and ogg_stream_check().

Referenced by _fetch_and_process_packet(), _fetch_headers(), _initial_pcmoffset(), ov_pcm_seek(), ov_pcm_seek_page(), and ov_raw_seek().

int ogg_stream_packetpeek | ( | ogg_stream_state * | os,
|  | ogg_packet * | op
| ) |  |

Definition at line 1017 of file framing.c.

References _packetout(), and ogg_stream_check().

Referenced by ov_pcm_seek(), and ov_pcm_seek_page().

int ogg_stream_pagein | ( | ogg_stream_state * | os,
|  | ogg_page * | og
| ) |  |

Definition at line 790 of file framing.c.

References _os_body_expand(), _os_lacing_expand(), ogg_page::body, ogg_stream_state::body_data, ogg_stream_state::body_fill, ogg_page::body_len, ogg_stream_state::body_returned, ogg_stream_state::e_o_s, ogg_stream_state::granule_vals, ogg_page::header, header(), i, ogg_stream_state::lacing_fill, ogg_stream_state::lacing_packet, ogg_stream_state::lacing_returned, ogg_stream_state::lacing_vals, memcpy, memmove, ogg_page_bos(), ogg_page_continued(), ogg_page_eos(), ogg_page_granulepos(), ogg_page_pageno(), ogg_page_serialno(), ogg_page_version(), ogg_stream_check(), ogg_stream_state::pageno, ogg_stream_state::serialno, and version.

Referenced by _fetch_and_process_packet(), _fetch_headers(), _initial_pcmoffset(), ov_pcm_seek(), ov_pcm_seek_page(), and ov_raw_seek().

int ogg_stream_pageout | ( | ogg_stream_state * | os,
|  | ogg_page * | og
| ) |  |

Definition at line 533 of file framing.c.

References ogg_stream_state::b_o_s, ogg_stream_state::e_o_s, ogg_stream_state::lacing_fill, ogg_stream_check(), and ogg_stream_flush_i().

int ogg_stream_pageout_fill | ( | ogg_stream_state * | os,
|  | ogg_page * | og,
|  | int | nfill
| ) |  |

Definition at line 548 of file framing.c.

References ogg_stream_state::b_o_s, ogg_stream_state::e_o_s, ogg_stream_state::lacing_fill, ogg_stream_check(), and ogg_stream_flush_i().

int ogg_stream_reset | ( | ogg_stream_state * | os | ) |

Definition at line 930 of file framing.c.

References ogg_stream_state::b_o_s, ogg_stream_state::body_fill, ogg_stream_state::body_returned, ogg_stream_state::e_o_s, ogg_stream_state::granulepos, ogg_stream_state::header_fill, ogg_stream_state::lacing_fill, ogg_stream_state::lacing_packet, ogg_stream_state::lacing_returned, ogg_stream_check(), ogg_stream_state::packetno, and ogg_stream_state::pageno.

Referenced by ogg_stream_reset_serialno(), and ov_raw_seek().

int ogg_stream_reset_serialno | ( | ogg_stream_state * | os,
|  | int | serialno
| ) |  |

Definition at line 951 of file framing.c.

References ogg_stream_check(), ogg_stream_reset(), and ogg_stream_state::serialno.

Referenced by _fetch_and_process_packet(), _fetch_headers(), ov_pcm_seek(), ov_pcm_seek_page(), and ov_raw_seek().

char* ogg_sync_buffer | ( | ogg_sync_state * | oy,
|  | long | size
| ) |  |

Definition at line 610 of file framing.c.

References _ogg_malloc, _ogg_realloc, ogg_sync_state::data, ogg_sync_state::fill, memmove, NULL, ogg_sync_check(), ogg_sync_clear(), ret, ogg_sync_state::returned, and ogg_sync_state::storage.

Referenced by _get_data(), and _ov_open1().

int ogg_sync_check | ( | ogg_sync_state * | oy | ) |

Definition at line 605 of file framing.c.

References ogg_sync_state::storage.

Referenced by ogg_sync_buffer(), ogg_sync_pageout(), ogg_sync_pageseek(), ogg_sync_reset(), and ogg_sync_wrote().

int ogg_sync_clear | ( | ogg_sync_state * | oy | ) |

Definition at line 589 of file framing.c.

References _ogg_free, ogg_sync_state::data, and memset.

Referenced by ogg_sync_buffer(), ogg_sync_destroy(), and ov_clear().

int ogg_sync_destroy | ( | ogg_sync_state * | oy | ) |

Definition at line 597 of file framing.c.

References _ogg_free, and ogg_sync_clear().

int ogg_sync_init | ( | ogg_sync_state * | oy | ) |

Definition at line 580 of file framing.c.

References memset, and ogg_sync_state::storage.

Referenced by _ov_open1().

int ogg_sync_pageout | ( | ogg_sync_state * | oy,
|  | ogg_page * | og
| ) |  |

Definition at line 757 of file framing.c.

References ogg_sync_check(), ogg_sync_pageseek(), ret, and ogg_sync_state::unsynced.

long ogg_sync_pageseek | ( | ogg_sync_state * | oy,
|  | ogg_page * | og
| ) |  |

Definition at line 659 of file framing.c.

References ogg_page::body, ogg_page::body_len, ogg_sync_state::bodybytes, ogg_sync_state::data, ogg_sync_state::fill, ogg_page::header, ogg_page::header_len, ogg_sync_state::headerbytes, i, int, memcpy, memset, ogg_page_checksum_set(), ogg_sync_check(), ogg_sync_state::returned, and ogg_sync_state::unsynced.

Referenced by _get_next_page(), and ogg_sync_pageout().

int ogg_sync_reset | ( | ogg_sync_state * | oy | ) |

Definition at line 919 of file framing.c.

References ogg_sync_state::bodybytes, ogg_sync_state::fill, ogg_sync_state::headerbytes, ogg_sync_check(), ogg_sync_state::returned, and ogg_sync_state::unsynced.

Referenced by _seek_helper().

int ogg_sync_wrote | ( | ogg_sync_state * | oy,
|  | long | bytes
| ) |  |

Definition at line 642 of file framing.c.

References ogg_sync_state::fill, ogg_sync_check(), and ogg_sync_state::storage.

Referenced by _get_data(), and _ov_open1().

## Variable Documentation

const ogg_uint32_t crc_lookup[256]

static

Definition at line 120 of file framing.c.