FFmpeg
Macros | Functions | Variables
rtpenc.c File Reference
#include "avformat.h"
#include "mpegts.h"
#include "internal.h"
#include "mux.h"
#include "libavutil/mathematics.h"
#include "libavutil/mem.h"
#include "libavutil/random_seed.h"
#include "libavutil/opt.h"
#include "rtpenc.h"

Go to the source code of this file.

Macros

#define RTCP_SR_SIZE   28
 

Functions

static int is_supported (enum AVCodecID id)
 
static int rtp_write_header (AVFormatContext *s1)
 
static void rtcp_send_sr (AVFormatContext *s1, int64_t ntp_time, int bye)
 
void ff_rtp_send_data (AVFormatContext *s1, const uint8_t *buf1, int len, int m)
 
static int rtp_send_samples (AVFormatContext *s1, const uint8_t *buf1, int size, int sample_size_bits)
 
static void rtp_send_mpegaudio (AVFormatContext *s1, const uint8_t *buf1, int size)
 
static void rtp_send_raw (AVFormatContext *s1, const uint8_t *buf1, int size)
 
static void rtp_send_mpegts_raw (AVFormatContext *s1, const uint8_t *buf1, int size)
 
static int rtp_send_ilbc (AVFormatContext *s1, const uint8_t *buf, int size)
 
static int rtp_write_packet (AVFormatContext *s1, AVPacket *pkt)
 
static int rtp_write_trailer (AVFormatContext *s1)
 

Variables

static const AVOption options []
 
static const AVClass rtp_muxer_class
 
const FFOutputFormat ff_rtp_muxer
 

Macro Definition Documentation

◆ RTCP_SR_SIZE

#define RTCP_SR_SIZE   28

Definition at line 49 of file rtpenc.c.

Function Documentation

◆ is_supported()

static int is_supported ( enum AVCodecID  id)
static

Definition at line 51 of file rtpenc.c.

Referenced by rtp_write_header().

◆ rtp_write_header()

static int rtp_write_header ( AVFormatContext s1)
static

Definition at line 97 of file rtpenc.c.

◆ rtcp_send_sr()

static void rtcp_send_sr ( AVFormatContext s1,
int64_t  ntp_time,
int  bye 
)
static

Definition at line 289 of file rtpenc.c.

Referenced by rtp_write_packet(), and rtp_write_trailer().

◆ ff_rtp_send_data()

void ff_rtp_send_data ( AVFormatContext s1,
const uint8_t *  buf1,
int  len,
int  m 
)

◆ rtp_send_samples()

static int rtp_send_samples ( AVFormatContext s1,
const uint8_t *  buf1,
int  size,
int  sample_size_bits 
)
static

Definition at line 359 of file rtpenc.c.

Referenced by rtp_write_packet().

◆ rtp_send_mpegaudio()

static void rtp_send_mpegaudio ( AVFormatContext s1,
const uint8_t *  buf1,
int  size 
)
static

Definition at line 388 of file rtpenc.c.

Referenced by rtp_write_packet().

◆ rtp_send_raw()

static void rtp_send_raw ( AVFormatContext s1,
const uint8_t *  buf1,
int  size 
)
static

Definition at line 440 of file rtpenc.c.

Referenced by rtp_write_packet().

◆ rtp_send_mpegts_raw()

static void rtp_send_mpegts_raw ( AVFormatContext s1,
const uint8_t *  buf1,
int  size 
)
static

Definition at line 462 of file rtpenc.c.

Referenced by rtp_write_packet().

◆ rtp_send_ilbc()

static int rtp_send_ilbc ( AVFormatContext s1,
const uint8_t *  buf,
int  size 
)
static

Definition at line 486 of file rtpenc.c.

Referenced by rtp_write_packet().

◆ rtp_write_packet()

static int rtp_write_packet ( AVFormatContext s1,
AVPacket pkt 
)
static

Definition at line 521 of file rtpenc.c.

◆ rtp_write_trailer()

static int rtp_write_trailer ( AVFormatContext s1)
static

Definition at line 651 of file rtpenc.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "payload_type", "Specify RTP payload type", 0x42, AV_OPT_TYPE_INT, {.i64 = -1 }, -1, 127, AV_OPT_FLAG_ENCODING_PARAM },
{ "ssrc", "Stream identifier", 0x42, AV_OPT_TYPE_INT, { .i64 = 0 }, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM },
{ "cname", "CNAME to include in RTCP SR packets", 0x42, AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, AV_OPT_FLAG_ENCODING_PARAM },
{ "seq", "Starting sequence number", 0x42, AV_OPT_TYPE_INT, { .i64 = -1 }, -1, 65535, AV_OPT_FLAG_ENCODING_PARAM },
{ NULL },
}

Definition at line 33 of file rtpenc.c.

◆ rtp_muxer_class

const AVClass rtp_muxer_class
static
Initial value:
= {
.class_name = "RTP muxer",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 42 of file rtpenc.c.

◆ ff_rtp_muxer

const FFOutputFormat ff_rtp_muxer
Initial value:
= {
.p.name = "rtp",
.p.long_name = NULL_IF_CONFIG_SMALL("RTP output"),
.priv_data_size = sizeof(RTPMuxContext),
.p.audio_codec = AV_CODEC_ID_PCM_MULAW,
.p.video_codec = AV_CODEC_ID_MPEG4,
.write_header = rtp_write_header,
.write_packet = rtp_write_packet,
.write_trailer = rtp_write_trailer,
.p.priv_class = &rtp_muxer_class,
.p.flags = AVFMT_TS_NONSTRICT,
}

Definition at line 664 of file rtpenc.c.

rtp_write_header
static int rtp_write_header(AVFormatContext *s1)
Definition: rtpenc.c:97
AV_CODEC_ID_MPEG4
@ AV_CODEC_ID_MPEG4
Definition: codec_id.h:64
FF_RTP_FLAG_OPTS
#define FF_RTP_FLAG_OPTS(ctx, fieldname)
Definition: rtpenc.h:74
rtp_write_trailer
static int rtp_write_trailer(AVFormatContext *s1)
Definition: rtpenc.c:651
options
static const AVOption options[]
Definition: rtpenc.c:33
AV_CODEC_ID_PCM_MULAW
@ AV_CODEC_ID_PCM_MULAW
Definition: codec_id.h:340
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:237
RTPMuxContext
Definition: rtpenc.h:27
rtp_muxer_class
static const AVClass rtp_muxer_class
Definition: rtpenc.c:42
AV_OPT_FLAG_ENCODING_PARAM
#define AV_OPT_FLAG_ENCODING_PARAM
A generic parameter which can be set by the user for muxing or encoding.
Definition: opt.h:352
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:94
AVFMT_TS_NONSTRICT
#define AVFMT_TS_NONSTRICT
Format does not require strictly increasing timestamps, but they must still be monotonic.
Definition: avformat.h:491
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition: opt.h:259
rtp_write_packet
static int rtp_write_packet(AVFormatContext *s1, AVPacket *pkt)
Definition: rtpenc.c:521
flags
#define flags(name, subs,...)
Definition: cbs_av1.c:482
AV_OPT_TYPE_STRING
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition: opt.h:276