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
20constexpr const char* GSTREAMER_LOGGER = "gstreamer";
21
36{
39
46 GStreamerDefinition(std::string f, std::string n, std::string t) :
47 format(std::move(f)), rootname(std::move(n)), type(std::move(t)) {
48 }
49
60 format(other.format), rootname(other.rootname + "_t" + std::to_string(t)), type(other.type), tid(t) {
61 if (tid < 0) {
62 rootname = other.rootname; // if tid is negative, use the original rootname
63 }
64 }
65
67 std::string format;
68
70 std::string rootname;
71
73 std::string type;
74
76 int tid = -1;
77
85 [[nodiscard]] std::string gstreamerPluginName() const { return "gstreamer_" + format + "_plugin"; }
86};
87
88
89namespace gstreamer {
102std::vector<GStreamerDefinition> getGStreamerDefinition(const std::shared_ptr<GOptions>& gopts);
103
114}
constexpr const char * GSTREAMER_LOGGER
Logger category name used by gstreamer components.
vector< GStreamerDefinition > getGStreamerDefinition(const std::shared_ptr< GOptions > &gopts)
Parse gstreamer output definitions from options.
GOptions defineOptions()
Contribute gstreamer options to the global option set.
constexpr const char * to_string(randomModel m) noexcept
Utility struct describing one configured output for the gstreamer module.
int tid
Thread id used to specialize rootname; negative means "not specialized".
GStreamerDefinition(std::string f, std::string n, std::string t)
Construct from explicit fields.
GStreamerDefinition(const GStreamerDefinition &other, int t)
Construct a per-thread variant of an existing definition.
std::string rootname
Base filename (without extension), possibly specialized by thread id.
std::string type
Semantic output type token (e.g. "event" or "stream").
std::string gstreamerPluginName() const
Return the plugin library / object name used by the dynamic loader.
std::string format
Output format token used to select a plugin.
GStreamerDefinition()=default
Default constructor producing an empty definition.