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
4884ef31
Commit
4884ef31
authored
Jul 10, 2014
by
Thomas Guillem
Committed by
Jean-Baptiste Kempf
Jul 11, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
omxil: move output handling into DecodeVideoOutput
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
76bff8bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
76 additions
and
57 deletions
+76
-57
modules/codec/omxil/omxil.c
modules/codec/omxil/omxil.c
+76
-57
No files found.
modules/codec/omxil/omxil.c
View file @
4884ef31
...
...
@@ -1195,13 +1195,86 @@ static OMX_ERRORTYPE PortReconfigure(decoder_t *p_dec, OmxPort *p_port)
return
omx_error
;
}
/*****************************************************************************
* DecodeVideoOutput
*****************************************************************************/
static
int
DecodeVideoOutput
(
decoder_t
*
p_dec
,
OmxPort
*
p_port
,
picture_t
**
pp_pic
)
{
VLC_UNUSED
(
p_dec
);
OMX_BUFFERHEADERTYPE
*
p_header
;
picture_t
*
p_pic
=
NULL
,
*
p_next_pic
;
OMX_ERRORTYPE
omx_error
;
while
(
!
p_pic
)
{
OMX_FIFO_PEEK
(
&
p_port
->
fifo
,
p_header
);
if
(
!
p_header
)
break
;
/* No frame available */
if
(
p_port
->
b_update_def
)
{
omx_error
=
GetPortDefinition
(
p_dec
,
p_port
,
p_port
->
p_fmt
);
p_port
->
b_update_def
=
0
;
CHECK_ERROR
(
omx_error
,
"GetPortDefinition failed"
);
}
if
(
p_header
->
nFilledLen
)
{
p_pic
=
p_header
->
pAppPrivate
;
if
(
!
p_pic
)
{
/* We're not in direct rendering mode.
* Get a new picture and copy the content */
p_pic
=
decoder_NewPicture
(
p_dec
);
if
(
p_pic
)
CopyOmxPicture
(
p_port
->
definition
.
format
.
video
.
eColorFormat
,
p_pic
,
p_port
->
definition
.
format
.
video
.
nSliceHeight
,
p_port
->
i_frame_stride
,
p_header
->
pBuffer
+
p_header
->
nOffset
,
p_port
->
i_frame_stride_chroma_div
,
NULL
);
}
if
(
p_pic
)
p_pic
->
date
=
FromOmxTicks
(
p_header
->
nTimeStamp
);
p_header
->
nFilledLen
=
0
;
p_header
->
pAppPrivate
=
0
;
}
/* Get a new picture */
if
(
p_port
->
b_direct
&&
!
p_header
->
pAppPrivate
)
{
p_next_pic
=
decoder_NewPicture
(
p_dec
);
if
(
!
p_next_pic
)
break
;
OMX_FIFO_GET
(
&
p_port
->
fifo
,
p_header
);
p_header
->
pAppPrivate
=
p_next_pic
;
p_header
->
pInputPortPrivate
=
p_header
->
pBuffer
;
p_header
->
pBuffer
=
p_next_pic
->
p
[
0
].
p_pixels
;
}
else
{
OMX_FIFO_GET
(
&
p_port
->
fifo
,
p_header
);
}
#ifdef OMXIL_EXTRA_DEBUG
msg_Dbg
(
p_dec
,
"FillThisBuffer %p, %p"
,
p_header
,
p_header
->
pBuffer
);
#endif
OMX_FillThisBuffer
(
p_port
->
omx_handle
,
p_header
);
}
*
pp_pic
=
p_pic
;
return
0
;
error:
return
-
1
;
}
/*****************************************************************************
* DecodeVideo: Called to decode one frame
*****************************************************************************/
static
picture_t
*
DecodeVideo
(
decoder_t
*
p_dec
,
block_t
**
pp_block
)
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
picture_t
*
p_pic
=
NULL
,
*
p_next_pic
;
picture_t
*
p_pic
=
NULL
;
OMX_ERRORTYPE
omx_error
;
unsigned
int
i
;
...
...
@@ -1250,62 +1323,8 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
}
/* Take care of decoded frames first */
while
(
!
p_pic
)
{
OMX_FIFO_PEEK
(
&
p_sys
->
out
.
fifo
,
p_header
);
if
(
!
p_header
)
break
;
/* No frame available */
if
(
p_sys
->
out
.
b_update_def
)
{
omx_error
=
GetPortDefinition
(
p_dec
,
&
p_sys
->
out
,
p_sys
->
out
.
p_fmt
);
p_sys
->
out
.
b_update_def
=
0
;
CHECK_ERROR
(
omx_error
,
"GetPortDefinition failed"
);
}
if
(
p_header
->
nFilledLen
)
{
p_pic
=
p_header
->
pAppPrivate
;
if
(
!
p_pic
)
{
/* We're not in direct rendering mode.
* Get a new picture and copy the content */
p_pic
=
decoder_NewPicture
(
p_dec
);
if
(
p_pic
)
CopyOmxPicture
(
p_sys
->
out
.
definition
.
format
.
video
.
eColorFormat
,
p_pic
,
p_sys
->
out
.
definition
.
format
.
video
.
nSliceHeight
,
p_sys
->
out
.
i_frame_stride
,
p_header
->
pBuffer
+
p_header
->
nOffset
,
p_sys
->
out
.
i_frame_stride_chroma_div
,
NULL
);
}
if
(
p_pic
)
p_pic
->
date
=
FromOmxTicks
(
p_header
->
nTimeStamp
);
p_header
->
nFilledLen
=
0
;
p_header
->
pAppPrivate
=
0
;
}
/* Get a new picture */
if
(
p_sys
->
out
.
b_direct
&&
!
p_header
->
pAppPrivate
)
{
p_next_pic
=
decoder_NewPicture
(
p_dec
);
if
(
!
p_next_pic
)
break
;
OMX_FIFO_GET
(
&
p_sys
->
out
.
fifo
,
p_header
);
p_header
->
pAppPrivate
=
p_next_pic
;
p_header
->
pInputPortPrivate
=
p_header
->
pBuffer
;
p_header
->
pBuffer
=
p_next_pic
->
p
[
0
].
p_pixels
;
}
else
{
OMX_FIFO_GET
(
&
p_sys
->
out
.
fifo
,
p_header
);
}
#ifdef OMXIL_EXTRA_DEBUG
msg_Dbg
(
p_dec
,
"FillThisBuffer %p, %p"
,
p_header
,
p_header
->
pBuffer
);
#endif
OMX_FillThisBuffer
(
p_sys
->
omx_handle
,
p_header
);
}
if
(
DecodeVideoOutput
(
p_dec
,
&
p_sys
->
out
,
&
p_pic
)
!=
0
)
goto
error
;
more_input:
/* Send the input buffer to the component */
...
...
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