X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=ffserver.c;h=f8649027b9a2541f4a0434f25c9964e11000f254;hb=454e37ce0c5c17b5c5029360408d60ce146fd1de;hp=a0efa54d15a93227164231598b6b4936014b908a;hpb=6ca48ad044e690c43985aa380cb474f1a3df7b4e;p=ffmpeg diff --git a/ffserver.c b/ffserver.c index a0efa54d15a..f8649027b9a 100644 --- a/ffserver.c +++ b/ffserver.c @@ -55,7 +55,6 @@ #include #endif #include -#include #include #include #include @@ -3553,7 +3552,7 @@ static void extract_mpeg4_header(AVFormatContext *infile) mpeg4_count = 0; for(i=0;inb_streams;i++) { st = infile->streams[i]; - if (st->codec->codec_id == CODEC_ID_MPEG4 && + if (st->codec->codec_id == AV_CODEC_ID_MPEG4 && st->codec->extradata_size == 0) { mpeg4_count++; } @@ -3566,7 +3565,7 @@ static void extract_mpeg4_header(AVFormatContext *infile) if (av_read_packet(infile, &pkt) < 0) break; st = infile->streams[pkt.stream_index]; - if (st->codec->codec_id == CODEC_ID_MPEG4 && + if (st->codec->codec_id == AV_CODEC_ID_MPEG4 && st->codec->extradata_size == 0) { av_freep(&st->codec->extradata); /* fill extradata with the header */ @@ -3882,22 +3881,22 @@ static void add_codec(FFStream *stream, AVCodecContext *av) memcpy(st->codec, av, sizeof(AVCodecContext)); } -static enum CodecID opt_audio_codec(const char *arg) +static enum AVCodecID opt_audio_codec(const char *arg) { AVCodec *p= avcodec_find_encoder_by_name(arg); if (p == NULL || p->type != AVMEDIA_TYPE_AUDIO) - return CODEC_ID_NONE; + return AV_CODEC_ID_NONE; return p->id; } -static enum CodecID opt_video_codec(const char *arg) +static enum AVCodecID opt_video_codec(const char *arg) { AVCodec *p= avcodec_find_encoder_by_name(arg); if (p == NULL || p->type != AVMEDIA_TYPE_VIDEO) - return CODEC_ID_NONE; + return AV_CODEC_ID_NONE; return p->id; } @@ -3940,7 +3939,7 @@ static int ffserver_opt_default(const char *opt, const char *arg, static int ffserver_opt_preset(const char *arg, AVCodecContext *avctx, int type, - enum CodecID *audio_id, enum CodecID *video_id) + enum AVCodecID *audio_id, enum AVCodecID *video_id) { FILE *f=NULL; char filename[1000], tmp[1000], tmp2[1000], line[1000]; @@ -4022,7 +4021,7 @@ static int parse_ffconfig(const char *filename) FFStream **last_stream, *stream, *redirect; FFStream **last_feed, *feed, *s; AVCodecContext audio_enc, video_enc; - enum CodecID audio_id, video_id; + enum AVCodecID audio_id, video_id; f = fopen(filename, "r"); if (!f) { @@ -4039,8 +4038,8 @@ static int parse_ffconfig(const char *filename) stream = NULL; feed = NULL; redirect = NULL; - audio_id = CODEC_ID_NONE; - video_id = CODEC_ID_NONE; + audio_id = AV_CODEC_ID_NONE; + video_id = AV_CODEC_ID_NONE; #define ERROR(...) report_config_error(filename, line_num, &errors, __VA_ARGS__) for(;;) { @@ -4233,8 +4232,8 @@ static int parse_ffconfig(const char *filename) avcodec_get_context_defaults3(&video_enc, NULL); avcodec_get_context_defaults3(&audio_enc, NULL); - audio_id = CODEC_ID_NONE; - video_id = CODEC_ID_NONE; + audio_id = AV_CODEC_ID_NONE; + video_id = AV_CODEC_ID_NONE; if (stream->fmt) { audio_id = stream->fmt->audio_codec; video_id = stream->fmt->video_codec; @@ -4316,13 +4315,13 @@ static int parse_ffconfig(const char *filename) } else if (!av_strcasecmp(cmd, "AudioCodec")) { get_arg(arg, sizeof(arg), &p); audio_id = opt_audio_codec(arg); - if (audio_id == CODEC_ID_NONE) { + if (audio_id == AV_CODEC_ID_NONE) { ERROR("Unknown AudioCodec: %s\n", arg); } } else if (!av_strcasecmp(cmd, "VideoCodec")) { get_arg(arg, sizeof(arg), &p); video_id = opt_video_codec(arg); - if (video_id == CODEC_ID_NONE) { + if (video_id == AV_CODEC_ID_NONE) { ERROR("Unknown VideoCodec: %s\n", arg); } } else if (!av_strcasecmp(cmd, "MaxTime")) { @@ -4513,9 +4512,9 @@ static int parse_ffconfig(const char *filename) if (stream) video_enc.dark_masking = atof(arg); } else if (!av_strcasecmp(cmd, "NoVideo")) { - video_id = CODEC_ID_NONE; + video_id = AV_CODEC_ID_NONE; } else if (!av_strcasecmp(cmd, "NoAudio")) { - audio_id = CODEC_ID_NONE; + audio_id = AV_CODEC_ID_NONE; } else if (!av_strcasecmp(cmd, "ACL")) { parse_acl_row(stream, feed, NULL, p, filename, line_num); } else if (!av_strcasecmp(cmd, "DynamicACL")) { @@ -4553,12 +4552,12 @@ static int parse_ffconfig(const char *filename) ERROR("No corresponding for \n"); } else { if (stream->feed && stream->fmt && strcmp(stream->fmt->name, "ffm") != 0) { - if (audio_id != CODEC_ID_NONE) { + if (audio_id != AV_CODEC_ID_NONE) { audio_enc.codec_type = AVMEDIA_TYPE_AUDIO; audio_enc.codec_id = audio_id; add_codec(stream, &audio_enc); } - if (video_id != CODEC_ID_NONE) { + if (video_id != AV_CODEC_ID_NONE) { video_enc.codec_type = AVMEDIA_TYPE_VIDEO; video_enc.codec_id = video_id; add_codec(stream, &video_enc); @@ -4646,13 +4645,12 @@ static void opt_debug(void) logfilename[0] = '-'; } -static int opt_help(const char *opt, const char *arg) +void show_help_default(const char *opt, const char *arg) { printf("usage: ffserver [options]\n" "Hyper fast multi format Audio/Video streaming server\n"); printf("\n"); - show_help_options(options, "Main options:\n", 0, 0); - return 0; + show_help_options(options, "Main options:", 0, 0, 0); } static const OptionDef options[] = {