gstreamer
Loading...
Searching...
No Matches
gstreamerJLABSROFactory.h
Go to the documentation of this file.
1#pragma once
2
3// gstreamer
4#include "gstreamer.h"
6
7// c++
8#include <fstream>
9
18#pragma pack(push, 1)
26{
27 uint32_t source_id;
28 uint32_t total_length;
31 uint32_t magic;
33 uint32_t flags;
35 uint64_t ts_sec;
36 uint64_t ts_nsec;
37};
38#pragma pack(pop)
39
56{
57public:
58 // GstreamerJSROFactory() = default;
59
60 // inherit the base (const std::shared_ptr<GOptions>&) ctor
62
63private:
64 // open and close the output media
65 bool openConnection() override;
66 bool closeConnectionImpl() override;
67
68 // frame streams
69 bool startStreamImpl(const GFrameDataCollection* frameRunData) override;
70 bool endStreamImpl(const GFrameDataCollection* frameRunData) override;
71 bool publishFrameHeaderImpl(const GFrameHeader* gframeHeader) override;
72 bool publishPayloadImpl(const std::vector<GIntegralPayload*>* payload) override;
73
74 // JLAB specific
75 static inline std::uint64_t llswap(unsigned long long val) { return (val >> 32) | (val << 32); }
76
77private:
79 std::ofstream* ofile = nullptr;
80
82 std::vector<unsigned int> frame_data{};
83
85 std::string filename() const override { return gstreamer_definitions.rootname + ".ev"; }
86};
87
88
Abstract base class for streaming GEMC event or frame data to output media.
Definition gstreamer.h:66
GStreamer(const std::shared_ptr< GOptions > &g)
Construct a streamer and bind it to module logging.
Definition gstreamer.h:72
GStreamerDefinition gstreamer_definitions
Output definition used by this streamer (format, base name, type, thread id).
Definition gstreamer.h:173
JLAB SRO gstreamer plugin producing binary frame streams (".ev" files).
Shared constants and error codes for the gstreamer module.
Core streaming interface for gstreamer output plugins.
Packed frame header written at the beginning of each frame record.
std::string rootname
Base filename (without extension), possibly specialized by thread id.