Page 1 of 1

hello_video hack...

Posted: Sun Oct 23, 2016 10:59 pm
by richardcgiroux
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.

Re: hello_video hack...

Posted: Mon Oct 24, 2016 7:11 am
by 6by9
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.

Re: hello_video hack...

Posted: Mon Oct 24, 2016 1:56 pm
by richardcgiroux
Thank you. That is awesome.

Re: hello_video hack...

Posted: Tue Oct 25, 2016 8:20 pm
by richardcgiroux
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;

Re: hello_video hack...

Posted: Tue Oct 25, 2016 8:37 pm
by 6by9
Sorry, silly typo
if(video_render != NULL && OMX_SetParameter(ILC_GET_HANDLE(video_render), OMX_IndexConfigDisplayRegion, &region) != OMX_ErrorNone)
(render, not decode).

Re: hello_video hack...

Posted: Wed Dec 14, 2016 12:25 pm
by fredfs
Is it possible to tweak it a bit more to accept layer number as argument on the command line? :idea:

Re: hello_video hack...

Posted: Tue Sep 03, 2019 1:15 pm
by 6by9
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.