richardcgiroux
Posts: 35
Joined: Sun May 15, 2016 1:54 pm

hello_video hack...

Sun Oct 23, 2016 10:59 pm

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.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9299
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: hello_video hack...

Mon Oct 24, 2016 7:11 am

Untested, but adding

Code: Select all

   {
	   OMX_CONFIG_DISPLAYREGIONTYPE region;
	   memset(&region, 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, &region) != OMX_ErrorNone)
	      status = -40;
   }
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.
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.

richardcgiroux
Posts: 35
Joined: Sun May 15, 2016 1:54 pm

Re: hello_video hack...

Mon Oct 24, 2016 1:56 pm

Thank you. That is awesome.

richardcgiroux
Posts: 35
Joined: Sun May 15, 2016 1:54 pm

Re: hello_video hack...

Tue Oct 25, 2016 8:20 pm

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(&region, 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, &region) != 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;

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9299
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: hello_video hack...

Tue Oct 25, 2016 8:37 pm

Sorry, silly typo
if(video_render != NULL && OMX_SetParameter(ILC_GET_HANDLE(video_render), OMX_IndexConfigDisplayRegion, &region) != 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.

fredfs
Posts: 58
Joined: Sun Jun 07, 2015 12:22 am

Re: hello_video hack...

Wed Dec 14, 2016 12:25 pm

Is it possible to tweak it a bit more to accept layer number as argument on the command line? :idea:

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 9299
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: hello_video hack...

Tue Sep 03, 2019 1:15 pm

fredfs wrote:
Wed Dec 14, 2016 12:25 pm
Is it possible to tweak it a bit more to accept layer number as argument on the command line? :idea:
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.

Return to “Graphics programming”