diff options
Diffstat (limited to 'src/libXvMC/surface.c')
-rw-r--r-- | src/libXvMC/surface.c | 41 |
1 files changed, 31 insertions, 10 deletions
diff --git a/src/libXvMC/surface.c b/src/libXvMC/surface.c index 038befc297..6031b39d10 100644 --- a/src/libXvMC/surface.c +++ b/src/libXvMC/surface.c @@ -40,12 +40,12 @@ static enum vlPictureType PictureToVL(int xvmc_pic) return -1; } -static enum vlMotionType MotionToVL(int xvmc_motion_type) +static enum vlMotionType MotionToVL(int xvmc_motion_type, int xvmc_dct_type) { switch (xvmc_motion_type) { case XVMC_PREDICTION_FRAME: - return vlMotionTypeFrame; + return xvmc_dct_type == XVMC_DCT_TYPE_FIELD ? vlMotionType16x8 : vlMotionTypeFrame; case XVMC_PREDICTION_FIELD: return vlMotionTypeField; case XVMC_PREDICTION_DUAL_PRIME: @@ -171,8 +171,8 @@ Status XvMCRenderSurface batch.macroblocks[i].mby = macroblocks->macro_blocks[j].y; batch.macroblocks[i].mb_type = TypeToVL(macroblocks->macro_blocks[j].macroblock_type); if (batch.macroblocks[i].mb_type != vlMacroBlockTypeIntra) - batch.macroblocks[i].mo_type = MotionToVL(macroblocks->macro_blocks[j].motion_type); - batch.macroblocks[i].dct_type = macroblocks->macro_blocks[j].dct_type & XVMC_DCT_TYPE_FIELD ? vlDCTTypeFieldCoded : vlDCTTypeFrameCoded; + batch.macroblocks[i].mo_type = MotionToVL(macroblocks->macro_blocks[j].motion_type, macroblocks->macro_blocks[j].dct_type); + batch.macroblocks[i].dct_type = macroblocks->macro_blocks[j].dct_type == XVMC_DCT_TYPE_FIELD ? vlDCTTypeFieldCoded : vlDCTTypeFrameCoded; for (k = 0; k < 2; ++k) for (l = 0; l < 2; ++l) @@ -201,7 +201,7 @@ Status XvMCFlushSurface(Display *display, XvMCSurface *surface) assert(display == vlGetNativeDisplay(vlGetDisplay(vlSurfaceGetScreen(vl_sfc)))); - /* TODO */ + vlSurfaceFlush(vl_sfc); return Success; } @@ -219,7 +219,7 @@ Status XvMCSyncSurface(Display *display, XvMCSurface *surface) assert(display == vlGetNativeDisplay(vlGetDisplay(vlSurfaceGetScreen(vl_sfc)))); - /* TODO */ + vlSurfaceSync(vl_sfc); return Success; } @@ -266,14 +266,15 @@ Status XvMCPutSurface vl_sfc = surface->privData; - vlPutPicture(vl_sfc, drawable, srcx, srcy, srcw, srch, destx, desty, destw, desth, PictureToVL(flags)); + vlPutPicture(vl_sfc, drawable, srcx, srcy, srcw, srch, destx, desty, destw, desth, width, height, PictureToVL(flags)); return Success; } Status XvMCGetSurfaceStatus(Display *display, XvMCSurface *surface, int *status) { - struct vlSurface *vl_sfc; + struct vlSurface *vl_sfc; + enum vlResourceStatus res_status; assert(display); @@ -286,8 +287,28 @@ Status XvMCGetSurfaceStatus(Display *display, XvMCSurface *surface, int *status) assert(display == vlGetNativeDisplay(vlGetDisplay(vlSurfaceGetScreen(vl_sfc)))); - /* TODO */ - *status = 0; + vlSurfaceGetStatus(vl_sfc, &res_status); + + switch (res_status) + { + case vlResourceStatusFree: + { + *status = 0; + break; + } + case vlResourceStatusRendering: + { + *status = XVMC_RENDERING; + break; + } + case vlResourceStatusDisplaying: + { + *status = XVMC_DISPLAYING; + break; + } + default: + assert(0); + } return Success; } |