@@ -305,65 +305,73 @@ endif()
305
305
if (BUILD_TEST_PLUGIN )
306
306
target_sources (flutterpi_module PRIVATE src/plugins/testplugin.c )
307
307
endif ()
308
-
309
- set (HAVE_GSTREAMER_VIDEO_PLAYER OFF )
310
- if (BUILD_GSTREAMER_VIDEO_PLAYER_PLUGIN OR BUILD_GSTREAMER_AUDIO_PLAYER_PLUGIN )#
311
- pkg_check_modules (LIBGSTREAMER IMPORTED_TARGET
312
- gstreamer-1.0
313
- gstreamer-plugins-base-1.0
314
- gstreamer-app-1.0
315
- gstreamer-allocators-1.0
316
- gstreamer-video-1.0
317
- gstreamer-audio-1.0
318
- )
319
-
320
- if (LIBGSTREAMER_FOUND )
321
- string (REPLACE "." ";" LIBGSTREAMER_VERSION_AS_LIST ${LIBGSTREAMER_gstreamer-1.0_VERSION} )
322
- list (GET LIBGSTREAMER_VERSION_AS_LIST 0 LIBGSTREAMER_VERSION_MAJOR )
323
- list (GET LIBGSTREAMER_VERSION_AS_LIST 1 LIBGSTREAMER_VERSION_MINOR )
324
- list (GET LIBGSTREAMER_VERSION_AS_LIST 2 LIBGSTREAMER_VERSION_PATCH )
325
-
326
- target_sources (flutterpi_module PRIVATE src/plugins/gstplayer.c )
327
- target_link_libraries (flutterpi_module PUBLIC PkgConfig::LIBGSTREAMER )
328
- endif ()
329
-
330
- if (BUILD_GSTREAMER_VIDEO_PLAYER_PLUGIN AND NOT LIBGSTREAMER_FOUND )
308
+ if (BUILD_GSTREAMER_VIDEO_PLAYER_PLUGIN )
309
+ if (NOT HAVE_EGL_GLES2 )
310
+ message (NOTICE "EGL and OpenGL ES2 are required for gstreamer video player. Gstreamer video player plugin won't be build." )
311
+ else ()
331
312
if (TRY_BUILD_GSTREAMER_VIDEO_PLAYER_PLUGIN )
332
- message (NOTICE "Some required gstreamer dependencies were not found. Gstreamer video player plugin won't be built." )
313
+ pkg_check_modules (LIBGSTREAMER IMPORTED_TARGET gstreamer-1.0 )
314
+ pkg_check_modules (LIBGSTREAMER_PLUGINS_BASE IMPORTED_TARGET gstreamer-plugins-base-1.0 )
315
+ pkg_check_modules (LIBGSTREAMER_APP IMPORTED_TARGET gstreamer-app-1.0 )
316
+ pkg_check_modules (LIBGSTREAMER_ALLOCATORS IMPORTED_TARGET gstreamer-allocators-1.0 )
317
+ pkg_check_modules (LIBGSTREAMER_VIDEO IMPORTED_TARGET gstreamer-video-1.0 )
333
318
else ()
334
- message (ERROR "Some required gstreamer dependencies were not found. Can't build gstreamer video player plugin." )
319
+ pkg_check_modules (LIBGSTREAMER REQUIRED IMPORTED_TARGET gstreamer-1.0 )
320
+ pkg_check_modules (LIBGSTREAMER_PLUGINS_BASE REQUIRED IMPORTED_TARGET gstreamer-plugins-base-1.0 )
321
+ pkg_check_modules (LIBGSTREAMER_APP REQUIRED IMPORTED_TARGET gstreamer-app-1.0 )
322
+ pkg_check_modules (LIBGSTREAMER_ALLOCATORS REQUIRED IMPORTED_TARGET gstreamer-allocators-1.0 )
323
+ pkg_check_modules (LIBGSTREAMER_VIDEO REQUIRED IMPORTED_TARGET gstreamer-video-1.0 )
335
324
endif ()
336
- endif ()
337
325
338
- if (BUILD_GSTREAMER_VIDEO_PLAYER_PLUGIN AND NOT HAVE_EGL_GLES2 )
339
- if (TRY_BUILD_GSTREAMER_VIDEO_PLAYER_PLUGIN )
340
- message (NOTICE "EGL and OpenGL ES2 are required for gstreamer video player. Gstreamer video player plugin won't be built." )
326
+ if (LIBGSTREAMER_FOUND AND LIBGSTREAMER_PLUGINS_BASE_FOUND AND LIBGSTREAMER_APP_FOUND AND LIBGSTREAMER_ALLOCATORS_FOUND AND LIBGSTREAMER_VIDEO_FOUND )
327
+ # There's no other way to query the libinput version (in code) somehow.
328
+ # So we need to roll our own libinput version macro
329
+ string (REPLACE "." ";" LIBGSTREAMER_VERSION_AS_LIST ${LIBGSTREAMER_VERSION} )
330
+ list (GET LIBGSTREAMER_VERSION_AS_LIST 0 LIBGSTREAMER_VERSION_MAJOR )
331
+ list (GET LIBGSTREAMER_VERSION_AS_LIST 1 LIBGSTREAMER_VERSION_MINOR )
332
+ list (GET LIBGSTREAMER_VERSION_AS_LIST 2 LIBGSTREAMER_VERSION_PATCH )
333
+
334
+ target_sources (flutterpi_module PRIVATE
335
+ src/plugins/gstreamer_video_player/plugin.c
336
+ src/plugins/gstreamer_video_player/player.c
337
+ src/plugins/gstreamer_video_player/frame.c
338
+ )
339
+ target_link_libraries (flutterpi_module PUBLIC
340
+ PkgConfig::LIBGSTREAMER
341
+ PkgConfig::LIBGSTREAMER_PLUGINS_BASE
342
+ PkgConfig::LIBGSTREAMER_APP
343
+ PkgConfig::LIBGSTREAMER_ALLOCATORS
344
+ PkgConfig::LIBGSTREAMER_VIDEO
345
+ )
341
346
else ()
342
- message (ERROR "EGL and OpenGL ES2 are required for gstreamer video player. Can 't build gstreamer video player plugin ." )
347
+ message (NOTICE "Couldn't find gstreamer libraries. Gstreamer video player plugin won 't be build ." )
343
348
endif ()
344
349
endif ()
350
+ endif ()
345
351
346
- if (BUILD_GSTREAMER_VIDEO_PLAYER_PLUGIN AND LIBGSTREAMER_FOUND AND HAVE_EGL_GLES2 )
347
- set (HAVE_GSTREAMER_VIDEO_PLAYER ON )
348
- target_sources (flutterpi_module PRIVATE
349
- src/plugins/gstreamer_video_player/frame.c
350
- src/plugins/gstreamer_video_player/flutter_texture_sink.c
351
- src/plugins/gstreamer_video_player/plugin.c
352
- )
353
- endif ()
354
-
355
- if (BUILD_GSTREAMER_VIDEO_PLAYER_PLUGIN AND NOT LIBGSTREAMER_FOUND )
356
- if (TRY_BUILD_GSTREAMER_VIDEO_PLAYER_PLUGIN )
357
- message (NOTICE "Some required gstreamer dependencies were not found. Gstreamer audio player plugin won't be built." )
358
- else ()
359
- message (ERROR "Some required gstreamer dependencies were not found. Can't build gstreamer audio player plugin." )
360
- endif ()
352
+ if (BUILD_GSTREAMER_AUDIO_PLAYER_PLUGIN )
353
+ if (TRY_BUILD_GSTREAMER_AUDIO_PLAYER_PLUGIN )
354
+ pkg_check_modules (LIBGSTREAMER IMPORTED_TARGET gstreamer-1.0 )
355
+ pkg_check_modules (LIBGSTREAMER_APP IMPORTED_TARGET gstreamer-app-1.0 )
356
+ pkg_check_modules (LIBGSTREAMER_AUDIO IMPORTED_TARGET gstreamer-audio-1.0 )
357
+ else ()
358
+ pkg_check_modules (LIBGSTREAMER REQUIRED IMPORTED_TARGET gstreamer-1.0 )
359
+ pkg_check_modules (LIBGSTREAMER_APP REQUIRED IMPORTED_TARGET gstreamer-app-1.0 )
360
+ pkg_check_modules (LIBGSTREAMER_AUDIO REQUIRED IMPORTED_TARGET gstreamer-audio-1.0 )
361
361
endif ()
362
362
363
- if (BUILD_GSTREAMER_AUDIO_PLAYER_PLUGIN AND LIBGSTREAMER_FOUND )
363
+ if (LIBGSTREAMER_FOUND AND LIBGSTREAMER_APP_FOUND AND LIBGSTREAMER_AUDIO_FOUND )
364
364
target_sources (flutterpi_module PRIVATE
365
365
src/plugins/audioplayers/plugin.c
366
+ src/plugins/audioplayers/player.c
366
367
)
368
+ target_link_libraries (flutterpi_module PUBLIC
369
+ PkgConfig::LIBGSTREAMER
370
+ PkgConfig::LIBGSTREAMER_APP
371
+ PkgConfig::LIBGSTREAMER_AUDIO
372
+ )
373
+ else ()
374
+ message (NOTICE "Couldn't find gstreamer libraries. Gstreamer audio player plugin won't be build." )
367
375
endif ()
368
376
endif ()
369
377
@@ -382,10 +390,10 @@ if (BUILD_SENTRY_PLUGIN)
382
390
383
391
if (SENTRY_BACKEND STREQUAL "crashpad" AND SENTRY_PLUGIN_BUNDLE_CRASHPAD_HANDLER )
384
392
set (HAVE_BUNDLED_CRASHPAD_HANDLER ON )
385
-
393
+
386
394
target_sources (flutter-pi PRIVATE src/crashpad_handler_trampoline.cc )
387
395
# link against the same libraries the crashpad_handler uses
388
-
396
+
389
397
get_target_property (handler_deps crashpad_handler INTERFACE_LINK_LIBRARIES )
390
398
target_link_libraries (flutter-pi PUBLIC ${handler_deps} )
391
399
endif ()
0 commit comments