Tidy FFMPEG
This commit is contained in:
@ -23,11 +23,9 @@ http_method_t http_methods[] = {
|
|||||||
{ "GET /?action=stream", http_stream },
|
{ "GET /?action=stream", http_stream },
|
||||||
{ "GET /video?", http_content, "text/html", html_video_html, 0, &html_video_html_len },
|
{ "GET /video?", http_content, "text/html", html_video_html, 0, &html_video_html_len },
|
||||||
{ "GET /video.h264?", http_h264_video },
|
{ "GET /video.h264?", http_h264_video },
|
||||||
#ifdef USE_FFMPEG
|
|
||||||
{ "GET /video.mkv?", http_mkv_video },
|
{ "GET /video.mkv?", http_mkv_video },
|
||||||
{ "GET /video.mp4?", http_mp4_video },
|
{ "GET /video.mp4?", http_mp4_video },
|
||||||
{ "GET /jmuxer.min.js?", http_content, "text/javascript", html_jmuxer_min_js, 0, &html_jmuxer_min_js_len },
|
{ "GET /jmuxer.min.js?", http_content, "text/javascript", html_jmuxer_min_js, 0, &html_jmuxer_min_js_len },
|
||||||
#endif // USE_FFMPEG
|
|
||||||
{ "GET /?", http_content, "text/html", html_index_html, 0, &html_index_html_len },
|
{ "GET /?", http_content, "text/html", html_index_html, 0, &html_index_html_len },
|
||||||
{ }
|
{ }
|
||||||
};
|
};
|
||||||
|
@ -3,10 +3,10 @@
|
|||||||
|
|
||||||
#ifdef USE_FFMPEG
|
#ifdef USE_FFMPEG
|
||||||
static AVRational time_base = {1, 1000LL * 1000LL};
|
static AVRational time_base = {1, 1000LL * 1000LL};
|
||||||
|
static int avio_ctx_buffer_size = 4096;
|
||||||
|
|
||||||
static int ffmpeg_remuxer_init_avcontext(AVFormatContext **context, ffmpeg_remuxer_t *remuxer, int output, int (*packet)(void *opaque, uint8_t *buf, int buf_size))
|
static int ffmpeg_remuxer_init_avcontext(AVFormatContext **context, ffmpeg_remuxer_t *remuxer, int output, int (*packet)(void *opaque, uint8_t *buf, int buf_size))
|
||||||
{
|
{
|
||||||
static int avio_ctx_buffer_size = 4096;
|
|
||||||
uint8_t *buffer = NULL;
|
uint8_t *buffer = NULL;
|
||||||
AVIOContext *avio = NULL;
|
AVIOContext *avio = NULL;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#ifdef USE_FFMPEG
|
#ifdef USE_FFMPEG
|
||||||
#include <libavcodec/avcodec.h>
|
#include <libavcodec/avcodec.h>
|
||||||
#include <libavformat/avio.h>
|
#include <libavformat/avio.h>
|
||||||
|
@ -39,7 +39,7 @@ static int http_ffmpeg_read_from_buf(void *opaque, uint8_t *buf, int buf_size)
|
|||||||
if (!status->buf)
|
if (!status->buf)
|
||||||
return FFMPEG_DATA_PACKET_EOF;
|
return FFMPEG_DATA_PACKET_EOF;
|
||||||
|
|
||||||
buf_size = FFMIN(buf_size, status->buf->used - status->buf_offset);
|
buf_size = MIN(buf_size, status->buf->used - status->buf_offset);
|
||||||
if (!buf_size)
|
if (!buf_size)
|
||||||
return FFMPEG_DATA_PACKET_EOF;
|
return FFMPEG_DATA_PACKET_EOF;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user