Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
e9b57851
Commit
e9b57851
authored
Sep 03, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec_video: cosmetics (use var_CreateGet whe applicable).
parent
df6fda46
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
31 deletions
+19
-31
modules/codec/avcodec/video.c
modules/codec/avcodec/video.c
+19
-31
No files found.
modules/codec/avcodec/video.c
View file @
e9b57851
...
...
@@ -190,7 +190,7 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
AVCodec
*
p_codec
,
int
i_codec_id
,
const
char
*
psz_namecodec
)
{
decoder_sys_t
*
p_sys
;
vlc_value_t
val
;
int
i_
val
;
/* Allocate the memory needed to store the decoder's structure */
if
(
(
p_dec
->
p_sys
=
p_sys
=
calloc
(
1
,
sizeof
(
decoder_sys_t
)
)
)
==
NULL
)
...
...
@@ -218,37 +218,28 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
config_GetInt
(
p_dec
,
"ffmpeg-error-resilience"
);
#endif
var_Create
(
p_dec
,
"grayscale"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_dec
,
"grayscale"
,
&
val
);
if
(
val
.
b_bool
)
p_sys
->
p_context
->
flags
|=
CODEC_FLAG_GRAY
;
if
(
var_CreateGetBool
(
p_dec
,
"grayscale"
)
)
p_sys
->
p_context
->
flags
|=
CODEC_FLAG_GRAY
;
var_Create
(
p_dec
,
"ffmpeg-vismv"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_dec
,
"ffmpeg-vismv"
,
&
val
);
if
(
val
.
i_int
)
p_sys
->
p_context
->
debug_mv
=
val
.
i_int
;
i_val
=
var_CreateGetInteger
(
p_dec
,
"ffmpeg-vismv"
);
if
(
i_val
)
p_sys
->
p_context
->
debug_mv
=
i_val
;
var_Create
(
p_dec
,
"ffmpeg-lowres"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_dec
,
"ffmpeg-lowres"
,
&
val
);
if
(
val
.
i_int
>
0
&&
val
.
i_int
<=
2
)
p_sys
->
p_context
->
lowres
=
val
.
i_int
;
i_val
=
var_CreateGetInteger
(
p_dec
,
"ffmpeg-lowres"
);
if
(
i_val
>
0
&&
i_val
<=
2
)
p_sys
->
p_context
->
lowres
=
i_val
;
var_Create
(
p_dec
,
"ffmpeg-skiploopfilter"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_dec
,
"ffmpeg-skiploopfilter"
,
&
val
);
if
(
val
.
i_int
>
0
)
p_sys
->
p_context
->
skip_loop_filter
=
AVDISCARD_NONREF
;
if
(
val
.
i_int
>
1
)
p_sys
->
p_context
->
skip_loop_filter
=
AVDISCARD_BIDIR
;
if
(
val
.
i_int
>
2
)
p_sys
->
p_context
->
skip_loop_filter
=
AVDISCARD_NONKEY
;
if
(
val
.
i_int
>
3
)
p_sys
->
p_context
->
skip_loop_filter
=
AVDISCARD_ALL
;
i_val
=
var_CreateGetInteger
(
p_dec
,
"ffmpeg-skiploopfilter"
);
if
(
i_val
>=
4
)
p_sys
->
p_context
->
skip_loop_filter
=
AVDISCARD_ALL
;
else
if
(
i_val
==
3
)
p_sys
->
p_context
->
skip_loop_filter
=
AVDISCARD_NONKEY
;
else
if
(
i_val
==
2
)
p_sys
->
p_context
->
skip_loop_filter
=
AVDISCARD_BIDIR
;
else
if
(
i_val
==
1
)
p_sys
->
p_context
->
skip_loop_filter
=
AVDISCARD_NONREF
;
bool
b_fast
=
var_CreateGetBool
(
p_dec
,
"ffmpeg-fast"
);
if
(
b_fast
)
p_sys
->
p_context
->
flags2
|=
CODEC_FLAG2_FAST
;
if
(
var_CreateGetBool
(
p_dec
,
"ffmpeg-fast"
)
)
p_sys
->
p_context
->
flags2
|=
CODEC_FLAG2_FAST
;
/* ***** ffmpeg frame skipping ***** */
var_Create
(
p_dec
,
"ffmpeg-hurry-up"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_dec
,
"ffmpeg-hurry-up"
,
&
val
);
p_sys
->
b_hurry_up
=
val
.
b_bool
;
p_sys
->
b_hurry_up
=
var_CreateGetBool
(
p_dec
,
"ffmpeg-hurry-up"
);
var_Create
(
p_dec
,
"ffmpeg-skip-frame"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_dec
,
"ffmpeg-skip-frame"
,
&
val
);
switch
(
val
.
i_int
)
switch
(
var_CreateGetInteger
(
p_dec
,
"ffmpeg-skip-frame"
)
)
{
case
-
1
:
p_sys
->
p_context
->
skip_frame
=
AVDISCARD_NONE
;
...
...
@@ -271,9 +262,7 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
}
p_sys
->
i_skip_frame
=
p_sys
->
p_context
->
skip_frame
;
var_Create
(
p_dec
,
"ffmpeg-skip-idct"
,
VLC_VAR_INTEGER
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_dec
,
"ffmpeg-skip-idct"
,
&
val
);
switch
(
val
.
i_int
)
switch
(
var_CreateGetInteger
(
p_dec
,
"ffmpeg-skip-idct"
)
)
{
case
-
1
:
p_sys
->
p_context
->
skip_idct
=
AVDISCARD_NONE
;
...
...
@@ -298,9 +287,8 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
/* ***** ffmpeg direct rendering ***** */
p_sys
->
b_direct_rendering
=
false
;
var_Create
(
p_dec
,
"ffmpeg-dr"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
var_Get
(
p_dec
,
"ffmpeg-dr"
,
&
val
);
if
(
val
.
b_bool
&&
(
p_sys
->
p_codec
->
capabilities
&
CODEC_CAP_DR1
)
&&
if
(
var_CreateGetBool
(
p_dec
,
"ffmpeg-dr"
)
&&
(
p_sys
->
p_codec
->
capabilities
&
CODEC_CAP_DR1
)
&&
/* Apparently direct rendering doesn't work with YUV422P */
p_sys
->
p_context
->
pix_fmt
!=
PIX_FMT_YUV422P
&&
/* H264 uses too many reference frames */
...
...
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