gstreamer
Loading...
Searching...
No Matches
gstreamer_options.h
Go to the documentation of this file.
1#pragma once
2
3// gemc
4#include "goptions.h"
5
6// c++
7#include <vector>
8
22constexpr const char* GSTREAMER_LOGGER = "gstreamer";
23
40{
43
51 GStreamerDefinition(std::string f, std::string n, std::string t) :
52 format(std::move(f)), rootname(std::move(n)), type(std::move(t)) {
53 }
54
66 format(other.format), rootname(other.rootname + "_t" + std::to_string(t)), type(other.type), tid(t) {
67 if (tid < 0) {
68 rootname = other.rootname;
69 }
70 }
71
73 std::string format;
74
76 std::string rootname;
77
79 std::string type;
80
82 int tid = -1;
83
94 [[nodiscard]] std::string gstreamerPluginName() const { return "gstreamer_" + format + "_plugin"; }
95};
96
97
98namespace gstreamer {
99
116std::vector<GStreamerDefinition> getGStreamerDefinition(const std::shared_ptr<GOptions>& gopts);
117
132
133}
vector< GStreamerDefinition > getGStreamerDefinition(const std::shared_ptr< GOptions > &gopts)
Parse all configured gstreamer output definitions from the options container.
GOptions defineOptions()
Define the options contributed by the gstreamer module.
constexpr const char * GSTREAMER_LOGGER
Logger category name used by gstreamer components.
constexpr const char * to_string(randomModel m) noexcept
Lightweight description of one configured gstreamer output.
int tid
Worker thread id associated with this definition, or a negative value when not specialized.
GStreamerDefinition(std::string f, std::string n, std::string t)
Construct a definition from explicit field values.
GStreamerDefinition(const GStreamerDefinition &other, int t)
Construct a per-thread specialization from an existing definition.
std::string rootname
Base output filename without extension, optionally specialized by thread id.
std::string type
Semantic output type, typically "event" or "stream".
std::string gstreamerPluginName() const
Return the plugin library name expected by the dynamic loader.
std::string format
Output format token used to select the plugin implementation.
GStreamerDefinition()=default
Default constructor producing an empty definition.