diff options
author | Younes Manton <[email protected]> | 2009-09-27 20:18:02 -0400 |
---|---|---|
committer | Younes Manton <[email protected]> | 2009-09-27 20:18:02 -0400 |
commit | e44c85637a3298918e292e9ddba812856cf92924 (patch) | |
tree | 25e881754374bebd8123fa51d889c070489a3320 /src/xvmc/subpicture.c | |
parent | f547472bfa0a797adacc2a7688b4c1ba65381a80 (diff) |
g3dvl: Implement XvMC using pipe_video_context.
Diffstat (limited to 'src/xvmc/subpicture.c')
-rw-r--r-- | src/xvmc/subpicture.c | 322 |
1 files changed, 136 insertions, 186 deletions
diff --git a/src/xvmc/subpicture.c b/src/xvmc/subpicture.c index 09e9c98e6af..78ba618f5ab 100644 --- a/src/xvmc/subpicture.c +++ b/src/xvmc/subpicture.c @@ -1,218 +1,168 @@ #include <assert.h> -#include <X11/Xlib.h> -#include <X11/extensions/Xvlib.h> -#include <X11/extensions/XvMC.h> #include <X11/Xlibint.h> +#include <X11/extensions/XvMClib.h> -Status XvMCCreateSubpicture -( - Display *display, - XvMCContext *context, - XvMCSubpicture *subpicture, - unsigned short width, - unsigned short height, - int xvimage_id -) +Status XvMCCreateSubpicture(Display *dpy, XvMCContext *context, XvMCSubpicture *subpicture, + unsigned short width, unsigned short height, int xvimage_id) { - Display *dpy = display; - assert(display); - - if (!context) - return XvMCBadContext; - - assert(subpicture); - - if (width > 2048 || height > 2048) - return BadValue; - - if (xvimage_id != 123) - return BadMatch; - - subpicture->subpicture_id = XAllocID(display); - subpicture->context_id = context->context_id; - subpicture->xvimage_id = xvimage_id; - subpicture->width = width; - subpicture->height = height; - subpicture->num_palette_entries = 0; - subpicture->entry_bytes = 0; - subpicture->component_order[0] = 0; - subpicture->component_order[1] = 0; - subpicture->component_order[2] = 0; - subpicture->component_order[3] = 0; - /* TODO: subpicture->privData = ;*/ - - SyncHandle(); - return Success; + assert(dpy); + + if (!context) + return XvMCBadContext; + + assert(subpicture); + + /*if (width > || height > ) + return BadValue;*/ + + /*if (xvimage_id != ) + return BadMatch;*/ + + subpicture->subpicture_id = XAllocID(dpy); + subpicture->context_id = context->context_id; + subpicture->xvimage_id = xvimage_id; + subpicture->width = width; + subpicture->height = height; + subpicture->num_palette_entries = 0; + subpicture->entry_bytes = 0; + subpicture->component_order[0] = 0; + subpicture->component_order[1] = 0; + subpicture->component_order[2] = 0; + subpicture->component_order[3] = 0; + /* TODO: subpicture->privData = ;*/ + + SyncHandle(); + + return Success; } -Status XvMCClearSubpicture -( - Display *display, - XvMCSubpicture *subpicture, - short x, - short y, - unsigned short width, - unsigned short height, - unsigned int color -) +Status XvMCClearSubpicture(Display *dpy, XvMCSubpicture *subpicture, short x, short y, + unsigned short width, unsigned short height, unsigned int color) { - assert(display); - - if (!subpicture) - return XvMCBadSubpicture; - - /* TODO: Assert clear rect is within bounds? Or clip? */ - - return Success; + assert(dpy); + + if (!subpicture) + return XvMCBadSubpicture; + + /* TODO: Assert clear rect is within bounds? Or clip? */ + + return Success; } -Status XvMCCompositeSubpicture -( - Display *display, - XvMCSubpicture *subpicture, - XvImage *image, - short srcx, - short srcy, - unsigned short width, - unsigned short height, - short dstx, - short dsty -) +Status XvMCCompositeSubpicture(Display *dpy, XvMCSubpicture *subpicture, XvImage *image, + short srcx, short srcy, unsigned short width, unsigned short height, + short dstx, short dsty) { - assert(display); - - if (!subpicture) - return XvMCBadSubpicture; - - assert(image); - - if (subpicture->xvimage_id != image->id) - return BadMatch; - - /* TODO: Assert rects are within bounds? Or clip? */ - - return Success; + assert(dpy); + + if (!subpicture) + return XvMCBadSubpicture; + + assert(image); + + if (subpicture->xvimage_id != image->id) + return BadMatch; + + /* TODO: Assert rects are within bounds? Or clip? */ + + return Success; } -Status XvMCDestroySubpicture(Display *display, XvMCSubpicture *subpicture) +Status XvMCDestroySubpicture(Display *dpy, XvMCSubpicture *subpicture) { - assert(display); - - if (!subpicture) - return XvMCBadSubpicture; - - return BadImplementation; + assert(dpy); + + if (!subpicture) + return XvMCBadSubpicture; + + return BadImplementation; } -Status XvMCSetSubpicturePalette(Display *display, XvMCSubpicture *subpicture, unsigned char *palette) +Status XvMCSetSubpicturePalette(Display *dpy, XvMCSubpicture *subpicture, unsigned char *palette) { - assert(display); - - if (!subpicture) - return XvMCBadSubpicture; - - assert(palette); - - /* We don't support paletted subpictures */ - return BadMatch; + assert(dpy); + + if (!subpicture) + return XvMCBadSubpicture; + + assert(palette); + + /* We don't support paletted subpictures */ + return BadMatch; } -Status XvMCBlendSubpicture -( - Display *display, - XvMCSurface *target_surface, - XvMCSubpicture *subpicture, - short subx, - short suby, - unsigned short subw, - unsigned short subh, - short surfx, - short surfy, - unsigned short surfw, - unsigned short surfh -) +Status XvMCBlendSubpicture(Display *dpy, XvMCSurface *target_surface, XvMCSubpicture *subpicture, + short subx, short suby, unsigned short subw, unsigned short subh, + short surfx, short surfy, unsigned short surfw, unsigned short surfh) { - assert(display); - - if (!target_surface) - return XvMCBadSurface; - - if (!subpicture) - return XvMCBadSubpicture; - - if (target_surface->context_id != subpicture->context_id) - return BadMatch; - - /* TODO: Assert rects are within bounds? Or clip? */ - return Success; + assert(dpy); + + if (!target_surface) + return XvMCBadSurface; + + if (!subpicture) + return XvMCBadSubpicture; + + if (target_surface->context_id != subpicture->context_id) + return BadMatch; + + /* TODO: Assert rects are within bounds? Or clip? */ + return Success; } -Status XvMCBlendSubpicture2 -( - Display *display, - XvMCSurface *source_surface, - XvMCSurface *target_surface, - XvMCSubpicture *subpicture, - short subx, - short suby, - unsigned short subw, - unsigned short subh, - short surfx, - short surfy, - unsigned short surfw, - unsigned short surfh -) +Status XvMCBlendSubpicture2(Display *dpy, XvMCSurface *source_surface, XvMCSurface *target_surface, + XvMCSubpicture *subpicture, short subx, short suby, unsigned short subw, unsigned short subh, + short surfx, short surfy, unsigned short surfw, unsigned short surfh) { - assert(display); - - if (!source_surface || !target_surface) - return XvMCBadSurface; - - if (!subpicture) - return XvMCBadSubpicture; - - if (source_surface->context_id != subpicture->context_id) - return BadMatch; - - if (source_surface->context_id != subpicture->context_id) - return BadMatch; - - /* TODO: Assert rects are within bounds? Or clip? */ - return Success; + assert(dpy); + + if (!source_surface || !target_surface) + return XvMCBadSurface; + + if (!subpicture) + return XvMCBadSubpicture; + + if (source_surface->context_id != subpicture->context_id) + return BadMatch; + + if (source_surface->context_id != subpicture->context_id) + return BadMatch; + + /* TODO: Assert rects are within bounds? Or clip? */ + return Success; } -Status XvMCSyncSubpicture(Display *display, XvMCSubpicture *subpicture) +Status XvMCSyncSubpicture(Display *dpy, XvMCSubpicture *subpicture) { - assert(display); - - if (!subpicture) - return XvMCBadSubpicture; - - return Success; + assert(dpy); + + if (!subpicture) + return XvMCBadSubpicture; + + return Success; } -Status XvMCFlushSubpicture(Display *display, XvMCSubpicture *subpicture) +Status XvMCFlushSubpicture(Display *dpy, XvMCSubpicture *subpicture) { - assert(display); - - if (!subpicture) - return XvMCBadSubpicture; - - return Success; + assert(dpy); + + if (!subpicture) + return XvMCBadSubpicture; + + return Success; } -Status XvMCGetSubpictureStatus(Display *display, XvMCSubpicture *subpicture, int *status) +Status XvMCGetSubpictureStatus(Display *dpy, XvMCSubpicture *subpicture, int *status) { - assert(display); - - if (!subpicture) - return XvMCBadSubpicture; - - assert(status); - - /* TODO */ - *status = 0; - - return Success; -} + assert(dpy); + if (!subpicture) + return XvMCBadSubpicture; + + assert(status); + + /* TODO */ + *status = 0; + + return Success; +} |