diff --git a/src/xvmc/intel_xvmc.c b/src/xvmc/intel_xvmc.c index 8c770cee..30df1efb 100644 --- a/src/xvmc/intel_xvmc.c +++ b/src/xvmc/intel_xvmc.c @@ -1,19 +1,30 @@ - -/* public interface file */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - +/* + * Copyright © 2007 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Authors: + * Zhenyu Wang + * + */ #include "intel_xvmc.h" -#include "xf86dri.h" -#include "driDrawable.h" static struct _intel_xvmc_driver* xvmc_driver = NULL; static int error_base; diff --git a/src/xvmc/intel_xvmc.h b/src/xvmc/intel_xvmc.h index 1d6ff712..fd1326e1 100644 --- a/src/xvmc/intel_xvmc.h +++ b/src/xvmc/intel_xvmc.h @@ -1,4 +1,29 @@ - +/* + * Copyright © 2007 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + * Authors: + * Zhenyu Wang + * + */ #ifndef INTEL_XVMC_H #define INTEL_XVMC_H @@ -16,6 +41,7 @@ #include #include "i830_common.h" #include "i830_hwmc.h" +#include #include #include #include @@ -83,13 +109,21 @@ struct _intel_xvmc_driver { char busID[32]; int fd; /* drm file handler */ void *private; - /* XXX: api hooks */ - int (*init)(/*XXX*/); - void (*fini)(/*XXX*/); - int (*create_context)(Display* display, XvMCContext *context, int priv_count, CARD32 *priv_data); + /* XXX: remove? */ + int (*init)(void); + void (*fini)(void); + + /* driver specific xvmc callbacks */ + int (*create_context)(Display* display, XvMCContext *context, + int priv_count, CARD32 *priv_data); + int (*destroy_context)(Display* display, XvMCContext *context); - int (*create_surface)(Display* display, XvMCContext *context, XvMCSurface *surface); + + int (*create_surface)(Display* display, XvMCContext *context, + XvMCSurface *surface); + int (*destroy_surface)(Display* display, XvMCSurface *surface); + int (*render_surface)(Display *display, XvMCContext *context, unsigned int picture_structure, XvMCSurface *target_surface, @@ -100,13 +134,18 @@ struct _intel_xvmc_driver { unsigned int first_macroblock, XvMCMacroBlockArray *macroblock_array, XvMCBlockArray *blocks); - int (*put_surface)(Display *display,XvMCSurface *surface, + + /* XXX this should be same for all drivers */ + int (*put_surface)(Display *display, XvMCSurface *surface, Drawable draw, short srcx, short srcy, unsigned short srcw, unsigned short srch, short destx, short desty, unsigned short destw, unsigned short desth, int flags); + int (*get_surface_status)(Display *display, XvMCSurface *surface, int *stat); + + /* XXX more for vld */ }; extern struct _intel_xvmc_driver i915_xvmc_mc_driver;