[g3dvl] rework video buffer format handling
[mesa.git] / src / gallium / include / pipe / p_video_context.h
index 8775bbb27056903c4b2121c6ad79f36d3436a6cd..c9e618b60800eca5ff832074b6a6edf201a4fd00 100644 (file)
@@ -62,12 +62,11 @@ struct pipe_video_context
    int (*get_param)(struct pipe_video_context *context, int param);
 
    /**
-    * Check if the given pipe_format is supported as a texture or
-    * drawing surface.
+    * Check if the given pipe_format is supported as a video buffer
     */
    boolean (*is_format_supported)(struct pipe_video_context *context,
                                   enum pipe_format format,
-                                  unsigned usage);
+                                  enum pipe_video_profile profile);
 
    /**
     * create a surface of a texture
@@ -121,7 +120,6 @@ struct pipe_video_context
     */
    struct pipe_video_buffer *(*create_buffer)(struct pipe_video_context *context,
                                               enum pipe_format buffer_format,
-                                              const enum pipe_format resource_formats[3],
                                               enum pipe_video_chroma_format chroma_format,
                                               unsigned width, unsigned height);
 
@@ -160,8 +158,7 @@ struct pipe_video_decoder
    void (*flush_buffer)(struct pipe_video_decode_buffer *decbuf,
                         unsigned num_ycbcr_blocks[3],
                         struct pipe_video_buffer *ref_frames[2],
-                        struct pipe_video_buffer *dst,
-                        struct pipe_fence_handle **fence);
+                        struct pipe_video_buffer *dst);
 };
 
 /**
@@ -179,7 +176,14 @@ struct pipe_video_decode_buffer
    /**
     * map the input buffer into memory before starting decoding
     */
-   void (*map)(struct pipe_video_decode_buffer *decbuf);
+   void (*begin_frame)(struct pipe_video_decode_buffer *decbuf);
+
+   /**
+    * set the quantification matrixes
+    */
+   void (*set_quant_matrix)(struct pipe_video_decode_buffer *decbuf,
+                            const uint8_t intra_matrix[64],
+                            const uint8_t non_intra_matrix[64]);
 
    /**
     * get the pointer where to put the ycbcr blocks of a component
@@ -201,19 +205,18 @@ struct pipe_video_decode_buffer
     */
    struct pipe_motionvector *(*get_mv_stream)(struct pipe_video_decode_buffer *decbuf, int ref_frame);
 
-#if 0
    /**
     * decode a bitstream
     */
    void (*decode_bitstream)(struct pipe_video_decode_buffer *decbuf,
-                            unsigned num_bufs,
-                            struct pipe_buffer **bitstream_buf);
-#endif
+                            unsigned num_bytes, const void *data,
+                            struct pipe_mpeg12_picture_desc *picture,
+                            unsigned num_ycbcr_blocks[3]);
 
    /**
     * unmap decoder buffer before flushing
     */
-   void (*unmap)(struct pipe_video_decode_buffer *decbuf);
+   void (*end_frame)(struct pipe_video_decode_buffer *decbuf);
 };
 
 /**
@@ -236,7 +239,12 @@ struct pipe_video_buffer
    /**
     * get a individual sampler view for each plane
     */
-   struct pipe_sampler_view **(*get_sampler_views)(struct pipe_video_buffer *buffer);
+   struct pipe_sampler_view **(*get_sampler_view_planes)(struct pipe_video_buffer *buffer);
+
+   /**
+    * get a individual sampler view for each component
+    */
+   struct pipe_sampler_view **(*get_sampler_view_components)(struct pipe_video_buffer *buffer);
 
    /**
     * get a individual surfaces for each plane
@@ -261,6 +269,16 @@ struct pipe_video_compositor
     */
    void (*set_csc_matrix)(struct pipe_video_compositor *compositor, const float mat[16]);
 
+   /**
+    * reset dirty area, so it's cleared with the clear colour
+    */
+   void (*reset_dirty_area)(struct pipe_video_compositor *compositor);
+
+   /**
+    * set the clear color
+    */
+   void (*set_clear_color)(struct pipe_video_compositor *compositor, float color[4]);
+
    /**
     * set overlay samplers
     */