提交 1642ee43 编写于 作者: S Stefano Sabatini

Deprecate and mark for deletion the function guess_stream_format(),

and clone its code to ffserver_guess_format() in ffserver.c.

guess_stream_format() is hackish since it relies on some undocumented
properties of the name of the muxers (wich is currently only relevant
for the ASF muxer), and has no use outside ffserver.c.

Originally committed as revision 20987 to svn://svn.ffmpeg.org/ffmpeg/trunk
上级 f9310cbb
...@@ -3731,6 +3731,25 @@ static int ffserver_opt_default(const char *opt, const char *arg, ...@@ -3731,6 +3731,25 @@ static int ffserver_opt_default(const char *opt, const char *arg,
return ret; return ret;
} }
static AVOutputFormat *ffserver_guess_format(const char *short_name, const char *filename,
const char *mime_type)
{
AVOutputFormat *fmt = guess_format(short_name, filename, mime_type);
if (fmt) {
AVOutputFormat *stream_fmt;
char stream_format_name[64];
snprintf(stream_format_name, sizeof(stream_format_name), "%s_stream", fmt->name);
stream_fmt = guess_format(stream_format_name, NULL, NULL);
if (stream_fmt)
fmt = stream_fmt;
}
return fmt;
}
static int parse_ffconfig(const char *filename) static int parse_ffconfig(const char *filename)
{ {
FILE *f; FILE *f;
...@@ -3972,7 +3991,7 @@ static int parse_ffconfig(const char *filename) ...@@ -3972,7 +3991,7 @@ static int parse_ffconfig(const char *filename)
} }
} }
stream->fmt = guess_stream_format(NULL, stream->filename, NULL); stream->fmt = ffserver_guess_format(NULL, stream->filename, NULL);
/* fetch avclass so AVOption works /* fetch avclass so AVOption works
* FIXME try to use avcodec_get_context_defaults2 * FIXME try to use avcodec_get_context_defaults2
* without changing defaults too much */ * without changing defaults too much */
...@@ -4020,7 +4039,7 @@ static int parse_ffconfig(const char *filename) ...@@ -4020,7 +4039,7 @@ static int parse_ffconfig(const char *filename)
/* jpeg cannot be used here, so use single frame jpeg */ /* jpeg cannot be used here, so use single frame jpeg */
if (!strcmp(arg, "jpeg")) if (!strcmp(arg, "jpeg"))
strcpy(arg, "mjpeg"); strcpy(arg, "mjpeg");
stream->fmt = guess_stream_format(arg, NULL, NULL); stream->fmt = ffserver_guess_format(arg, NULL, NULL);
if (!stream->fmt) { if (!stream->fmt) {
fprintf(stderr, "%s:%d: Unknown Format: %s\n", fprintf(stderr, "%s:%d: Unknown Format: %s\n",
filename, line_num, arg); filename, line_num, arg);
......
...@@ -712,9 +712,11 @@ enum CodecID av_guess_image2_codec(const char *filename); ...@@ -712,9 +712,11 @@ enum CodecID av_guess_image2_codec(const char *filename);
/* utils.c */ /* utils.c */
void av_register_input_format(AVInputFormat *format); void av_register_input_format(AVInputFormat *format);
void av_register_output_format(AVOutputFormat *format); void av_register_output_format(AVOutputFormat *format);
AVOutputFormat *guess_stream_format(const char *short_name, #if LIBAVFORMAT_VERSION_MAJOR < 53
attribute_deprecated AVOutputFormat *guess_stream_format(const char *short_name,
const char *filename, const char *filename,
const char *mime_type); const char *mime_type);
#endif
AVOutputFormat *guess_format(const char *short_name, AVOutputFormat *guess_format(const char *short_name,
const char *filename, const char *filename,
const char *mime_type); const char *mime_type);
......
...@@ -219,6 +219,7 @@ AVOutputFormat *guess_format(const char *short_name, const char *filename, ...@@ -219,6 +219,7 @@ AVOutputFormat *guess_format(const char *short_name, const char *filename,
return fmt_found; return fmt_found;
} }
#if LIBAVFORMAT_VERSION_MAJOR < 53
AVOutputFormat *guess_stream_format(const char *short_name, const char *filename, AVOutputFormat *guess_stream_format(const char *short_name, const char *filename,
const char *mime_type) const char *mime_type)
{ {
...@@ -237,6 +238,7 @@ AVOutputFormat *guess_stream_format(const char *short_name, const char *filename ...@@ -237,6 +238,7 @@ AVOutputFormat *guess_stream_format(const char *short_name, const char *filename
return fmt; return fmt;
} }
#endif
enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name, enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name,
const char *filename, const char *mime_type, enum CodecType type){ const char *filename, const char *mime_type, enum CodecType type){
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册