1 /**************************************************************************
3 * Copyright 2009 Younes Manton.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
28 #ifndef xvmc_private_h
29 #define xvmc_private_h
32 #include <X11/extensions/XvMClib.h>
34 #include "pipe/p_video_state.h"
36 #include "util/u_debug.h"
37 #include "util/u_math.h"
39 #include "vl/vl_csc.h"
40 #include "vl/vl_compositor.h"
42 #define BLOCK_SIZE_SAMPLES 64
43 #define BLOCK_SIZE_BYTES (BLOCK_SIZE_SAMPLES * 2)
45 struct pipe_video_codec
;
46 struct pipe_video_buffer
;
48 struct pipe_sampler_view
;
49 struct pipe_fence_handle
;
53 struct vl_screen
*vscreen
;
54 struct pipe_context
*pipe
;
55 struct pipe_video_codec
*decoder
;
57 enum VL_CSC_COLOR_STANDARD color_standard
;
58 struct vl_procamp procamp
;
59 struct vl_compositor compositor
;
60 struct vl_compositor_state cstate
;
62 unsigned short subpicture_max_width
;
63 unsigned short subpicture_max_height
;
69 struct pipe_video_buffer
*video_buffer
;
71 /* nonzero if this picture is already being decoded */
72 unsigned picture_structure
;
76 struct pipe_fence_handle
*fence
;
78 /* The subpicture associated with this surface, if any. */
79 XvMCSubpicture
*subpicture
;
81 /* Some XvMC functions take a surface but not a context,
82 so we keep track of which context each surface belongs to. */
88 struct pipe_sampler_view
*sampler
;
90 /* optional palette for this subpicture */
91 struct pipe_sampler_view
*palette
;
93 struct u_rect src_rect
;
94 struct u_rect dst_rect
;
96 /* The surface this subpicture is currently associated with, if any. */
99 /* Some XvMC functions take a subpicture but not a context,
100 so we keep track of which context each subpicture belongs to. */
101 XvMCContext
*context
;
102 } XvMCSubpicturePrivate
;
109 static inline void XVMC_MSG(int level
, const char *fmt
, ...)
111 static int debug_level
= -1;
113 if (debug_level
== -1) {
114 debug_level
= MAX2(debug_get_num_option("XVMC_DEBUG", 0), 0);
117 if (level
<= debug_level
) {
120 _debug_vprintf(fmt
, ap
);
125 #endif /* xvmc_private_h */