video render buffer of opencore

22 views
Skip to first unread message

Andy Quan

unread,
Aug 13, 2009, 4:02:38 AM8/13/09
to android-...@googlegroups.com
Hi,
Another question about the new decoder buffer allocation mechanism since OpenCORE v2.x. 

Video decoder MIO is allowed to provide output buffer at "Negotiate parameter" stage of decoding node according to compact FSI information transferred. One of the important variables is "video_format", i.e. "YUVFormat". It will decide how large buffer MIO should allocate. However, I happen to find that YUVFormat is not achieved before MIO allocates video buffer... It seems strange and unsafe to me... Any comment, esp. PV?

--
Thanks,
Andy

RaviY

unread,
Aug 13, 2009, 7:50:58 AM8/13/09
to android-platform
The number of buffers and the size of these buffers is sent through
the setParameter call. So, the MIO would know what size to allocate,
isn't it? If you have a specific sequence of steps that causes a
problem, can you please share it with us?

-Ravi

On Aug 13, 3:02 am, Andy Quan <androidr...@gmail.com> wrote:
> Hi,Another question about the new decoder buffer allocation mechanism since

Andy Quan

unread,
Aug 13, 2009, 12:25:17 PM8/13/09
to android-...@googlegroups.com
Ravi,
The buffer size sent to MIO is based on the component's minimized buffer size requirement regardless of YUV format. For example, YUV420P and YUV422 definitely require different sizes. However, YUV format is not available according to current OMX calling sequence. 


Line 793 will result in UNKNOWN. The YUV format is not polled and set until MIO buffers are allocated. I think it is better if YUV format is polled and set before compact Fsi transfer.

Let me know your comment. Thanks.
--
Thanks,
Andy

RaviY

unread,
Aug 13, 2009, 10:26:38 PM8/13/09
to android-platform
I did look at this part of the code earlier today. And yes, I agree
that the YUV format should be set before sending the FSI. We will
change that.

However, I am still not sure about the buffer size not being valid.
The component knows the actual buffer size (based on the output format
that it would eventually decode into) that it would require. And, as
part of negotiating, we would get that from the component. And, this
information is sent to the MIO.

-Ravi

On Aug 13, 11:25 am, Andy Quan <androidr...@gmail.com> wrote:
> Ravi,The buffer size sent to MIO is based on the component's minimized
> buffer size requirement regardless of YUV format. For example, YUV420P and
> YUV422 definitely require different sizes. However, YUV format is not
> available according to current OMX calling sequence.
>
> http://android.git.kernel.org/?p=platform/external/opencore.git;a=blo...
>
> <http://android.git.kernel.org/?p=platform/external/opencore.git;a=blo...>Line

Andy Quan

unread,
Aug 13, 2009, 11:21:15 PM8/13/09
to android-...@googlegroups.com
Ravi,
My previous thought is that nBufferSize is based on YUV format. For example, VGA YUV420P and VGA YUV422 would require different nBufferSize. Therefore, if the default nBufferSize is set based on YUV420P while later OMX is configured to be YUV422, the size may not meet the requirement. It can be unsafe even if there is PortSettingsChanged event.

Anyway, based on current code, if we use compact fsi transfer, there is no way that YUV format will be sent to MIO. This is because 1) YUV is set after compact setting in Negotiate. 2) if compact setting is used, fsi will not be transferred again in QueueOutputBuffer. 

Let me know if I have misunderstandings. Thanks.
--
Thanks,
Andy

RaviY

unread,
Aug 14, 2009, 11:53:11 AM8/14/09
to android-platform
Looks like we do set that YUV format when the decoder and mediaoutput
node are connected. So, we might be lucking out now. However, there
definitely is something funky about this. I shall try to come up with
concrete proofs for where this could fail.

But yes, the YUV format is not being set correctly as part of the
compactsettings. I will also check how port reconfiguration affects
this usecase.

-Ravi

On Aug 13, 10:21 pm, Andy Quan <androidr...@gmail.com> wrote:
> Ravi,My previous thought is that nBufferSize is based on YUV format. For

RaviY

unread,
Aug 14, 2009, 12:46:33 PM8/14/09
to android-platform
So, with the help of a co-worker, I think I understand this more now.

When port settings are changed , the allocator is re-queried. So, we
should be good. All that needs to change now is that the correct YUV
format needs to be set as part of the compact FSI settings.

-Ravi
Reply all
Reply to author
Forward
0 new messages