register plugin && fix r&b colors
Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
parent
8b7be688c2
commit
9559a889fb
@ -2,6 +2,9 @@
|
||||
|
||||
#include <optional>
|
||||
|
||||
#include <desktop_multi_window/desktop_multi_window_plugin.h>
|
||||
#include <texture_rgba_renderer/texture_rgba_renderer_plugin_c_api.h>
|
||||
|
||||
#include "flutter/generated_plugin_registrant.h"
|
||||
|
||||
FlutterWindow::FlutterWindow(const flutter::DartProject& project)
|
||||
@ -25,6 +28,13 @@ bool FlutterWindow::OnCreate() {
|
||||
return false;
|
||||
}
|
||||
RegisterPlugins(flutter_controller_->engine());
|
||||
DesktopMultiWindowSetWindowCreatedCallback([](void *controller) {
|
||||
auto *flutter_view_controller =
|
||||
reinterpret_cast<flutter::FlutterViewController *>(controller);
|
||||
auto *registry = flutter_view_controller->engine();
|
||||
TextureRgbaRendererPluginCApiRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("TextureRgbaRendererPlugin"));
|
||||
});
|
||||
SetChildContent(flutter_controller_->view()->GetNativeWindow());
|
||||
return true;
|
||||
}
|
||||
|
@ -944,9 +944,10 @@ impl VideoHandler {
|
||||
}
|
||||
match &vf.union {
|
||||
Some(frame) => {
|
||||
#[cfg(feature = "flutter_texture_render")]
|
||||
// windows && flutter_texture_render, fmt is ImageFormat::ABGR
|
||||
#[cfg(all(target_os = "windows", feature = "flutter_texture_render"))]
|
||||
let fmt = ImageFormat::ABGR;
|
||||
#[cfg(not(feature = "flutter_texture_render"))]
|
||||
#[cfg(not(all(target_os = "windows", feature = "flutter_texture_render")))]
|
||||
let fmt = ImageFormat::ARGB;
|
||||
let res = self.decoder.handle_video_frame(frame, fmt, &mut self.rgb);
|
||||
if self.record {
|
||||
|
Loading…
x
Reference in New Issue
Block a user