MythTV  master
Classes | Macros | Typedefs | Functions
ringbuffer.h File Reference
#include <cstdio>
#include <cstdint>
#include <unistd.h>
#include <vector>
Include dependency graph for ringbuffer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ringbuffer
 
struct  dummy_buffer
 

Macros

#define FULL_BUFFER   (-1000)
 
#define EMPTY_BUFFER   (-1000)
 
#define DBUF_INDEX   10000
 

Typedefs

using peek_poke_vec = std::vector< uint8_t >
 

Functions

int ring_init (ringbuffer *rbuf, int size)
 
int ring_reinit (ringbuffer *rbuf, int size)
 
void ring_clear (ringbuffer *rbuf)
 
void ring_destroy (ringbuffer *rbuf)
 
int ring_write (ringbuffer *rbuf, uint8_t *data, int count)
 
int ring_read (ringbuffer *rbuf, uint8_t *data, int count)
 
int ring_write_file (ringbuffer *rbuf, int fd, int count)
 
int ring_read_file (ringbuffer *rbuf, int fd, int count)
 
int ring_peek (ringbuffer *rbuf, uint8_t *data, unsigned int count, uint32_t off)
 
int ring_peek (ringbuffer *rbuf, peek_poke_vec &data, unsigned int count, uint32_t off)
 
int ring_peek (ringbuffer *rbuf, peek_poke_vec &data, uint32_t off)
 
int ring_poke (ringbuffer *rbuf, uint8_t *data, unsigned int count, uint32_t off)
 
int ring_poke (ringbuffer *rbuf, peek_poke_vec &data, unsigned int count, uint32_t off)
 
int ring_poke (ringbuffer *rbuf, peek_poke_vec &data, uint32_t off)
 
int ring_skip (ringbuffer *rbuf, int count)
 
static int ring_wpos (ringbuffer *rbuf)
 
static int ring_rpos (ringbuffer *rbuf)
 
static int ring_posdiff (ringbuffer *rbuf, int pos1, int pos2)
 
static int ring_wdiff (ringbuffer *rbuf, int pos)
 
static int ring_rdiff (ringbuffer *rbuf, int pos)
 
static unsigned int ring_free (ringbuffer *rbuf)
 
static unsigned int ring_avail (ringbuffer *rbuf)
 
static uint32_t dummy_space (dummy_buffer *dbuf)
 
int dummy_delete (dummy_buffer *dbuf, uint64_t time)
 
int dummy_add (dummy_buffer *dbuf, uint64_t time, uint32_t size)
 
void dummy_clear (dummy_buffer *dbuf)
 
int dummy_init (dummy_buffer *dbuf, int s)
 
void dummy_destroy (dummy_buffer *dbuf)
 
void ring_show (ringbuffer *rbuf, unsigned int count, uint32_t off)
 

Macro Definition Documentation

◆ FULL_BUFFER

#define FULL_BUFFER   (-1000)

Definition at line 37 of file ringbuffer.h.

◆ EMPTY_BUFFER

#define EMPTY_BUFFER   (-1000)

Definition at line 38 of file ringbuffer.h.

◆ DBUF_INDEX

#define DBUF_INDEX   10000

Definition at line 47 of file ringbuffer.h.

Typedef Documentation

◆ peek_poke_vec

using peek_poke_vec = std::vector<uint8_t>

Definition at line 35 of file ringbuffer.h.

Function Documentation

◆ ring_init()

int ring_init ( ringbuffer rbuf,
int  size 
)

Definition at line 38 of file ringbuffer.cpp.

Referenced by dummy_init(), find_pids_stdin(), init_replex(), and MPEG2fixup::InitReplex().

◆ ring_reinit()

int ring_reinit ( ringbuffer rbuf,
int  size 
)

Definition at line 58 of file ringbuffer.cpp.

Referenced by MPEG2fixup::AddFrame().

◆ ring_clear()

void ring_clear ( ringbuffer rbuf)

Definition at line 78 of file ringbuffer.cpp.

Referenced by dummy_clear().

◆ ring_destroy()

void ring_destroy ( ringbuffer rbuf)

Definition at line 86 of file ringbuffer.cpp.

Referenced by dummy_destroy(), and MPEG2replex::~MPEG2replex().

◆ ring_write()

int ring_write ( ringbuffer rbuf,
uint8_t *  data,
int  count 
)

◆ ring_read()

