]> git.sesse.net Git - ffmpeg/commitdiff
vaapi: switch ff_vaapi_get_surface_id from Picture to AVFrame
authorwm4 <nfxjfg@googlemail.com>
Thu, 20 Mar 2014 07:53:18 +0000 (08:53 +0100)
committerAnton Khirnov <anton@khirnov.net>
Thu, 20 Mar 2014 16:01:59 +0000 (17:01 +0100)
Signed-off-by: Anton Khirnov <anton@khirnov.net>
libavcodec/vaapi.c
libavcodec/vaapi_h264.c
libavcodec/vaapi_internal.h
libavcodec/vaapi_mpeg2.c
libavcodec/vaapi_mpeg4.c
libavcodec/vaapi_vc1.c

index 0532daf9832a7d1dcb87ca2a4348800a28ad92d6..6183d0b1f0876557db616ab6ede553bf71bd44f2 100644 (file)
@@ -205,7 +205,7 @@ int ff_vaapi_mpeg_end_frame(AVCodecContext *avctx)
         goto finish;
 
     ret = ff_vaapi_render_picture(vactx,
-                                  ff_vaapi_get_surface_id(s->current_picture_ptr));
+                                  ff_vaapi_get_surface_id(&s->current_picture_ptr->f));
     if (ret < 0)
         goto finish;
 
index a1a0e070e2310c876df8f0e59be99285bd29bd4a..f2a912cf27d1b1a5b033288a3d5c22c53806ac68 100644 (file)
@@ -59,7 +59,7 @@ static void fill_vaapi_pic(VAPictureH264 *va_pic,
         pic_structure = pic->reference;
     pic_structure &= PICT_FRAME; /* PICT_TOP_FIELD|PICT_BOTTOM_FIELD */
 
-    va_pic->picture_id = ff_vaapi_get_surface_id(pic);
+    va_pic->picture_id = ff_vaapi_get_surface_id(&pic->f);
     va_pic->frame_idx  = pic->long_ref ? pic->pic_id : pic->frame_num;
 
     va_pic->flags      = 0;
@@ -99,7 +99,7 @@ static int dpb_add(DPB *dpb, H264Picture *pic)
 
     for (i = 0; i < dpb->size; i++) {
         VAPictureH264 * const va_pic = &dpb->va_pics[i];
-        if (va_pic->picture_id == ff_vaapi_get_surface_id(pic)) {
+        if (va_pic->picture_id == ff_vaapi_get_surface_id(&pic->f)) {
             VAPictureH264 temp_va_pic;
             fill_vaapi_pic(&temp_va_pic, pic, 0);
 
@@ -298,7 +298,7 @@ static int vaapi_h264_end_frame(AVCodecContext *avctx)
     if (ret < 0)
         goto finish;
 
-    ret = ff_vaapi_render_picture(vactx, ff_vaapi_get_surface_id(h->cur_pic_ptr));
+    ret = ff_vaapi_render_picture(vactx, ff_vaapi_get_surface_id(&h->cur_pic_ptr->f));
     if (ret < 0)
         goto finish;
 
index 029265496b24a5a8bc75b2678662f8d0ce9f2325..d0fa7ae9173e2293e6a0cb2d835259cdf71a9d00 100644 (file)
  * @{
  */
 
-/** Extract VASurfaceID from a Picture */
-static inline VASurfaceID ff_vaapi_get_surface_id(Picture *pic)
+/** Extract VASurfaceID from an AVFrame */
+static inline VASurfaceID ff_vaapi_get_surface_id(AVFrame *pic)
 {
-    return (uintptr_t)pic->f.data[3];
+    return (uintptr_t)pic->data[3];
 }
 
 /** Common AVHWAccel.end_frame() implementation */
index d873cd04e86bac0d6556b223b1c0a4c4fb9f1ade..e0f9193144db974f4fe053252abd1aecc4ad36df 100644 (file)
@@ -73,10 +73,10 @@ static int vaapi_mpeg2_start_frame(AVCodecContext *avctx, av_unused const uint8_
 
     switch (s->pict_type) {
     case AV_PICTURE_TYPE_B:
-        pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture);
+        pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture.f);
         // fall-through
     case AV_PICTURE_TYPE_P:
-        pic_param->forward_reference_picture = ff_vaapi_get_surface_id(&s->last_picture);
+        pic_param->forward_reference_picture = ff_vaapi_get_surface_id(&s->last_picture.f);
         break;
     }
 
index b771482b567a6a4bae6e8bdc07fd6e9ca74500a8..098b37a8ada14a4ba94f4cf562317b819013bda1 100644 (file)
@@ -95,9 +95,9 @@ static int vaapi_mpeg4_start_frame(AVCodecContext *avctx, av_unused const uint8_
     pic_param->TRD                                      = s->pp_time;
 
     if (s->pict_type == AV_PICTURE_TYPE_B)
-        pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture);
+        pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture.f);
     if (s->pict_type != AV_PICTURE_TYPE_I)
-        pic_param->forward_reference_picture  = ff_vaapi_get_surface_id(&s->last_picture);
+        pic_param->forward_reference_picture  = ff_vaapi_get_surface_id(&s->last_picture.f);
 
     /* Fill in VAIQMatrixBufferMPEG4 */
     /* Only the first inverse quantisation method uses the weighting matrices */
index 50cba16c21c67d95d7fe86efe143e9b0bca047f4..f50c5cf3cc46b0fb662a4eaa0e3884a311002ee8 100644 (file)
@@ -258,10 +258,10 @@ static int vaapi_vc1_start_frame(AVCodecContext *avctx, av_unused const uint8_t
 
     switch (s->pict_type) {
     case AV_PICTURE_TYPE_B:
-        pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture);
+        pic_param->backward_reference_picture = ff_vaapi_get_surface_id(&s->next_picture.f);
         // fall-through
     case AV_PICTURE_TYPE_P:
-        pic_param->forward_reference_picture = ff_vaapi_get_surface_id(&s->last_picture);
+        pic_param->forward_reference_picture = ff_vaapi_get_surface_id(&s->last_picture.f);
         break;
     }