Path: blob/21.2-virgl/src/gallium/frontends/xvmc/xvmc_private.h
4565 views
/**************************************************************************1*2* Copyright 2009 Younes Manton.3* All Rights Reserved.4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the7* "Software"), to deal in the Software without restriction, including8* without limitation the rights to use, copy, modify, merge, publish,9* distribute, sub license, and/or sell copies of the Software, and to10* permit persons to whom the Software is furnished to do so, subject to11* the following conditions:12*13* The above copyright notice and this permission notice (including the14* next paragraph) shall be included in all copies or substantial portions15* of the Software.16*17* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS18* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF19* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.20* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR21* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,22* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE23* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.24*25**************************************************************************/2627#ifndef xvmc_private_h28#define xvmc_private_h2930#include <X11/Xlib.h>31#include <X11/extensions/XvMClib.h>3233#include "pipe/p_video_state.h"3435#include "util/u_debug.h"36#include "util/u_math.h"3738#include "vl/vl_csc.h"39#include "vl/vl_compositor.h"4041#define BLOCK_SIZE_SAMPLES 6442#define BLOCK_SIZE_BYTES (BLOCK_SIZE_SAMPLES * 2)4344struct pipe_video_codec;45struct pipe_video_buffer;4647struct pipe_sampler_view;48struct pipe_fence_handle;4950typedef struct51{52struct vl_screen *vscreen;53struct pipe_context *pipe;54struct pipe_video_codec *decoder;5556enum VL_CSC_COLOR_STANDARD color_standard;57struct vl_procamp procamp;58struct vl_compositor compositor;59struct vl_compositor_state cstate;6061unsigned short subpicture_max_width;62unsigned short subpicture_max_height;6364} XvMCContextPrivate;6566typedef struct67{68struct pipe_video_buffer *video_buffer;6970/* nonzero if this picture is already being decoded */71unsigned picture_structure;7273XvMCSurface *ref[2];7475struct pipe_fence_handle *fence;7677/* The subpicture associated with this surface, if any. */78XvMCSubpicture *subpicture;7980/* Some XvMC functions take a surface but not a context,81so we keep track of which context each surface belongs to. */82XvMCContext *context;83} XvMCSurfacePrivate;8485typedef struct86{87struct pipe_sampler_view *sampler;8889/* optional palette for this subpicture */90struct pipe_sampler_view *palette;9192struct u_rect src_rect;93struct u_rect dst_rect;9495/* The surface this subpicture is currently associated with, if any. */96XvMCSurface *surface;9798/* Some XvMC functions take a subpicture but not a context,99so we keep track of which context each subpicture belongs to. */100XvMCContext *context;101} XvMCSubpicturePrivate;102103#define XVMC_OUT 0104#define XVMC_ERR 1105#define XVMC_WARN 2106#define XVMC_TRACE 3107108static inline void XVMC_MSG(int level, const char *fmt, ...)109{110static int debug_level = -1;111112if (debug_level == -1) {113debug_level = MAX2(debug_get_num_option("XVMC_DEBUG", 0), 0);114}115116if (level <= debug_level) {117va_list ap;118va_start(ap, fmt);119_debug_vprintf(fmt, ap);120va_end(ap);121}122}123124#endif /* xvmc_private_h */125126127