#include <vdpau/vdpau_x11.h>
#include "pipe/p_compiler.h"
-#include "pipe/p_video_decoder.h"
+#include "pipe/p_video_codec.h"
#include "util/u_debug.h"
#include "util/u_rect.h"
#include "vl/vl_csc.h"
#include "vl/vl_matrix_filter.h"
#include "vl/vl_median_filter.h"
-
-#include "vl_winsys.h"
+#include "vl/vl_winsys.h"
/* Full VDPAU API documentation available at :
* ftp://download.nvidia.com/XFree86/vdpau/doxygen/html/index.html */
return -1;
}
+static inline enum pipe_video_chroma_format
+FormatYCBCRToPipeChroma(VdpYCbCrFormat vdpau_format)
+{
+ switch (vdpau_format) {
+ case VDP_YCBCR_FORMAT_NV12:
+ return PIPE_VIDEO_CHROMA_FORMAT_420;
+ case VDP_YCBCR_FORMAT_YV12:
+ return PIPE_VIDEO_CHROMA_FORMAT_420;
+ case VDP_YCBCR_FORMAT_UYVY:
+ return PIPE_VIDEO_CHROMA_FORMAT_422;
+ case VDP_YCBCR_FORMAT_YUYV:
+ return PIPE_VIDEO_CHROMA_FORMAT_422;
+ case VDP_YCBCR_FORMAT_Y8U8V8A8:
+ return PIPE_VIDEO_CHROMA_FORMAT_444;
+ case VDP_YCBCR_FORMAT_V8U8Y8A8:
+ return PIPE_VIDEO_CHROMA_FORMAT_444;
+ default:
+ assert(0);
+ }
+
+ return PIPE_FORMAT_NONE;
+}
+
static inline enum pipe_format
FormatYCBCRToPipe(VdpYCbCrFormat vdpau_format)
{
return PIPE_FORMAT_UYVY;
case VDP_YCBCR_FORMAT_YUYV:
return PIPE_FORMAT_YUYV;
- case VDP_YCBCR_FORMAT_Y8U8V8A8: /* Not defined in p_format.h */
- return PIPE_FORMAT_NONE;
+ case VDP_YCBCR_FORMAT_Y8U8V8A8:
+ return PIPE_FORMAT_R8G8B8A8_UNORM;
case VDP_YCBCR_FORMAT_V8U8Y8A8:
- return PIPE_FORMAT_VUYA;
+ return PIPE_FORMAT_B8G8R8A8_UNORM;
default:
assert(0);
}
return VDP_YCBCR_FORMAT_UYVY;
case PIPE_FORMAT_YUYV:
return VDP_YCBCR_FORMAT_YUYV;
- //case PIPE_FORMAT_YUVA:
- // return VDP_YCBCR_FORMAT_Y8U8V8A8;
- case PIPE_FORMAT_VUYA:
+ case PIPE_FORMAT_R8G8B8A8_UNORM:
+ return VDP_YCBCR_FORMAT_Y8U8V8A8;
+ case PIPE_FORMAT_B8G8R8A8_UNORM:
return VDP_YCBCR_FORMAT_V8U8Y8A8;
default:
assert(0);
} delayed_rendering;
} vlVdpDevice;
-typedef struct
-{
- vlVdpDevice *device;
- Drawable drawable;
-} vlVdpPresentationQueueTarget;
-
-typedef struct
-{
- vlVdpDevice *device;
- Drawable drawable;
- struct vl_compositor_state cstate;
-} vlVdpPresentationQueue;
-
typedef struct
{
vlVdpDevice *device;
typedef struct
{
- vlVdpTime timestamp;
vlVdpDevice *device;
struct pipe_surface *surface;
struct pipe_sampler_view *sampler_view;
typedef struct
{
vlVdpDevice *device;
- struct pipe_video_decoder *decoder;
+ Drawable drawable;
+} vlVdpPresentationQueueTarget;
+
+typedef struct
+{
+ vlVdpDevice *device;
+ Drawable drawable;
+ struct vl_compositor_state cstate;
+ vlVdpOutputSurface *last_surf;
+} vlVdpPresentationQueue;
+
+typedef struct
+{
+ vlVdpDevice *device;
+ pipe_mutex mutex;
+ struct pipe_video_codec *decoder;
} vlVdpDecoder;
typedef uint32_t vlHandle;
VdpVideoSurfaceGetParameters vlVdpVideoSurfaceGetParameters;
VdpVideoSurfaceGetBitsYCbCr vlVdpVideoSurfaceGetBitsYCbCr;
VdpVideoSurfacePutBitsYCbCr vlVdpVideoSurfacePutBitsYCbCr;
+void vlVdpVideoSurfaceClear(vlVdpSurface *vlsurf);
VdpDecoderCreate vlVdpDecoderCreate;
VdpDecoderDestroy vlVdpDecoderDestroy;
VdpDecoderGetParameters vlVdpDecoderGetParameters;