33 #include <librtmp/rtmp.h>
34 #include <librtmp/log.h>
96 RTMP_LogSetLevel(
level);
101 if (ctx->
app) len += strlen(ctx->
app) +
sizeof(
" app=");
119 if (!RTMP_SetupURL(r, filename)) {
127 if (!RTMP_Connect(r,
NULL) || !RTMP_ConnectStream(r, 0)) {
143 RTMP *
r = &ctx->
rtmp;
145 return RTMP_Write(r, buf, size);
151 RTMP *
r = &ctx->
rtmp;
153 return RTMP_Read(r, buf, size);
159 RTMP *
r = &ctx->
rtmp;
161 if (!RTMP_Pause(r, pause))
167 int64_t timestamp,
int flags)
170 RTMP *
r = &ctx->
rtmp;
176 if (stream_index < 0)
180 if (!RTMP_SendSeek(r, timestamp))
188 RTMP *
r = &ctx->
rtmp;
190 return RTMP_Socket(r);
193 #define OFFSET(x) offsetof(LibRTMPContext, x)
194 #define DEC AV_OPT_FLAG_DECODING_PARAM
195 #define ENC AV_OPT_FLAG_ENCODING_PARAM
202 #define RTMP_CLASS(flavor)\
203 static const AVClass lib ## flavor ## _class = {\
204 .class_name = "lib" #flavor " protocol",\
205 .item_name = av_default_item_name,\
207 .version = LIBAVUTIL_VERSION_INT,\
221 .priv_data_class = &librtmp_class,
236 .priv_data_class = &librtmpt_class,
251 .priv_data_class = &librtmpe_class,
266 .priv_data_class = &librtmpte_class,
281 .priv_data_class = &librtmps_class,
void * av_malloc(size_t size)
Allocate a block of size bytes with alignment suitable for all memory accesses (including vectors if ...
#define URL_PROTOCOL_FLAG_NETWORK
static int64_t rtmp_read_seek(URLContext *s, int stream_index, int64_t timestamp, int flags)
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.
int is_streamed
true if streamed (no seek possible), default = false
static int rtmp_read_pause(URLContext *s, int pause)
void av_freep(void *arg)
Free a memory block which has been allocated with av_malloc(z)() or av_realloc() and set the pointer ...
int av_log_get_level(void)
static int rtmp_close(URLContext *s)
static int rtmp_open(URLContext *s, const char *uri, int flags)
Open RTMP connection and verify that the stream can be played.
URLProtocol ff_librtmpt_protocol
void av_vlog(void *avcl, int level, const char *fmt, va_list vl)
static void rtmp_log(int level, const char *fmt, va_list args)
void av_log(void *avcl, int level, const char *fmt,...)
size_t av_strlcpy(char *dst, const char *src, size_t size)
Copy the string src to dst, but no more than size - 1 bytes, and null-terminate dst.
URLProtocol ff_librtmpte_protocol
URLProtocol ff_librtmpe_protocol
URLProtocol ff_librtmp_protocol
#define AVSEEK_FLAG_BACKWARD
static const AVOption options[]
Describe the class of an AVClass context structure.
static int rtmp_write(URLContext *s, const uint8_t *buf, int size)
size_t av_strlcat(char *dst, const char *src, size_t size)
Append the string src to the string dst, but to a total length of no more than size - 1 bytes...
char * filename
specified URL
struct LibRTMPContext LibRTMPContext
static int rtmp_get_file_handle(URLContext *s)
URLProtocol ff_librtmps_protocol
static int rtmp_read(URLContext *s, uint8_t *buf, int size)
unbuffered private I/O API
#define RTMP_CLASS(flavor)