Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[submodule "tv-native-apis"]
path = tv-native-apis
url = https://github.com/webosbrew/tv-native-apis.git
[submodule "unicapture/hyperion-webos"]
path = unicapture/hyperion-webos
url = https://github.com/webosbrew/hyperion-webos.git
16 changes: 4 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14)
project (webos-vncserver C)
project (webos-vncserver C CXX)

add_subdirectory(prebuilt)
add_subdirectory(tv-native-apis)
Expand Down Expand Up @@ -35,6 +35,8 @@ include_directories(${GLIB2_INCLUDE_DIRS})
include_directories(${LS2_INCLUDE_DIRS})
include_directories(${PMLOG_INCLUDE_DIRS})

add_subdirectory(unicapture)

set(CMAKE_INSTALL_RPATH $ORIGIN)
add_executable(webos-vncserver
src/main.c
Expand All @@ -45,20 +47,10 @@ add_executable(webos-vncserver
src/log.c
)
set_property(TARGET webos-vncserver PROPERTY ENABLE_EXPORTS 1)
target_link_libraries(webos-vncserver im vncserver pthread z png jpeg ssl crypto dl ${LS2_LDFLAGS} ${PBNJSON_LDFLAGS} ${GLIB2_LDFLAGS} ${PMLOG_LDFLAGS} rt)
target_link_libraries(webos-vncserver im vncserver unicapture pthread z png jpeg ssl crypto dl ${LS2_LDFLAGS} ${PBNJSON_LDFLAGS} ${GLIB2_LDFLAGS} ${PMLOG_LDFLAGS} rt)

set_target_properties(webos-vncserver PROPERTIES
BUILD_RPATH_USE_ORIGIN ON
INSTALL_RPATH "$ORIGIN:$ORIGIN/lib"
BUILD_RPATH "$ORIGIN:$ORIGIN/lib"
)

add_library(capture_gm SHARED
src/capture_gm.c
)
target_link_libraries(capture_gm gm)

add_library(capture_halgal SHARED
src/capture_halgal.c
)
target_link_libraries(capture_halgal halgal)
8 changes: 8 additions & 0 deletions frontend/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export function App() {
const [width, setWidth] = React.useState("");
const [height, setHeight] = React.useState("");
const [autostart, setAutostart] = React.useState(false);
const [captureVideo, setCaptureVideo] = React.useState(false);

const [running, setRunning] = React.useState(null);
const [activeClients, setActiveClients] = React.useState(0);
Expand Down Expand Up @@ -92,6 +93,7 @@ export function App() {
setHeight(status.settings.height);
setAutostart(status.settings.autostart);
setFramerate(status.settings.framerate);
setCaptureVideo(status.settings.captureVideo);

setLoading(false);
} catch (err) {
Expand All @@ -109,6 +111,7 @@ export function App() {
autostart,
password,
framerate,
captureVideo,
});
setStatusText("Configuration changed.");
} catch (err) {
Expand Down Expand Up @@ -169,6 +172,11 @@ export function App() {
value={password}
onChange={(evt) => setPassword(evt.target.value)}
/>
<SwitchItem
checked={captureVideo}
label="Capture Video"
onClick={() => setCaptureVideo(!captureVideo)}
/>
<SwitchItem
checked={autostart}
label="Autostart"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"start": "webpack serve --mode development",
"build": "webpack",
"build-service": "cmake -S . -B build && cmake --build build --target webos-vncserver --target capture_gm --target capture_halgal",
"build-service": "cmake -S . -B build && cmake --build build --target webos-vncserver",
"package": "ares-package -o dist/ -n build/frontend build/service",
"compat-check": "webosbrew-ipk-compat-checker --markdown --github-emoji dist/${npm_package_name}_${npm_package_version}_all.ipk",
"build-manifest": "webosbrew-gen-manifest --appinfo build/frontend/appinfo.json --pkgfile dist/${npm_package_name}_${npm_package_version}_all.ipk --output dist/${npm_package_name}.manifest.json --icon assets/largeIcon.png --link https://github.com/Informatic/webos-vncserver --root true",
Expand Down
6 changes: 0 additions & 6 deletions src/capture.h

This file was deleted.

31 changes: 0 additions & 31 deletions src/capture_gm.c

This file was deleted.

66 changes: 0 additions & 66 deletions src/capture_halgal.c

This file was deleted.

5 changes: 2 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ int main (int argc, char** argv) {
log_set_level(Debug);
}

server_t server;
server_t server = {0};
server.active_clients = 0;
server.running = false;

settings_t settings;
settings_t settings = {0};
loop = g_main_loop_new(NULL, FALSE);

settings.framerate = 30;
Expand All @@ -43,7 +43,6 @@ int main (int argc, char** argv) {
if (!getenv("LS_SERVICE_NAMES")) {
INFO("Running via CLI - starting anyway");
server_start(&server, &settings);
server_bind_gmainloop(&server);
signal(SIGINT, int_handler);
}

Expand Down
Loading