* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define vl_compositor_h
#include "pipe/p_state.h"
-#include "pipe/p_video_decoder.h"
+#include "pipe/p_video_codec.h"
#include "pipe/p_video_state.h"
#include "util/u_rect.h"
VL_COMPOSITOR_BOB_BOTTOM
};
+/* clockwise degree */
+enum vl_compositor_rotation
+{
+ VL_COMPOSITOR_ROTATE_0,
+ VL_COMPOSITOR_ROTATE_90,
+ VL_COMPOSITOR_ROTATE_180,
+ VL_COMPOSITOR_ROTATE_270
+};
+
struct vl_compositor_layer
{
bool clearing;
} src, dst;
struct vertex2f zw;
struct vertex4f colors[4];
+ enum vl_compositor_rotation rotate;
};
struct vl_compositor_state
void *vs;
void *fs_video_buffer;
- void *fs_weave;
+ void *fs_weave_rgb;
void *fs_rgba;
+ struct {
+ struct {
+ void *y;
+ void *uv;
+ } weave;
+ struct {
+ void *y;
+ void *uv;
+ } bob;
+ } fs_yuv;
+
struct {
void *rgb;
void *yuv;
} fs_palette;
+
+ struct {
+ void *y;
+ void *uv;
+ } fs_rgb_yuv;
};
/**
/**
* set yuv -> rgba conversion matrix
*/
-void
-vl_compositor_set_csc_matrix(struct vl_compositor_state *settings, const vl_csc_matrix *matrix);
+bool
+vl_compositor_set_csc_matrix(struct vl_compositor_state *settings,
+ const vl_csc_matrix *matrix,
+ float luma_min, float luma_max);
/**
* reset dirty area, so it's cleared with the clear colour
struct u_rect *dst_rect,
struct vertex4f *colors);
+/**
+ * set the layer rotation
+ */
+void
+vl_compositor_set_layer_rotation(struct vl_compositor_state *state,
+ unsigned layer,
+ enum vl_compositor_rotation rotate);
+
+/**
+ * deinterlace yuv buffer with full abilities
+ */
+void
+vl_compositor_yuv_deint_full(struct vl_compositor_state *state,
+ struct vl_compositor *compositor,
+ struct pipe_video_buffer *src,
+ struct pipe_video_buffer *dst,
+ struct u_rect *src_rect,
+ struct u_rect *dst_rect,
+ enum vl_compositor_deinterlace deinterlace);
+
+/**
++ * convert rgb to yuv
++ */
+void
+vl_compositor_convert_rgb_to_yuv(struct vl_compositor_state *state,
+ struct vl_compositor *compositor,
+ unsigned layer,
+ struct pipe_resource *src_res,
+ struct pipe_video_buffer *dst,
+ struct u_rect *src_rect,
+ struct u_rect *dst_rect);
+
/*@}*/
/**
vl_compositor_render(struct vl_compositor_state *state,
struct vl_compositor *compositor,
struct pipe_surface *dst_surface,
- struct u_rect *dirty_area);
+ struct u_rect *dirty_area,
+ bool clear_dirty);
/**
* destroy this compositor