I need hello_video to run on layer 2...I want to put a graphic overlay on the video
Could anyone tell me how to mod hello_video to make it play on layer 2?
Otherwise, I am willing to pay someone to mod hello_video with that and a couple of other things.
-
- Posts: 35
- Joined: Sun May 15, 2016 1:54 pm
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 10586
- Joined: Wed Dec 04, 2013 11:27 am
- Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.
Re: hello_video hack...
Untested, but adding
to the source at a point after the component has been created and before it is changed to executing. Straight after the "set_tunnel" calls would be about perfect.
Code: Select all
{
OMX_CONFIG_DISPLAYREGIONTYPE region;
memset(®ion, 0, sizeof(OMX_CONFIG_DISPLAYREGIONTYPE));
region.nSize = sizeof(OMX_CONFIG_DISPLAYREGIONTYPE);
region.nVersion.nVersion = OMX_VERSION;
region.nPortIndex = 90;
region.layer = 2;
region.set |= OMX_DISPLAY_SET_LAYER;
if(video_decode != NULL && OMX_SetParameter(ILC_GET_HANDLE(video_decode), OMX_IndexConfigDisplayRegion, ®ion) != OMX_ErrorNone)
status = -40;
}
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
-
- Posts: 35
- Joined: Sun May 15, 2016 1:54 pm
Re: hello_video hack...
Thank you. That is awesome.
-
- Posts: 35
- Joined: Sun May 15, 2016 1:54 pm
Re: hello_video hack...
I pasted in the code and it compiles but exits when I try to test it. Commenting out the code causes it to work again.
set_tunnel(tunnel, video_decode, 131, video_scheduler, 10);
set_tunnel(tunnel+1, video_scheduler, 11, video_render, 90);
set_tunnel(tunnel+2, clock, 80, video_scheduler, 12);
{
OMX_CONFIG_DISPLAYREGIONTYPE region;
memset(®ion, 0, sizeof(OMX_CONFIG_DISPLAYREGIONTYPE));
region.nSize = sizeof(OMX_CONFIG_DISPLAYREGIONTYPE);
region.nVersion.nVersion = OMX_VERSION;
region.nPortIndex = 90;
region.layer = 2;
region.set |= OMX_DISPLAY_SET_LAYER;
if(video_decode != NULL && OMX_SetParameter(ILC_GET_HANDLE(video_decode), OMX_IndexConfigDisplayRegion, ®ion) != OMX_ErrorNone)
status = -40;
}
// setup clock tunnel first
if(status == 0 && ilclient_setup_tunnel(tunnel+2, 0, 0) != 0)
status = -15;
else
ilclient_change_component_state(clock, OMX_StateExecuting);
if(status == 0)
ilclient_change_component_state(video_decode, OMX_StateIdle);
memset(&format, 0, sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE));
format.nSize = sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE);
format.nVersion.nVersion = OMX_VERSION;
format.nPortIndex = 130;
format.eCompressionFormat = OMX_VIDEO_CodingAVC;
set_tunnel(tunnel, video_decode, 131, video_scheduler, 10);
set_tunnel(tunnel+1, video_scheduler, 11, video_render, 90);
set_tunnel(tunnel+2, clock, 80, video_scheduler, 12);
{
OMX_CONFIG_DISPLAYREGIONTYPE region;
memset(®ion, 0, sizeof(OMX_CONFIG_DISPLAYREGIONTYPE));
region.nSize = sizeof(OMX_CONFIG_DISPLAYREGIONTYPE);
region.nVersion.nVersion = OMX_VERSION;
region.nPortIndex = 90;
region.layer = 2;
region.set |= OMX_DISPLAY_SET_LAYER;
if(video_decode != NULL && OMX_SetParameter(ILC_GET_HANDLE(video_decode), OMX_IndexConfigDisplayRegion, ®ion) != OMX_ErrorNone)
status = -40;
}
// setup clock tunnel first
if(status == 0 && ilclient_setup_tunnel(tunnel+2, 0, 0) != 0)
status = -15;
else
ilclient_change_component_state(clock, OMX_StateExecuting);
if(status == 0)
ilclient_change_component_state(video_decode, OMX_StateIdle);
memset(&format, 0, sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE));
format.nSize = sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE);
format.nVersion.nVersion = OMX_VERSION;
format.nPortIndex = 130;
format.eCompressionFormat = OMX_VIDEO_CodingAVC;
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 10586
- Joined: Wed Dec 04, 2013 11:27 am
- Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.
Re: hello_video hack...
Sorry, silly typo
if(video_render != NULL && OMX_SetParameter(ILC_GET_HANDLE(video_render), OMX_IndexConfigDisplayRegion, ®ion) != OMX_ErrorNone)
(render, not decode).
if(video_render != NULL && OMX_SetParameter(ILC_GET_HANDLE(video_render), OMX_IndexConfigDisplayRegion, ®ion) != OMX_ErrorNone)
(render, not decode).
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
Re: hello_video hack...
Is it possible to tweak it a bit more to accept layer number as argument on the command line? 

-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 10586
- Joined: Wed Dec 04, 2013 11:27 am
- Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.
Re: hello_video hack...
It is possible to set the layer via a command line parameter. Use sscanf or atoi on argv.
hello_video is a very simple example app, therefore I'm not going to be making that sort of change.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
I'm not interested in doing contracts for bespoke functionality - please don't ask.