QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
BranchContext.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <functional>
4
#include <gst/gst.h>
5
6
#include <QtCore/QString>
7
8
#include "
GstScoped.h
"
9
10
class
PipelineDotDumper
;
11
class
StreamWatchdog
;
12
13
namespace
GStreamer
{
14
16
enum class
PipelineBranch
17
{
18
None
,
19
Decoding
,
20
Recording
,
21
};
22
23
inline
GQuark
pipelineBranchQuark
()
24
{
25
static
const
GQuark quark = g_quark_from_static_string(
"qgc-pipeline-branch"
);
26
return
quark;
27
}
28
30
inline
void
markBranch
(
GstElement
* element,
PipelineBranch
branch)
31
{
32
g_object_set_qdata(G_OBJECT(element),
pipelineBranchQuark
(), GINT_TO_POINTER(
static_cast<
int
>
(branch)));
33
}
34
36
inline
PipelineBranch
branchOf
(GstObject*
object
)
37
{
38
GstObjectPtr
current =
object
?
adoptObject
(GST_OBJECT(gst_object_ref(
object
))) :
nullptr
;
39
while
(current) {
40
if
(
const
gpointer mark = g_object_get_qdata(G_OBJECT(current.get()),
pipelineBranchQuark
())) {
41
return
static_cast<
PipelineBranch
>
(GPOINTER_TO_INT(mark));
42
}
43
current =
adoptObject
(gst_object_get_parent(current.get()));
44
}
45
return
PipelineBranch::None
;
46
}
47
48
}
// namespace GStreamer
49
52
struct
BranchContext
53
{
54
GstElement
*
pipeline
=
nullptr
;
55
GstElement
*
tee
=
nullptr
;
57
QString
redactedUri
;
58
const
PipelineDotDumper
*
dotDumper
=
nullptr
;
59
StreamWatchdog
*
watchdog
=
nullptr
;
61
std::function<void(std::function<
void
()>)>
post
;
62
};
GstScoped.h
GstElement
struct _GstElement GstElement
Definition
MockVideoStreamServer.h:7
PipelineDotDumper
Definition
PipelineDotDumper.h:12
StreamWatchdog
Definition
StreamWatchdog.h:15
GStreamer
Definition
BranchContext.h:13
GStreamer::GstObjectPtr
std::unique_ptr< GstObject, GstObjectDeleter > GstObjectPtr
Definition
GstScoped.h:59
GStreamer::markBranch
void markBranch(GstElement *element, PipelineBranch branch)
Marks element and everything inside it as part of branch.
Definition
BranchContext.h:30
GStreamer::PipelineBranch
PipelineBranch
The tee branch a pipeline element belongs to, so a bus message can be blamed on the part that failed.
Definition
BranchContext.h:17
GStreamer::PipelineBranch::None
@ None
The source, the tee, or the pipeline itself.
Definition
BranchContext.h:18
GStreamer::PipelineBranch::Recording
@ Recording
Definition
BranchContext.h:20
GStreamer::PipelineBranch::Decoding
@ Decoding
Definition
BranchContext.h:19
GStreamer::branchOf
PipelineBranch branchOf(GstObject *object)
The branch of object's nearest marked ancestor (itself included). Thread-safe.
Definition
BranchContext.h:36
GStreamer::adoptObject
GstObjectPtr adoptObject(GstObject *object) noexcept
Definition
GstScoped.h:74
GStreamer::pipelineBranchQuark
GQuark pipelineBranchQuark()
Definition
BranchContext.h:23
BranchContext
Definition
BranchContext.h:53
BranchContext::watchdog
StreamWatchdog * watchdog
Definition
BranchContext.h:59
BranchContext::tee
GstElement * tee
Definition
BranchContext.h:55
BranchContext::pipeline
GstElement * pipeline
Definition
BranchContext.h:54
BranchContext::dotDumper
const PipelineDotDumper * dotDumper
Definition
BranchContext.h:58
BranchContext::redactedUri
QString redactedUri
For logs: the stream's URI without credentials.
Definition
BranchContext.h:57
BranchContext::post
std::function< void(std::function< void()>)> post
Runs a task on the worker thread unless the session is gone by then.
Definition
BranchContext.h:61
src
VideoManager
GStreamer
Pipeline
BranchContext.h
Generated by
1.15.0