[video_player_videohole] Migrating from Platform Channels to Dart FFI - #1073
Open
gin7773 wants to merge 41 commits into
Open
[video_player_videohole] Migrating from Platform Channels to Dart FFI#1073gin7773 wants to merge 41 commits into
gin7773 wants to merge 41 commits into
Conversation
gin7773
marked this pull request as draft
July 28, 2026 10:38
…tore the return type of restore.
- Add nlohmann/json single-header library to tizen/third_party/ - Replace handwritten JSON parser with nlohmann/json in ParseJsonMap() - Simplify ParseCreateMessage() to use json library directly - Add EncodableValueFromJson() helper for JSON to EncodableValue conversion This change improves JSON parsing reliability by supporting: - Escape characters in strings - Nested objects and arrays - Unicode characters - Proper error handling with parse_error exceptions Co-Authored-By: Cline SR
- Add UnregisterAllPlayerEventPorts() function in video_player.cc - Add ffi_unregister_all_player_event_ports() FFI wrapper - Add Dart bindings in ffi_messages.g.dart - Call unregisterAllPlayerEventPorts() in init() to clean up ports on hot restart This fix prevents Dart port leaks when the Dart VM is restarted (e.g., hot restart during development) while the native process continues. Co-Authored-By: Cline SR
- Fix FFI event port symbol name mismatch (ffi_register_dart_port) - Call Prepare() after RestorePlayer for two-phase initialization - Return true from Play() when already playing (idempotent) - Remove duplicate play() call in restored event handler Co-Authored-By: Cline SR
xiaowei-guan
self-requested a review
July 30, 2026 09:24
gin7773
marked this pull request as ready for review
August 5, 2026 08:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Main changes:
Threading note
After migrating from Platform Channels to Dart FFI, some native calls are invoked synchronously from the Flutter UI thread rather than through the previous platform-channel handler path. The ecore_wl2 display path is marked with a TODO because those APIs are not thread-safe and will be revisited during the planned ecore-to-GLib migration.
Performance Comparison: FFI vs Platform Channel
Conclusion
FFI provides massive speedups for communication-heavy operations (3-58x) and uses 4.1x less memory. The only comparable areas are native-dominated operations (create+dispose) where communication overhead is negligible relative to player initialization.