StormByte-Multimedia 3.3.2
C++26 multimedia processing module of the StormByte suite
Loading...
Searching...
No Matches
typedefs.hxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024-2026 David C. Manuelda (StormBytePP)
3 *
4 * This file is part of StormByte-Multimedia.
5 *
6 * StormByte-Multimedia original source is dual-licensed:
7 *
8 * 1. GNU Lesser General Public License v3.0 (or later)
9 * You may redistribute and/or modify this file under the terms of the
10 * GNU Lesser General Public License as published by the Free Software
11 * Foundation, either version 3 of the License, or (at your option)
12 * any later version.
13 *
14 * 2. Commercial license
15 * Alternatively, this file may be used under the terms of a commercial
16 * license agreement with the copyright holder
17 * (David C. Manuelda <StormByte@gmail.com>).
18 *
19 * Both licenses apply only to original StormByte-Multimedia source in this
20 * file. Third-party components — including FFmpeg and embedded trained data —
21 * remain under their own licenses and are not covered by the commercial grant.
22 *
23 * A written StormByte commercial agreement may license this original source
24 * on terms other than the LGPL, including specific use, distribution or
25 * linking arrangements such as static linking, as stated in that agreement.
26 * It does not grant rights to dependencies or waive their license conditions.
27 * Enabling WITH_GPL or WITH_NONFREE may include components with separate
28 * obligations for modification, linking (static or dynamic), redistribution
29 * or works that incorporate them. The person modifying, linking, packaging or
30 * distributing the resulting work is responsible for determining and meeting
31 * all applicable requirements, including any needed patent permissions.
32 * A StormByte commercial agreement does not provide those rights for GPL or
33 * nonfree components.
34 *
35 * Neither license grants any patent rights. Any patent licenses required
36 * to use this software or third-party components must be obtained separately
37 * from the patent holders.
38 *
39 * StormByte-Multimedia is distributed in the hope that it will be useful,
40 * but WITHOUT ANY WARRANTY; without even the implied warranty of
41 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
42 * GNU Lesser General Public License for more details.
43 *
44 * You should have received a copy of the GNU Lesser General Public License
45 * version 3 along with StormByte-Multimedia. If not, see
46 * <https://www.gnu.org/licenses/lgpl-3.0.html>.
47 *
48 * SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-StormByte-Commercial
49 */
50
51#pragma once
52
53#include <StormByte/bitmask.hxx>
54#include <StormByte/buffer/hopper.hxx>
55#include <StormByte/expected.hxx>
58#include <StormByte/type_traits.hxx>
59
60#include <cstdint>
61#include <memory>
62
68namespace StormByte {
73 namespace Buffer {
78 template<Detail::HopperValue T>
79 class Sink;
80 }
81
87 namespace Multimedia {
93 namespace Pipeline {
98
109 enum class Kind: std::uint8_t {
110 Packet = 1 << 0,
111 Frame = 1 << 1
112 };
113
119 constexpr const char* ToString(Kind kind) noexcept {
120 switch (kind) {
121 case Kind::Frame: return "Frame";
122 case Kind::Packet: return "Packet";
123 default: return "Invalid";
124 }
125 }
126
146
152 constexpr const char* ToString(Producer producer) noexcept {
153 switch (producer) {
154 case Producer::Demuxer: return "Demuxer";
155 case Producer::Decoder: return "Decoder";
156 case Producer::Remuxer: return "Remuxer";
157 case Producer::Filter: return "Filter";
158 case Producer::Route: return "Route";
159 case Producer::Filters: return "Filters";
160 case Producer::Encoder: return "Encoder";
161 case Producer::Muxer: return "Muxer";
162 default: return "Invalid";
163 }
164 }
165
180 public:
185 };
186
211 enum class State: std::uint8_t {
217 };
218 }
219 }
220}
constexpr Bitmask() noexcept
Decodes packets of one origin track into frames.
Definition decoder.hxx:148
Reads interleaved compressed packets from the Plan reader.
Definition demuxer.hxx:148
Encodes frames of one output track into packets.
Definition encoder.hxx:145
Optional facade: Between stretches, Add filters, Close.
Definition filters.hxx:194
One decoded access unit.
Definition frame.hxx:103
Bitmask of Kind.
Definition typedefs.hxx:179
Writes interleaved packets to the Plan writer.
Definition muxer.hxx:217
One compressed access unit.
Definition packet.hxx:102
Forwards compressed packets of one origin track to the muxer.
Definition remuxer.hxx:133
State
Lifecycle of the stage thread.
Definition typedefs.hxx:211
Producer
Named stage of the tube.
Definition typedefs.hxx:136
Kind
Whether an Item is a decoded frame or a compressed packet.
Definition typedefs.hxx:109
@ Created
Constructed and available for configuration.
Definition typedefs.hxx:212
@ Stopping
Shutdown requested but not completed.
Definition typedefs.hxx:214
@ Ready
Initialized and processing media.
Definition typedefs.hxx:213
@ Demuxer
Demuxer stage.
Definition typedefs.hxx:137
@ Encoder
Encoder stage.
Definition typedefs.hxx:143
@ Route
A configured connection between pipeline stages.
Definition typedefs.hxx:141
@ Remuxer
Remuxer stage.
Definition typedefs.hxx:139
@ Muxer
Muxer stage.
Definition typedefs.hxx:144
@ Filter
Filter::FFmpeg stage.
Definition typedefs.hxx:140
@ Decoder
Decoder stage.
Definition typedefs.hxx:138
@ Filters
Filters stage.
Definition typedefs.hxx:142
@ Frame
Decoded StormByte::Multimedia::Pipeline::Frame.
Definition typedefs.hxx:111
@ Packet
Compressed StormByte::Multimedia::Pipeline::Packet.
Definition typedefs.hxx:110
@ Stopped
Constructed; Run has not started, or OnStart declined.
Definition transcoder.hxx:152
Typed item queues provided by StormByte-Buffer.
Frame and packet steps attached to a job or a raw pipeline.
Demux / decode / filter / encode / mux types.
@ Failed
Execution ended with a stage failure.
Definition activity.hxx:88
constexpr const char * ToString(Kind kind) noexcept
Converts a single Kind flag to a string literal.
Definition typedefs.hxx:119
StormByte::Expected< void, PlanException > CheckResult
Outcome of Plan::Check.
Definition typedefs.hxx:97
Multimedia module of the StormByte suite.
Root namespace of the StormByte C++ suite.
std::conditional_t< Type::Reference< T >, std::expected< std::reference_wrapper< std::remove_reference_t< T > >, Safe::Shared< E > >, std::expected< T, Safe::Shared< E > > > Expected
#define STORMBYTE_MULTIMEDIA_PUBLIC
Definition visibility.h:61