Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
0a0f19b5
Commit
0a0f19b5
authored
Aug 11, 2012
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: add const to AVCodec* function parameters.
parent
15c71dfd
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
14 deletions
+17
-14
avcodec.h
libavcodec/avcodec.h
+7
-7
options.c
libavcodec/options.c
+4
-2
utils.c
libavcodec/utils.c
+6
-5
No files found.
libavcodec/avcodec.h
View file @
0a0f19b5
...
...
@@ -1298,7 +1298,7 @@ typedef struct AVCodecContext {
int
log_level_offset
;
enum
AVMediaType
codec_type
;
/* see AVMEDIA_TYPE_xxx */
struct
AVCodec
*
codec
;
const
struct
AVCodec
*
codec
;
char
codec_name
[
32
];
enum
AVCodecID
codec_id
;
/* see AV_CODEC_ID_xxx */
...
...
@@ -3150,7 +3150,7 @@ typedef struct AVSubtitle {
* if c is non-NULL, returns the next registered codec after c,
* or NULL if c is the last one.
*/
AVCodec
*
av_codec_next
(
AVCodec
*
c
);
AVCodec
*
av_codec_next
(
const
AVCodec
*
c
);
/**
* Return the LIBAVCODEC_VERSION_INT constant.
...
...
@@ -3204,7 +3204,7 @@ void avcodec_register_all(void);
* @return An AVCodecContext filled with default values or NULL on failure.
* @see avcodec_get_context_defaults
*/
AVCodecContext
*
avcodec_alloc_context3
(
AVCodec
*
codec
);
AVCodecContext
*
avcodec_alloc_context3
(
const
AVCodec
*
codec
);
/**
* Set the fields of the given AVCodecContext to default values corresponding
...
...
@@ -3215,7 +3215,7 @@ AVCodecContext *avcodec_alloc_context3(AVCodec *codec);
* 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
);
int
avcodec_get_context_defaults3
(
AVCodecContext
*
s
,
const
AVCodec
*
codec
);
/**
* Get the AVClass for AVCodecContext. It can be used in combination with
...
...
@@ -3290,7 +3290,7 @@ void avcodec_get_frame_defaults(AVFrame *pic);
* @see avcodec_alloc_context3(), avcodec_find_decoder(), avcodec_find_encoder(),
* av_dict_set(), av_opt_find().
*/
int
avcodec_open2
(
AVCodecContext
*
avctx
,
AVCodec
*
codec
,
AVDictionary
**
options
);
int
avcodec_open2
(
AVCodecContext
*
avctx
,
const
AVCodec
*
codec
,
AVDictionary
**
options
);
/**
* Close a given AVCodecContext and free all the data associated with it
...
...
@@ -4527,12 +4527,12 @@ int avcodec_is_open(AVCodecContext *s);
/**
* @return a non-zero number if codec is an encoder, zero otherwise
*/
int
av_codec_is_encoder
(
AVCodec
*
codec
);
int
av_codec_is_encoder
(
const
AVCodec
*
codec
);
/**
* @return a non-zero number if codec is a decoder, zero otherwise
*/
int
av_codec_is_decoder
(
AVCodec
*
codec
);
int
av_codec_is_decoder
(
const
AVCodec
*
codec
);
/**
* @return descriptor for given codec ID or NULL if no descriptor exists.
...
...
libavcodec/options.c
View file @
0a0f19b5
...
...
@@ -77,7 +77,8 @@ static const AVClass av_codec_context_class = {
.
child_class_next
=
codec_child_class_next
,
};
int
avcodec_get_context_defaults3
(
AVCodecContext
*
s
,
AVCodec
*
codec
){
int
avcodec_get_context_defaults3
(
AVCodecContext
*
s
,
const
AVCodec
*
codec
)
{
memset
(
s
,
0
,
sizeof
(
AVCodecContext
));
s
->
av_class
=
&
av_codec_context_class
;
...
...
@@ -122,7 +123,8 @@ int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec){
return
0
;
}
AVCodecContext
*
avcodec_alloc_context3
(
AVCodec
*
codec
){
AVCodecContext
*
avcodec_alloc_context3
(
const
AVCodec
*
codec
)
{
AVCodecContext
*
avctx
=
av_malloc
(
sizeof
(
AVCodecContext
));
if
(
avctx
==
NULL
)
return
NULL
;
...
...
libavcodec/utils.c
View file @
0a0f19b5
...
...
@@ -96,7 +96,8 @@ void av_fast_padded_malloc(void *ptr, unsigned int *size, size_t min_size)
/* encoder management */
static
AVCodec
*
first_avcodec
=
NULL
;
AVCodec
*
av_codec_next
(
AVCodec
*
c
){
AVCodec
*
av_codec_next
(
const
AVCodec
*
c
)
{
if
(
c
)
return
c
->
next
;
else
return
first_avcodec
;
}
...
...
@@ -112,12 +113,12 @@ static void avcodec_init(void)
ff_dsputil_static_init
();
}
int
av_codec_is_encoder
(
AVCodec
*
codec
)
int
av_codec_is_encoder
(
const
AVCodec
*
codec
)
{
return
codec
&&
(
codec
->
encode
||
codec
->
encode2
);
}
int
av_codec_is_decoder
(
AVCodec
*
codec
)
int
av_codec_is_decoder
(
const
AVCodec
*
codec
)
{
return
codec
&&
codec
->
decode
;
}
...
...
@@ -627,7 +628,7 @@ AVFrame *avcodec_alloc_frame(void){
return
pic
;
}
int
attribute_align_arg
avcodec_open2
(
AVCodecContext
*
avctx
,
AVCodec
*
codec
,
AVDictionary
**
options
)
int
attribute_align_arg
avcodec_open2
(
AVCodecContext
*
avctx
,
const
AVCodec
*
codec
,
AVDictionary
**
options
)
{
int
ret
=
0
;
AVDictionary
*
tmp
=
NULL
;
...
...
@@ -1508,7 +1509,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
{
const
char
*
codec_name
;
const
char
*
profile
=
NULL
;
AVCodec
*
p
;
const
AVCodec
*
p
;
char
buf1
[
32
];
int
bitrate
;
AVRational
display_aspect_ratio
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment