6#include <initializer_list>
28 gst_element_remove_pad(GST_ELEMENT(_bin), _ghost);
30 while (_ownedCount > 0) {
31 gst_bin_remove(_bin, _owned[--_ownedCount]);
46 if (g_object_is_floating(element)) {
47 (void) gst_object_ref_sink(element);
49 const bool added = (_ownedCount < _owned.size()) && gst_bin_add(_bin, element);
50 gst_object_unref(element);
54 _owned[_ownedCount++] = element;
58 bool linkChain(std::initializer_list<GstElement*> chain)
65 if (prev && !gst_element_link(prev, element)) {
75 GstPad* sinkpad = gst_element_get_static_pad(head,
"sink");
79 _ghost = gst_ghost_pad_new(
"sink", sinkpad);
80 gst_object_unref(sinkpad);
84 if (!gst_element_add_pad(GST_ELEMENT(_bin), _ghost)) {
96 std::array<GstElement*, kMaxElements> _owned{};
97 std::size_t _ownedCount = 0;
98 GstPad* _ghost =
nullptr;
99 bool _committed =
false;
struct _GstElement GstElement
BinChain & operator=(const BinChain &)=delete
BinChain(const BinChain &)=delete
bool ghostSink(GstElement *head)
bool linkChain(std::initializer_list< GstElement * > chain)
static constexpr std::size_t kMaxElements
The longest chain qgcvideosinkbin builds: videoconvert ! videoscale ! glupload ! glcolorconvert !...
GstElement * adopt(GstElement *element)
GstVideoSink that pushes decoded frames into a Qt QVideoSink; sole sink in qgcvideosinkbin....