/**
 * \fn uncompress
 * \brief 
 * @param in
 * @param out
 * @return 
 */
bool decoderFFLIBVA::uncompress (ADMCompressedImage * in, ADMImage * out)
{
    // First let ffmpeg prepare datas...

    aprintf("[LIBVA]>-------------uncompress>\n");
   
    if(!decoderFF::uncompress (in, scratch))
    {
        aprintf("[LIBVA] No data from libavcodec\n");
        return 0;
    }
    uint64_t p=(uint64_t )scratch->GetReadPtr(PLANAR_Y);
    VASurfaceID id=(VASurfaceID)p;
    out->Pts=scratch->Pts;
    out->flags=scratch->flags;
    
    ADM_vaSurface *img=lookupBySurfaceId(id);
    
    out->refType=ADM_HW_LIBVA;
    out->refDescriptor.refCookie=this;
    out->refDescriptor.refInstance=img;
    out->refDescriptor.refMarkUsed=libvaMarkSurfaceUsed;
    out->refDescriptor.refMarkUnused=libvaMarkSurfaceUnused;
    out->refDescriptor.refDownload=libvaRefDownload;
    aprintf("uncompress : Got surface =0x%x\n",id);
    return true;
    
}
예제 #2
0
bool        decoderFFLIBVA::markSurfaceUnused(VASurfaceID id)
{
    aprintf("Freeing surface %x\n",(int)id);
    ADM_vaSurface *s=lookupBySurfaceId(id);
    ADM_assert(s);
    return markSurfaceUnused(s);
}
/**
    \fn releaseBuffer
*/
void decoderFFLIBVA::releaseBuffer(AVCodecContext *avctx, AVFrame *pic)
{
  uint64_t p=(uint64_t )pic->data[0];
  VASurfaceID s=(VASurfaceID)p;
  decoderFFLIBVA *x=(decoderFFLIBVA *)avctx->opaque;
    
  ADM_vaSurface *i=lookupBySurfaceId(s);
  
  aprintf("Release Buffer : 0x%llx\n",s);
  
  for(int i=0; i<4; i++)
  {
    pic->data[i]= NULL;
  }
  
  libvaMarkSurfaceUnused(i,this);
  
}