mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-12 09:46:21 +02:00
feat: Add streaming handlers for live TV proxying and VOD HLS transcoding using FFmpeg.
This commit is contained in:
1 parent
887bfad433
commit
89bd5bd7cb
51 files changed
+4568
No files matched your search
@@ -0,0 +1,53 @@
|
||||
// Copyright 2013 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "include/flutter/flutter_view_controller.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
|
||||
namespace flutter {
|
||||
|
||||
FlutterViewController::FlutterViewController(int width,
|
||||
int height,
|
||||
const DartProject& project) {
|
||||
engine_ = std::make_shared<FlutterEngine>(project);
|
||||
controller_ = FlutterDesktopViewControllerCreate(width, height,
|
||||
engine_->RelinquishEngine());
|
||||
if (!controller_) {
|
||||
std::cerr << "Failed to create view controller." << std::endl;
|
||||
return;
|
||||
}
|
||||
view_ = std::make_unique<FlutterView>(
|
||||
FlutterDesktopViewControllerGetView(controller_));
|
||||
}
|
||||
|
||||
FlutterViewController::~FlutterViewController() {
|
||||
if (controller_) {
|
||||
FlutterDesktopViewControllerDestroy(controller_);
|
||||
}
|
||||
}
|
||||
|
||||
FlutterViewId FlutterViewController::view_id() const {
|
||||
auto view_id = FlutterDesktopViewControllerGetViewId(controller_);
|
||||
|
||||
return static_cast<FlutterViewId>(view_id);
|
||||
}
|
||||
|
||||
void FlutterViewController::ForceRedraw() {
|
||||
FlutterDesktopViewControllerForceRedraw(controller_);
|
||||
}
|
||||
|
||||
std::optional<LRESULT> FlutterViewController::HandleTopLevelWindowProc(
|
||||
HWND hwnd,
|
||||
UINT message,
|
||||
WPARAM wparam,
|
||||
LPARAM lparam) {
|
||||
LRESULT result;
|
||||
bool handled = FlutterDesktopViewControllerHandleTopLevelWindowProc(
|
||||
controller_, hwnd, message, wparam, lparam, &result);
|
||||
return handled ? result : std::optional<LRESULT>(std::nullopt);
|
||||
}
|
||||
|
||||
} // namespace flutter
|
||||
Reference in new issue
Block a user