]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/dxva2.c
dca: Move data tables from a header to an object file
[ffmpeg] / libavcodec / dxva2.c
index f8b8eba4bf3e69c8a7aef3a01caf76395073ef23..9ee22c8d56c62db926d85994a120776c73af1628 100644 (file)
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
+#include <assert.h>
+#include <string.h>
+
+#include "libavutil/log.h"
+#include "libavutil/time.h"
+
+#include "avcodec.h"
+#include "mpegvideo.h"
 #include "dxva2_internal.h"
 
-void *ff_dxva2_get_surface(const Picture *picture)
+void *ff_dxva2_get_surface(const AVFrame *frame)
 {
-    return picture->f.data[3];
+    return frame->data[3];
 }
 
 unsigned ff_dxva2_get_surface_index(const struct dxva_context *ctx,
-                                    const Picture *picture)
+                                    const AVFrame *frame)
 {
-    void *surface = ff_dxva2_get_surface(picture);
+    void *surface = ff_dxva2_get_surface(frame);
     unsigned i;
 
     for (i = 0; i < ctx->surface_count; i++)
@@ -55,7 +63,7 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx,
     hr = IDirectXVideoDecoder_GetBuffer(ctx->decoder, type,
                                         &dxva_data, &dxva_size);
     if (FAILED(hr)) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to get a buffer for %d: 0x%x\n",
+        av_log(avctx, AV_LOG_ERROR, "Failed to get a buffer for %u: 0x%lx\n",
                type, hr);
         return -1;
     }
@@ -69,21 +77,21 @@ int ff_dxva2_commit_buffer(AVCodecContext *avctx,
 
         result = 0;
     } else {
-        av_log(avctx, AV_LOG_ERROR, "Buffer for type %d was too small\n", type);
+        av_log(avctx, AV_LOG_ERROR, "Buffer for type %u was too small\n", type);
         result = -1;
     }
 
     hr = IDirectXVideoDecoder_ReleaseBuffer(ctx->decoder, type);
     if (FAILED(hr)) {
         av_log(avctx, AV_LOG_ERROR,
-               "Failed to release buffer type %d: 0x%x\n",
+               "Failed to release buffer type %u: 0x%lx\n",
                type, hr);
         result = -1;
     }
     return result;
 }
 
-int ff_dxva2_common_end_frame(AVCodecContext *avctx, Picture *pic,
+int ff_dxva2_common_end_frame(AVCodecContext *avctx, AVFrame *frame,
                               const void *pp, unsigned pp_size,
                               const void *qm, unsigned qm_size,
                               int (*commit_bs_si)(AVCodecContext *,
@@ -99,14 +107,14 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, Picture *pic,
 
     do {
         hr = IDirectXVideoDecoder_BeginFrame(ctx->decoder,
-                                             ff_dxva2_get_surface(pic),
+                                             ff_dxva2_get_surface(frame),
                                              NULL);
         if (hr == E_PENDING)
             av_usleep(2000);
     } while (hr == E_PENDING && ++runs < 50);
 
     if (FAILED(hr)) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to begin frame: 0x%x\n", hr);
+        av_log(avctx, AV_LOG_ERROR, "Failed to begin frame: 0x%lx\n", hr);
         return -1;
     }
 
@@ -151,14 +159,14 @@ int ff_dxva2_common_end_frame(AVCodecContext *avctx, Picture *pic,
     exec.pExtensionData      = NULL;
     hr = IDirectXVideoDecoder_Execute(ctx->decoder, &exec);
     if (FAILED(hr)) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to execute: 0x%x\n", hr);
+        av_log(avctx, AV_LOG_ERROR, "Failed to execute: 0x%lx\n", hr);
         result = -1;
     }
 
 end:
     hr = IDirectXVideoDecoder_EndFrame(ctx->decoder, NULL);
     if (FAILED(hr)) {
-        av_log(avctx, AV_LOG_ERROR, "Failed to end frame: 0x%x\n", hr);
+        av_log(avctx, AV_LOG_ERROR, "Failed to end frame: 0x%lx\n", hr);
         result = -1;
     }