feat: enable video player in linux
This commit is contained in:
parent
41cc0560d0
commit
f043e191d2
11 changed files with 92 additions and 33 deletions
32
ios/Flutter/ephemeral/flutter_lldb_helper.py
Normal file
32
ios/Flutter/ephemeral/flutter_lldb_helper.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
#
|
||||
# Generated file, do not edit.
|
||||
#
|
||||
|
||||
import lldb
|
||||
|
||||
def handle_new_rx_page(frame: lldb.SBFrame, bp_loc, extra_args, intern_dict):
|
||||
"""Intercept NOTIFY_DEBUGGER_ABOUT_RX_PAGES and touch the pages."""
|
||||
base = frame.register["x0"].GetValueAsAddress()
|
||||
page_len = frame.register["x1"].GetValueAsUnsigned()
|
||||
|
||||
# Note: NOTIFY_DEBUGGER_ABOUT_RX_PAGES will check contents of the
|
||||
# first page to see if handled it correctly. This makes diagnosing
|
||||
# misconfiguration (e.g. missing breakpoint) easier.
|
||||
data = bytearray(page_len)
|
||||
data[0:8] = b'IHELPED!'
|
||||
|
||||
error = lldb.SBError()
|
||||
frame.GetThread().GetProcess().WriteMemory(base, data, error)
|
||||
if not error.Success():
|
||||
print(f'Failed to write into {base}[+{page_len}]', error)
|
||||
return
|
||||
|
||||
def __lldb_init_module(debugger: lldb.SBDebugger, _):
|
||||
target = debugger.GetDummyTarget()
|
||||
# Caveat: must use BreakpointCreateByRegEx here and not
|
||||
# BreakpointCreateByName. For some reasons callback function does not
|
||||
# get carried over from dummy target for the later.
|
||||
bp = target.BreakpointCreateByRegex("^NOTIFY_DEBUGGER_ABOUT_RX_PAGES$")
|
||||
bp.SetScriptCallbackFunction('{}.handle_new_rx_page'.format(__name__))
|
||||
bp.SetAutoContinue(True)
|
||||
print("-- LLDB integration loaded --")
|
||||
5
ios/Flutter/ephemeral/flutter_lldbinit
Normal file
5
ios/Flutter/ephemeral/flutter_lldbinit
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#
|
||||
# Generated file, do not edit.
|
||||
#
|
||||
|
||||
command script import --relative-to-command-file flutter_lldb_helper.py
|
||||
|
|
@ -17,6 +17,7 @@ import 'package:fluffychat/config/app_config.dart';
|
|||
import 'package:fluffychat/utils/client_manager.dart';
|
||||
import 'package:fluffychat/utils/notification_background_handler.dart';
|
||||
import 'package:fluffychat/utils/platform_infos.dart';
|
||||
import 'package:video_player_media_kit/video_player_media_kit.dart';
|
||||
import 'config/setting_keys.dart';
|
||||
import 'utils/background_push.dart';
|
||||
import 'widgets/fluffy_chat_app.dart';
|
||||
|
|
@ -47,7 +48,17 @@ void main() async {
|
|||
// widget bindings are initialized already.
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
|
||||
JustAudioMediaKit.ensureInitialized(linux: true);
|
||||
|
||||
if (PlatformInfos.isLinux || PlatformInfos.isWindows) {
|
||||
JustAudioMediaKit.ensureInitialized(
|
||||
linux: true,
|
||||
windows: true
|
||||
);
|
||||
VideoPlayerMediaKit.ensureInitialized(
|
||||
linux: true,
|
||||
windows: true
|
||||
);
|
||||
}
|
||||
|
||||
final store = await AppSettings.init();
|
||||
Logs().i('Welcome to ${AppSettings.applicationName.value} <3');
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class EventVideoPlayer extends StatelessWidget {
|
|||
timeline: timeline,
|
||||
outerContext: context,
|
||||
),
|
||||
)
|
||||
),
|
||||
borderRadius: BorderRadius.circular(AppConfig.borderRadius),
|
||||
child: SizedBox(
|
||||
width: width,
|
||||
|
|
|
|||
|
|
@ -13,10 +13,9 @@
|
|||
#include <file_selector_linux/file_selector_plugin.h>
|
||||
#include <flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h>
|
||||
#include <flutter_webrtc/flutter_web_r_t_c_plugin.h>
|
||||
#include <fvp/fvp_plugin.h>
|
||||
#include <gtk/gtk_plugin.h>
|
||||
#include <handy_window/handy_window_plugin.h>
|
||||
#include <media_kit_libs_linux/media_kit_libs_linux_plugin.h>
|
||||
#include <media_kit_video/media_kit_video_plugin.h>
|
||||
#include <record_linux/record_linux_plugin.h>
|
||||
#include <screen_retriever_linux/screen_retriever_linux_plugin.h>
|
||||
#include <sqlcipher_flutter_libs/sqlite3_flutter_libs_plugin.h>
|
||||
|
|
@ -47,18 +46,15 @@ void fl_register_plugins(FlPluginRegistry* registry) {
|
|||
g_autoptr(FlPluginRegistrar) flutter_webrtc_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterWebRTCPlugin");
|
||||
flutter_web_r_t_c_plugin_register_with_registrar(flutter_webrtc_registrar);
|
||||
g_autoptr(FlPluginRegistrar) fvp_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "FvpPlugin");
|
||||
fvp_plugin_register_with_registrar(fvp_registrar);
|
||||
g_autoptr(FlPluginRegistrar) gtk_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "GtkPlugin");
|
||||
gtk_plugin_register_with_registrar(gtk_registrar);
|
||||
g_autoptr(FlPluginRegistrar) handy_window_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "HandyWindowPlugin");
|
||||
handy_window_plugin_register_with_registrar(handy_window_registrar);
|
||||
g_autoptr(FlPluginRegistrar) media_kit_libs_linux_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "MediaKitLibsLinuxPlugin");
|
||||
media_kit_libs_linux_plugin_register_with_registrar(media_kit_libs_linux_registrar);
|
||||
g_autoptr(FlPluginRegistrar) media_kit_video_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "MediaKitVideoPlugin");
|
||||
media_kit_video_plugin_register_with_registrar(media_kit_video_registrar);
|
||||
g_autoptr(FlPluginRegistrar) record_linux_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "RecordLinuxPlugin");
|
||||
record_linux_plugin_register_with_registrar(record_linux_registrar);
|
||||
|
|
|
|||
|
|
@ -10,10 +10,9 @@ list(APPEND FLUTTER_PLUGIN_LIST
|
|||
file_selector_linux
|
||||
flutter_secure_storage_linux
|
||||
flutter_webrtc
|
||||
fvp
|
||||
gtk
|
||||
handy_window
|
||||
media_kit_libs_linux
|
||||
media_kit_video
|
||||
record_linux
|
||||
screen_retriever_linux
|
||||
sqlcipher_flutter_libs
|
||||
|
|
|
|||
|
|
@ -18,9 +18,9 @@ import flutter_new_badger
|
|||
import flutter_secure_storage_darwin
|
||||
import flutter_web_auth_2
|
||||
import flutter_webrtc
|
||||
import fvp
|
||||
import geolocator_apple
|
||||
import just_audio
|
||||
import media_kit_video
|
||||
import package_info_plus
|
||||
import record_macos
|
||||
import screen_retriever_macos
|
||||
|
|
@ -49,9 +49,9 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
|
|||
FlutterSecureStorageDarwinPlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStorageDarwinPlugin"))
|
||||
FlutterWebAuth2Plugin.register(with: registry.registrar(forPlugin: "FlutterWebAuth2Plugin"))
|
||||
FlutterWebRTCPlugin.register(with: registry.registrar(forPlugin: "FlutterWebRTCPlugin"))
|
||||
FvpPlugin.register(with: registry.registrar(forPlugin: "FvpPlugin"))
|
||||
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
|
||||
JustAudioPlugin.register(with: registry.registrar(forPlugin: "JustAudioPlugin"))
|
||||
MediaKitVideoPlugin.register(with: registry.registrar(forPlugin: "MediaKitVideoPlugin"))
|
||||
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
|
||||
RecordMacOsPlugin.register(with: registry.registrar(forPlugin: "RecordMacOsPlugin"))
|
||||
ScreenRetrieverMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverMacosPlugin"))
|
||||
|
|
|
|||
39
pubspec.lock
39
pubspec.lock
|
|
@ -669,19 +669,6 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "4.0.0"
|
||||
fuchsia_remote_debug_protocol:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
fvp:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: fvp
|
||||
sha256: e03c4ba02c367cde8610c09325d085c9b1efe4f7d98a563950993a1fee17a28b
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.35.2"
|
||||
geoclue:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -1019,7 +1006,7 @@ packages:
|
|||
source: hosted
|
||||
version: "1.6.2"
|
||||
linkify:
|
||||
dependency: transitive
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: linkify
|
||||
sha256: "4139ea77f4651ab9c315b577da2dd108d9aa0bd84b5d03d33323f1970c645832"
|
||||
|
|
@ -1106,6 +1093,22 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.2.1"
|
||||
media_kit_libs_windows_video:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: media_kit_libs_windows_video
|
||||
sha256: dff76da2778729ab650229e6b4ec6ec111eb5151431002cbd7ea304ff1f112ab
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.0.11"
|
||||
media_kit_video:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: media_kit_video
|
||||
sha256: afaa509e7b7e0bf247557a3a740cde903a52c34ace9810f94500e127bd7b043d
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.1"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
@ -2063,6 +2066,14 @@ packages:
|
|||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.9.3"
|
||||
video_player_media_kit:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
name: video_player_media_kit
|
||||
sha256: "66c5f30e2700f4528154320e708f89f4a80075b2451bebc6fef73a15d63a3fca"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.0.0"
|
||||
video_player_platform_interface:
|
||||
dependency: transitive
|
||||
description:
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ dependencies:
|
|||
flutter_vodozemac: ^0.5.0
|
||||
flutter_web_auth_2: ^5.0.1
|
||||
flutter_webrtc: ^1.3.1
|
||||
fvp: ^0.35.2
|
||||
geolocator: ^14.0.2
|
||||
go_router: ^17.1.0
|
||||
handy_window: ^0.4.2
|
||||
|
|
@ -83,6 +82,8 @@ dependencies:
|
|||
video_player: ^2.11.1
|
||||
wakelock_plus: ^1.5.0
|
||||
webrtc_interface: ^1.3.0
|
||||
media_kit_libs_windows_video: ^1.0.11
|
||||
video_player_media_kit: ^2.0.0
|
||||
|
||||
dev_dependencies:
|
||||
dart_code_linter: ^3.2.1
|
||||
|
|
|
|||
|
|
@ -13,8 +13,9 @@
|
|||
#include <file_selector_windows/file_selector_windows.h>
|
||||
#include <flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h>
|
||||
#include <flutter_webrtc/flutter_web_r_t_c_plugin.h>
|
||||
#include <fvp/fvp_plugin_c_api.h>
|
||||
#include <geolocator_windows/geolocator_windows.h>
|
||||
#include <media_kit_libs_windows_video/media_kit_libs_windows_video_plugin_c_api.h>
|
||||
#include <media_kit_video/media_kit_video_plugin_c_api.h>
|
||||
#include <record_windows/record_windows_plugin_c_api.h>
|
||||
#include <screen_retriever_windows/screen_retriever_windows_plugin_c_api.h>
|
||||
#include <share_plus/share_plus_windows_plugin_c_api.h>
|
||||
|
|
@ -39,10 +40,12 @@ void RegisterPlugins(flutter::PluginRegistry* registry) {
|
|||
registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin"));
|
||||
FlutterWebRTCPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("FlutterWebRTCPlugin"));
|
||||
FvpPluginCApiRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("FvpPluginCApi"));
|
||||
GeolocatorWindowsRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("GeolocatorWindows"));
|
||||
MediaKitLibsWindowsVideoPluginCApiRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("MediaKitLibsWindowsVideoPluginCApi"));
|
||||
MediaKitVideoPluginCApiRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("MediaKitVideoPluginCApi"));
|
||||
RecordWindowsPluginCApiRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("RecordWindowsPluginCApi"));
|
||||
ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar(
|
||||
|
|
|
|||
|
|
@ -10,8 +10,9 @@ list(APPEND FLUTTER_PLUGIN_LIST
|
|||
file_selector_windows
|
||||
flutter_secure_storage_windows
|
||||
flutter_webrtc
|
||||
fvp
|
||||
geolocator_windows
|
||||
media_kit_libs_windows_video
|
||||
media_kit_video
|
||||
record_windows
|
||||
screen_retriever_windows
|
||||
share_plus
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue