g3dvl: pipe_video_context interface, softpipe impl, auxiliary libs
[profile/ivi/mesa.git] / src / gallium / include / pipe / p_video_context.h
1 #ifndef PIPE_VIDEO_CONTEXT_H
2 #define PIPE_VIDEO_CONTEXT_H
3
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
7
8 #include <pipe/p_video_state.h>
9
10 struct pipe_screen;
11 struct pipe_buffer;
12 struct pipe_surface;
13 struct pipe_video_surface;
14 struct pipe_macroblock;
15 struct pipe_picture_desc;
16 struct pipe_fence_handle;
17
18 /**
19  * Gallium video rendering context
20  */
21 struct pipe_video_context
22 {
23    struct pipe_screen *screen;
24    enum pipe_video_profile profile;
25    enum pipe_video_chroma_format chroma_format;
26    unsigned width;
27    unsigned height;
28
29    void *priv; /**< context private data (for DRI for example) */
30
31    void (*destroy)(struct pipe_video_context *vpipe);
32
33    /**
34     * Picture decoding and displaying
35     */
36    /*@{*/
37    void (*decode_bitstream)(struct pipe_video_context *vpipe,
38                             unsigned num_bufs,
39                             struct pipe_buffer **bitstream_buf);
40
41    void (*decode_macroblocks)(struct pipe_video_context *vpipe,
42                               struct pipe_video_surface *past,
43                               struct pipe_video_surface *future,
44                               unsigned num_macroblocks,
45                               struct pipe_macroblock *macroblocks,
46                               struct pipe_fence_handle **fence);
47
48    void (*clear_surface)(struct pipe_video_context *vpipe,
49                          unsigned x, unsigned y,
50                          unsigned width, unsigned height,
51                          unsigned value,
52                          struct pipe_surface *surface);
53
54    void (*render_picture)(struct pipe_video_context     *vpipe,
55                           /*struct pipe_surface         *backround,
56                           struct pipe_video_rect        *backround_area,*/
57                           struct pipe_video_surface     *src_surface,
58                           enum pipe_mpeg12_picture_type picture_type,
59                           /*unsigned                    num_past_surfaces,
60                           struct pipe_video_surface     *past_surfaces,
61                           unsigned                      num_future_surfaces,
62                           struct pipe_video_surface     *future_surfaces,*/
63                           struct pipe_video_rect        *src_area,
64                           struct pipe_surface           *dst_surface,
65                           struct pipe_video_rect        *dst_area,
66                           /*unsigned                      num_layers,
67                           struct pipe_texture           *layers,
68                           struct pipe_video_rect        *layer_src_areas,
69                           struct pipe_video_rect        *layer_dst_areas,*/
70                           struct pipe_fence_handle      **fence);
71    /*@}*/
72
73    /**
74     * Parameter-like states (or properties)
75     */
76    /*@{*/
77    void (*set_picture_desc)(struct pipe_video_context *vpipe,
78                             const struct pipe_picture_desc *desc);
79
80    void (*set_decode_target)(struct pipe_video_context *vpipe,
81                              struct pipe_video_surface *dt);
82
83    /* TODO: Interface for CSC matrix, scaling modes, post-processing, etc. */
84    /*@}*/
85 };
86
87
88 #ifdef __cplusplus
89 }
90 #endif
91
92 #endif /* PIPE_VIDEO_CONTEXT_H */