]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/vdpau_internal.h
hevc: eliminate an unneeded intermediate variable
[ffmpeg] / libavcodec / vdpau_internal.h
index 94c81ff78ebae66985c15075a3cea2e0695edccd..16493b0741c52d80b238801ef1f51c801b8e4fe1 100644 (file)
 #include "mpegvideo.h"
 #include "version.h"
 
-/** Extract VdpVideoSurface from a Picture */
-static inline uintptr_t ff_vdpau_get_surface_id(Picture *pic)
+/** Extract VdpVideoSurface from an AVFrame */
+static inline uintptr_t ff_vdpau_get_surface_id(AVFrame *pic)
 {
-    return (uintptr_t)pic->f.data[3];
+    return (uintptr_t)pic->data[3];
 }
 
 #if !FF_API_BUFS_VDPAU
@@ -48,6 +48,39 @@ union AVVDPAUPictureInfo {
 #include "vdpau.h"
 #endif
 
+typedef struct VDPAUHWContext {
+    AVVDPAUContext context;
+    VdpDevice device;
+    VdpGetProcAddress *get_proc_address;
+    char reset;
+    unsigned char flags;
+} VDPAUHWContext;
+
+typedef struct VDPAUContext {
+    /**
+     * VDPAU device handle
+     */
+    VdpDevice device;
+
+    /**
+     * VDPAU decoder handle
+     */
+    VdpDecoder decoder;
+
+    /**
+     * VDPAU device driver
+     */
+    VdpGetProcAddress *get_proc_address;
+
+    /**
+     * VDPAU decoder render callback
+     */
+    VdpDecoderRender *render;
+
+    uint32_t width;
+    uint32_t height;
+} VDPAUContext;
+
 struct vdpau_picture_context {
     /**
      * VDPAU picture information.
@@ -70,8 +103,14 @@ struct vdpau_picture_context {
     VdpBitstreamBuffer *bitstream_buffers;
 };
 
+int ff_vdpau_common_init(AVCodecContext *avctx, VdpDecoderProfile profile,
+                         int level);
+int ff_vdpau_common_uninit(AVCodecContext *avctx);
+
 int ff_vdpau_common_start_frame(struct vdpau_picture_context *pic,
                                 const uint8_t *buffer, uint32_t size);
+int ff_vdpau_common_end_frame(AVCodecContext *avctx, AVFrame *frame,
+                              struct vdpau_picture_context *pic);
 int ff_vdpau_mpeg_end_frame(AVCodecContext *avctx);
 int ff_vdpau_add_buffer(struct vdpau_picture_context *pic, const uint8_t *buf,
                         uint32_t buf_size);