Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#6828 closed defect (fixed)

ffmpeg git master compile error with libva 2.0

Reported by: bermond Owned by:
Priority: important Component: undetermined
Version: git-master Keywords: regression
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I'm getting the following compile error in ffmpeg git master when using libva 2.0:

CC      libavutil/hwcontext_vaapi.o
libavutil/hwcontext_vaapi.c: In function ‘vaapi_map_to_drm’:
libavutil/hwcontext_vaapi.c:1083:5: error: unknown type name ‘VADRMPRIMESurfaceDescriptor’; did you mean ‘AVDRMFrameDescriptor’?
     VADRMPRIMESurfaceDescriptor va_desc;
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
     AVDRMFrameDescriptor
libavutil/hwcontext_vaapi.c:1089:11: error: implicit declaration of function ‘vaExportSurfaceHandle’ [-Werror=implicit-function-declaration]
     vas = vaExportSurfaceHandle(hwctx->display, surface_id,
           ^~~~~~~~~~~~~~~~~~~~~
libavutil/hwcontext_vaapi.c:1090:33: error: ‘VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2’ undeclared (first use in this function); did you mean ‘VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME’?
                                 VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME_2,
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                 VA_SURFACE_ATTRIB_MEM_TYPE_DRM_PRIME
libavutil/hwcontext_vaapi.c:1090:33: note: each undeclared identifier is reported only once for each function it appears in
libavutil/hwcontext_vaapi.c:1091:33: error: ‘VA_EXPORT_SURFACE_READ_ONLY’ undeclared (first use in this function)
                                 VA_EXPORT_SURFACE_READ_ONLY |
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~
libavutil/hwcontext_vaapi.c:1092:33: error: ‘VA_EXPORT_SURFACE_SEPARATE_LAYERS’ undeclared (first use in this function); did you mean ‘VA_EXPORT_SURFACE_READ_ONLY’?
                                 VA_EXPORT_SURFACE_SEPARATE_LAYERS,
                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                 VA_EXPORT_SURFACE_READ_ONLY
libavutil/hwcontext_vaapi.c:1109:35: error: request for member ‘num_objects’ in something not a structure or union
     drm_desc->nb_objects = va_desc.num_objects;
                                   ^
libavutil/hwcontext_vaapi.c:1110:28: error: request for member ‘num_objects’ in something not a structure or union
     for (i = 0; i < va_desc.num_objects; i++) {
                            ^
libavutil/hwcontext_vaapi.c:1111:44: error: request for member ‘objects’ in something not a structure or union
         drm_desc->objects[i].fd   = va_desc.objects[i].fd;
                                            ^
libavutil/hwcontext_vaapi.c:1112:44: error: request for member ‘objects’ in something not a structure or union
         drm_desc->objects[i].size = va_desc.objects[i].size;
                                            ^
libavutil/hwcontext_vaapi.c:1114:20: error: request for member ‘objects’ in something not a structure or union
             va_desc.objects[i].drm_format_modifier;
                    ^
libavutil/hwcontext_vaapi.c:1116:34: error: request for member ‘num_layers’ in something not a structure or union
     drm_desc->nb_layers = va_desc.num_layers;
                                  ^
libavutil/hwcontext_vaapi.c:1117:28: error: request for member ‘num_layers’ in something not a structure or union
     for (i = 0; i < va_desc.num_layers; i++) {
                            ^
libavutil/hwcontext_vaapi.c:1118:48: error: request for member ‘layers’ in something not a structure or union
         drm_desc->layers[i].format    = va_desc.layers[i].drm_format;
                                                ^
libavutil/hwcontext_vaapi.c:1119:48: error: request for member ‘layers’ in something not a structure or union
         drm_desc->layers[i].nb_planes = va_desc.layers[i].num_planes;
                                                ^
libavutil/hwcontext_vaapi.c:1120:32: error: request for member ‘layers’ in something not a structure or union
         for (j = 0; j < va_desc.layers[i].num_planes; j++) {
                                ^
libavutil/hwcontext_vaapi.c:1122:24: error: request for member ‘layers’ in something not a structure or union
                 va_desc.layers[i].object_index[j];
                        ^
libavutil/hwcontext_vaapi.c:1124:24: error: request for member ‘layers’ in something not a structure or union
                 va_desc.layers[i].offset[j];
                        ^
libavutil/hwcontext_vaapi.c:1126:24: error: request for member ‘layers’ in something not a structure or union
                 va_desc.layers[i].pitch[j];
                        ^
libavutil/hwcontext_vaapi.c:1142:28: error: request for member ‘num_objects’ in something not a structure or union
     for (i = 0; i < va_desc.num_objects; i++)
                            ^
libavutil/hwcontext_vaapi.c:1143:22: error: request for member ‘objects’ in something not a structure or union
         close(va_desc.objects[i].fd);
                      ^
cc1: some warnings being treated as errors
make: *** [ffbuild/common.mak:60: libavutil/hwcontext_vaapi.o] Error 1

How to reproduce:

$ git clone git://source.ffmpeg.org/ffmpeg.git
$ cd ffmpeg
$ ./configure --enable-libdrm --enable-libmfx
$ make -j1

ffmpeg git master compiles fine with libva 1.8.3.

Strangely, ffmpeg 3.4 compiles fine with libva 2.0.

System information:
OS: Arch Linux x86_64
Compiler: gcc 7.2.0
glibc: 2.26
FFmpeg: git master
libva: 2.0.0
libdrm: 2.4.88
libmfx: 1.23

Relevant system-wide environmet variables:
CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-march=native -O2 -pipe -fstack-protector-strong -fno-plt"
CXXFLAGS="-march=native -O2 -pipe -fstack-protector-strong -fno-plt"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now"

Change History (4)

in reply to:  description comment:1 by Carl Eugen Hoyos, 6 years ago

Keywords: regression added
Priority: normalimportant

Replying to bermond:

Strangely, ffmpeg 3.4 compiles fine with libva 2.0.

Please use git bisect to find the change introducing the regression.

comment:2 by bermond, 6 years ago

I could not get a conclusive result with git bisect.

Initial result is:

$ git bisect start
$ git bisect bad
$ git bisect good n3.4
Bisecting: a merge base must be tested
[7bec3f78da2533968b7246ff222770582ab4aafb] avcodec/rkmppdec: check wether typo
<build fails with chosen commit 7bec3f78da2533968b7246ff222770582ab4aafb>
$ git bisect bad
The merge base 7bec3f78da2533968b7246ff222770582ab4aafb is bad.
This means the bug has been fixed between 7bec3f78da2533968b7246ff222770582ab4aafb and [01e291a592452f27b3a4e811536aaaf94096e244].

From this point, git bisect cannot proceed any further.

The first commit in the range provided by git bisect is the "bad merge", and it fails to compile, being a bad commit. The second one points to n3.4 release tag, which compiles fine, being a good commit.

When bisecting between this range using each one as the bad and good commits, git bisect shows nothing:

$ git bisect reset
$ git bisect start
$ git bisect bad 7bec3f78da2533968b7246ff222770582ab4aafb
$ git bisect good 01e291a592452f27b3a4e811536aaaf94096e244
Some good revs are not ancestors of the bad rev.
git bisect cannot work properly in this case.
Maybe you mistook good and bad revs?

comment:3 by jkqxz, 6 years ago

Resolution: fixed
Status: newclosed

Fixed by 1ef4af2d492e87e6d9fc9157a2d9c7f95585f61c.

(The perils of working on both sides of the API, I guess. I always have a version with vaExportSurfaceHandle() now because it's needed for sensible playback on AMD.)

in reply to:  3 comment:4 by bermond, 6 years ago

Replying to jkqxz:

Fixed by 1ef4af2d492e87e6d9fc9157a2d9c7f95585f61c.

(The perils of working on both sides of the API, I guess. I always have a version with vaExportSurfaceHandle() now because it's needed for sensible playback on AMD.)

I can confirm that it's building fine now.

Thank you for fixing this!

Note: See TracTickets for help on using tickets.