[g3dvl] split compositor out of video context
[mesa.git] / src / gallium / auxiliary / vl / vl_compositor.h
index 820c9ef6ddbee9f64ceebdd9d683761e3360b3fc..0e4badb65d2374b1a24d11a6ca462c247a8d691a 100644 (file)
 #ifndef vl_compositor_h
 #define vl_compositor_h
 
-#include <pipe/p_compiler.h>
 #include <pipe/p_state.h>
+#include <pipe/p_video_context.h>
 #include <pipe/p_video_state.h>
-#include "vl_types.h"
 
 struct pipe_context;
-struct keymap;
 
 #define VL_COMPOSITOR_MAX_LAYERS 16
 
+struct vl_compositor_layer
+{
+   void *fs;
+   struct pipe_sampler_view *sampler_views[3];
+   struct pipe_video_rect src_rect;
+   struct pipe_video_rect dst_rect;
+};
+
 struct vl_compositor
 {
+   struct pipe_video_compositor base;
    struct pipe_context *pipe;
 
    struct pipe_framebuffer_state fb_state;
-   struct vertex2f fb_inv_size;
-   void *sampler;
-   struct pipe_sampler_view *sampler_view;
-   void *vertex_shader;
-   struct
-   {
-      void *ycbcr_2_rgb;
-      void *rgb_2_rgb;
-   } fragment_shader;
    struct pipe_viewport_state viewport;
    struct pipe_vertex_buffer vertex_buf;
+   struct pipe_resource *csc_matrix;
+
+   void *sampler;
+   void *blend;
    void *vertex_elems_state;
-   struct pipe_resource *fs_const_buf;
 
-   struct pipe_surface *bg;
-   struct pipe_video_rect bg_src_rect;
-   bool dirty_bg;
-   struct pipe_surface *layers[VL_COMPOSITOR_MAX_LAYERS];
-   struct pipe_video_rect layer_src_rects[VL_COMPOSITOR_MAX_LAYERS];
-   struct pipe_video_rect layer_dst_rects[VL_COMPOSITOR_MAX_LAYERS];
-   unsigned dirty_layers;
+   void *vs;
+   void *fs_video_buffer;
+   void *fs_palette;
+   void *fs_rgba;
 
-   struct keymap *texview_map;
+   unsigned used_layers:VL_COMPOSITOR_MAX_LAYERS;
+   struct vl_compositor_layer layers[VL_COMPOSITOR_MAX_LAYERS];
 };
 
-bool vl_compositor_init(struct vl_compositor *compositor, struct pipe_context *pipe);
-
-void vl_compositor_cleanup(struct vl_compositor *compositor);
-
-void vl_compositor_set_background(struct vl_compositor *compositor,
-                                  struct pipe_surface *bg, struct pipe_video_rect *bg_src_rect);
-
-void vl_compositor_set_layers(struct vl_compositor *compositor,
-                              struct pipe_surface *layers[],
-                              struct pipe_video_rect *src_rects[],
-                              struct pipe_video_rect *dst_rects[],
-                              unsigned num_layers);
-
-void vl_compositor_render(struct vl_compositor          *compositor,
-                          struct pipe_surface           *src_surface,
-                          enum pipe_mpeg12_picture_type picture_type,
-                          /*unsigned                    num_past_surfaces,
-                          struct pipe_surface           *past_surfaces,
-                          unsigned                      num_future_surfaces,
-                          struct pipe_surface           *future_surfaces,*/
-                          struct pipe_video_rect        *src_area,
-                          struct pipe_surface           *dst_surface,
-                          struct pipe_video_rect        *dst_area,
-                          struct pipe_fence_handle      **fence);
-
-void vl_compositor_set_csc_matrix(struct vl_compositor *compositor, const float *mat);
+struct pipe_video_compositor *vl_compositor_init(struct pipe_video_context *vpipe,
+                                                 struct pipe_context *pipe);
 
 #endif /* vl_compositor_h */