Go to the documentation of this file.
37 #include <librtmp/rtmp.h>
38 #include <librtmp/log.h>
113 RTMP_LogSetLevel(
level);
128 char *sep, *p =
ctx->conn;
134 sep = strchr(p,
' ');
151 if (
ctx->client_buffer_time)
153 if (
ctx->swfurl ||
ctx->swfverify) {
167 if (!RTMP_SetupURL(
r,
ctx->filename.str)) {
175 if (!RTMP_Connect(
r,
NULL) || !RTMP_ConnectStream(
r, 0)) {
182 int tmp =
ctx->buffer_size;
183 if (setsockopt(
r->m_sb.sb_socket, SOL_SOCKET, SO_SNDBUF, &
tmp,
sizeof(
tmp))) {
204 RTMP *
r = &
ctx->rtmp;
215 RTMP *
r = &
ctx->rtmp;
226 RTMP *
r = &
ctx->rtmp;
228 if (!RTMP_Pause(
r, pause))
234 int64_t timestamp,
int flags)
237 RTMP *
r = &
ctx->rtmp;
243 if (stream_index < 0)
247 if (!RTMP_SendSeek(
r, timestamp))
255 RTMP *
r = &
ctx->rtmp;
257 return RTMP_Socket(
r);
260 #define OFFSET(x) offsetof(LibRTMPContext, x)
261 #define DEC AV_OPT_FLAG_DECODING_PARAM
262 #define ENC AV_OPT_FLAG_ENCODING_PARAM
265 {
"rtmp_buffer",
"Set buffer time in milliseconds. The default is 3000.",
OFFSET(client_buffer_time),
AV_OPT_TYPE_STRING, {.str =
"3000"}, 0, 0,
DEC|
ENC},
268 {
"rtmp_live",
"Specify that the media is a live stream.",
OFFSET(live),
AV_OPT_TYPE_INT, {.i64 = 0}, INT_MIN, INT_MAX,
DEC,
"rtmp_live"},
272 {
"rtmp_pageurl",
"URL of the web page in which the media was embedded. By default no value will be sent.",
OFFSET(pageurl),
AV_OPT_TYPE_STRING, {.str =
NULL }, 0, 0,
DEC},
274 {
"rtmp_subscribe",
"Name of live stream to subscribe to. Defaults to rtmp_playpath.",
OFFSET(subscribe),
AV_OPT_TYPE_STRING, {.str =
NULL }, 0, 0,
DEC},
276 {
"rtmp_swfverify",
"URL to player swf file, compute hash/size automatically. (unimplemented)",
OFFSET(swfverify),
AV_OPT_TYPE_STRING, {.str =
NULL }, 0, 0,
DEC},
284 #define RTMP_CLASS(flavor)\
285 static const AVClass lib ## flavor ## _class = {\
286 .class_name = "lib" #flavor " protocol",\
287 .item_name = av_default_item_name,\
289 .version = LIBAVUTIL_VERSION_INT,\
303 .priv_data_class = &librtmp_class,
318 .priv_data_class = &librtmpt_class,
333 .priv_data_class = &librtmpe_class,
348 .priv_data_class = &librtmpte_class,
363 .priv_data_class = &librtmps_class,
void av_vlog(void *avcl, int level, const char *fmt, va_list vl)
Send the specified message to the log if the level is less than or equal to the current av_log_level.
#define AV_LOG_WARNING
Something somehow does not look correct.
#define AV_BPRINT_SIZE_UNLIMITED
static int av_bprint_is_complete(const AVBPrint *buf)
Test if the print buffer is complete (not truncated).
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
#define URL_PROTOCOL_FLAG_NETWORK
void av_bprint_init(AVBPrint *buf, unsigned size_init, unsigned size_max)
#define AVERROR_EOF
End of file.
static int rtmp_close(URLContext *s)
const URLProtocol ff_librtmps_protocol
#define AV_LOG_VERBOSE
Detailed information.
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
const URLProtocol ff_librtmpt_protocol
static int64_t rtmp_read_seek(URLContext *s, int stream_index, int64_t timestamp, int flags)
static int rtmp_open(URLContext *s, const char *uri, int flags)
Open RTMP connection and verify that the stream can be played.
static int rtmp_read_pause(URLContext *s, int pause)
@ AV_ROUND_UP
Round toward +infinity.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
const URLProtocol ff_librtmp_protocol
#define AVIO_FLAG_WRITE
write-only
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
int av_log_get_level(void)
Get the current log level.
Describe the class of an AVClass context structure.
int64_t av_rescale_rnd(int64_t a, int64_t b, int64_t c, enum AVRounding rnd)
Rescale a 64-bit integer with specified rounding.
static void rtmp_log(int level, const char *fmt, va_list args)
int av_bprint_finalize(AVBPrint *buf, char **ret_str)
Finalize a print buffer.
char * client_buffer_time
static const AVOption options[]
#define AVERROR_EXTERNAL
Generic error in an external library.
#define AV_LOG_INFO
Standard information.
#define AV_TIME_BASE
Internal time base represented as integer.
@ AV_ROUND_DOWN
Round toward -infinity.
static int rtmp_read(URLContext *s, uint8_t *buf, int size)
#define AV_LOG_FATAL
Something went wrong and recovery is not possible.
void av_bprintf(AVBPrint *buf, const char *fmt,...)
const URLProtocol ff_librtmpe_protocol
static int rtmp_write(URLContext *s, const uint8_t *buf, int size)
const URLProtocol ff_librtmpte_protocol
static int rtmp_get_file_handle(URLContext *s)
#define flags(name, subs,...)
#define RTMP_CLASS(flavor)