diff options
author | Younes Manton <younes.m@gmail.com> | 2008-08-16 13:04:23 -0400 |
---|---|---|
committer | Younes Manton <younes.m@gmail.com> | 2008-08-16 13:04:54 -0400 |
commit | 6858dd50c9b696c1c6044f5a403000f9d20b286b (patch) | |
tree | 03304cd6b3e129db06aa006ed0be066e8f0abd35 /src/libXvMC/block.c | |
parent | fb2732ff056a83418a379b81c1e5da50675c41ac (diff) |
g3dvl: Modularized rendering, refactored to accommodate VAAPI, other APIs.
Diffstat (limited to 'src/libXvMC/block.c')
-rw-r--r-- | src/libXvMC/block.c | 47 |
1 files changed, 21 insertions, 26 deletions
diff --git a/src/libXvMC/block.c b/src/libXvMC/block.c index deca305bdc..328b035576 100644 --- a/src/libXvMC/block.c +++ b/src/libXvMC/block.c @@ -2,83 +2,78 @@ #include <stdlib.h> #include <X11/Xlib.h> #include <X11/extensions/XvMC.h> +#include <vl_display.h> +#include <vl_screen.h> #include <vl_context.h> -/* - * XvMC defines 64 element blocks (8x8 elements). - * Elements are 8 bits when they represent color values, - * 9 bits when they reprecent DCT coefficients, we - * store them in 2 bytes in either case. - */ #define BLOCK_SIZE (64 * 2) Status XvMCCreateBlocks(Display *display, XvMCContext *context, unsigned int num_blocks, XvMCBlockArray *blocks) { - struct vl_context *vl_ctx; - + struct vlContext *vl_ctx; + assert(display); - + if (!context) return XvMCBadContext; if (num_blocks == 0) return BadValue; - + assert(blocks); - + vl_ctx = context->privData; - assert(display == vl_ctx->display); + assert(display == vlGetNativeDisplay(vlGetDisplay(vlContextGetScreen(vl_ctx)))); blocks->context_id = context->context_id; blocks->num_blocks = num_blocks; blocks->blocks = malloc(BLOCK_SIZE * num_blocks); /* Since we don't have a VL type for blocks, set privData to the display so we can catch mismatches */ blocks->privData = display; - + return Success; } Status XvMCDestroyBlocks(Display *display, XvMCBlockArray *blocks) -{ +{ assert(display); assert(blocks); assert(display == blocks->privData); free(blocks->blocks); - + return Success; } Status XvMCCreateMacroBlocks(Display *display, XvMCContext *context, unsigned int num_blocks, XvMCMacroBlockArray *blocks) { - struct vl_context *vl_ctx; - + struct vlContext *vl_ctx; + assert(display); - + if (!context) return XvMCBadContext; if (num_blocks == 0) return BadValue; - + assert(blocks); - + vl_ctx = context->privData; - assert(display == vl_ctx->display); - + assert(display == vlGetNativeDisplay(vlGetDisplay(vlContextGetScreen(vl_ctx)))); + blocks->context_id = context->context_id; blocks->num_blocks = num_blocks; blocks->macro_blocks = malloc(sizeof(XvMCMacroBlock) * num_blocks); /* Since we don't have a VL type for blocks, set privData to the display so we can catch mismatches */ blocks->privData = display; - + return Success; } Status XvMCDestroyMacroBlocks(Display *display, XvMCMacroBlockArray *blocks) -{ +{ assert(display); assert(blocks); assert(display == blocks->privData); free(blocks->macro_blocks); - + return Success; } - |