Explanation and Development Work of OpenMAX IL

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 28

Ch3 Bellagio - Implementation of OpenMAX IL

RTLAB

Outline
Bellagio Introduction Bellagio IL core Bellagio States and Command Bellagio work flow How to add a component at Bellagio

Bellagio Introduction

Bellagio
OpenMax IL Run on Linux (FC4) ffmpeg library

Have

to enable shared libraries (--enable-shared)

omxregisterComponents Run your application

Bellagio

omxcore.c : Core functions, implements at st_static_component_loader.c.


/src/component/yourcomponents: components (library_entry_point.c) omxregister.c: component /test/ : Your application (IL Client) /src/base

omx_base_filter.c omx_base_port.c omx_base_component.c

IL

Bellagio IL core

Bellagio IL Core

BellagioComponentLoaderIL Core LoaderBellagio ST_loader for Linux

Bellagio IL Core functions omxcore.c

OMX_Init() / OMX_DeInit()

Core st_static_InitComponentLoader(): Load ST_static_loader functions to ComponentLoader. BOSA_InitComponentLoader(loadersList[i]): Load Componentomxregister fileshared libraries nameomx_component_library_Setup(). omx_component_library_Setup()library entry Componentrole,nameloader( componentfunction).

Bellagio IL Core functions omxcore.c

OMX_GetHandle() / OMX_FreeHandle()

BOSA_ST_CreateComponent() scan loaderComponents requestComponentComponentConstructor OMX_HANDLETYPE hComponent omx_final_constructor()

All about Component (eg. codecs format, ffmpeg init, BufferMgmtcallBack). All about port All about state change, callbacks. Create compMessageHandlerFunction() thread: IL Client (Command).

omx_base_port_Constructor()

omx_base_constructor()

Bellagio IL Core functions omxcore.c

OMX_SetupTunnel()
Establish a

tunnel between two ports of two components. StateLoaded

OMX_SetupTunnel(appPriv->videodechandle, 1, appPriv->colorconv_handle, 0); OMX_SetupTunnel(appPriv->colorconv_handle, 1, appPriv->fbdev_sink_handle, 0);

Tunnel setupdetailIL spec p119 Tunneled Initialization

Data flow with tunneled components

AOMX_EmptyThisBuffer() Componentsdata Acallbacks

Bellagio States and Command

Bellagio Command type

Sendcommand(): commandmessage queuemessage handler.


OMX_CommandStateSet

Change the component state.


OMX_SendCommand(appPriv->videodechandle, OMX_CommandStateSet, OMX_StateIdle, NULL);

OMX_CommandFlush

Flush the queue of buffer on a port of component. Disable a port on a component.


OMX_SendCommand(appPriv->fbdev_sink_handle, OMX_CommandPortDisable, 0, NULL);

OMX_CommandPortDisable OMX_CommandPortEnable

Enable a port on a component


OMX_SendCommand(appPriv->videodechandle, OMX_CommandPortEnable, 1, NULL);

OMX_CommandMakeBuffer

Make a buffer

Bellagio Component States state

Bellagio Component States State flow

Bellagio State change

StateLoaded StateIdle
Starting

buffer management thread. Allocate here the buffers needed for the tunneling.

StateIdle StateExecution
Send

Tunneled Buffer to the Neighbouring Components.

Component Callbacks

Components(eg. State change , fill buffer , empty buffer)callbackIL Client (Use wait and signal) 3 kind of callback function
EventHandler :

this function is executed by the component when a SendCommand request has been completed. EmptyBufferDone: when the buffer is input has been totally consumed. FillBufferDone: when a buffer in output has been totally filled

Bellagio work flow

Bellagio Video application

Video decoder component


Mpeg4 , H.264 OMX_COLOR_Format24bitRGB888 (default format) OMX_COLOR_Format24bitBGR888 OMX_COLOR_Format32bitBGRA8888 OMX_COLOR_Format32bitARGB8888 OMX_COLOR_Format16bitARGB1555 OMX_COLOR_Format16bitRGB565 OMX_COLOR_Format16bitBGR565 If requested, then play the video directly.

Color convert component


Frame buffer Sink component

Tunnel or No-tunnel

Bellagio Video application

BOSA_InitComponentLoader

IL Client (application)

OMX_Init() BOSA_CreateComponent

Loder Componts_1 Componts_2 Componts_3 . . . Componts_n

OMX_GetHandle()

Video_handle

Colorconv_handle OMX_GetParameter()

CallBacks()
Message Handler Fb_sin_handle

OMX_SetupTunnel()
pthread_create if OMX_SendCommand(StateSet) StateLoaded to StateIdle

Constructor
pthread_create

OMX_AllocateBuffer() BufferMgmtCallback() Create BufferMgmtFunction

Input Buffer

OMX_SendCommand(StateSet) StateIdle to StateExecution

Buffer
fread() Read input file

Read input to buffer

EmptyThisBuffer()

OMX_SendCommand(StateSet) StateExecution to StateIdle

Free

How to add a component at Bellagio

How to add a component at Bellagio

omx_final_component.c, omx_final_component.h, library_entry_point.csrc/component.


Edit /src/Makefile.am: Add some library dependencies.

Edit /src/components/Makefile.am
Create src/components/yourcomponent/Makefile.am file. Add Makefile.am at /test if you have test application.

applicationcomponent
#make check

OpenMAX GStreamer on Nomadik

STn8815 STn8815OS STn8815ARM9L2

You might also like