33 #include <librtmp/rtmp.h>
34 #include <librtmp/log.h>
98 RTMP_LogSetLevel(
level);
103 if (ctx->
app) len += strlen(ctx->
app) +
sizeof(
" app=");
121 if (!RTMP_SetupURL(r, filename)) {
129 if (!RTMP_Connect(r,
NULL) || !RTMP_ConnectStream(r, 0)) {
144 RTMP *
r = &ctx->
rtmp;
146 return RTMP_Write(r, buf, size);
152 RTMP *
r = &ctx->
rtmp;
154 return RTMP_Read(r, buf, size);
160 RTMP *
r = &ctx->
rtmp;
162 if (!RTMP_Pause(r, pause))
168 int64_t timestamp,
int flags)
171 RTMP *
r = &ctx->
rtmp;
177 if (stream_index < 0)
181 if (!RTMP_SendSeek(r, timestamp))
189 RTMP *
r = &ctx->
rtmp;
191 return RTMP_Socket(r);
194 #define OFFSET(x) offsetof(LibRTMPContext, x)
195 #define DEC AV_OPT_FLAG_DECODING_PARAM
196 #define ENC AV_OPT_FLAG_ENCODING_PARAM
203 #define RTMP_CLASS(flavor)\
204 static const AVClass lib ## flavor ## _class = {\
205 .class_name = "lib" #flavor " protocol",\
206 .item_name = av_default_item_name,\
208 .version = LIBAVUTIL_VERSION_INT,\
222 .priv_data_class = &librtmp_class,
237 .priv_data_class = &librtmpt_class,
252 .priv_data_class = &librtmpe_class,
267 .priv_data_class = &librtmpte_class,
282 .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.
#define AV_LOG_WARNING
Something somehow does not look correct.
int is_streamed
true if streamed (no seek possible), default = false
#define AVIO_FLAG_WRITE
write-only
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 ...
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
#define AV_LOG_VERBOSE
Detailed information.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
static void rtmp_log(int level, const char *fmt, va_list args)
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
void av_log(void *avcl, int level, const char *fmt,...)
int av_log_get_level(void)
Get the current log level.
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
#define AV_TIME_BASE
Internal time base represented as integer.
URLProtocol ff_librtmpe_protocol
URLProtocol ff_librtmp_protocol
#define AV_LOG_INFO
Standard information.
static const AVOption options[]
Describe the class of an AVClass context structure.
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...
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
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
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 AV_LOG_FATAL
Something went wrong and recovery is not possible.
#define RTMP_CLASS(flavor)