Open ncboot opened 7 months ago
I can fix above errors manually by fixing MAX() macro and by defining missed functions like this:
int av_frame_cropped_width(const AVFrame * const frame){ return frame->width; }
int av_frame_cropped_height(const AVFrame * const frame){ return frame->height; }
I am not sure if this is correct. Then it compiles. But does not work:
~/hello_wayland/build $ ./hello_wayland --cube /NC/test-video2-marks.mp4 <<< wayland_out_new Segmentation fault ~/hello_wayland/build $ ./hello_wayland --cube Usage: hello_wayland [-e] [-l
] [-f ] [-o ] [--deinterlace] [--pace-input ] [--fullscreen] [--ticker ] [--cube] [--no-wait] [ ...] -e Use EGL to render video (otherwise direct dmabuf) -l Loop video playback times. -1 means forever --cube Show rotating cube --ticker Show scrolling ticker with repeated indefinitely --no-wait Decode at max speed, do not wait for display
What is a proper way to run this app to show at least something?
Huh, this definitely built fine for me on a Pi5 on Raspberry Pi OS Bookworm last week. Can you please confirm which exact "Bookworm" image you're using please? Are all your packages up to date? (sudo apt update && sudo apt full-upgrade
)
Are you able to recreate this problem on a freshly-written Bookworm image on a spare SD card?
Ahh... I do get the same errors as you if I try building on 32-bit Bookworm instead of 64-bit Bookworm. @jc-kynesim Is already aware of this.
I'll fix this tomorrow when I've got a 32-bit Pi in front of me
32-bit compile should now be fixed. @ncboot - I've got to assume that you aren't compiling under PiOS as if you were you would have av_frame_cropped_xxx. See if it now works for you - if it doesn't then please use gdb to get a backtrace of the segfault and I'll see if it something I can fix. What Wayland compositor are you using?
Trying to build on RPI5 with Bookworm OS.
Got this build output: ` ~/hello_wayland/build $ meson compile INFO: autodetecting backend as ninja INFO: calculating backend command to run: /usr/bin/ninja [1/4] Compiling C object freetype/librunticker_way.a.p/ticker.c.o FAILED: freetype/librunticker_way.a.p/ticker.c.o cc -Ifreetype/librunticker_way.a.p -Ifreetype -I../freetype -I. -I.. -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/libdrm -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -O2 -g -fPIC -pthread -MD -MQ freetype/librunticker_way.a.p/ticker.c.o -MF freetype/librunticker_way.a.p/ticker.c.o.d -o freetype/librunticker_way.a.p/ticker.c.o -c ../freetype/ticker.c ../freetype/ticker.c: In function ‘do_render’: ../freetype/ticker.c:63:23: error: comparison of integer expressions of different signedness: ‘unsigned int’ and ‘FT_Pos’ {aka ‘long int’} [-Werror=sign-compare]
63 | #define MAX(a,b) ((a) > (b) ? (a) : (b)) | ^ ../freetype/ticker.c:204:12: note: in expansion of macro ‘MAX’
204 | shl1 = MAX(slot->bitmap_left + slot->bitmap.width, (te->pen.x + slot->advance.x) >> 6) - te->target_width; | ^~~ ../freetype/ticker.c:63:37: error: operand of ‘?:’ changes signedness from ‘FT_Pos’ {aka ‘long int’} to ‘unsigned int’ due to unsignedness of other operand [-Werror=sign-compare]
63 | #define MAX(a,b) ((a) > (b) ? (a) : (b)) | ^~~ ../freetype/ticker.c:204:12: note: in expansion of macro ‘MAX’
204 | shl1 = MAX(slot->bitmap_left + slot->bitmap.width, (te->pen.x + slot->advance.x) >> 6) - te->target_width; | ^~~ cc1: all warnings being treated as errors [2/4] Compiling C object hello_wayland.p/init_window.c.o FAILED: hello_wayland.p/init_window.c.o cc -Ihello_wayland.p -I. -I.. -I/usr/include/libdrm -I/usr/include/arm-linux-gnueabihf -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wextra -Wpedantic -Werror -O2 -g -pthread -MD -MQ hello_wayland.p/init_window.c.o -MF hello_wayland.p/init_window.c.o.d -o hello_wayland.p/init_window.c.o -c ../init_window.c ../init_window.c: In function ‘set_vid_par’: ../init_window.c:232:28: error: implicit declaration of function ‘av_frame_cropped_width’ [-Werror=implicit-function-declaration]
232 | const unsigned int w = av_frame_cropped_width(frame); | ^
~~~~~ ../init_window.c:233:28: error: implicit declaration of function ‘av_frame_cropped_height’ [-Werror=implicit-function-declaration]233 | const unsigned int h = av_frame_cropped_height(frame); | ^
~~~~~~ cc1: all warnings being treated as errors ninja: build stopped: subcommand failed. `