Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
bac9fb6c
Commit
bac9fb6c
authored
Apr 21, 2015
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: refactor and call decoder_UpdateVideoFormat()
parent
90848d64
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
modules/codec/avcodec/video.c
modules/codec/avcodec/video.c
+17
-7
No files found.
modules/codec/avcodec/video.c
View file @
bac9fb6c
...
@@ -117,15 +117,17 @@ static uint32_t ffmpeg_CodecTag( vlc_fourcc_t fcc )
...
@@ -117,15 +117,17 @@ static uint32_t ffmpeg_CodecTag( vlc_fourcc_t fcc )
* Local Functions
* Local Functions
*****************************************************************************/
*****************************************************************************/
/* Returns a new picture buffer */
/**
static
inline
picture_t
*
ffmpeg_NewPictBuf
(
decoder_t
*
p_dec
,
* Sets the decoder output format.
AVCodecContext
*
p_context
)
*/
static
int
lavc_UpdateVideoFormat
(
decoder_t
*
p_dec
,
AVCodecContext
*
p_context
)
{
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
bool
hwaccel
=
p_dec
->
p_sys
->
p_va
!=
NULL
;
int
width
=
p_context
->
coded_width
;
int
width
=
p_context
->
coded_width
;
int
height
=
p_context
->
coded_height
;
int
height
=
p_context
->
coded_height
;
if
(
p_sys
->
p_va
==
NULL
)
if
(
!
hwaccel
)
{
{
int
aligns
[
AV_NUM_DATA_POINTERS
];
int
aligns
[
AV_NUM_DATA_POINTERS
];
...
@@ -136,7 +138,7 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,
...
@@ -136,7 +138,7 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,
if
(
width
==
0
||
height
==
0
||
width
>
8192
||
height
>
8192
)
if
(
width
==
0
||
height
==
0
||
width
>
8192
||
height
>
8192
)
{
{
msg_Err
(
p_dec
,
"Invalid frame size %dx%d."
,
width
,
height
);
msg_Err
(
p_dec
,
"Invalid frame size %dx%d."
,
width
,
height
);
return
NULL
;
/* invalid display size */
return
-
1
;
/* invalid display size */
}
}
p_dec
->
fmt_out
.
video
.
i_width
=
width
;
p_dec
->
fmt_out
.
video
.
i_width
=
width
;
p_dec
->
fmt_out
.
video
.
i_height
=
height
;
p_dec
->
fmt_out
.
video
.
i_height
=
height
;
...
@@ -152,7 +154,7 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,
...
@@ -152,7 +154,7 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,
p_dec
->
fmt_out
.
video
.
i_visible_height
=
height
;
p_dec
->
fmt_out
.
video
.
i_visible_height
=
height
;
}
}
if
(
!
p_sys
->
p_va
&&
GetVlcChroma
(
&
p_dec
->
fmt_out
.
video
,
p_context
->
pix_fmt
)
)
if
(
!
hwaccel
&&
GetVlcChroma
(
&
p_dec
->
fmt_out
.
video
,
p_context
->
pix_fmt
)
)
{
{
/* we are doomed, but not really, because most codecs set their pix_fmt
/* we are doomed, but not really, because most codecs set their pix_fmt
* much later
* much later
...
@@ -192,7 +194,15 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,
...
@@ -192,7 +194,15 @@ static inline picture_t *ffmpeg_NewPictBuf( decoder_t *p_dec,
p_dec
->
fmt_out
.
video
.
i_frame_rate
=
p_context
->
time_base
.
den
;
p_dec
->
fmt_out
.
video
.
i_frame_rate
=
p_context
->
time_base
.
den
;
p_dec
->
fmt_out
.
video
.
i_frame_rate_base
=
p_context
->
time_base
.
num
*
__MAX
(
p_context
->
ticks_per_frame
,
1
);
p_dec
->
fmt_out
.
video
.
i_frame_rate_base
=
p_context
->
time_base
.
num
*
__MAX
(
p_context
->
ticks_per_frame
,
1
);
}
}
return
decoder_UpdateVideoFormat
(
p_dec
);
}
/* Returns a new picture buffer */
static
inline
picture_t
*
ffmpeg_NewPictBuf
(
decoder_t
*
p_dec
,
AVCodecContext
*
p_context
)
{
lavc_UpdateVideoFormat
(
p_dec
,
p_context
);
/* FIXME: check for error ^^ and return NULL */
return
decoder_NewPicture
(
p_dec
);
return
decoder_NewPicture
(
p_dec
);
}
}
...
...
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