Skip to content

Commit 0d1f85a

Browse files
authored
Revert "audio & video player: migrate to common playbin implementation" (#482)
Accidentally merged before it was ready. * Revert "gstplayer: don't use sd_event_source_disable_unref" This reverts commit 5c296de. * Revert "gstplayer: only define appsink event handler for gstreamer >= 1.20.0" This reverts commit 0e85a9e. * Revert "gstplayer: don't use gst_video_info_new_from_caps" This reverts commit d1ae60a. * Revert "Revert "video player: disable hw decoding for gstreamer < 1.22.8"" This reverts commit 6027cca. * Revert "cmake: remove deleted `audioplayers/player.c` file" This reverts commit 18bdd03. * Revert "modesetting: remove logs if a separate cursor plane couldn't be found" This reverts commit 8f02bf1. * Revert "gstplayer: move gstplayer into separate file" This reverts commit adbb903. * Revert "audioplayers: migrate to gstplayer" This reverts commit 63efdca. * Revert "gstplayer: feature parity with audioplayers player" This reverts commit 5c617ce. * Revert "gitignore: ignore .cache" This reverts commit 91dfa31. * Revert "platform channels: helpers for decoding method calls" This reverts commit f14dcd5. * Revert "util: add khash hashmap implementation" This reverts commit 8870ffb. * Revert "video player: make seek flags construction a bit more easier to follow" This reverts commit 7a88da9. * Revert "video player: disable hw decoding for gstreamer < 1.22.8" This reverts commit 8d0fe72. * Revert "video player: fix parameter in g_object_set" This reverts commit f4fb9b7. * Revert "video player: fix code for gstreamer < 1.24.0" This reverts commit edb54a3. * Revert "video player: don't handle dma_drm video info" This reverts commit 3efc24a. * Revert "video player: use playbin3 instead of uridecodebin" This reverts commit 1fd62ad. * Revert "video player: use square BO" This reverts commit 9a8689a.
1 parent 5c296de commit 0d1f85a

File tree

16 files changed

+2537
-3480
lines changed

16 files changed

+2537
-3480
lines changed

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,3 @@ Icon
9999
Network Trash Folder
100100
Temporary Items
101101
.apdisk
102-
103-
# Used by zed to store clangd cache
104-
.cache

CMakeLists.txt

Lines changed: 56 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -305,65 +305,73 @@ endif()
305305
if (BUILD_TEST_PLUGIN)
306306
target_sources(flutterpi_module PRIVATE src/plugins/testplugin.c)
307307
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()
331312
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)
333318
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)
335324
endif()
336-
endif()
337325

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+
)
341346
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.")
343348
endif()
344349
endif()
350+
endif()
345351

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)
361361
endif()
362362

363-
if (BUILD_GSTREAMER_AUDIO_PLAYER_PLUGIN AND LIBGSTREAMER_FOUND)
363+
if (LIBGSTREAMER_FOUND AND LIBGSTREAMER_APP_FOUND AND LIBGSTREAMER_AUDIO_FOUND)
364364
target_sources(flutterpi_module PRIVATE
365365
src/plugins/audioplayers/plugin.c
366+
src/plugins/audioplayers/player.c
366367
)
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.")
367375
endif()
368376
endif()
369377

@@ -382,10 +390,10 @@ if (BUILD_SENTRY_PLUGIN)
382390

383391
if (SENTRY_BACKEND STREQUAL "crashpad" AND SENTRY_PLUGIN_BUNDLE_CRASHPAD_HANDLER)
384392
set(HAVE_BUNDLED_CRASHPAD_HANDLER ON)
385-
393+
386394
target_sources(flutter-pi PRIVATE src/crashpad_handler_trampoline.cc)
387395
# link against the same libraries the crashpad_handler uses
388-
396+
389397
get_target_property(handler_deps crashpad_handler INTERFACE_LINK_LIBRARIES)
390398
target_link_libraries(flutter-pi PUBLIC ${handler_deps})
391399
endif()

