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
be7cf826
Commit
be7cf826
authored
Jun 24, 2008
by
Antoine Cellerier
Committed by
Jean-Paul Saman
Nov 12, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix video decoding for most samples.
Signed-off-by:
Jean-Paul Saman
<
jean-paul.saman@m2x.nl
>
parent
50044fd9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
11 deletions
+28
-11
modules/codec/davinci/viddec.c
modules/codec/davinci/viddec.c
+28
-11
No files found.
modules/codec/davinci/viddec.c
View file @
be7cf826
...
@@ -281,7 +281,8 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block )
...
@@ -281,7 +281,8 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block )
}
}
}
}
if
(
VIDDEC_control
(
p_sys
->
d
,
XDM_GETSTATUS
,
&
dparams
,
&
status
)
!=
VIDDEC_EOK
)
if
(
VIDDEC_control
(
p_sys
->
d
,
XDM_GETSTATUS
,
&
dparams
,
&
status
)
!=
VIDDEC_EOK
)
{
{
msg_Err
(
p_dec
,
"Failed to get decoder status"
);
msg_Err
(
p_dec
,
"Failed to get decoder status"
);
goto
error
;
goto
error
;
...
@@ -289,7 +290,8 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block )
...
@@ -289,7 +290,8 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block )
/* Setup input arguments */
/* Setup input arguments */
in_args
.
size
=
sizeof
(
in_args
);
in_args
.
size
=
sizeof
(
in_args
);
in_args
.
numBytes
=
__MIN
(
p_block
->
i_buffer
,
p_sys
->
in
.
bufSizes
[
0
]
);
in_args
.
numBytes
=
__MIN
(
p_dec
->
fmt_in
.
i_extra
+
p_block
->
i_buffer
,
p_sys
->
in
.
bufSizes
[
0
]
);
in_args
.
inputID
=
0
;
/* FIXME? */
in_args
.
inputID
=
0
;
/* FIXME? */
/* Setup input buffer */
/* Setup input buffer */
...
@@ -297,8 +299,17 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block )
...
@@ -297,8 +299,17 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block )
if
(
p_block
->
i_buffer
>
p_sys
->
in
.
bufSizes
[
0
]
)
if
(
p_block
->
i_buffer
>
p_sys
->
in
.
bufSizes
[
0
]
)
msg_Dbg
(
p_dec
,
"Woah! Not enough room to store the whole block"
);
msg_Dbg
(
p_dec
,
"Woah! Not enough room to store the whole block"
);
#endif
#endif
memcpy
(
p_sys
->
in
.
bufs
[
0
],
p_block
->
p_buffer
,
in_args
.
numBytes
);
if
(
p_dec
->
fmt_in
.
i_extra
>
0
)
msg_Warn
(
p_dec
,
"Sending %d bytes"
,
(
int
)
in_args
.
numBytes
);
{
memcpy
(
p_sys
->
in
.
bufs
[
0
],
p_dec
->
fmt_in
.
p_extra
,
p_dec
->
fmt_in
.
i_extra
);
}
memcpy
(
p_sys
->
in
.
bufs
[
0
]
+
p_dec
->
fmt_in
.
i_extra
,
p_block
->
p_buffer
,
in_args
.
numBytes
-
p_dec
->
fmt_in
.
i_extra
);
#ifdef DEBUG_DAVINCI
msg_Dbg
(
p_dec
,
"Sending %d + %d bytes"
,
p_dec
->
fmt_in
.
i_extra
,
(
int
)
in_args
.
numBytes
-
p_dec
->
fmt_in
.
i_extra
);
#endif
#if 0
#if 0
/* This obviously doesn't work (at least for mpeg2 video */
/* This obviously doesn't work (at least for mpeg2 video */
...
@@ -352,17 +363,24 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block )
...
@@ -352,17 +363,24 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block )
}
}
#endif
#endif
#ifdef DEBUG_DAVINCI
msg_Info
(
p_dec
,
"Frame info: "
);
msg_Info
(
p_dec
,
"Frame info: "
);
msg_Info
(
p_dec
,
" Width: %d"
,
(
int
)
status
.
outputWidth
);
msg_Info
(
p_dec
,
" Width: %d"
,
(
int
)
status
.
outputWidth
);
msg_Info
(
p_dec
,
" Height: %d"
,
(
int
)
status
.
outputHeight
);
msg_Info
(
p_dec
,
" Height: %d"
,
(
int
)
status
.
outputHeight
);
msg_Info
(
p_dec
,
" Content type: %s"
,
status
.
contentType
==
IVIDEO_PROGRESSIVE
?
"progressive"
:
status
.
contentType
==
IVIDEO_INTERLACED
?
"interlaced"
:
"not available"
);
msg_Info
(
p_dec
,
" Content type: %s"
,
status
.
contentType
==
IVIDEO_PROGRESSIVE
?
"progressive"
:
status
.
contentType
==
IVIDEO_INTERLACED
?
"interlaced"
:
"not available"
);
#endif
/* Setup output arguemnts */
/* Setup output arguemnts */
out_args
.
size
=
sizeof
(
out_args
);
out_args
.
size
=
sizeof
(
out_args
);
/* That was easy :p */
/* That was easy :p */
/* Decode the video */
/* Decode the video */
#ifdef DEBUG_DAVINCI
printf
(
"%s %s %d
\n
"
,
__FILE__
,
__func__
,
__LINE__
);
printf
(
"%s %s %d
\n
"
,
__FILE__
,
__func__
,
__LINE__
);
#endif
if
(
(
i
=
VIDDEC_process
(
p_sys
->
d
,
&
p_sys
->
in
,
&
p_sys
->
out
,
&
in_args
,
&
out_args
)
)
if
(
(
i
=
VIDDEC_process
(
p_sys
->
d
,
&
p_sys
->
in
,
&
p_sys
->
out
,
&
in_args
,
&
out_args
)
)
!=
VIDDEC_EOK
)
!=
VIDDEC_EOK
)
{
{
...
@@ -371,10 +389,8 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block )
...
@@ -371,10 +389,8 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block )
PrintExtendedError
(
p_dec
,
out_args
.
extendedError
);
PrintExtendedError
(
p_dec
,
out_args
.
extendedError
);
goto
error
;
goto
error
;
}
}
printf
(
"%s %s %d
\n
"
,
__FILE__
,
__func__
,
__LINE__
);
#ifdef DEBUG_DAVINCI
#ifdef DEBUG_DAVINCI
msg_Info
(
p_dec
,
"%s %d"
,
__func__
,
__LINE__
);
printf
(
"%s %s %d
\n
"
,
__FILE__
,
__func__
,
__LINE__
);
#endif
#endif
if
(
VIDDEC_control
(
p_sys
->
d
,
XDM_GETSTATUS
,
&
dparams
,
&
status
)
!=
VIDDEC_EOK
)
if
(
VIDDEC_control
(
p_sys
->
d
,
XDM_GETSTATUS
,
&
dparams
,
&
status
)
!=
VIDDEC_EOK
)
...
@@ -391,12 +407,13 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block )
...
@@ -391,12 +407,13 @@ static picture_t *DecodeVideoBlock( decoder_t *p_dec, block_t **pp_block )
msg_Info
(
p_dec
,
" Bytes consumed: %d"
,
(
int
)
out_args
.
bytesConsumed
);
msg_Info
(
p_dec
,
" Bytes consumed: %d"
,
(
int
)
out_args
.
bytesConsumed
);
#endif
#endif
p_block
->
p_buffer
+=
out_args
.
bytesConsumed
;
p_block
->
p_buffer
+=
out_args
.
bytesConsumed
-
p_dec
->
fmt_in
.
i_extra
;
p_block
->
i_buffer
-=
out_args
.
bytesConsumed
;
p_block
->
i_buffer
-=
out_args
.
bytesConsumed
-
p_dec
->
fmt_in
.
i_extra
;
p_dec
->
fmt_out
.
video
.
i_width
=
status
.
outputWidth
;
p_dec
->
fmt_out
.
video
.
i_width
=
status
.
outputWidth
;
p_dec
->
fmt_out
.
video
.
i_height
=
status
.
outputHeight
;
p_dec
->
fmt_out
.
video
.
i_height
=
status
.
outputHeight
;
p_dec
->
fmt_out
.
video
.
i_aspect
=
VOUT_ASPECT_FACTOR
*
status
.
outputWidth
/
status
.
outputHeight
;
/* FIXME */
p_dec
->
fmt_out
.
video
.
i_aspect
=
VOUT_ASPECT_FACTOR
*
status
.
outputWidth
/
status
.
outputHeight
;
/* FIXME */
/* Get a new picture */
/* Get a new picture */
p_pic
=
p_dec
->
pf_vout_buffer_new
(
p_dec
);
p_pic
=
p_dec
->
pf_vout_buffer_new
(
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