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
84626b36
Commit
84626b36
authored
Jun 08, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: add support for codec-specific defaults.
parent
71a861cf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
0 deletions
+23
-0
avcodec.h
libavcodec/avcodec.h
+7
-0
internal.h
libavcodec/internal.h
+5
-0
options.c
libavcodec/options.c
+11
-0
No files found.
libavcodec/avcodec.h
View file @
84626b36
...
...
@@ -2860,6 +2860,8 @@ typedef struct AVProfile {
const
char
*
name
;
///< short name for the profile
}
AVProfile
;
typedef
struct
AVCodecDefault
AVCodecDefault
;
/**
* AVCodec.
*/
...
...
@@ -2922,6 +2924,11 @@ typedef struct AVCodec {
*/
int
(
*
update_thread_context
)(
AVCodecContext
*
dst
,
const
AVCodecContext
*
src
);
/** @} */
/**
* Private codec-specific defaults.
*/
const
AVCodecDefault
*
defaults
;
}
AVCodec
;
/**
...
...
libavcodec/internal.h
View file @
84626b36
...
...
@@ -27,6 +27,11 @@
#include <stdint.h>
#include "avcodec.h"
struct
AVCodecDefault
{
const
uint8_t
*
key
;
const
uint8_t
*
value
;
};
/**
* Determine whether pix_fmt is a hardware accelerated format.
*/
...
...
libavcodec/options.c
View file @
84626b36
...
...
@@ -25,6 +25,8 @@
*/
#include "avcodec.h"
#include "internal.h"
#include "libavutil/avassert.h"
#include "libavutil/opt.h"
#include <float.h>
/* FLT_MIN, FLT_MAX */
...
...
@@ -524,6 +526,15 @@ int avcodec_get_context_defaults3(AVCodecContext *s, AVCodec *codec){
av_opt_set_defaults
(
s
->
priv_data
);
}
}
if
(
codec
&&
codec
->
defaults
)
{
int
ret
;
AVCodecDefault
*
d
=
codec
->
defaults
;
while
(
d
->
key
)
{
ret
=
av_set_string3
(
s
,
d
->
key
,
d
->
value
,
0
,
NULL
);
av_assert0
(
ret
>=
0
);
d
++
;
}
}
return
0
;
}
...
...
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