libcaption
Macros | Functions | Variables
flv.c File Reference
#include "flv.h"
#include <stdlib.h>
#include <string.h>

Macros

#define FLVTAG_PREALOC   2048
 
#define MAX_AMF_STRING   65636
 
#define LENGTH_SIZE   4
 

Functions

void flvtag_init (flvtag_t *tag)
 
void flvtag_free (flvtag_t *tag)
 
void flvtag_swap (flvtag_t *tag1, flvtag_t *tag2)
 
int flvtag_reserve (flvtag_t *tag, uint32_t size)
 
FILE * flv_open_read (const char *flv)
 
FILE * flv_open_write (const char *flv)
 
FILE * flv_close (FILE *flv)
 
int flv_read_header (FILE *flv, int *has_audio, int *has_video)
 
int flv_write_header (FILE *flv, int has_audio, int has_video)
 
int flv_read_tag (FILE *flv, flvtag_t *tag)
 
int flv_write_tag (FILE *flv, flvtag_t *tag)
 
size_t flvtag_header_size (flvtag_t *tag)
 
size_t flvtag_payload_size (flvtag_t *tag)
 
uint8_t * flvtag_payload_data (flvtag_t *tag)
 
int flvtag_updatesize (flvtag_t *tag, uint32_t size)
 
int flvtag_initavc (flvtag_t *tag, uint32_t dts, int32_t cts, flvtag_frametype_t type)
 
int flvtag_initamf (flvtag_t *tag, uint32_t dts)
 
static void base64_encode (const unsigned char *in, unsigned long inlen, unsigned char *out, unsigned long *outlen)
 
int flvtag_amfcaption_708 (flvtag_t *tag, uint32_t timestamp, sei_message_t *msg)
 
int flvtag_amfcaption_utf8 (flvtag_t *tag, uint32_t timestamp, const utf8_char_t *text)
 
int flvtag_avcwritenal (flvtag_t *tag, uint8_t *data, size_t size)
 
int flvtag_avcwritesei (flvtag_t *tag, sei_t *sei)
 
int flvtag_addsei (flvtag_t *tag, sei_t *sei)
 
int flvtag_addcaption_text (flvtag_t *tag, const utf8_char_t *text)
 
int flvtag_addcaption_scc (flvtag_t *tag, const scc_t *scc)
 

Variables

const char onCaptionInfo708 []
 
const char onCaptionInfoUTF8 []
 

Macro Definition Documentation

#define FLVTAG_PREALOC   2048
#define LENGTH_SIZE   4
#define MAX_AMF_STRING   65636

Function Documentation

static void base64_encode ( const unsigned char *  in,
unsigned long  inlen,
unsigned char *  out,
unsigned long *  outlen 
)
static
FILE* flv_close ( FILE *  flv)
FILE* flv_open_read ( const char *  flv)
FILE* flv_open_write ( const char *  flv)
int flv_read_header ( FILE *  flv,
int *  has_audio,
int *  has_video 
)
int flv_read_tag ( FILE *  flv,
flvtag_t tag 
)
int flv_write_header ( FILE *  flv,
int  has_audio,
int  has_video 
)
int flv_write_tag ( FILE *  flv,
flvtag_t tag 
)
int flvtag_addcaption_scc ( flvtag_t tag,
const scc_t *  scc 
)
int flvtag_addcaption_text ( flvtag_t tag,
const utf8_char_t *  text 
)
int flvtag_addsei ( flvtag_t tag,
sei_t *  sei 
)
int flvtag_amfcaption_708 ( flvtag_t tag,
uint32_t  timestamp,
sei_message_t *  msg 
)
int flvtag_amfcaption_utf8 ( flvtag_t tag,
uint32_t  timestamp,
const utf8_char_t *  text 
)
int flvtag_avcwritenal ( flvtag_t tag,
uint8_t *  data,
size_t  size 
)
int flvtag_avcwritesei ( flvtag_t tag,
sei_t *  sei 
)
void flvtag_free ( flvtag_t tag)
size_t flvtag_header_size ( flvtag_t tag)
void flvtag_init ( flvtag_t tag)
int flvtag_initamf ( flvtag_t tag,
uint32_t  dts 
)
int flvtag_initavc ( flvtag_t tag,
uint32_t  dts,
int32_t  cts,
flvtag_frametype_t  type 
)
uint8_t* flvtag_payload_data ( flvtag_t tag)
size_t flvtag_payload_size ( flvtag_t tag)
int flvtag_reserve ( flvtag_t tag,
uint32_t  size 
)
void flvtag_swap ( flvtag_t tag1,
flvtag_t tag2 
)
int flvtag_updatesize ( flvtag_t tag,
uint32_t  size 
)

Variable Documentation

const char onCaptionInfo708[]
Initial value:
= { 0x02, 0x00, 0x0D, 'o', 'n', 'C', 'a', 'p', 't', 'i', 'o', 'n', 'I', 'n', 'f', 'o',
0x08, 0x00, 0x00, 0x00, 0x02,
0x00, 0x04, 't', 'y', 'p', 'e',
0x02, 0x00, 0x03, '7', '0', '8',
0x00, 0x04, 'd', 'a', 't', 'a',
0x02, 0x00, 0x00 }
const char onCaptionInfoUTF8[]
Initial value:
= { 0x02, 0x00, 0x0D, 'o', 'n', 'C', 'a', 'p', 't', 'i', 'o', 'n', 'I', 'n', 'f', 'o',
0x08, 0x00, 0x00, 0x00, 0x02,
0x00, 0x04, 't', 'y', 'p', 'e',
0x02, 0x00, 0x04, 'U', 'T', 'F', '8',
0x00, 0x04, 'd', 'a', 't', 'a',
0x02, 0x00, 0x00 }