Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

H264 decode AV_PIX_FMT_YAMI putsurface error #23

Open
zackxue opened this issue Sep 23, 2016 · 6 comments
Open

H264 decode AV_PIX_FMT_YAMI putsurface error #23

zackxue opened this issue Sep 23, 2016 · 6 comments

Comments

@zackxue
Copy link

zackxue commented Sep 23, 2016

we use the AV_PIX_FMT_YAMI put surface to the window and the code is like below, the decode is ok, but the put surface error.
Decode format 335 (1920, 1080) AV_PIX_FMT_YAMI 335 AV_PIX_FMT_NV12 25
vaPutSurface return 0x14 surface id 67108876
Decode format 335 (1920, 1080) AV_PIX_FMT_YAMI 335 AV_PIX_FMT_NV12 25
vaPutSurface return 0x14 surface id 67108877
Decode format 335 (1920, 1080) AV_PIX_FMT_YAMI 335 AV_PIX_FMT_NV12 25
vaPutSurface return 0x14 surface id 67108878
Decode format 335 (1920, 1080) AV_PIX_FMT_YAMI 335 AV_PIX_FMT_NV12 25
vaPutSurface return 0x14 surface id 67108879
Decode format 335 (1920, 1080) AV_PIX_FMT_YAMI 335 AV_PIX_FMT_NV12 25
vaPutSurface return 0x14 surface id 67108880
Decode format 335 (1920, 1080) AV_PIX_FMT_YAMI 335 AV_PIX_FMT_NV12 25
vaPutSurface return 0x14 surface id 67108881

    AVFrame* pFrame = ph264->decode(raw_media_data, count);
    if (pFrame)
    {
        printf("Decode  format %d (%d, %d) AV_PIX_FMT_YAMI %d AV_PIX_FMT_NV12 %d\n", pFrame->format, pFrame->width, 
            pFrame->height, AV_PIX_FMT_YAMI, AV_PIX_FMT_NV12);
        if (m_pWinHandle)
        {
            VAStatus status = VA_STATUS_SUCCESS;
            YamiImage *pImage = (YamiImage *)pFrame->data[3];

            status = vaPutSurface(pImage->va_display, (VASurfaceID)pImage->output_frame->surface,
                m_pWinHandle, 0, 0, pFrame->width, 
                pFrame->height,  0, 0, m_winw, m_winh,
                NULL, 0, 0);
            if (status != VA_STATUS_SUCCESS) 
            {
                printf("vaPutSurface return 0x%x  surface id %d\n", status, 
                    (VASurfaceID)pImage->output_frame->surface);
            }               
        }

    }
@zackxue
Copy link
Author

zackxue commented Oct 11, 2016

any idea ?

@mypopydev
Copy link
Contributor

We will try to reproduce this issue, please keep mind.

@zackxue
Copy link
Author

zackxue commented Oct 20, 2016

in i965_PutSurface the IS_VA_X11 is false, the display type is VA_DISPLAY_DRM

@zackxue
Copy link
Author

zackxue commented Oct 20, 2016

VAStatus
i965_PutSurface(VADriverContextP ctx,
VASurfaceID surface,
void draw, / X Drawable /
short srcx,
short srcy,
unsigned short srcw,
unsigned short srch,
short destx,
short desty,
unsigned short destw,
unsigned short desth,
VARectangle *cliprects, /
client supplied clip list /
unsigned int number_cliprects, /
number of clip rects in the clip list /
unsigned int flags) /
de-interlacing flags */
{
#ifdef HAVE_VA_X11
if (IS_VA_X11(ctx)) {
VARectangle src_rect, dst_rect;

    src_rect.x      = srcx;
    src_rect.y      = srcy;
    src_rect.width  = srcw;
    src_rect.height = srch;

    dst_rect.x      = destx;
    dst_rect.y      = desty;
    dst_rect.width  = destw;
    dst_rect.height = desth;

    return i965_put_surface_dri(ctx, surface, draw, &src_rect, &dst_rect,
                                cliprects, number_cliprects, flags);
}

#endif
return VA_STATUS_ERROR_UNIMPLEMENTED;
}

@mypopydev
Copy link
Contributor

mypopydev commented Oct 20, 2016

I think you need to check the Libva build setting, not ffmpeg_libyami.

And is it you want to just decode by ffmpeg_libyami, then used to putsurface display the pic in X11?

@zackxue
Copy link
Author

zackxue commented Oct 20, 2016

yes, we want put the pic to x11 window.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants