Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
8d499950
Commit
8d499950
authored
Feb 09, 2010
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Stability fix for the omxil decoder and make UYVY the default output format
for the video decoder on OMAP
parent
102f5c88
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
72 additions
and
25 deletions
+72
-25
modules/codec/omxil/omxil.c
modules/codec/omxil/omxil.c
+71
-25
modules/codec/omxil/omxil.h
modules/codec/omxil/omxil.h
+1
-0
No files found.
modules/codec/omxil/omxil.c
View file @
8d499950
...
@@ -168,6 +168,49 @@ static int CreateComponentsList(decoder_t *p_dec, const char *psz_role)
...
@@ -168,6 +168,49 @@ static int CreateComponentsList(decoder_t *p_dec, const char *psz_role)
return
p_sys
->
components
;
return
p_sys
->
components
;
}
}
/*****************************************************************************
* ImplementationSpecificWorkarounds: place-holder for implementation
* specific workarounds
*****************************************************************************/
static
OMX_ERRORTYPE
ImplementationSpecificWorkarounds
(
decoder_t
*
p_dec
,
OmxPort
*
p_port
,
es_format_t
*
p_fmt
)
{
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
OMX_PARAM_PORTDEFINITIONTYPE
*
def
=
&
p_port
->
definition
;
if
(
!
strcmp
(
p_sys
->
psz_component
,
"OMX.TI.Video.Decoder"
))
{
if
(
p_fmt
->
i_cat
==
VIDEO_ES
&&
def
->
eDir
==
OMX_DirOutput
&&
p_fmt
->
i_codec
==
VLC_CODEC_I420
)
{
/* I420 xvideo is slow on OMAP */
def
->
format
.
video
.
eColorFormat
=
OMX_COLOR_FormatCbYCrY
;
GetVlcChromaFormat
(
def
->
format
.
video
.
eColorFormat
,
&
p_fmt
->
i_codec
,
0
);
GetVlcChromaSizes
(
p_fmt
->
i_codec
,
def
->
format
.
video
.
nFrameWidth
,
def
->
format
.
video
.
nFrameHeight
,
&
p_port
->
i_frame_size
,
&
p_port
->
i_frame_stride
,
&
p_port
->
i_frame_stride_chroma_div
);
def
->
format
.
video
.
nStride
=
p_port
->
i_frame_stride
;
def
->
nBufferSize
=
p_port
->
i_frame_size
;
}
}
else
if
(
!
strcmp
(
p_sys
->
psz_component
,
"OMX.st.video_encoder"
))
{
if
(
p_fmt
->
i_cat
==
VIDEO_ES
)
{
/* Bellagio's encoder doesn't encode the framerate in Q16 */
def
->
format
.
video
.
xFramerate
>>=
16
;
}
}
return
OMX_ErrorNone
;
}
/*****************************************************************************
* SetPortDefinition: set definition of the omx port based on the vlc format
*****************************************************************************/
static
OMX_ERRORTYPE
SetPortDefinition
(
decoder_t
*
p_dec
,
OmxPort
*
p_port
,
static
OMX_ERRORTYPE
SetPortDefinition
(
decoder_t
*
p_dec
,
OmxPort
*
p_port
,
es_format_t
*
p_fmt
)
es_format_t
*
p_fmt
)
{
{
...
@@ -188,12 +231,8 @@ static OMX_ERRORTYPE SetPortDefinition(decoder_t *p_dec, OmxPort *p_port,
...
@@ -188,12 +231,8 @@ static OMX_ERRORTYPE SetPortDefinition(decoder_t *p_dec, OmxPort *p_port,
def
->
format
.
video
.
nStride
=
def
->
format
.
video
.
nFrameWidth
;
def
->
format
.
video
.
nStride
=
def
->
format
.
video
.
nFrameWidth
;
if
(
p_fmt
->
video
.
i_frame_rate
>
0
&&
if
(
p_fmt
->
video
.
i_frame_rate
>
0
&&
p_fmt
->
video
.
i_frame_rate_base
>
0
)
p_fmt
->
video
.
i_frame_rate_base
>
0
)
#if 0
def
->
format
.
video
.
xFramerate
=
(
p_fmt
->
video
.
i_frame_rate
<<
16
)
/
def
->
format
.
video
.
xFramerate
=
(
p_fmt
->
video
.
i_frame_rate
<<
16
)
/
p_fmt
->
video
.
i_frame_rate_base
;
p_fmt
->
video
.
i_frame_rate_base
;
#else
def
->
format
.
video
.
xFramerate
=
p_fmt
->
video
.
i_frame_rate
;
#endif
if
(
def
->
eDir
==
OMX_DirInput
||
p_dec
->
p_sys
->
b_enc
)
if
(
def
->
eDir
==
OMX_DirInput
||
p_dec
->
p_sys
->
b_enc
)
{
{
...
@@ -222,7 +261,6 @@ static OMX_ERRORTYPE SetPortDefinition(decoder_t *p_dec, OmxPort *p_port,
...
@@ -222,7 +261,6 @@ static OMX_ERRORTYPE SetPortDefinition(decoder_t *p_dec, OmxPort *p_port,
}
}
else
else
{
{
//def->format.video.eColorFormat = OMX_COLOR_FormatCbYCrY;
if
(
!
GetVlcChromaFormat
(
def
->
format
.
video
.
eColorFormat
,
if
(
!
GetVlcChromaFormat
(
def
->
format
.
video
.
eColorFormat
,
&
p_fmt
->
i_codec
,
0
)
)
&
p_fmt
->
i_codec
,
0
)
)
{
{
...
@@ -267,6 +305,8 @@ static OMX_ERRORTYPE SetPortDefinition(decoder_t *p_dec, OmxPort *p_port,
...
@@ -267,6 +305,8 @@ static OMX_ERRORTYPE SetPortDefinition(decoder_t *p_dec, OmxPort *p_port,
default:
return
OMX_ErrorNotImplemented
;
default:
return
OMX_ErrorNotImplemented
;
}
}
ImplementationSpecificWorkarounds
(
p_dec
,
p_port
,
p_fmt
);
omx_error
=
OMX_SetParameter
(
p_port
->
omx_handle
,
omx_error
=
OMX_SetParameter
(
p_port
->
omx_handle
,
OMX_IndexParamPortDefinition
,
def
);
OMX_IndexParamPortDefinition
,
def
);
CHECK_ERROR
(
omx_error
,
"OMX_SetParameter failed (%x : %s)"
,
CHECK_ERROR
(
omx_error
,
"OMX_SetParameter failed (%x : %s)"
,
...
@@ -300,6 +340,9 @@ static OMX_ERRORTYPE SetPortDefinition(decoder_t *p_dec, OmxPort *p_port,
...
@@ -300,6 +340,9 @@ static OMX_ERRORTYPE SetPortDefinition(decoder_t *p_dec, OmxPort *p_port,
return
omx_error
;
return
omx_error
;
}
}
/*****************************************************************************
* GetPortDefinition: set vlc format based on the definition of the omx port
*****************************************************************************/
static
OMX_ERRORTYPE
GetPortDefinition
(
decoder_t
*
p_dec
,
OmxPort
*
p_port
,
static
OMX_ERRORTYPE
GetPortDefinition
(
decoder_t
*
p_dec
,
OmxPort
*
p_port
,
es_format_t
*
p_fmt
)
es_format_t
*
p_fmt
)
{
{
...
@@ -434,7 +477,7 @@ static OMX_ERRORTYPE DeinitialiseComponent(decoder_t *p_dec,
...
@@ -434,7 +477,7 @@ static OMX_ERRORTYPE DeinitialiseComponent(decoder_t *p_dec,
{
{
omx_error
=
OMX_SendCommand
(
omx_handle
,
OMX_CommandStateSet
,
omx_error
=
OMX_SendCommand
(
omx_handle
,
OMX_CommandStateSet
,
OMX_StateLoaded
,
0
);
OMX_StateLoaded
,
0
);
CHECK_ERROR
(
omx_error
,
"ONX_CommandStateSet
Idle
failed (%x)"
,
omx_error
);
CHECK_ERROR
(
omx_error
,
"ONX_CommandStateSet
Loaded
failed (%x)"
,
omx_error
);
for
(
i
=
0
;
i
<
p_sys
->
ports
;
i
++
)
for
(
i
=
0
;
i
<
p_sys
->
ports
;
i
++
)
{
{
...
@@ -454,7 +497,7 @@ static OMX_ERRORTYPE DeinitialiseComponent(decoder_t *p_dec,
...
@@ -454,7 +497,7 @@ static OMX_ERRORTYPE DeinitialiseComponent(decoder_t *p_dec,
}
}
omx_error
=
WaitForSpecificOmxEvent
(
p_dec
,
OMX_EventCmdComplete
,
0
,
0
,
0
);
omx_error
=
WaitForSpecificOmxEvent
(
p_dec
,
OMX_EventCmdComplete
,
0
,
0
,
0
);
CHECK_ERROR
(
omx_error
,
"Wait for
Idle
failed (%x)"
,
omx_error
);
CHECK_ERROR
(
omx_error
,
"Wait for
Loaded
failed (%x)"
,
omx_error
);
}
}
error:
error:
...
@@ -494,6 +537,7 @@ static OMX_ERRORTYPE InitialiseComponent(decoder_t *p_dec,
...
@@ -494,6 +537,7 @@ static OMX_ERRORTYPE InitialiseComponent(decoder_t *p_dec,
omx_error
,
ErrorToString
(
omx_error
)
);
omx_error
,
ErrorToString
(
omx_error
)
);
return
omx_error
;
return
omx_error
;
}
}
strncpy
(
p_sys
->
psz_component
,
psz_component
,
OMX_MAX_STRINGNAME_SIZE
-
1
);
OMX_ComponentRoleEnum
(
omx_handle
,
psz_role
,
0
);
OMX_ComponentRoleEnum
(
omx_handle
,
psz_role
,
0
);
msg_Dbg
(
p_dec
,
"loaded component %s of role %s"
,
psz_component
,
psz_role
);
msg_Dbg
(
p_dec
,
"loaded component %s of role %s"
,
psz_component
,
psz_role
);
...
@@ -1013,6 +1057,11 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
...
@@ -1013,6 +1057,11 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
OMX_FIFO_GET
(
&
p_sys
->
in
.
fifo
,
p_header
);
OMX_FIFO_GET
(
&
p_sys
->
in
.
fifo
,
p_header
);
if
(
p_header
)
if
(
p_header
)
{
{
p_header
->
nFilledLen
=
p_block
->
i_buffer
;
p_header
->
nOffset
=
0
;
p_header
->
nFlags
=
OMX_BUFFERFLAG_ENDOFFRAME
;
p_header
->
nTimeStamp
=
p_block
->
i_dts
;
/* In direct mode we pass the input pointer as is.
/* In direct mode we pass the input pointer as is.
* Otherwise we memcopy the data */
* Otherwise we memcopy the data */
if
(
p_sys
->
in
.
b_direct
)
if
(
p_sys
->
in
.
b_direct
)
...
@@ -1023,20 +1072,16 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
...
@@ -1023,20 +1072,16 @@ static picture_t *DecodeVideo( decoder_t *p_dec, block_t **pp_block )
}
}
else
else
{
{
if
(
p_
block
->
i_buffer
>
p_header
->
nAllocLen
)
if
(
p_
header
->
nFilledLen
>
p_header
->
nAllocLen
)
{
{
msg_Dbg
(
p_dec
,
"buffer too small (%i,%i)"
,
p_block
->
i_buffer
,
msg_Dbg
(
p_dec
,
"buffer too small (%i,%i)"
,
(
int
)
p_header
->
nAllocLen
);
(
int
)
p_header
->
n
FilledLen
,
(
int
)
p_header
->
n
AllocLen
);
p_
block
->
i_buffer
=
p_header
->
nAllocLen
;
p_
header
->
nFilledLen
=
p_header
->
nAllocLen
;
}
}
memcpy
(
p_header
->
pBuffer
,
p_block
->
p_buffer
,
p_
block
->
i_buffer
);
memcpy
(
p_header
->
pBuffer
,
p_block
->
p_buffer
,
p_
header
->
nFilledLen
);
block_Release
(
p_block
);
block_Release
(
p_block
);
}
}
p_header
->
nFilledLen
=
p_block
->
i_buffer
;
p_header
->
nOffset
=
0
;
p_header
->
nFlags
=
OMX_BUFFERFLAG_ENDOFFRAME
;
p_header
->
nTimeStamp
=
p_block
->
i_dts
;
#ifdef OMXIL_EXTRA_DEBUG
#ifdef OMXIL_EXTRA_DEBUG
msg_Dbg
(
p_dec
,
"EmptyThisBuffer %p, %p, %i"
,
p_header
,
p_header
->
pBuffer
,
msg_Dbg
(
p_dec
,
"EmptyThisBuffer %p, %p, %i"
,
p_header
,
p_header
->
pBuffer
,
(
int
)
p_header
->
nFilledLen
);
(
int
)
p_header
->
nFilledLen
);
...
@@ -1145,6 +1190,11 @@ aout_buffer_t *DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
...
@@ -1145,6 +1190,11 @@ aout_buffer_t *DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
OMX_FIFO_GET
(
&
p_sys
->
in
.
fifo
,
p_header
);
OMX_FIFO_GET
(
&
p_sys
->
in
.
fifo
,
p_header
);
if
(
p_header
)
if
(
p_header
)
{
{
p_header
->
nFilledLen
=
p_block
->
i_buffer
;
p_header
->
nOffset
=
0
;
p_header
->
nFlags
=
OMX_BUFFERFLAG_ENDOFFRAME
;
p_header
->
nTimeStamp
=
p_block
->
i_dts
;
/* In direct mode we pass the input pointer as is.
/* In direct mode we pass the input pointer as is.
* Otherwise we memcopy the data */
* Otherwise we memcopy the data */
if
(
p_sys
->
in
.
b_direct
)
if
(
p_sys
->
in
.
b_direct
)
...
@@ -1155,20 +1205,16 @@ aout_buffer_t *DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
...
@@ -1155,20 +1205,16 @@ aout_buffer_t *DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
}
}
else
else
{
{
if
(
p_
block
->
i_buffer
>
p_header
->
nAllocLen
)
if
(
p_
header
->
nFilledLen
>
p_header
->
nAllocLen
)
{
{
msg_Dbg
(
p_dec
,
"buffer too small (%i,%i)"
,
p_block
->
i_buffer
,
msg_Dbg
(
p_dec
,
"buffer too small (%i,%i)"
,
(
int
)
p_header
->
nAllocLen
);
(
int
)
p_header
->
n
FilledLen
,
(
int
)
p_header
->
n
AllocLen
);
p_
block
->
i_buffer
=
p_header
->
nAllocLen
;
p_
header
->
nFilledLen
=
p_header
->
nAllocLen
;
}
}
memcpy
(
p_header
->
pBuffer
,
p_block
->
p_buffer
,
p_
block
->
i_buffer
);
memcpy
(
p_header
->
pBuffer
,
p_block
->
p_buffer
,
p_
header
->
nFilledLen
);
block_Release
(
p_block
);
block_Release
(
p_block
);
}
}
p_header
->
nFilledLen
=
p_block
->
i_buffer
;
p_header
->
nOffset
=
0
;
p_header
->
nFlags
=
OMX_BUFFERFLAG_ENDOFFRAME
;
p_header
->
nTimeStamp
=
p_block
->
i_dts
;
#ifdef OMXIL_EXTRA_DEBUG
#ifdef OMXIL_EXTRA_DEBUG
msg_Dbg
(
p_dec
,
"EmptyThisBuffer %p, %p, %i"
,
p_header
,
p_header
->
pBuffer
,
msg_Dbg
(
p_dec
,
"EmptyThisBuffer %p, %p, %i"
,
p_header
,
p_header
->
pBuffer
,
(
int
)
p_header
->
nFilledLen
);
(
int
)
p_header
->
nFilledLen
);
...
...
modules/codec/omxil/omxil.h
View file @
8d499950
...
@@ -91,6 +91,7 @@ struct decoder_sys_t
...
@@ -91,6 +91,7 @@ struct decoder_sys_t
bool
b_init
;
bool
b_init
;
vlc_mutex_t
lock
;
vlc_mutex_t
lock
;
char
psz_component
[
OMX_MAX_STRINGNAME_SIZE
];
char
ppsz_components
[
MAX_COMPONENTS_LIST_SIZE
][
OMX_MAX_STRINGNAME_SIZE
];
char
ppsz_components
[
MAX_COMPONENTS_LIST_SIZE
][
OMX_MAX_STRINGNAME_SIZE
];
unsigned
int
components
;
unsigned
int
components
;
...
...
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