gstreamer
Loading...
Searching...
No Matches
gSROImplementation.h
Go to the documentation of this file.
1#pragma once
2
3#include "gSROCrate.h"
4
5#include <gemc/gbase/gbase.h>
6#include <gemc/gfactory/gdl.h>
7
14
16 std::shared_ptr<const GSROTiming> timing;
18 std::size_t max_pending_events = 65536;
19};
20
30class GSROImplementation : public GBase<GSROImplementation> {
31public:
32 explicit GSROImplementation(const std::shared_ptr<GOptions>& opts)
33 : GBase(opts, "gstreamer"), options(opts) {}
34 ~GSROImplementation() override = default;
35
37 void set_loggers(const std::shared_ptr<GOptions>& opts) {
38 options = opts;
39 log = std::make_shared<GLogger>(opts, "GSROImplementation", "gstreamer");
40 }
41
44
45 static GSROImplementation* instantiate(dlhandle handle, const std::shared_ptr<GOptions>& opts) {
46 using Factory = GSROImplementation* (*)(const std::shared_ptr<GOptions>&);
47 auto factory = reinterpret_cast<Factory>(dlsym(handle, "GSROImplementationFactory"));
48 if (!factory) { throw std::runtime_error("SRO plugin is missing GSROImplementationFactory"); }
49 return factory(opts);
50 }
51
52protected:
53 std::shared_ptr<GOptions> options;
54};
GBase(const std::shared_ptr< GOptions > &gopt, std::string logger_name="")
std::shared_ptr< GLogger > log
static GSROImplementation * instantiate(dlhandle handle, const std::shared_ptr< GOptions > &opts)
GSROImplementation(const std::shared_ptr< GOptions > &opts)
~GSROImplementation() override=default
void set_loggers(const std::shared_ptr< GOptions > &opts)
GManager calls this after loading an implementation, following the standard GEMC plugin contract.
virtual GSROCrateResources create_crate(GSROCrateId crate, const GSRORunContext &run) const =0
std::shared_ptr< GOptions > options
virtual GSROConfiguration configure_run(const GSRORunContext &run)=0
std::uint32_t GSROCrateId
Definition gSROData.h:18
std::uint64_t GSROEventId
Definition gSROData.h:19
void * dlhandle
run
std::size_t max_pending_events
GSROCrateLimits crate_limits
std::shared_ptr< const GSROTiming > timing
Per-crate bounds preventing asynchronous delivery from consuming unlimited memory.
Definition gSROCrate.h:29
Declare the sink first so the plugin referencing it is destroyed first.
Definition gSROCrate.h:42
Upcoming in the next release. Implementation-owned timing and output for one SRO invocation.
GSROEventId event_count
std::string output_basename