Commit graph

18 commits

Author SHA1 Message Date
Sergey Stepanov
ae5260fb47
Handle recover in VPX tests 2021-05-07 13:09:47 +03:00
Sergey Stepanov
a7d8e53dac
Add video encoder tests 2021-04-17 12:55:54 +03:00
Sergey Stepanov
efd8679de3
Fix some mistakes 2021-04-14 11:37:43 +03:00
sergystepanov
602b9ea47c
Make executables ready for static linking (#307)
* Disable CGO (C libs) for coordinator

Needed for static linking.

* Fix "error strings should not be capitalized (ST1005)"

* Fix SA1015

Using time.Tick leaks the underlying ticker, consider using it only in endless functions, tests and the main package, and use time.NewTicker here (SA1015)

* Fix SA9004

Only the first constant in this group has an explicit type (SA9004).

* Remove unused code in the webrtc package

* Fix S1000

Should use a simple channel send/receive instead of select with a single case (S1000).

* Force dir creation/check for core downloader

* Update Makefile release script

* Disable ASLR for worker builds

* Remove WORKER_BUILD_PARAMS flag from the CI

* Don't force recompilation in release

* Add Debian packages installer script

* Build worker app without libopusfile

* Test worker app without libopusfile

* Add opus wrapper without opusfile

* Make install.sh executable

* Add opus lib in Win builds

* Make insecure HTTPS requests when downloading libs

* Add ca-certificates for Docker build stage

go mod download works only with SSL certificates installed.

* Move libx264 wrapper into the repo

That way we can get rid of a lot of not needed external Go dependencies.

* Update the dependencies
2021-04-06 18:16:52 +03:00
sergystepanov
cbab5a1c71
Add deprecation note for libx264 < v160 (#301)
Deprecation due to libx264 version below v160 shouldn't work properly, and it's hard to support both v155, v160 in Golang.
2021-03-26 18:51:10 +03:00
sergystepanov
a779353569
Reduce coordinator dependencies tree (#292)
* Reduce coordinator dependencies tree

* Parallelize build/check

* Update dependencies
2021-03-15 13:08:15 +03:00
sergystepanov
f4c3a8cfef
Add new YUV converter with avg color calc (#287)
Add new YUV converter with 2x2 pixel matrix YUV color estimation.

The new YUV color converter, as opposed to the original one, uses more precise color calculations based on four neighboring pixels' average color values which helps a great deal with image aliasing / shimmering artifacts.
By default, it runs in the multithreaded mode with the game frames sliced between 2*(CPU cores) goroutines.
In case if this estimation mode doesn't work as expected it is possible to switch back to the original mode.

The default encoder is switched to x264 since it's faster now.
2021-03-07 18:17:52 +03:00
sergystepanov
fa28197390
Refactor and update VPX codec (#285)
* Refactor and update VPX codec

* Add VPX codec options support

* Add generic video encoding pipe

* Tweak in/out channels for the pipe

* Update YUV encoder

* Clean VP8 encoder
2021-02-27 18:09:55 +03:00
sergystepanov
4c883cf8e4
Fix x264 build trash (#282)
* Check x264 lib version with some conditional hacks for versions < 159
2021-02-21 21:41:10 +03:00
sergystepanov
bd701f10fc
Use modified x264 lib (#275)
* Use modified x264 lib

* Add x264 system lib

* Set x264 version 155 for Debian (Buster)

* Add h264 config params

* Set vp8 codec
2021-02-21 13:51:44 +03:00
Sergey Stepanov
69bc3cbb6f
Use new OPUS buffer every audio frame for less garbage 2021-01-21 19:25:19 +03:00
sergystepanov
76b7cafb71
Refactor OPUS encoder for quality and speed (#262)
* Refactor OPUS encoder for quality and speed.

Use OPUS low delay mode (https://www.opus-codec.org/docs/opus_api-1.1.3/group__opus__ctlvalues.html#ga592232fb39db60c1369989c5c5d19a07)

* Slightly tweak linear resample function and disable it on 48kHz input

* Rewrite OPUS encoder as a struct with some internal buffer

* Use OPUS 192Kbps preset by default

* Add encoder callback function on a full buffer

* Reuse OPUS output buffer

* Add write limiter for samples
2021-01-18 23:20:50 +03:00
sergystepanov
1fcf34ee02
Add new Libretro core manager module (#249)
* Add initial external configuration files support.

These external configuration files allow changing app params at the runtime without recompilation.

* Find config files with specified directory in the tests

* Add aspect ratio recalculation config

* Clean code

* Add new configuration files into the Docker container image

* Add shared core and config paths into the Libretro cores config

* Split ROM <-> Emulator mapping between workers and coordinators

* Extract coordinator config

* Add shared worker/coordinator server config

* Add explicit embedded shared worker/coordinator struct for auto-config reflection fill

* Remove default stun/turn servers from the config

* Extract and add new ice servers config structures

* Update coordinator config params

* Add auto emulation lib loader based on the runtime OS/arch

* Update configuration structures

* Remove shared config embedding

* Add missing network config params

* Add game library external config

* Remove unused config parameters

* Add WebRTC encoder external options

* Add user dir for config search

* Update config loader

* Update config

* Add generic downloader with Grab lib implementation

* Add a simple file downloader backed by the grab lib

* Add initial Libretro core repos abstractions

* Expose compression info for Libretro cores repository records

* Add pipe-based abstract file downloader

* Refactor downloader

* Refactor Libretro repos

* Add worker coresync stubs

* Add multiprocess-safe HTTP-based core manager implementation

* Remove Libretro cores from the repo

* Keep custom N64 cores in te repo for now

* Add Libretro cores repo select in the config

* Fix http manager repo switch

* Cleanup code

* Add greedy Libretro lib loader

* Don't crash when arch map is not set

* Disable dynamic recompiler for pcsx core by default since it's could cause a crash

* Use global Libretro dynalib handler

* Shorten the default Libretro cores store path

* Update zip extractor implementation

* Remove explicit fig lib field markings

* Add config note to the README file

* Add GitHub repo backend for the core downloader

* Fix GitHub repo param list in the manager factory

* Add env variables reader with CLOUD_GAME prefix

* Re-optimize ice server info struct custom marshaler
2020-12-31 13:24:27 +03:00
sergystepanov
a42aebec88
Migrate to v2 suffix (#231) 2020-10-04 23:21:03 +08:00
88hcsif
e7162d2085
Fix race condition when closing encoders (#215)
* Fix race condition when closing encoders

* Apply PR feedback
2020-07-02 16:53:49 +08:00
88hcsif
85bb99f8f8
Explicitly set RTP timestamp to cope with variable frame rate. (#211)
Set the timestamp as early as possible and propagate it through the pipeline.
2020-06-28 17:25:23 +08:00
giongto35
0b9d628ec2
Refactor: Fix channel init order (#141)
* Fix channel order

* Remove Done in encoder

* Update h264 encoder done code

* remove Unnecessary IsRunning
2019-11-27 02:38:13 +08:00
Sadlil Rhythom
0e17092acb Refactor of cloud game overlord and overworker (#70)
* Introduce Makefile and go vendor directory for faster build

* WIP: Refactor cloud-game codebase with spliting overlord and worker binary

* Fix all issues and have a running build

* Complete first version of refactor
2019-09-12 03:35:21 +08:00