meta-raspberrypi/recipes-multimedia/rpidistro-ffmpeg/files/2001-configure-setup-for-OE-core-usage.patch
Vincent Davis Jr 1f33240549 rpidistro-ffmpeg: upgrade 4.3.2 -> 4.3.4
Upgrades version of ffmpeg to 4.3.4
* Reason for not upgrading to 4.3.5 all ported raspberrypi
  team patches may not be included in that version/commit.
* SRCREV set to 246e1a55a0eca931537d8706acd8b133c07beb05

Updates to PACKAGECONFIG
* Only include --enable-opengl flag when opengl is set in
  DISTRO_FEATURES
* Add new flag --enable-epoxy required by vout-egl
* vout-egl requires both libepoxy and x11. Only
  enable vout-egl if x11 contained in DISTRO_FEATURES.
* The remaining RPI-Distro related flags added
  through patches. Are only enabled if vc4graphics
  is disabled and userland graphics enabled. As an
  attempt to keep ffmpeg ./configure generic unless
  specified other wise.

Removes TARGET_CFLAGS:append as include flags are set in
./configure via the 2001-configure-setup-for-OE-core-usage.patch
patch.

Replaces patches with updated patches used in actual commit.
Adds four new patches to fix ./configure, compile, runtime bugs.

PATCHES:
- 2001-configure-setup-for-OE-core-usage.patch
* The ./configure stage fails if neither x11 or wayland defined
  in DISTRO_FEATURES. When opengl enabled ./configure checks for
  relevant headers. The last header it checks for is ES2/gl.h which
  doesn't exists. Neither do the others if certain perameters
  are not meet. Patch addes check for GLES2/gl2.h which does
  exists. We use utilize GLESv2 to compile and link with.
  Patch also replaces where compiler find mmal and omx headers
  and libs.

- 2002-libavdevice-opengl_enc-update-dynamic-function-loader.patch
* After configure stage succeeds the compile stage fails as
  SelectedGetProcAddress isn't defined. It can't be define as
  if x11 isn't enabled. Patch defines SelectedGetProcAddress
  if x11 not enabled, but sdl2 enabled to SDL_GL_GetProcAddress.
  If neither sdl2 or x11 is enabled patch loads GL functions
  pointers at compile time versus dynamically at runtime.

- 2003-libavcodec-fix-v4l2_req_devscan.patch
* v412_req_devscan.h function definitions where different
  from v412_req_devscan.c function implementations.

- 2004-libavcodec-omx-replace-opt-vc-path-with-usr-lib.patch
* Fixes where libbcm_host.so and libopenmaxil.so are loaded from.

Signed-off-by: Vincent Davis Jr <vince@underview.tech>
2022-12-13 02:32:11 +00:00

83 lines
4.3 KiB
Diff

From 01e738a8f1414acd0102e432bbc15b4e603fd956 Mon Sep 17 00:00:00 2001
From: Vincent Davis Jr <vince@underview.tech>
Date: Thu, 8 Dec 2022 10:34:20 -0600
Subject: [PATCH] configure: setup for OE-core usage
Upstream-Status: Inappropriate
RPI-Distro repo clones original ffmpeg and applies patches to enable
raspiberry pi support.
Add global CFLAGS and LDFLAGS. So, that when
./configure runs test it's able to locate proper
headers and libs in a cross-compile environment.
Add new check to opengl. None of the above headers
exists and we also should be using GLESv2.
Update where compiler finds OMX_Core.h
Only check that sdl2 version greater than 2.0.1
Signed-off-by: Vincent Davis Jr <vince@underview.tech>
---
configure | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/configure b/configure
index 723b81f1..0c7f2654 100755
--- a/configure
+++ b/configure
@@ -5746,6 +5746,9 @@ enable_weak_pic() {
}
enabled pic && enable_weak_pic
+# Set CFLAGS and LDFLAGS globally
+add_cflags -I${sysroot}/usr/include/ -I${sysroot}/usr/include/IL -I${sysroot}/usr/include/drm
+add_ldflags -L${sysroot}/usr/lib/
test_cc <<EOF || die "Symbol mangling check failed."
int ff_extern;
@@ -6471,8 +6474,7 @@ enabled mbedtls && { check_pkg_config mbedtls mbedtls mbedtls/x509_crt
die "ERROR: mbedTLS not found"; }
enabled mediacodec && { enabled jni || die "ERROR: mediacodec requires --enable-jni"; }
( enabled rpi ||
- enabled mmal ) && { { add_cflags -isystem/opt/vc/include/ -isystem/opt/vc/include/interface/vmcs_host/linux -isystem/opt/vc/include/interface/vcos/pthreads -fgnu89-inline &&
- add_ldflags -L/opt/vc/lib/ &&
+ enabled mmal ) && { { add_cflags -I${sysroot}/usr/include/interface/vmcs_host/linux -I${sysroot}/usr/include/interface/vcos/pthreads -fgnu89-inline &&
check_lib mmal interface/mmal/mmal.h mmal_port_connect -lmmal_core -lmmal_util -lmmal_vc_client -lbcm_host -lvcsm -lvchostif -lvchiq_arm -lvcos; } ||
die "ERROR: mmal not found" &&
check_func_headers interface/mmal/mmal.h "MMAL_PARAMETER_VIDEO_MAX_NUM_CALLBACKS"; }
@@ -6492,15 +6494,15 @@ enabled opengl && { check_lib opengl GL/glx.h glXGetProcAddress "-lGL
check_lib opengl windows.h wglGetProcAddress "-lopengl32 -lgdi32" ||
check_lib opengl OpenGL/gl3.h glGetError "-Wl,-framework,OpenGL" ||
check_lib opengl ES2/gl.h glGetError "-isysroot=${sysroot} -Wl,-framework,OpenGLES" ||
+ check_lib opengl GLES2/gl2.h glGetError "-lGLESv2" ||
die "ERROR: opengl not found."
}
-enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame ||
+enabled omx_rpi && { test_code cc IL/OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame ||
{ ! enabled cross_compile &&
- add_cflags -isystem/opt/vc/include/IL &&
- test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame; } ||
+ test_code cc IL/OMX_Core.h OMX_IndexConfigBrcmVideoRequestIFrame; } ||
die "ERROR: OpenMAX IL headers from raspberrypi/firmware not found"; } &&
enable omx
-enabled omx && require_headers OMX_Core.h
+enabled omx && require_headers IL/OMX_Core.h
enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl ||
check_pkg_config openssl openssl openssl/ssl.h SSL_library_init ||
check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto ||
@@ -6540,7 +6542,7 @@ fi
if enabled sdl2; then
SDL2_CONFIG="${cross_prefix}sdl2-config"
- test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 2.1.0" SDL_events.h SDL_PollEvent
+ test_pkg_config sdl2 "sdl2 >= 2.0.1" SDL_events.h SDL_PollEvent
if disabled sdl2 && "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
sdl2_extralibs=$("${SDL2_CONFIG}" --libs)
--
2.38.1