vdpau: remove the unused and incomplete mpeg2 parser
[mesa.git] / src / gallium / state_trackers / vdpau / vdpau_private.h
index 566c99266eddb24fea77afaf4449fe5c9cf52976..5931a2dda344c3d402a1563d18747873290153b4 100644 (file)
@@ -1,6 +1,6 @@
 /**************************************************************************
  *
- * Copyright 2010 Younes Manton.
+ * Copyright 2010 Younes Manton & Thomas Balling Sørensen.
  * All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -28,8 +28,8 @@
 #ifndef VDPAU_PRIVATE_H
 #define VDPAU_PRIVATE_H
 
-
 #include <vdpau/vdpau.h>
+#include <vdpau/vdpau_x11.h>
 #include <pipe/p_compiler.h>
 #include <pipe/p_video_context.h>
 #include <vl_winsys.h>
@@ -41,7 +41,8 @@
 #define INFORMATION_STRING TOSTRING(INFORMATION)
 #define VL_HANDLES
 
-static enum pipe_video_chroma_format TypeToPipe(VdpChromaType vdpau_type)
+static inline enum pipe_video_chroma_format
+ChromaToPipe(VdpChromaType vdpau_type)
 {
    switch (vdpau_type) {
       case VDP_CHROMA_TYPE_420:
@@ -57,7 +58,8 @@ static enum pipe_video_chroma_format TypeToPipe(VdpChromaType vdpau_type)
    return -1;
 }
 
-static VdpChromaType PipeToType(enum pipe_video_chroma_format pipe_type)
+static inline VdpChromaType
+PipeToChroma(enum pipe_video_chroma_format pipe_type)
 {
    switch (pipe_type) {
       case PIPE_VIDEO_CHROMA_FORMAT_420:
@@ -73,7 +75,9 @@ static VdpChromaType PipeToType(enum pipe_video_chroma_format pipe_type)
    return -1;
 }
 
-static enum pipe_format FormatToPipe(VdpYCbCrFormat vdpau_format)
+
+static inline enum pipe_format
+FormatToPipe(VdpYCbCrFormat vdpau_format)
 {
    switch (vdpau_format) {
       case VDP_YCBCR_FORMAT_NV12:
@@ -95,7 +99,29 @@ static enum pipe_format FormatToPipe(VdpYCbCrFormat vdpau_format)
    return -1;
 }
 
-static VdpYCbCrFormat PipeToFormat(enum pipe_format p_format)
+static inline enum pipe_format
+FormatRGBAToPipe(VdpRGBAFormat vdpau_format)
+{
+   switch (vdpau_format) {
+      case VDP_RGBA_FORMAT_A8:
+         return PIPE_FORMAT_A8_UNORM;
+      case VDP_RGBA_FORMAT_B10G10R10A2:
+         return PIPE_FORMAT_B10G10R10A2_UNORM;
+      case VDP_RGBA_FORMAT_B8G8R8A8:
+         return PIPE_FORMAT_B8G8R8A8_UNORM;
+      case VDP_RGBA_FORMAT_R10G10B10A2:
+         return PIPE_FORMAT_R10G10B10A2_UNORM;
+      case VDP_RGBA_FORMAT_R8G8B8A8:
+         return PIPE_FORMAT_R8G8B8A8_UNORM;
+      default:
+         assert(0);
+   }
+
+   return -1;
+}
+
+static inline VdpYCbCrFormat
+PipeToFormat(enum pipe_format p_format)
 {
    switch (p_format) {
       case PIPE_FORMAT_NV12:
@@ -117,7 +143,8 @@ static VdpYCbCrFormat PipeToFormat(enum pipe_format p_format)
    return -1;
 }
 
-static enum pipe_video_profile ProfileToPipe(VdpDecoderProfile vdpau_profile)
+static inline enum pipe_video_profile
+ProfileToPipe(VdpDecoderProfile vdpau_profile)
 {
    switch (vdpau_profile) {
       case VDP_DECODER_PROFILE_MPEG1:
@@ -133,36 +160,55 @@ static enum pipe_video_profile ProfileToPipe(VdpDecoderProfile vdpau_profile)
       case VDP_DECODER_PROFILE_H264_HIGH:
             return PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH;
       default:
-         PIPE_VIDEO_PROFILE_UNKNOWN;
+         return PIPE_VIDEO_PROFILE_UNKNOWN;
    }
-
-   return -1;
 }
 
 typedef struct
 {
-   void *display;
+   Display *display;
    int screen;
+   struct vl_screen *vscreen;
+   struct vl_context *context;
 } vlVdpDevice;
 
 typedef struct
 {
    vlVdpDevice *device;
-   uint32_t width;
-   uint32_t height;
-   uint32_t pitch;
-   struct pipe_surface *psurface;
-   enum pipe_format format;
-   enum pipe_video_chroma_format chroma_format;
-   uint8_t *data;
+   Drawable drawable;
+} vlVdpPresentationQueueTarget;
+
+typedef struct
+{
+   vlVdpDevice *device;
+   Drawable drawable;
+   struct pipe_video_compositor *compositor;
+} vlVdpPresentationQueue;
+
+typedef struct
+{
+   vlVdpDevice *device;
+   struct pipe_video_compositor *compositor;
+} vlVdpVideoMixer;
+
+typedef struct
+{
+   vlVdpDevice *device;
+   struct pipe_video_buffer *video_buffer;
 } vlVdpSurface;
 
 typedef struct
 {
-       vlVdpDevice *device;
-       struct vl_screen *vlscreen;
-    struct vl_context *vctx;
-       enum pipe_video_chroma_format chroma_format;
+   vlVdpDevice *device;
+   struct pipe_surface *surface;
+   struct pipe_sampler_view *sampler_view;
+} vlVdpOutputSurface;
+
+typedef struct
+{
+   vlVdpDevice *device;
+   struct pipe_video_decoder *decoder;
+   struct pipe_video_decode_buffer *buffer;
 } vlVdpDecoder;
 
 typedef uint32_t vlHandle;
@@ -171,8 +217,16 @@ boolean vlCreateHTAB(void);
 void vlDestroyHTAB(void);
 vlHandle vlAddDataHTAB(void *data);
 void* vlGetDataHTAB(vlHandle handle);
+void vlRemoveDataHTAB(vlHandle handle);
+
 boolean vlGetFuncFTAB(VdpFuncId function_id, void **func);
 
+/* Public functions */
+VdpDeviceCreateX11 vdp_imp_device_create_x11;
+VdpPresentationQueueTargetCreateX11 vlVdpPresentationQueueTargetCreateX11;
+
+/* Internal function pointers */
+VdpGetErrorString vlVdpGetErrorString;
 VdpDeviceDestroy vlVdpDeviceDestroy;
 VdpGetProcAddress vlVdpGetProcAddress;
 VdpGetApiVersion vlVdpGetApiVersion;
