"If the IL client requests a state transition from OMX_StateLoaded to
OMX_StateIdle, the
component shall acquire all of its static resources, including buffers
for all enabled ports,
before completing the transition. The component does not acquire
buffers for any
disabled ports. Furthermore, before the transition can complete, the
buffer supplier,
which is always the IL client when not tunneling, shall ensure that
the non-supplier
possesses all of its buffers."

>> What mechanism they are using to make component wait for buffers.
Whos is "they" here?

- Your description of the "transition" seems correct.
- The command to move the component from Loaded to Idle state is an
asynchronous call.
- The command to allocate buffers should be all syncrhonous. So, the
statement that "buffer allocation takes time" should not be relevant
here.

-Ravi

On Jan 4, 9:36 am, guru <[email protected]> wrote:
> Can any one guide me on this? I am thinking to provide thread
> synchronization mechanism! between state transition phase and buffer
> allocation to I/O ports.
>
> OR
>
> Current implementation itself provides?
> On Dec 31 2009, 5:32 pm, guru <[email protected]> wrote:
>
> > HI Ravi
>
> > According to Omx call sequence doc for OMX Transition Loaded->Idle
> > State:
>
> > The buffer allocation is handled as part of the allocation to the Idle
> > state. During this transition,
> > PV Framework:
> > ● Issues command to the OMX component to change state from
> > OMX_StateLoaded to
> > OMX_StateIdle via “OMX_SendCommand” call
> > ● Issues a series of either “OMX_UseBuffer” calls or
> > “OMX_AllocateBuffer” calls to the
> > OMX component. The call is used NumInputBuffer times for input port,
> > and
> > NumOutputBuffers for the output port.
> > ● Waits for the EventHandler callback to arrive from the component
> > which notifies the
> > framework that the component state transition is complete
> > (OMX_EventCmdComplete).
>
> > Since buffer allocation takes time,component has to wait for buffer to
> > be allocated so that it can go to Idle state.
> > What mechanism they are using to make component wait for buffers.
>
> > Are they using locking mechanism?. Please give me some inputs?
>
> > Regards
> > Gururaja B O
>
> > On Dec 30, 9:26 am, guru <[email protected]> wrote:
>
> > > Hi All,
>
> > > I have integrated decoder component with OpenCore. If i try to play
> > > audio file it is failing. when I saw the log it is failing when it
> > > tries to change its state to Idle.
>
> > > My understanding is :
>
> > > Before it can change to idle state it has to allocate buffers to input
> > > and output ports. then it should call event handler about the state
> > > change.
>
> > > But according to the log, before allocating the buffers it is trying
> > > to check for buffers(whether allocated) then fails. after failure,
> > > buffers are allocated.
>
> > > It should be:
>
> > > Buffer allocation
> > > state transition to idle
>
> > > but in my case
>
> > > State transition to idle
> > > Buffer allocation. is happening
>
> > > What may be the reason?
> > > Since state change is occuring in Component Thread and buffer
> > > allocation in main thread, so  is there any timing issue?
>
> > > E/PV      (  878): PVLOG:TID
> > > (0x5b950):Time=1150:PVMFOMXAudioDecNode::DoPrepare()
> > > : Changing Component state Loaded -> Idle
> > > E/        (  878): ....Calling OMX_SendCommand
> > > E/        (  878): OMX_AACLC_COMP.c MySendCommand IN
> > > E/        (  878): .... State transition command start --> component
> > > thread
> > > E/        (  878): .... case OMX_StateIdle
> > > E/        (  878): ........Inside StateIdle While Loop
> > > E/        (  878): ........Inside StateIdle While Loop
> > > E/        (  878): ........Inside StateIdle While Loop
> > > E/        (  878): ........Inside StateIdle While Loop
> > > E/        (  878): ........Inside StateIdle While Loop
> > > E/        (  878): ........Inside StateIdle While Loop
> > > E/        (  878): ........Inside StateIdle While Loop
> > > E/        (  878): ........Inside StateIdle While Loop
> > > E/        (  878): ........Inside StateIdle While Loop
> > > E/        (  878): ........Inside StateIdle While Loop
> > > E/        (  878): .... Calling Event Handler8
> > > E/        (  878): CallbackEventHandler Multithread IN
> > > E/        (  878): CallbackEventHandler Multithread OUT
> > > E/        (  878): Idle transition failed
> > > E/        (  878): .... State transition command end --> component
> > > thread ends
> > > E/        (  878): OMX_AACLC_COMP.c MySendCommand OUT
> > > E/        (  878): ....Exiting in OMX_SenCommand
> > > E/PV      (  878): PVLOG:TID
> > > (0x5b950):Time=1152:PVMFOMXAudioDecNode::CreateInput
> > > MemPool() start
> > > E/PV      (  878): PVLOG:TID
> > > (0x5b950):Time=1152:PVMFOMXAudioDecNode::CreateInput
> > > MemPool() allocating buffer header pointers and shared media data
> > > ptrs
> > > E/PV      (  878): PVLOG:TID
> > > (0x5b950):Time=1152:PVMFOMXAudioDecNode::CreateInput
> > > MemPool() done
> > > E/PV      (  878): PVLOG:TID
> > > (0x5b950):Time=1152:PVMFOMXAudioDecNode::ProvideBuff
> > > ersToComponent() enter
> > > E/        (  878): OMX_AACLC_COMP.c  MyAllocateBuffer IN
> > > E/        (  878): OMX_AACLC_COMP.c  MyAllocateBuffer OUT
> > > E/PV      (  878): PVLOG:TID
> > > (0x5b950):Time=1153:PVMFOMXAudioDecNode::ProvideBuff
> > > ersToComponent() done
> > > E/PV      (  878): PVLOG:TID
> > > (0x5b950):Time=1153:PVMFOMXAudioDecNode::CreateOutMe
> > > mPool() start
> > > E/PV      (  878): PVLOG:TID
> > > (0x5b950):Time=1153:PVMFOMXAudioDecNode::CreateOutMe
> > > mPool() Allocating output buffer header pointers
> > > E/PV      (  878): PVLOG:TID
> > > (0x5b950):Time=1153:PVMFOMXAudioDecNode::CreateOutMe
> > > mPool() done
> > > E/PV      (  878): PVLOG:TID
> > > (0x5b950):Time=1154:PVMFOMXAudioDecNode::ProvideBuff
> > > ersToComponent() enter
> > > E/        (  878): OMX_AACLC_COMP.c  MyAllocateBuffer IN
> > > E/        (  878): OMX_AACLC_COMP.c  MyAllocateBuffer OUT
> > > E/PV      (  878): PVLOG:TID
> > > (0x5b950):Time=1154:PVMFOMXAudioDecNode::ProvideBuff
> > > ersToComponent() done
> > > E/PV      (  878): PVLOG:TID
> > > (0x5b950):Time=1154:EventHandlerThreadSafeCallbackAO
> > > ::Run() In
> > > E/PV      (  878): PVLOG:TID
> > > (0x5b950):Time=1154:EventHandlerThreadSafeCallbackAO
> > > ::Run() - No more events, call PendForExec()
> > > E/PV      (  878): PVLOG:TID
> > > (0x5b950):Time=1155:EventHandlerThreadSafeCallbackAO
> > > _Audio::Run() - Calling Process Event
> > > E/PV      (  878): PVLOG:TID
> > > (0x5b950):Time=1155:PVMFOMXAudioDecNode::EventHandle
> > > rProcessing: Event Generated - 1
> > > E/PV      (  878): PVLOG:TID
> > > (0x5b950):Time=1155:PVMFOMXAudioDecNode::EventHandle
> > > rProcessing: OMX_EventError
>
> > > Thanks
> > > Gururaja- Hide quoted text -
>
> > - Show quoted text -
>
>

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

Reply via email to