[Mesa-dev] [PATCH 4/4] st/omx/dec: make decoder video buffer progressive

Leo Liu leo.liu at amd.com
Thu Jul 7 16:11:37 UTC 2016



On 07/07/2016 11:39 AM, Emil Velikov wrote:
> On 6 July 2016 at 19:03, Leo Liu <leo.liu at amd.com> wrote:
>> The idea of encode tunneling is to use video buffer directly for encoder,
>> but currently the encoder doesn’t support interlaced surface, the OMX
>> decoder set progressive surface before on that purpose.
>>
>> Since now we are polling the driver for interlacing information for
>> decoder, we got the interlaced as preferred as other APIs(VDPAU, VA-API),
>> thus breaking the transcode with tunneling.
>>
>> The solution is when with tunnel detected, re-allocate progressive target
>> buffers, and then converting the interlaced decoder results to there.
>>
>> This has been tested with transcode results bit to bit matching as before
>> with surface from progressive to progressive.
>>
>> Signed-off-by: Leo Liu <leo.liu at amd.com>
>> ---
>>   src/gallium/state_trackers/omx/vid_dec.c | 65 +++++++++++++++++++++++++++++++-
>>   src/gallium/state_trackers/omx/vid_dec.h |  6 ++-
>>   2 files changed, 68 insertions(+), 3 deletions(-)
>>
>> diff --git a/src/gallium/state_trackers/omx/vid_dec.c b/src/gallium/state_trackers/omx/vid_dec.c
>> index a989c10..7842966 100644
>> --- a/src/gallium/state_trackers/omx/vid_dec.c
>> +++ b/src/gallium/state_trackers/omx/vid_dec.c
>> @@ -167,6 +167,19 @@ static OMX_ERRORTYPE vid_dec_Constructor(OMX_COMPONENTTYPE *comp, OMX_STRING nam
>>      if (!priv->pipe)
>>         return OMX_ErrorInsufficientResources;
>>
>> +   if (!vl_compositor_init(&priv->compositor, priv->pipe)) {
>> +      priv->pipe->destroy(priv->pipe);
>> +      priv->pipe = NULL;
>> +      return OMX_ErrorInsufficientResources;
>> +   }
>> +
>> +   if (!vl_compositor_init_state(&priv->cstate, priv->pipe)) {
>> +      vl_compositor_cleanup(&priv->compositor);
>> +      priv->pipe->destroy(priv->pipe);
>> +      priv->pipe = NULL;
>> +      return OMX_ErrorInsufficientResources;
>> +   }
>> +()
> IIRC as vid_dec_Constructor() fails, the caller (bellagio?)
Right. currently it's bellagio.
> explicitly
> calls the destructor vid_dec_Destructor(). Thus the above teardown
> should not be needed.

Right.
>>      priv->sPortTypesParam[OMX_PortDomainVideo].nStartPortNumber = 0;
>>      priv->sPortTypesParam[OMX_PortDomainVideo].nPorts = 2;
>>      priv->ports = CALLOC(2, sizeof(omx_base_PortType *));
>> @@ -218,8 +231,11 @@ static OMX_ERRORTYPE vid_dec_Destructor(OMX_COMPONENTTYPE *comp)
>>         priv->ports=NULL;
>>      }
>>
>> -   if (priv->pipe)
>> +   if (priv->pipe) {
>> +      vl_compositor_cleanup_state(&priv->cstate);
>> +      vl_compositor_cleanup(&priv->compositor);
> Neither vl_compositor_cleanup_state() nor vl_compositor_cleanup() is
> happy if upon deref. the value (pointer again) is NULL.
>
> omx/vid_enc.c could use similar cleanups ?

I'll come up with a patch to fix that on vid_enc.c

Thanks,
Leo

>
> Thanks,
> Emil



More information about the mesa-dev mailing list