Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Ffmpeg
提交
f0eeff70
F
Ffmpeg
项目概览
小白菜888
/
Ffmpeg
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
Ffmpeg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f0eeff70
编写于
10月 08, 2011
作者:
A
Anton Khirnov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
lavc: make avcodec_get_context_defaults3 "officially" public
Deprecate avcodec_get_context_defaults/avcodec_get_context_defaults2
上级
84ad31ff
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
36 addition
and
24 deletion
+36
-24
avserver.c
avserver.c
+2
-2
libavcodec/avcodec.h
libavcodec/avcodec.h
+14
-2
libavcodec/options.c
libavcodec/options.c
+20
-20
未找到文件。
avserver.c
浏览文件 @
f0eeff70
...
...
@@ -4234,8 +4234,8 @@ static int parse_ffconfig(const char *filename)
}
stream
->
fmt
=
avserver_guess_format
(
NULL
,
stream
->
filename
,
NULL
);
avcodec_get_context_defaults
2
(
&
video_enc
,
AVMEDIA_TYPE_VIDEO
);
avcodec_get_context_defaults
2
(
&
audio_enc
,
AVMEDIA_TYPE_AUDIO
);
avcodec_get_context_defaults
3
(
&
video_enc
,
NULL
);
avcodec_get_context_defaults
3
(
&
audio_enc
,
NULL
);
audio_id
=
CODEC_ID_NONE
;
video_id
=
CODEC_ID_NONE
;
if
(
stream
->
fmt
)
{
...
...
libavcodec/avcodec.h
浏览文件 @
f0eeff70
...
...
@@ -3592,19 +3592,31 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode);
*/
const
char
*
av_get_profile_name
(
const
AVCodec
*
codec
,
int
profile
);
#if FF_API_ALLOC_CONTEXT
/**
* Set the fields of the given AVCodecContext to default values.
*
* @param s The AVCodecContext of which the fields should be set to default values.
* @deprecated use avcodec_get_context_defaults3
*/
attribute_deprecated
void
avcodec_get_context_defaults
(
AVCodecContext
*
s
);
/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
* we WILL change its arguments and name a few times! */
attribute_deprecated
void
avcodec_get_context_defaults2
(
AVCodecContext
*
s
,
enum
AVMediaType
);
#endif
/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API!
* we WILL change its arguments and name a few times! */
/**
* Set the fields of the given AVCodecContext to default values corresponding
* to the given codec (defaults may be codec-dependent).
*
* Do not call this function if a non-NULL codec has been passed
* to avcodec_alloc_context3() that allocated this AVCodecContext.
* If codec is non-NULL, it is illegal to call avcodec_open2() with a
* different codec on this AVCodecContext.
*/
int
avcodec_get_context_defaults3
(
AVCodecContext
*
s
,
AVCodec
*
codec
);
#if FF_API_ALLOC_CONTEXT
...
...
libavcodec/options.c
浏览文件 @
f0eeff70
...
...
@@ -531,30 +531,32 @@ static const AVClass av_codec_context_class = {
.
child_class_next
=
codec_child_class_next
,
};
#if FF_API_ALLOC_CONTEXT
void
avcodec_get_context_defaults2
(
AVCodecContext
*
s
,
enum
AVMediaType
codec_type
){
avcodec_get_context_defaults3
(
s
,
NULL
);
}
#endif
int
avcodec_get_context_defaults3
(
AVCodecContext
*
s
,
AVCodec
*
codec
){
memset
(
s
,
0
,
sizeof
(
AVCodecContext
));
s
->
av_class
=
&
av_codec_context_class
;
s
->
av_class
=
&
av_codec_context_class
;
s
->
codec_type
=
codec
_type
;
s
->
codec_type
=
codec
?
codec
->
type
:
AVMEDIA_TYPE_UNKNOWN
;
av_opt_set_defaults
(
s
);
s
->
time_base
=
(
AVRational
){
0
,
1
};
s
->
get_buffer
=
avcodec_default_get_buffer
;
s
->
release_buffer
=
avcodec_default_release_buffer
;
s
->
get_format
=
avcodec_default_get_format
;
s
->
execute
=
avcodec_default_execute
;
s
->
execute2
=
avcodec_default_execute2
;
s
->
sample_aspect_ratio
=
(
AVRational
){
0
,
1
};
s
->
pix_fmt
=
PIX_FMT_NONE
;
s
->
sample_fmt
=
AV_SAMPLE_FMT_NONE
;
s
->
reget_buffer
=
avcodec_default_reget_buffer
;
s
->
reordered_opaque
=
AV_NOPTS_VALUE
;
}
int
avcodec_get_context_defaults3
(
AVCodecContext
*
s
,
AVCodec
*
codec
){
avcodec_get_context_defaults2
(
s
,
codec
?
codec
->
type
:
AVMEDIA_TYPE_UNKNOWN
);
s
->
time_base
=
(
AVRational
){
0
,
1
};
s
->
get_buffer
=
avcodec_default_get_buffer
;
s
->
release_buffer
=
avcodec_default_release_buffer
;
s
->
get_format
=
avcodec_default_get_format
;
s
->
execute
=
avcodec_default_execute
;
s
->
execute2
=
avcodec_default_execute2
;
s
->
sample_aspect_ratio
=
(
AVRational
){
0
,
1
};
s
->
pix_fmt
=
PIX_FMT_NONE
;
s
->
sample_fmt
=
AV_SAMPLE_FMT_NONE
;
s
->
reget_buffer
=
avcodec_default_reget_buffer
;
s
->
reordered_opaque
=
AV_NOPTS_VALUE
;
if
(
codec
&&
codec
->
priv_data_size
){
if
(
!
s
->
priv_data
){
s
->
priv_data
=
av_mallocz
(
codec
->
priv_data_size
);
...
...
@@ -602,13 +604,11 @@ AVCodecContext *avcodec_alloc_context2(enum AVMediaType codec_type){
return
avctx
;
}
#endif
void
avcodec_get_context_defaults
(
AVCodecContext
*
s
){
avcodec_get_context_defaults2
(
s
,
AVMEDIA_TYPE_UNKNOWN
);
}
#if FF_API_ALLOC_CONTEXT
AVCodecContext
*
avcodec_alloc_context
(
void
){
return
avcodec_alloc_context2
(
AVMEDIA_TYPE_UNKNOWN
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录