Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
48f9e457
Commit
48f9e457
authored
Aug 11, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf: add avformat_query_codec().
It allows to check if a given codec can be written into a container.
parent
bca06e77
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
0 deletions
+35
-0
APIchanges
doc/APIchanges
+3
-0
avformat.h
libavformat/avformat.h
+18
-0
utils.c
libavformat/utils.c
+14
-0
No files found.
doc/APIchanges
View file @
48f9e457
...
...
@@ -13,6 +13,9 @@ libavutil: 2011-04-18
API changes, most recent first:
2011-08-xx - xxxxxxx - lavf 53.4.0
Add avformat_query_codec().
2011-08-xx - xxxxxxx - lavc 53.8.0
Add avcodec_get_type().
...
...
libavformat/avformat.h
View file @
48f9e457
...
...
@@ -322,6 +322,14 @@ typedef struct AVOutputFormat {
const
AVClass
*
priv_class
;
///< AVClass for the private context
/**
* Test if the given codec can be stored in this container.
*
* @return 1 if the codec is supported, 0 if it is not.
* A negative number if unknown.
*/
int
(
*
query_codec
)(
enum
CodecID
id
,
int
std_compliance
);
/* private fields */
struct
AVOutputFormat
*
next
;
}
AVOutputFormat
;
...
...
@@ -1595,4 +1603,14 @@ attribute_deprecated int avf_sdp_create(AVFormatContext *ac[], int n_files, char
*/
int
av_match_ext
(
const
char
*
filename
,
const
char
*
extensions
);
/**
* Test if the given container can store a codec.
*
* @param std_compliance standards compliance level, one of FF_COMPLIANCE_*
*
* @return 1 if codec with ID codec_id can be stored in ofmt, 0 if it cannot.
* A negative number if this information is not available.
*/
int
avformat_query_codec
(
AVOutputFormat
*
ofmt
,
enum
CodecID
codec_id
,
int
std_compliance
);
#endif
/* AVFORMAT_AVFORMAT_H */
libavformat/utils.c
View file @
48f9e457
...
...
@@ -3904,3 +3904,17 @@ int64_t ff_iso8601_to_unix_time(const char *datestr)
return
0
;
#endif
}
int
avformat_query_codec
(
AVOutputFormat
*
ofmt
,
enum
CodecID
codec_id
,
int
std_compliance
)
{
if
(
ofmt
)
{
if
(
ofmt
->
query_codec
)
return
ofmt
->
query_codec
(
codec_id
,
std_compliance
);
else
if
(
ofmt
->
codec_tag
)
return
!!
av_codec_get_tag
(
ofmt
->
codec_tag
,
codec_id
);
else
if
(
codec_id
==
ofmt
->
video_codec
||
codec_id
==
ofmt
->
audio_codec
||
codec_id
==
ofmt
->
subtitle_codec
)
return
1
;
}
return
AVERROR_PATCHWELCOME
;
}
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