GStreamer - Emit a signal to an element

Iván Pérez

I have a pipeline written into a C program which redirects a video stream from stdin to multiple UDP clients. I want those clients to be added or removed dynamically, so it's not possible to define at compile time which of them and how many there will be. This is my pipeline (if I add a fixed clients parameter it works fine):

fdsrc name=origin \
! video/x-h264,width=320,height=240,framerate=30/1,profile=baseline,stream-format=avc,alignment=au \
! h264parse \
! rtph264pay \
    config-interval=1 \
    pt=96 \
! multiudpsink name=dest \
     sync=false

According to the GStreamer docs, I can achieve it by sending a signal in order to add or remove clients dynamically. In this case, it should be the add signal.

But I can't find any information about sending a signal to an element (in this case, to the multiudpsink element). It's easy to get the reference to my element:

GstElement *sink = gst_bin_get_by_name(GST_BIN(pipeline), "dest");
/* TODO: send a signal to add a client */
g_object_unref(sink);

But now how can I emit a signal to that element?

Iván Pérez

Finally I got it. Using g_signal_emit_by_name you can send to any GStreamer element a message.

The code looks like:

GstElement *sink = gst_bin_get_by_name(GST_BIN(pipeline), "dest");
g_signal_emit_by_name(sink, "add", "192.168.1.25", 5004, NULL);
g_object_unref(sink);

Thanks to Tim Müller, from the GStreamer-devel mailing list, who gave me the right example on how to proceed.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Gstreamer 1.0 Pause signal

From Dev

Emit a signal in a static function

From Dev

emit qml signal on start application

From Dev

Emit signal in standard python thread

From Dev

Can't emit signal in Android

From Dev

Wait for several objects to emit a signal

From Dev

emit qml signal on start application

From Dev

QGraphicsitem emit signal when selected/unselected?

From Dev

Emit Signal Only When QCheckBox is Checked

From Dev

How to emit a Qt signal daily at a given time?

From Dev

In QT is it safe to emit a signal from a closeEvent function?

From Dev

Can we emit a signal from a public slot

From Dev

How to emit a delayed signal in PyQt GUI?

From Dev

Qt - how to emit a signal from derived class?

From Dev

Emit safely a signal from a thread and connect it to a widget

From Dev

When does a `QTreeView` emit the activated signal on Mac?

From Dev

How to emit a delayed signal in PyQt GUI?

From Dev

Qt emit signal from a class to class

From Dev

pyqt emit signal from threading thread

From Dev

How to use the signal QMovie::frameChanged(int frameNumber) to emit a signal?

From Dev

Qt - QCheckBox does not emit stateChanged(int state) signal

From Dev

C++ Qt: Redirect cout from a thread to emit a signal

From Dev

Qt - Is there a way to emit a signal when a particular key is typed?

From Dev

Does an Item emit a signal when its position/size is changed in QML?

From Dev

How to emit signal, when user changes row with keyboard arrows in tableView?

From Dev

When a process call the sleep function, does it emit a signal?

From Dev

How do i get QGeoPositionInfoSource to emit a signal in Qt 5.5.1 with iOS?

From Dev

Qt5 emit a signal on behalf of another object

From Dev

Can I emit a signal from within a exception handler in Qt?

Related Related

  1. 1

    Gstreamer 1.0 Pause signal

  2. 2

    Emit a signal in a static function

  3. 3

    emit qml signal on start application

  4. 4

    Emit signal in standard python thread

  5. 5

    Can't emit signal in Android

  6. 6

    Wait for several objects to emit a signal

  7. 7

    emit qml signal on start application

  8. 8

    QGraphicsitem emit signal when selected/unselected?

  9. 9

    Emit Signal Only When QCheckBox is Checked

  10. 10

    How to emit a Qt signal daily at a given time?

  11. 11

    In QT is it safe to emit a signal from a closeEvent function?

  12. 12

    Can we emit a signal from a public slot

  13. 13

    How to emit a delayed signal in PyQt GUI?

  14. 14

    Qt - how to emit a signal from derived class?

  15. 15

    Emit safely a signal from a thread and connect it to a widget

  16. 16

    When does a `QTreeView` emit the activated signal on Mac?

  17. 17

    How to emit a delayed signal in PyQt GUI?

  18. 18

    Qt emit signal from a class to class

  19. 19

    pyqt emit signal from threading thread

  20. 20

    How to use the signal QMovie::frameChanged(int frameNumber) to emit a signal?

  21. 21

    Qt - QCheckBox does not emit stateChanged(int state) signal

  22. 22

    C++ Qt: Redirect cout from a thread to emit a signal

  23. 23

    Qt - Is there a way to emit a signal when a particular key is typed?

  24. 24

    Does an Item emit a signal when its position/size is changed in QML?

  25. 25

    How to emit signal, when user changes row with keyboard arrows in tableView?

  26. 26

    When a process call the sleep function, does it emit a signal?

  27. 27

    How do i get QGeoPositionInfoSource to emit a signal in Qt 5.5.1 with iOS?

  28. 28

    Qt5 emit a signal on behalf of another object

  29. 29

    Can I emit a signal from within a exception handler in Qt?

HotTag

Archive