@@ -182,6 +236,7 @@ VdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities vlVdpVideoSurfaceQueryGetPutBits
 VdpDecoderQueryCapabilities vlVdpDecoderQueryCapabilities;
 VdpOutputSurfaceQueryCapabilities vlVdpOutputSurfaceQueryCapabilities;
 VdpOutputSurfaceQueryGetPutBitsNativeCapabilities vlVdpOutputSurfaceQueryGetPutBitsNativeCapabilities;
+VdpOutputSurfaceQueryPutBitsIndexedCapabilities vlVdpOutputSurfaceQueryPutBitsIndexedCapabilities;
 VdpOutputSurfaceQueryPutBitsYCbCrCapabilities vlVdpOutputSurfaceQueryPutBitsYCbCrCapabilities;
 VdpBitmapSurfaceQueryCapabilities vlVdpBitmapSurfaceQueryCapabilities;
 VdpVideoMixerQueryFeatureSupport vlVdpVideoMixerQueryFeatureSupport;
@@ -196,6 +251,41 @@ VdpVideoSurfaceGetBitsYCbCr vlVdpVideoSurfaceGetBitsYCbCr;
 VdpVideoSurfacePutBitsYCbCr vlVdpVideoSurfacePutBitsYCbCr;
 VdpDecoderCreate vlVdpDecoderCreate;
 VdpDecoderDestroy vlVdpDecoderDestroy;
