diff options
author | Christian König <[email protected]> | 2014-07-04 12:44:36 -0400 |
---|---|---|
committer | Leo Liu <[email protected]> | 2014-10-01 13:21:36 -0400 |
commit | 1be55158381f509d420e42f40018ec95fe329f5b (patch) | |
tree | dda90c46409f8af047d62ee595e1caa53d7298e1 /src/gallium/state_trackers/va/va_private.h | |
parent | 2825ef3abf29b152b12faef8cd5a373c71b9fbaf (diff) |
st/va: implement Context Surface and Buffer
This patch implements context managements, relate it HW driver,
functions for video surface managements, and functions for
application data memory buffer managements.
implemented functions:
vlVa(Create|Destroy)Context
vlVa(Create|Destroy|Put)Surfaces
vlVa(Create|Destroy)Buffer
Signed-off-by: Christian König <[email protected]>
Signed-off-by: Leo Liu <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/va/va_private.h')
-rw-r--r-- | src/gallium/state_trackers/va/va_private.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/va/va_private.h b/src/gallium/state_trackers/va/va_private.h index 130d2dff1a0..7ba5bf4996d 100644 --- a/src/gallium/state_trackers/va/va_private.h +++ b/src/gallium/state_trackers/va/va_private.h @@ -35,10 +35,30 @@ #include <va/va_backend.h> #include "pipe/p_video_enums.h" +#include "pipe/p_video_codec.h" + +#include "vl/vl_compositor.h" +#include "vl/vl_csc.h" #define VL_VA_DRIVER(ctx) ((vlVaDriver *)ctx->pDriverData) #define VL_VA_PSCREEN(ctx) (VL_VA_DRIVER(ctx)->vscreen->pscreen) +static inline enum pipe_video_chroma_format +ChromaToPipe(int format) +{ + switch (format) { + case VA_RT_FORMAT_YUV420: + return PIPE_VIDEO_CHROMA_FORMAT_420; + case VA_RT_FORMAT_YUV422: + return PIPE_VIDEO_CHROMA_FORMAT_422; + case VA_RT_FORMAT_YUV444: + return PIPE_VIDEO_CHROMA_FORMAT_444; + default: + assert(0); + return PIPE_VIDEO_CHROMA_FORMAT_420; + } +} + static inline VAProfile PipeToProfile(enum pipe_video_profile profile) { @@ -102,8 +122,36 @@ ProfileToPipe(VAProfile profile) typedef struct { struct vl_screen *vscreen; + struct pipe_context *pipe; + struct handle_table *htab; + struct vl_compositor compositor; + struct vl_compositor_state cstate; + vl_csc_matrix csc; } vlVaDriver; +typedef struct { + struct pipe_video_codec *decoder; + union { + struct pipe_picture_desc base; + struct pipe_mpeg12_picture_desc mpeg12; + struct pipe_mpeg4_picture_desc mpeg4; + struct pipe_vc1_picture_desc vc1; + struct pipe_h264_picture_desc h264; + } desc; +} vlVaContext; + +typedef struct { + VABufferType type; + unsigned int size; + unsigned int num_elements; + void *data; +} vlVaBuffer; + +typedef struct { + struct pipe_video_buffer templat, *buffer; + struct pipe_fence_handle *fence; +} vlVaSurface; + // Public functions: VAStatus VA_DRIVER_INIT_FUNC(VADriverContextP ctx); |