GPAC
Open Source Multimedia Framework. For more information, check out http://gpac.wp.mines-telecom.fr
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups
ffmpeg_ts_muxer.c File Reference
#include "ts_muxer.h"
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
+ Include dependency graph for ffmpeg_ts_muxer.c:
+ This graph shows which files directly or indirectly include this file:

Data Structures

struct  GF_AbstractTSMuxer
 

Macros

#define STREAM_FRAME_RATE   25 /* 25 images/s */
 
#define STREAM_NB_FRAMES   ((int)(STREAM_DURATION * STREAM_FRAME_RATE))
 
#define STREAM_PIX_FMT   PIX_FMT_YUV420P /* default pix_fmt */
 
#define PACKETS_BUFFER_LEN   1024
 
#define GUESS_FORMAT   guess_stream_format
 

Functions

static Bool has_packet_ready (GF_AbstractTSMuxer *ts, GF_Mutex *mx, AVPacketList **pkts)
 
static AVPacketList * wait_for_packet (GF_AbstractTSMuxer *ts, GF_Mutex *mx, AVPacketList **pkts)
 
static u32 ts_interleave_thread_run (void *param)
 
GF_AbstractTSMuxer * ts_amux_new (GF_AVRedirect *avr, u32 videoBitrateInBitsPerSec, u32 width, u32 height, u32 audioBitRateInBitsPerSec)
 
void ts_amux_del (GF_AbstractTSMuxer *muxerToDelete)
 
Bool ts_encode_audio_frame (GF_AbstractTSMuxer *ts, uint8_t *data, int encoded, u64 pts)
 
Bool ts_encode_video_frame (GF_AbstractTSMuxer *ts, uint8_t *data, int encoded)
 
AVCodecContext * ts_get_video_codec_context (GF_AbstractTSMuxer *ts)
 
AVCodecContext * ts_get_audio_codec_context (GF_AbstractTSMuxer *ts)
 

Data Structure Documentation

struct avr_ts_muxer
+ Collaboration diagram for GF_AbstractTSMuxer:
Data Fields
AVFormatContext * oc
AVStream * audio_st
AVStream * video_st
AVPacketList * videoPackets
AVPacketList * audioPackets
volatile Bool encode
GF_Mutex * videoMx
GF_Mutex * audioMx
GF_Thread * tsEncodingThread
const char * destination
GF_M2TS_Mux * muxer
GF_ESIPacket videoCurrentTSPacket
GF_ESIPacket audioCurrentTSPacket
GF_ESInterface * video
GF_ESInterface * audio
u64 frameTimeSentOverTS
GF_Socket * ts_output_udp_sk

Macro Definition Documentation

#define STREAM_FRAME_RATE   25 /* 25 images/s */
#define STREAM_NB_FRAMES   ((int)(STREAM_DURATION * STREAM_FRAME_RATE))
#define STREAM_PIX_FMT   PIX_FMT_YUV420P /* default pix_fmt */
#define PACKETS_BUFFER_LEN   1024
#define GUESS_FORMAT   guess_stream_format

Function Documentation

static Bool has_packet_ready ( GF_AbstractTSMuxer *  ts,
GF_Mutex *  mx,
AVPacketList **  pkts 
)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static AVPacketList* wait_for_packet ( GF_AbstractTSMuxer *  ts,
GF_Mutex *  mx,
AVPacketList **  pkts 
)
static

Wait for a packet on a given queue

Parameters
tsThe muxer
mxThe mutex to use
pktsThe list of packets to watch
idxa pointer to the index in the list
Returns
NULL if encoding is ended, the first packet available otherwise

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static u32 ts_interleave_thread_run ( void *  param)
static

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

GF_AbstractTSMuxer* ts_amux_new ( GF_AVRedirect avr,
u32  videoBitrateInBitsPerSec,
u32  width,
u32  height,
u32  audioBitRateInBitsPerSec 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ts_amux_del ( GF_AbstractTSMuxer *  muxerToDelete)

+ Here is the caller graph for this function:

Bool ts_encode_audio_frame ( GF_AbstractTSMuxer *  ts,
uint8_t data,
int  encoded,
u64  pts 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Bool ts_encode_video_frame ( GF_AbstractTSMuxer *  ts,
uint8_t data,
int  encoded 
)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

AVCodecContext* ts_get_video_codec_context ( GF_AbstractTSMuxer *  ts)

+ Here is the caller graph for this function:

AVCodecContext* ts_get_audio_codec_context ( GF_AbstractTSMuxer *  ts)

+ Here is the caller graph for this function: