Monado OpenXR Runtime
gst_internal.h
Go to the documentation of this file.
1 // Copyright 2019-2021, Collabora, Ltd.
2 // SPDX-License-Identifier: BSL-1.0
3 /*!
4  * @file
5  * @brief Semi internal structs for gstreamer code.
6  * @author Jakob Bornecrantz <jakob@collabora.com>
7  * @ingroup aux_util
8  */
9 
10 #pragma once
11 
12 #include "xrt/xrt_frame.h"
13 
14 typedef struct _GstElement GstElement;
15 
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
21 
22 /*
23  *
24  * Pipeline
25  *
26  */
27 
28 /*!
29  * A pipeline from which you can create one or more @ref gstreamer_sink from.
30  *
31  * @implements xrt_frame_node
32  */
34 {
35  struct xrt_frame_node node;
36 
37  struct xrt_frame_context *xfctx;
38 
39  GstElement *pipeline;
40 };
41 
42 
43 /*
44  *
45  * Sink
46  *
47  */
48 
49 /*!
50  * An @ref xrt_frame_sink that uses appsrc.
51  *
52  * @implements xrt_frame_sink
53  * @implements xrt_frame_node
54  */
56 {
57  //! The base structure exposing the sink interface.
58  struct xrt_frame_sink base;
59 
60  //! A sink can expose multie @ref xrt_frame_sink but only one node.
61  struct xrt_frame_node node;
62 
63  //! Pipeline this sink is producing frames into.
65 
66  //! Offset applied to timestamps given to GStreamer.
67  uint64_t offset_ns;
68 
69  //! Last sent timestamp, used to calculate duration.
70  uint64_t timestamp_ns;
71 
72  //! Cached appsrc element.
73  GstElement *appsrc;
74 };
75 
76 
77 #ifdef __cplusplus
78 }
79 #endif
A pipeline from which you can create one or more gstreamer_sink from.
Definition: gst_internal.h:34
An xrt_frame_sink that uses appsrc.
Definition: gst_internal.h:56
struct gstreamer_pipeline * gp
Pipeline this sink is producing frames into.
Definition: gst_internal.h:64
struct xrt_frame_sink base
The base structure exposing the sink interface.
Definition: gst_internal.h:58
uint64_t timestamp_ns
Last sent timestamp, used to calculate duration.
Definition: gst_internal.h:70
uint64_t offset_ns
Offset applied to timestamps given to GStreamer.
Definition: gst_internal.h:67
struct xrt_frame_node node
A sink can expose multie xrt_frame_sink but only one node.
Definition: gst_internal.h:61
GstElement * appsrc
Cached appsrc element.
Definition: gst_internal.h:73
Object used to track all sinks and frame producers in a graph.
Definition: xrt_frame.h:108
A interface object used for destroying a frame graph.
Definition: xrt_frame.h:87
A object that is sent frames.
Definition: xrt_frame.h:58
Data frame header.