+VdpDecoderGetParameters vlVdpDecoderGetParameters;
 VdpDecoderRender vlVdpDecoderRender;
+VdpOutputSurfaceCreate vlVdpOutputSurfaceCreate;
+VdpOutputSurfaceDestroy vlVdpOutputSurfaceDestroy;
+VdpOutputSurfaceGetParameters vlVdpOutputSurfaceGetParameters;
+VdpOutputSurfaceGetBitsNative vlVdpOutputSurfaceGetBitsNative;
+VdpOutputSurfacePutBitsNative vlVdpOutputSurfacePutBitsNative;
+VdpOutputSurfacePutBitsIndexed vlVdpOutputSurfacePutBitsIndexed;
+VdpOutputSurfacePutBitsYCbCr vlVdpOutputSurfacePutBitsYCbCr;
+VdpOutputSurfaceRenderOutputSurface vlVdpOutputSurfaceRenderOutputSurface;
+VdpOutputSurfaceRenderBitmapSurface vlVdpOutputSurfaceRenderBitmapSurface;
+VdpBitmapSurfaceCreate vlVdpBitmapSurfaceCreate;
+VdpBitmapSurfaceDestroy vlVdpBitmapSurfaceDestroy;
+VdpBitmapSurfaceGetParameters vlVdpBitmapSurfaceGetParameters;
+VdpBitmapSurfacePutBitsNative vlVdpBitmapSurfacePutBitsNative;
+VdpPresentationQueueTargetDestroy vlVdpPresentationQueueTargetDestroy;
+VdpPresentationQueueCreate vlVdpPresentationQueueCreate;
+VdpPresentationQueueDestroy vlVdpPresentationQueueDestroy;
+VdpPresentationQueueSetBackgroundColor vlVdpPresentationQueueSetBackgroundColor;
+VdpPresentationQueueGetBackgroundColor vlVdpPresentationQueueGetBackgroundColor;
+VdpPresentationQueueGetTime vlVdpPresentationQueueGetTime;
+VdpPresentationQueueDisplay vlVdpPresentationQueueDisplay;
+VdpPresentationQueueBlockUntilSurfaceIdle vlVdpPresentationQueueBlockUntilSurfaceIdle;
+VdpPresentationQueueQuerySurfaceStatus vlVdpPresentationQueueQuerySurfaceStatus;
+VdpPreemptionCallback vlVdpPreemptionCallback;
+VdpPreemptionCallbackRegister vlVdpPreemptionCallbackRegister;
+VdpVideoMixerSetFeatureEnables vlVdpVideoMixerSetFeatureEnables;
+VdpVideoMixerCreate vlVdpVideoMixerCreate;
+VdpVideoMixerRender vlVdpVideoMixerRender;
+VdpVideoMixerSetAttributeValues vlVdpVideoMixerSetAttributeValues;
+VdpVideoMixerGetFeatureSupport vlVdpVideoMixerGetFeatureSupport;
+VdpVideoMixerGetFeatureEnables vlVdpVideoMixerGetFeatureEnables;
+VdpVideoMixerGetParameterValues vlVdpVideoMixerGetParameterValues;
+VdpVideoMixerGetAttributeValues vlVdpVideoMixerGetAttributeValues;
+VdpVideoMixerDestroy vlVdpVideoMixerDestroy;
+VdpGenerateCSCMatrix vlVdpGenerateCSCMatrix;
 
-#endif // VDPAU_PRIVATE_H
\ No newline at end of file
+#endif // VDPAU_PRIVATE_H