int ring_read ( ringbuffer rbuf,
uint8_t *  data,
int  count 
)

◆ ring_write_file()

int ring_write_file ( ringbuffer rbuf,
int  fd,
int  count 
)

Definition at line 264 of file ringbuffer.cpp.

◆ ring_read_file()

int ring_read_file ( ringbuffer rbuf,
int  fd,
int  count 
)

Definition at line 302 of file ringbuffer.cpp.

Referenced by do_demux().

◆ ring_peek() [1/3]

int ring_peek ( ringbuffer rbuf,
uint8_t *  data,
unsigned int  count,
uint32_t  off 
)

◆ ring_peek() [2/3]

int ring_peek ( ringbuffer rbuf,
peek_poke_vec data,
unsigned int  count,
uint32_t  off 
)

Definition at line 153 of file ringbuffer.cpp.

◆ ring_peek() [3/3]

int ring_peek ( ringbuffer rbuf,
peek_poke_vec data,
uint32_t  off 
)

Definition at line 158 of file ringbuffer.cpp.

◆ ring_poke() [1/3]

int ring_poke ( ringbuffer rbuf,
uint8_t *  data,
unsigned int  count,
uint32_t  off 
)

Definition at line 163 of file ringbuffer.cpp.

Referenced by ring_poke(), and writeout_video().

◆ ring_poke() [2/3]

int ring_poke ( ringbuffer rbuf,
peek_poke_vec data,
unsigned int  count,
uint32_t  off 
)

Definition at line 192 of file ringbuffer.cpp.

◆ ring_poke() [3/3]

int ring_poke ( ringbuffer rbuf,
peek_poke_vec data,
uint32_t  off 
)

Definition at line 197 of file ringbuffer.cpp.

◆ ring_skip()

int ring_skip ( ringbuffer rbuf,
int  count 
)

◆ ring_wpos()

static int ring_wpos ( ringbuffer rbuf)
inlinestatic

Definition at line 77 of file ringbuffer.h.

Referenced by get_avi(), get_avi_from_index(), init_pes_in(), and pes_es_out().

◆ ring_rpos()

static int ring_rpos ( ringbuffer rbuf)
inlinestatic

◆ ring_posdiff()

static int ring_posdiff ( ringbuffer rbuf,
int  pos1,
int  pos2 
)
inlinestatic

Definition at line 87 of file ringbuffer.h.

Referenced by analyze_audio(), analyze_video(), ring_rdiff(), and ring_wdiff().

◆ ring_wdiff()

static int ring_wdiff ( ringbuffer rbuf,
int  pos 
)
inlinestatic

Definition at line 93 of file ringbuffer.h.

◆ ring_rdiff()

static int ring_rdiff ( ringbuffer rbuf,
int  pos 
)
inlinestatic

Definition at line 97 of file ringbuffer.h.

Referenced by analyze_audio(), and analyze_video().

◆ ring_free()

static unsigned int ring_free ( ringbuffer rbuf)
inlinestatic

◆ ring_avail()

static unsigned int ring_avail ( ringbuffer rbuf)
inlinestatic

◆ dummy_space()

static uint32_t dummy_space ( dummy_buffer dbuf)
inlinestatic

Definition at line 117 of file ringbuffer.h.

Referenced by check_times(), dummy_add(), dummy_delete(), writeout_ext(), and writeout_video().

◆ dummy_delete()

int dummy_delete ( dummy_buffer dbuf,
uint64_t  time 
)

Definition at line 444 of file ringbuffer.cpp.

Referenced by check_times().

◆ dummy_add()

int dummy_add ( dummy_buffer dbuf,
uint64_t  time,
uint32_t  size 
)

Definition at line 426 of file ringbuffer.cpp.

Referenced by writeout_ext(), and writeout_video().

◆ dummy_clear()

void dummy_clear ( dummy_buffer dbuf)

Definition at line 419 of file ringbuffer.cpp.

◆ dummy_init()

int dummy_init ( dummy_buffer dbuf,
int  s 
)

Definition at line 401 of file ringbuffer.cpp.

Referenced by init_multiplex().

◆ dummy_destroy()

void dummy_destroy ( dummy_buffer dbuf)

Definition at line 413 of file ringbuffer.cpp.

Referenced by finish_mpg().

◆ ring_show()

void ring_show ( ringbuffer rbuf,
unsigned int  count,
uint32_t  off 
)

Definition at line 373 of file ringbuffer.cpp.