diff options
author | Timothy Flynn <trflynn89@pm.me> | 2023-04-09 11:59:35 -0400 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-04-09 23:55:05 +0200 |
commit | 7132047c924c1850c406e52cf58e2d80267e8370 (patch) | |
tree | 581ffc93cfc43416c18707e1661b5fa263e59535 /Userland/Libraries/LibVideo | |
parent | 918ed5c920de3a5ea0ceb5c477a0822fb14ab9db (diff) | |
download | serenity-7132047c924c1850c406e52cf58e2d80267e8370.zip |
LibVideo: Add a forwarding header
And change some non-plain structs to classes for consistency.
Diffstat (limited to 'Userland/Libraries/LibVideo')
-rw-r--r-- | Userland/Libraries/LibVideo/DecoderError.h | 5 | ||||
-rw-r--r-- | Userland/Libraries/LibVideo/Forward.h | 19 | ||||
-rw-r--r-- | Userland/Libraries/LibVideo/PlaybackManager.h | 3 | ||||
-rw-r--r-- | Userland/Libraries/LibVideo/Track.h | 2 |
4 files changed, 24 insertions, 5 deletions
diff --git a/Userland/Libraries/LibVideo/DecoderError.h b/Userland/Libraries/LibVideo/DecoderError.h index c66b7717ea..bca03e1c18 100644 --- a/Userland/Libraries/LibVideo/DecoderError.h +++ b/Userland/Libraries/LibVideo/DecoderError.h @@ -10,12 +10,11 @@ #include <AK/Error.h> #include <AK/Format.h> #include <AK/SourceLocation.h> +#include <LibVideo/Forward.h> #include <errno.h> namespace Video { -struct DecoderError; - template<typename T> using DecoderErrorOr = ErrorOr<T, DecoderError>; @@ -33,7 +32,7 @@ enum class DecoderErrorCategory : u32 { NotImplemented, }; -struct DecoderError { +class DecoderError { public: static DecoderError with_description(DecoderErrorCategory category, StringView description) { diff --git a/Userland/Libraries/LibVideo/Forward.h b/Userland/Libraries/LibVideo/Forward.h new file mode 100644 index 0000000000..6eb99471f3 --- /dev/null +++ b/Userland/Libraries/LibVideo/Forward.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org> + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +namespace Video { + +class DecoderError; +class FrameQueueItem; +class PlaybackManager; +class Sample; +class Track; +class VideoDecoder; +class VideoFrame; + +} diff --git a/Userland/Libraries/LibVideo/PlaybackManager.h b/Userland/Libraries/LibVideo/PlaybackManager.h index 92c03d5131..813101ba6f 100644 --- a/Userland/Libraries/LibVideo/PlaybackManager.h +++ b/Userland/Libraries/LibVideo/PlaybackManager.h @@ -23,7 +23,8 @@ namespace Video { -struct FrameQueueItem { +class FrameQueueItem { +public: static constexpr Time no_timestamp = Time::min(); enum class Type { diff --git a/Userland/Libraries/LibVideo/Track.h b/Userland/Libraries/LibVideo/Track.h index 476ff51314..4653cc22fc 100644 --- a/Userland/Libraries/LibVideo/Track.h +++ b/Userland/Libraries/LibVideo/Track.h @@ -20,7 +20,7 @@ enum class TrackType : u32 { Subtitles, }; -struct Track { +class Track { struct VideoData { Time duration {}; u64 pixel_width { 0 }; |