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 TUNGSTEN GRAPHICS 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 PIPE_VIDEO_CONTEXT_H
29 #define PIPE_VIDEO_CONTEXT_H
35 #include <pipe/p_video_state.h>
40 struct pipe_video_surface;
41 struct pipe_macroblock;
42 struct pipe_picture_desc;
43 struct pipe_fence_handle;
46 * Gallium video rendering context
48 struct pipe_video_context
50 struct pipe_screen *screen;
51 enum pipe_video_profile profile;
52 enum pipe_video_chroma_format chroma_format;
56 void *priv; /**< context private data (for DRI for example) */
58 void (*destroy)(struct pipe_video_context *vpipe);
61 * Picture decoding and displaying
64 void (*decode_bitstream)(struct pipe_video_context *vpipe,
66 struct pipe_buffer **bitstream_buf);
68 void (*decode_macroblocks)(struct pipe_video_context *vpipe,
69 struct pipe_video_surface *past,
70 struct pipe_video_surface *future,
71 unsigned num_macroblocks,
72 struct pipe_macroblock *macroblocks,
73 struct pipe_fence_handle **fence);
75 void (*clear_surface)(struct pipe_video_context *vpipe,
76 unsigned x, unsigned y,
77 unsigned width, unsigned height,
79 struct pipe_surface *surface);
81 void (*render_picture)(struct pipe_video_context *vpipe,
82 /*struct pipe_surface *backround,
83 struct pipe_video_rect *backround_area,*/
84 struct pipe_video_surface *src_surface,
85 enum pipe_mpeg12_picture_type picture_type,
86 /*unsigned num_past_surfaces,
87 struct pipe_video_surface *past_surfaces,
88 unsigned num_future_surfaces,
89 struct pipe_video_surface *future_surfaces,*/
90 struct pipe_video_rect *src_area,
91 struct pipe_surface *dst_surface,
92 struct pipe_video_rect *dst_area,
93 /*unsigned num_layers,
94 struct pipe_texture *layers,
95 struct pipe_video_rect *layer_src_areas,
96 struct pipe_video_rect *layer_dst_areas,*/
97 struct pipe_fence_handle **fence);
101 * Parameter-like states (or properties)
104 void (*set_picture_desc)(struct pipe_video_context *vpipe,
105 const struct pipe_picture_desc *desc);
107 void (*set_decode_target)(struct pipe_video_context *vpipe,
108 struct pipe_video_surface *dt);
110 void (*set_csc_matrix)(struct pipe_video_context *vpipe, const float *mat);
112 /* TODO: Interface for scaling modes, post-processing, etc. */
121 #endif /* PIPE_VIDEO_CONTEXT_H */