docs: improvements to source code documentation (#1236)

This commit is contained in:
ReenigneArcher 2023-05-07 15:01:44 -04:00 committed by GitHub
commit 979f7f4e60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
71 changed files with 1284 additions and 1430 deletions

View file

@ -52,7 +52,7 @@ NamespaceIndentation: All
ObjCSpaceAfterProperty: true
ObjCSpaceBeforeProtocolList: true
PointerAlignment: Right
ReflowComments: false
ReflowComments: true
SpaceAfterCStyleCast: true
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true

View file

@ -8,16 +8,16 @@ version: 2
# Set the version of Python
build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "3.10"
python: "3.11"
apt_packages:
- graphviz
## Include the submodules, required for cmake
# submodules:
# include: all
# recursive: true
# submodules required for include statements
submodules:
include: all
recursive: true
# Build documentation in the docs/ directory with Sphinx
sphinx:

View file

@ -878,6 +878,7 @@ WARN_IF_UNDOC_ENUM_VAL = NO
# The default value is: NO.
WARN_AS_ERROR = NO
# todo - ideally this will eventually become FAIL_ON_WARNINGS
# The WARN_FORMAT tag determines the format of the warning messages that doxygen
# can produce. The string should contain the $file, $line, and $text tags, which
@ -2354,7 +2355,7 @@ SEARCH_INCLUDES = YES
# RECURSIVE has no effect here.
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
INCLUDE_PATH =
INCLUDE_PATH = ../third-party/ffmpeg-linux-x86_64/include/
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the

View file

@ -95,8 +95,16 @@ breathe_projects = dict(
)
todo_include_todos = True
subprocess.run('doxygen', shell=True, cwd=source_dir)
# disable epub mimetype warnings
# https://github.com/readthedocs/readthedocs.org/blob/eadf6ac6dc6abc760a91e1cb147cc3c5f37d1ea8/docs/conf.py#L235-L236
suppress_warnings = ["epub.unknown_project_files"]
# get doxygen version
doxy_proc = subprocess.run('doxygen --version', shell=True, cwd=source_dir, capture_output=True)
doxy_version = doxy_proc.stdout.decode('utf-8').strip()
print('doxygen version: ' + doxy_version)
# run doxygen
doxy_proc = subprocess.run('doxygen Doxyfile', shell=True, cwd=source_dir)
if doxy_proc.returncode != 0:
raise RuntimeError('doxygen failed with return code ' + str(doxy_proc.returncode))

View file

@ -1,5 +1,4 @@
#ifndef SUNSHINE_AUDIO_H
#define SUNSHINE_AUDIO_H
#pragma once
#include "thread_safe.h"
#include "utility.h"
@ -44,5 +43,3 @@ namespace audio {
void
capture(safe::mail_t mail, config_t config, void *channel_data);
} // namespace audio
#endif

View file

@ -87,9 +87,9 @@ namespace cbs {
make_sps_h264(const AVCodecContext *ctx) {
H264RawSPS sps {};
/* b_per_p == ctx->max_b_frames for h264 */
/* desired_b_depth == avoption("b_depth") == 1 */
/* max_b_depth == std::min(av_log2(ctx->b_per_p) + 1, desired_b_depth) ==> 1 */
// b_per_p == ctx->max_b_frames for h264
// desired_b_depth == avoption("b_depth") == 1
// max_b_depth == std::min(av_log2(ctx->b_per_p) + 1, desired_b_depth) ==> 1
auto max_b_depth = 1;
auto dpb_frame = ctx->gop_size == 1 ? 0 : 1 + max_b_depth;
auto mb_width = (FFALIGN(ctx->width, 16) / 16) * 16;

View file

@ -1,5 +1,4 @@
#ifndef SUNSHINE_CBS_H
#define SUNSHINE_CBS_H
#pragma once
#include "utility.h"
@ -33,5 +32,3 @@ namespace cbs {
bool
validate_sps(const AVPacket *packet, int codec_id);
} // namespace cbs
#endif

View file

@ -1,5 +1,4 @@
#ifndef SUNSHINE_CONFIG_H
#define SUNSHINE_CONFIG_H
#pragma once
#include <bitset>
#include <chrono>
@ -162,4 +161,3 @@ namespace config {
std::unordered_map<std::string, std::string>
parse_config(const std::string_view &file_content);
} // namespace config
#endif

View file

@ -1,4 +1,3 @@
// Created by TheElixZammuto on 2021-05-09.
// TODO: Authentication, better handling of routes common to nvhttp, cleanup
#define BOOST_BIND_GLOBAL_PLACEHOLDERS

View file

@ -1,7 +1,4 @@
// Created by loki on 6/3/19.
#ifndef SUNSHINE_CONFIGHTTP_H
#define SUNSHINE_CONFIGHTTP_H
#pragma once
#include <functional>
#include <string>
@ -34,5 +31,3 @@ const std::map<std::string, std::string> mime_types = {
{ "woff2", "font/woff2" },
{ "xml", "text/xml" },
};
#endif // SUNSHINE_CONFIGHTTP_H

View file

@ -1,5 +1,3 @@
// Created by loki on 5/31/19.
#include "crypto.h"
#include <openssl/pem.h>
@ -35,7 +33,7 @@ namespace crypto {
}
}
/*
/**
* When certificates from two or more instances of Moonlight have been added to x509_store_t,
* only one of them will be verified by X509_verify_cert, resulting in only a single instance of
* Moonlight to be able to use Sunshine

View file

@ -1,7 +1,4 @@
// Created by loki on 6/1/19.
#ifndef SUNSHINE_CRYPTO_H
#define SUNSHINE_CRYPTO_H
#pragma once
#include <array>
#include <openssl/evp.h>
@ -155,5 +152,3 @@ namespace crypto {
};
} // namespace cipher
} // namespace crypto
#endif //SUNSHINE_CRYPTO_H

View file

@ -1,3 +1,5 @@
#pragma once
#include "network.h"
#include "thread_safe.h"

View file

@ -1,5 +1,3 @@
// Created by loki on 6/20/19.
// define uint32_t for <moonlight-common-c/src/Input.h>
#include <cstdint>
extern "C" {
@ -366,8 +364,7 @@ namespace input {
mouse_press[button] = !release;
}
///////////////////////////////////
/*/
/**
* When Moonlight sends mouse input through absolute coordinates,
* it's possible that BUTTON_RIGHT is pressed down immediately after releasing BUTTON_LEFT.
* As a result, Sunshine will left-click on hyperlinks in the browser before right-clicking
@ -380,7 +377,7 @@ namespace input {
*
* input->mouse_left_button_timeout can only be nullptr
* when the last mouse coordinates were absolute
/*/
*/
if (button == BUTTON_LEFT && release && !input->mouse_left_button_timeout) {
auto f = [=]() {
auto left_released = mouse_press[BUTTON_LEFT];
@ -408,7 +405,6 @@ namespace input {
return;
}
///////////////////////////////////
platf::button_mouse(platf_input, button, release);
}

View file

@ -1,7 +1,4 @@
// Created by loki on 6/20/19.
#ifndef SUNSHINE_INPUT_H
#define SUNSHINE_INPUT_H
#pragma once
#include <functional>
@ -33,5 +30,3 @@ namespace input {
float scalar_inv;
};
} // namespace input
#endif // SUNSHINE_INPUT_H

View file

@ -3,8 +3,7 @@
*/
// macros
#ifndef SUNSHINE_MAIN_H
#define SUNSHINE_MAIN_H
#pragma once
// standard includes
#include <filesystem>
@ -87,5 +86,3 @@ namespace service_ctrl {
wait_for_ui_ready();
} // namespace service_ctrl
#endif
#endif // SUNSHINE_MAIN_H

View file

@ -1,9 +1,8 @@
#ifndef DOSSIER_MOVE_BY_COPY_H
#define DOSSIER_MOVE_BY_COPY_H
#pragma once
#include <utility>
namespace move_by_copy_util {
/*
/**
* When a copy is made, it moves the object
* This allows you to move an object when a move can't be done.
*/
@ -53,4 +52,3 @@ namespace move_by_copy_util {
return MoveByCopy<T>(std::move(const_cast<T &>(movable)));
}
} // namespace move_by_copy_util
#endif

View file

@ -1,5 +1,3 @@
// Created by loki on 12/27/19.
#include "network.h"
#include "utility.h"
#include <algorithm>

View file

@ -1,7 +1,4 @@
// Created by loki on 12/27/19.
#ifndef SUNSHINE_NETWORK_H
#define SUNSHINE_NETWORK_H
#pragma once
#include <tuple>
@ -34,5 +31,3 @@ namespace net {
host_t
host_create(ENetAddress &addr, std::size_t peers, std::uint16_t port);
} // namespace net
#endif // SUNSHINE_NETWORK_H

View file

@ -3,8 +3,7 @@
*/
// macros
#ifndef SUNSHINE_NVHTTP_H
#define SUNSHINE_NVHTTP_H
#pragma once
// standard includes
#include <string>
@ -46,5 +45,3 @@ namespace nvhttp {
void
erase_all_clients();
} // namespace nvhttp
#endif // SUNSHINE_NVHTTP_H

View file

@ -1,9 +1,4 @@
//
// Created by loki on 6/21/19.
//
#ifndef SUNSHINE_COMMON_H
#define SUNSHINE_COMMON_H
#pragma once
#include <bitset>
#include <filesystem>
@ -468,5 +463,3 @@ namespace platf {
std::vector<std::string_view> &
supported_gamepads();
} // namespace platf
#endif //SUNSHINE_COMMON_H

View file

@ -1,6 +1,3 @@
//
// Created by loki on 5/16/21.
//
#include <bitset>
#include <sstream>

View file

@ -30,7 +30,7 @@ using namespace std::literals;
using namespace std::literals;
//////////////////// Special desclarations
// Special declarations
/**
* NVCC tends to have problems with standard headers.
* Don't include common.h, instead use bare minimum
@ -78,7 +78,7 @@ static_assert(sizeof(video::color_t) == sizeof(video::color_extern_t), "color ma
extern color_t colors[6];
} // namespace video
//////////////////// End special declarations
// End special declarations
namespace cuda {
auto constexpr INVALID_TEXTURE = std::numeric_limits<cudaTextureObject_t>::max();

View file

@ -1,5 +1,6 @@
#if !defined(SUNSHINE_PLATFORM_CUDA_H) && defined(SUNSHINE_BUILD_CUDA)
#define SUNSHINE_PLATFORM_CUDA_H
#pragma once
#if defined(SUNSHINE_BUILD_CUDA)
#include <cstdint>
#include <memory>

View file

@ -1,5 +1,4 @@
#ifndef SUNSHINE_PLATFORM_LINUX_OPENGL_H
#define SUNSHINE_PLATFORM_LINUX_OPENGL_H
#pragma once
#include <optional>
#include <string_view>
@ -352,5 +351,3 @@ namespace egl {
bool
fail();
} // namespace egl
#endif

View file

@ -144,7 +144,7 @@ namespace platf {
/**
* @brief Initializes the keycode constants for translating
* moonlight keycodes to linux/X11 keycodes
* moonlight keycodes to linux/X11 keycodes.
*/
static constexpr std::array<keycode_t, 0xE3>
init_keycodes() {
@ -1247,7 +1247,7 @@ namespace platf {
/**
* @brief XTest mouse scroll.
* @param input The input_t instance to use.
* @param distance How far to scroll
* @param distance How far to scroll.
* @param button_pos Which mouse button to emulate for positive scroll.
* @param button_neg Which mouse button to emulate for negative scroll.
*
@ -1276,7 +1276,7 @@ namespace platf {
/**
* @brief Vertical mouse scroll.
* @param input The input_t instance to use.
* @param high_res_distance How far to scroll
* @param high_res_distance How far to scroll.
*
* EXAMPLES:
* ```cpp
@ -1301,7 +1301,7 @@ namespace platf {
/**
* @brief Horizontal mouse scroll.
* @param input The input_t instance to use.
* @param high_res_distance How far to scroll
* @param high_res_distance How far to scroll.
*
* EXAMPLES:
* ```cpp
@ -1428,7 +1428,7 @@ namespace platf {
/**
* Here we receive a single UTF-8 encoded char at a time,
* the trick is to convert it to UTF-32 then send CTRL+SHIFT+U+<HEXCODE> in order to produce any
* the trick is to convert it to UTF-32 then send CTRL+SHIFT+U+{HEXCODE} in order to produce any
* unicode character, see: https://en.wikipedia.org/wiki/Unicode_input
*
* ex:
@ -1549,7 +1549,7 @@ namespace platf {
}
/**
* @brief Initalize a new keyboard and return it.
* @brief Initialize a new keyboard and return it.
*
* EXAMPLES:
* ```cpp
@ -1578,7 +1578,7 @@ namespace platf {
}
/**
* @brief Initalize a new uinput virtual mouse and return it.
* @brief Initialize a new `uinput` virtual mouse and return it.
*
* EXAMPLES:
* ```cpp
@ -1629,7 +1629,7 @@ namespace platf {
}
/**
* @brief Initalize a new uinput virtual touchscreen and return it.
* @brief Initialize a new `uinput` virtual touchscreen and return it.
*
* EXAMPLES:
* ```cpp
@ -1679,7 +1679,7 @@ namespace platf {
}
/**
* @brief Initalize a new uinput virtual X360 gamepad and return it.
* @brief Initialize a new `uinput` virtual X360 gamepad and return it.
*
* EXAMPLES:
* ```cpp
@ -1756,7 +1756,7 @@ namespace platf {
}
/**
* @brief Initalize the input system and return it.
* @brief Initialize the input system and return it.
*
* EXAMPLES:
* ```cpp

View file

@ -1,5 +1,4 @@
#ifndef SUNSHINE_PLATFORM_MISC_H
#define SUNSHINE_PLATFORM_MISC_H
#pragma once
#include <unistd.h>
#include <vector>
@ -29,5 +28,3 @@ namespace dyn {
handle(const std::vector<const char *> &libs);
} // namespace dyn
#endif

View file

@ -12,7 +12,9 @@ using namespace std::literals;
namespace avahi {
/** Error codes used by avahi */
/**
* @brief Error codes used by avahi
*/
enum err_e {
OK = 0, /**< OK */
ERR_FAILURE = -1, /**< Generic error code */
@ -113,7 +115,9 @@ namespace avahi {
CLIENT_NO_FAIL = 2 /**< Don't fail if the daemon is not available when avahi_client_new() is called, instead enter CLIENT_CONNECTING state and wait for the daemon to appear */
};
/** Some flags for publishing functions */
/**
* @brief Some flags for publishing functions
*/
enum PublishFlags {
PUBLISH_UNIQUE = 1, /**< For raw records: The RRset is intended to be unique */
PUBLISH_NO_PROBE = 2, /**< For raw records: Though the RRset is intended to be unique no probes shall be sent */

View file

@ -7,8 +7,7 @@ extern "C" {
#include <libavcodec/avcodec.h>
#include <va/va.h>
#if !VA_CHECK_VERSION(1, 9, 0)
/* vaSyncBuffer stub allows Sunshine built against libva <2.9.0
to link against ffmpeg on libva 2.9.0 or later */
// vaSyncBuffer stub allows Sunshine built against libva <2.9.0 to link against ffmpeg on libva 2.9.0 or later
VAStatus
vaSyncBuffer(
VADisplay dpy,
@ -56,10 +55,7 @@ namespace va {
// Needs to be closed manually
int fd;
/*
* Total size of this object (may include regions which are
* not part of the surface).
*/
// Total size of this object (may include regions which are not part of the surface)
uint32_t size;
// Format modifier applied to this object, not sure what that means
uint64_t drm_format_modifier;
@ -85,7 +81,9 @@ namespace va {
} layers[4];
};
/** Currently defined profiles */
/**
* @brief Currently defined profiles
*/
enum class profile_e {
// Profile ID used for video processing.
ProfileNone = -1,
@ -135,9 +133,9 @@ namespace va {
IDCT = 3,
MoComp = 4,
Deblocking = 5,
EncSlice = 6, /* slice level encode */
EncPicture = 7, /* pictuer encode, JPEG, etc */
/*
EncSlice = 6, /** slice level encode */
EncPicture = 7, /** picture encode, JPEG, etc */
/**
* For an implementation that supports a low power/high performance variant
* for slice level encode, it can choose to expose the
* VAEntrypointEncSliceLP entrypoint. Certain encoding tools may not be
@ -148,7 +146,7 @@ namespace va {
EncSliceLP = 8,
VideoProc = 10, /**< Video pre/post-processing. */
/**
* \brief FEI
* @brief FEI
*
* The purpose of FEI (Flexible Encoding Infrastructure) is to allow applications to
* have more controls and trade off quality for speed with their own IPs.
@ -162,10 +160,10 @@ namespace va {
* and VAEncFEIDistortionBufferType) for FEI entry function.
* If separate PAK is set, two extra input buffers
* (VAEncFEIMVBufferType, VAEncFEIMBModeBufferType) are needed for PAK input.
**/
*/
FEI = 11,
/**
* \brief Stats
* @brief Stats
*
* A pre-processing function for getting some statistics and motion vectors is added,
* and some extra controls for Encode pipeline are provided. The application can
@ -179,19 +177,19 @@ namespace va {
* (VAStatsStatisticsParameterBufferType) and one or two output buffers
* (VAStatsStatisticsBufferType, VAStatsStatisticsBottomFieldBufferType (for interlace only)
* and VAStatsMVBufferType) are needed for this entry point.
**/
*/
Stats = 12,
/**
* \brief ProtectedTEEComm
* @brief ProtectedTEEComm
*
* A function for communicating with TEE (Trusted Execution Environment).
**/
*/
ProtectedTEEComm = 13,
/**
* \brief ProtectedContent
* @brief ProtectedContent
*
* A function for protected content to decrypt encrypted content.
**/
*/
ProtectedContent = 14,
};

View file

@ -1,5 +1,4 @@
#ifndef SUNSHINE_VAAPI_H
#define SUNSHINE_VAAPI_H
#pragma once
#include "misc.h"
#include "src/platform/common.h"
@ -29,4 +28,3 @@ namespace va {
int
init();
} // namespace va
#endif

View file

@ -1,5 +1,4 @@
#ifndef SUNSHINE_WAYLAND_H
#define SUNSHINE_WAYLAND_H
#pragma once
#include <bitset>
@ -246,5 +245,3 @@ namespace wl {
init() { return -1; }
} // namespace wl
#endif
#endif

View file

@ -1,7 +1,3 @@
//
// Created by loki on 6/21/19.
//
#include "src/platform/common.h"
#include <fstream>
@ -389,7 +385,7 @@ namespace platf {
mem_type_e mem_type;
/*
/**
* Last X (NOT the streamed monitor!) size.
* This way we can trigger reinitialization if the dimensions changed while streaming
*/

View file

@ -1,5 +1,4 @@
#ifndef SUNSHINE_X11_GRAB
#define SUNSHINE_X11_GRAB
#pragma once
#include <optional>
@ -66,5 +65,3 @@ namespace platf::x11 {
make_display() { return nullptr; }
#endif
} // namespace platf::x11
#endif

View file

@ -1,5 +1,4 @@
#ifndef SUNSHINE_PLATFORM_AV_AUDIO_H
#define SUNSHINE_PLATFORM_AV_AUDIO_H
#pragma once
#import <AVFoundation/AVFoundation.h>
@ -22,5 +21,3 @@
- (int)setupMicrophone:(AVCaptureDevice *)device sampleRate:(UInt32)sampleRate frameSize:(UInt32)frameSize channels:(UInt8)channels;
@end
#endif //SUNSHINE_PLATFORM_AV_AUDIO_H

View file

@ -1,5 +1,4 @@
#ifndef av_img_t_h
#define av_img_t_h
#pragma once
#include "src/platform/common.h"
@ -14,5 +13,3 @@ namespace platf {
~av_img_t();
};
} // namespace platf
#endif /* av_img_t_h */

View file

@ -1,5 +1,4 @@
#ifndef SUNSHINE_PLATFORM_AV_VIDEO_H
#define SUNSHINE_PLATFORM_AV_VIDEO_H
#pragma once
#import <AVFoundation/AVFoundation.h>
@ -38,5 +37,3 @@ typedef bool (^FrameCallbackBlock)(CMSampleBufferRef);
- (dispatch_semaphore_t)capture:(FrameCallbackBlock)frameCallback;
@end
#endif //SUNSHINE_PLATFORM_AV_VIDEO_H

View file

@ -1,5 +1,4 @@
#ifndef SUNSHINE_PLATFORM_MISC_H
#define SUNSHINE_PLATFORM_MISC_H
#pragma once
#include <vector>
@ -14,5 +13,3 @@ namespace dyn {
handle(const std::vector<const char *> &libs);
} // namespace dyn
#endif

View file

@ -1,5 +1,4 @@
#ifndef vtdevice_h
#define vtdevice_h
#pragma once
#include "src/platform/common.h"
@ -29,5 +28,3 @@ namespace platf {
};
} // namespace platf
#endif /* vtdevice_h */

View file

@ -12,7 +12,9 @@ using namespace std::literals;
namespace avahi {
/** Error codes used by avahi */
/**
* @brief Error codes used by avahi
*/
enum err_e {
OK = 0, /**< OK */
ERR_FAILURE = -1, /**< Generic error code */
@ -113,7 +115,9 @@ namespace avahi {
CLIENT_NO_FAIL = 2 /**< Don't fail if the daemon is not available when avahi_client_new() is called, instead enter CLIENT_CONNECTING state and wait for the daemon to appear */
};
/** Some flags for publishing functions */
/**
* @brief Some flags for publishing functions
*/
enum PublishFlags {
PUBLISH_UNIQUE = 1, /**< For raw records: The RRset is intended to be unique */
PUBLISH_NO_PROBE = 2, /**< For raw records: Though the RRset is intended to be unique no probes shall be sent */
@ -434,4 +438,4 @@ namespace platf::publish {
return std::make_unique<deinit_t>(std::thread { avahi::simple_poll_loop, poll.get() });
}
}; // namespace platf::publish
} // namespace platf::publish

View file

@ -1,7 +1,3 @@
//
// Created by loki on 1/12/20.
//
#include <audioclient.h>
#include <mmdeviceapi.h>
#include <roapi.h>

View file

@ -1,9 +1,4 @@
//
// Created by loki on 4/23/20.
//
#ifndef SUNSHINE_DISPLAY_H
#define SUNSHINE_DISPLAY_H
#pragma once
#include <d3d11.h>
#include <d3d11_4.h>
@ -237,5 +232,3 @@ namespace platf::dxgi {
std::atomic<uint32_t> next_image_id;
};
} // namespace platf::dxgi
#endif

View file

@ -1,7 +1,3 @@
//
// Created by loki on 1/12/20.
//
#include <cmath>
#include <codecvt>
#include <initguid.h>

View file

@ -1,5 +1,4 @@
#ifndef SUNSHINE_WINDOWS_MISC_H
#define SUNSHINE_WINDOWS_MISC_H
#pragma once
#include <chrono>
#include <string_view>
@ -18,5 +17,3 @@ namespace platf {
std::chrono::nanoseconds
qpc_time_difference(int64_t performance_counter1, int64_t performance_counter2);
} // namespace platf
#endif

View file

@ -1,5 +1,3 @@
// Created by loki on 12/14/19.
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
#include "process.h"

View file

@ -1,7 +1,4 @@
// Created by loki on 12/14/19.
#ifndef SUNSHINE_PROCESS_H
#define SUNSHINE_PROCESS_H
#pragma once
#ifndef __kernel_entry
#define __kernel_entry
@ -19,7 +16,7 @@ namespace proc {
using file_t = util::safe_ptr_v2<FILE, int, fclose>;
typedef config::prep_cmd_t cmd_t;
/*
/**
* pre_cmds -- guaranteed to be executed unless any of the commands fail.
* detached -- commands detached from Sunshine
* cmd -- Runs indefinitely until:
@ -117,4 +114,3 @@ namespace proc {
extern proc_t proc;
} // namespace proc
#endif // SUNSHINE_PROCESS_H

View file

@ -1,5 +1,4 @@
#ifndef KITTY_UTIL_ITERATOR_H
#define KITTY_UTIL_ITERATOR_H
#pragma once
#include <iterator>
@ -180,5 +179,3 @@ namespace round_robin_util {
return round_robin_t<V, It>(begin, end);
}
} // namespace round_robin_util
#endif

View file

@ -1,5 +1,3 @@
// Created by loki on 2/2/20.
#define BOOST_BIND_GLOBAL_PLACEHOLDERS
extern "C" {

View file

@ -1,7 +1,4 @@
// Created by loki on 2/2/20.
#ifndef SUNSHINE_RTSP_H
#define SUNSHINE_RTSP_H
#pragma once
#include <atomic>
@ -27,5 +24,3 @@ namespace rtsp_stream {
rtpThread();
} // namespace rtsp_stream
#endif // SUNSHINE_RTSP_H

View file

@ -1,5 +1,3 @@
// Created by loki on 6/5/19.
#include "process.h"
#include <future>

View file

@ -1,7 +1,4 @@
// Created by loki on 6/5/19.
#ifndef SUNSHINE_STREAM_H
#define SUNSHINE_STREAM_H
#pragma once
#include <boost/asio.hpp>
@ -49,5 +46,3 @@ namespace stream {
state(session_t &session);
} // namespace session
} // namespace stream
#endif // SUNSHINE_STREAM_H

View file

@ -1,7 +1,4 @@
// Created by loki on 16-4-19.
#ifndef SUNSHINE_SYNC_H
#define SUNSHINE_SYNC_H
#pragma once
#include <array>
#include <mutex>
@ -98,5 +95,3 @@ namespace sync_util {
};
} // namespace sync_util
#endif // SUNSHINE_SYNC_H

View file

@ -2,8 +2,7 @@
* @file system_tray.h
*/
#ifndef SUNSHINE_SYSTEM_TRAY_H
#define SUNSHINE_SYSTEM_TRAY_H
#pragma once
// system_tray namespace
namespace system_tray {
@ -31,4 +30,3 @@ namespace system_tray {
end_tray();
} // namespace system_tray
#endif // SUNSHINE_SYSTEM_TRAY_H

View file

@ -1,5 +1,4 @@
#ifndef KITTY_TASK_POOL_H
#define KITTY_TASK_POOL_H
#pragma once
#include <chrono>
#include <deque>
@ -111,7 +110,7 @@ namespace task_pool_util {
}
/**
* @return an id to potentially delay the task
* @return an id to potentially delay the task.
*/
template <class Function, class X, class Y, class... Args>
auto
@ -146,7 +145,8 @@ namespace task_pool_util {
}
/**
* @param duration The delay before executing the task
* @param task_id The id of the task to delay.
* @param duration The delay before executing the task.
*/
template <class X, class Y>
void
@ -257,4 +257,3 @@ namespace task_pool_util {
}
};
} // namespace task_pool_util
#endif

View file

@ -1,13 +1,11 @@
#ifndef KITTY_THREAD_POOL_H
#define KITTY_THREAD_POOL_H
#pragma once
#include "task_pool.h"
#include <thread>
namespace thread_pool_util {
/*
* Allow threads to execute unhindered
* while keeping full control over the threads.
/**
* Allow threads to execute unhindered while keeping full control over the threads.
*/
class ThreadPool: public task_pool_util::TaskPool {
public:
@ -127,4 +125,3 @@ namespace thread_pool_util {
}
};
} // namespace thread_pool_util
#endif

View file

@ -1,7 +1,4 @@
// Created by loki on 6/10/19.
#ifndef SUNSHINE_THREAD_SAFE_H
#define SUNSHINE_THREAD_SAFE_H
#pragma once
#include <array>
#include <atomic>
@ -574,5 +571,3 @@ namespace safe {
mail->cleanup();
}
} // namespace safe
#endif // SUNSHINE_THREAD_SAFE_H

View file

@ -1,5 +1,4 @@
#ifndef SUNSHINE_UPNP_H
#define SUNSHINE_UPNP_H
#pragma once
#include "platform/common.h"
@ -7,5 +6,3 @@ namespace upnp {
[[nodiscard]] std::unique_ptr<platf::deinit_t>
start();
}
#endif

View file

@ -1,5 +1,4 @@
#ifndef UTILITY_H
#define UTILITY_H
#pragma once
#include <algorithm>
#include <condition_variable>
@ -1030,4 +1029,3 @@ namespace util {
big(T x) { return endian_helper<T>::big(x); }
} // namespace endian
} // namespace util
#endif

View file

@ -1,7 +1,4 @@
// Created by loki on 8-2-19.
#ifndef T_MAN_UUID_H
#define T_MAN_UUID_H
#pragma once
#include <random>
@ -80,4 +77,3 @@ namespace uuid_util {
}
};
} // namespace uuid_util
#endif // T_MAN_UUID_H

View file

@ -1,10 +1,7 @@
#ifndef INCLUDE_GUARD
#define INCLUDE_GUARD
#pragma once
#define PROJECT_NAME "@PROJECT_NAME@"
#define PROJECT_VER "@PROJECT_VERSION@"
#define PROJECT_VER_MAJOR "@PROJECT_VERSION_MAJOR@"
#define PROJECT_VER_MINOR "@PROJECT_VERSION_MINOR@"
#define PROJECT_VER_PATCH "@PROJECT_VERSION_PATCH@"
#endif // INCLUDE_GUARD

View file

@ -1,5 +1,3 @@
// Created by loki on 6/6/19.
#include <atomic>
#include <bitset>
#include <list>
@ -1001,7 +999,7 @@ namespace video {
auto &sps = session.sps;
auto &vps = session.vps;
/* send the frame to the encoder */
// send the frame to the encoder
auto ret = avcodec_send_frame(ctx.get(), frame);
if (ret < 0) {
char err_str[AV_ERROR_MAX_STRING_SIZE] { 0 };
@ -1962,12 +1960,12 @@ namespace video {
return true;
}
/*
This is called once at startup and each time a stream is launched to
ensure the best encoder is selected. Encoder availablility can change
at runtime due to all sorts of things from driver updates to eGPUs.
This is only safe to call when there is no client actively streaming.
/**
* This is called once at startup and each time a stream is launched to
* ensure the best encoder is selected. Encoder availablility can change
* at runtime due to all sorts of things from driver updates to eGPUs.
*
* This is only safe to call when there is no client actively streaming.
*/
int
probe_encoders() {

View file

@ -1,7 +1,4 @@
// Created by loki on 6/9/19.
#ifndef SUNSHINE_VIDEO_H
#define SUNSHINE_VIDEO_H
#pragma once
#include "input.h"
#include "platform/common.h"
@ -103,5 +100,3 @@ namespace video {
int
probe_encoders();
} // namespace video
#endif // SUNSHINE_VIDEO_H