config.h.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,5 @@
2626
#cmakedefine ENABLE_MTRACE
2727
#cmakedefine ENABLE_ASAN
2828
#cmakedefine HAVE_BUNDLED_CRASHPAD_HANDLER
29-
#cmakedefine HAVE_GSTREAMER_VIDEO_PLAYER
3029

3130
#endif

src/modesetting.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2448,6 +2448,9 @@ int kms_req_builder_push_fb_layer(
24482448
/* id_range */ false, 0
24492449
// clang-format on
24502450
);
2451+
if (plane == NULL) {
2452+
LOG_DEBUG("Couldn't find a fitting cursor plane.\n");
2453+
}
24512454
}
24522455

24532456
/// TODO: Not sure we can use crtc_x, crtc_y, etc with primary planes

src/platformchannel.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,10 +1320,6 @@ int platch_respond_native_error_std(const FlutterPlatformMessageResponseHandle *
13201320
return platch_respond_error_std(handle, "nativeerror", strerror(_errno), &STDINT32(_errno));
13211321
}
13221322

1323-
int platch_respond_malformed_message_std(const FlutterPlatformMessage *message) {
1324-
return platch_respond_error_std(message->response_handle, "malformed-message", "The platform message received was malformed.", &STDNULL);
1325-
}
1326-
13271323
/************************
13281324
* JSON METHOD CHANNELS *
13291325
************************/
@@ -2487,13 +2483,3 @@ MALLOCLIKE MUST_CHECK char *raw_std_method_call_get_method_dup(const struct raw_
24872483
ATTR_PURE const struct raw_std_value *raw_std_method_call_get_arg(const struct raw_std_value *value) {
24882484
return raw_std_value_after(value);
24892485
}
2490-
2491-
ATTR_PURE const struct raw_std_value *raw_std_method_call_from_buffer(const void *buffer, size_t buffer_size) {
2492-
const struct raw_std_value *envelope = (const struct raw_std_value *) buffer;
2493-
2494-
if (!raw_std_method_call_check(envelope, buffer_size)) {
2495-
return NULL;
2496-
} else {
2497-
return envelope;
2498-
}
2499-
}

src/platformchannel.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Platform Channels
44
*
55
* Encoding/Decoding of flutter platform messages, with different
6-
*
6+
*
77
* Supported codecs:
88
* - standard message & method codec,
99
* - json message & method codec
@@ -1491,8 +1491,6 @@ int platch_respond_illegal_arg_ext_std(const FlutterPlatformMessageResponseHandl
14911491

14921492
int platch_respond_native_error_std(const FlutterPlatformMessageResponseHandle *handle, int _errno);
14931493

1494-
int platch_respond_malformed_message_std(const FlutterPlatformMessage *message);
1495-
14961494
int platch_respond_success_json(const FlutterPlatformMessageResponseHandle *handle, struct json_value *return_value);
14971495

14981496
int platch_respond_error_json(
@@ -1616,7 +1614,6 @@ ATTR_PURE bool raw_std_method_call_check(const struct raw_std_value *value, size
16161614
ATTR_PURE bool raw_std_method_call_response_check(const struct raw_std_value *value, size_t buffer_size);
16171615
ATTR_PURE bool raw_std_event_check(const struct raw_std_value *value, size_t buffer_size);
16181616

1619-
ATTR_PURE const struct raw_std_value *raw_std_method_call_from_buffer(const void *buffer, size_t buffer_size);
16201617
ATTR_PURE const struct raw_std_value *raw_std_method_call_get_method(const struct raw_std_value *value);
16211618
ATTR_PURE bool raw_std_method_call_is_method(const struct raw_std_value *value, const char *method_name);
16221619
MALLOCLIKE MUST_CHECK char *raw_std_method_call_get_method_dup(const struct raw_std_value *value);

0 commit comments

Comments
 (0)