Skip to content

socketsrc: Connect to unix socket with socket-path parameter

This adds additional "socket-path" parameter to socketsrc element. The parameter is supposed to be a path to existing unix socket, and if provided, it will connect to specified socket from gst_socketsrc_start() to receive data. Previously only used internally by tcpclientsrc this makes socketsrc a first-class citizen source element for the pipeline.

The implementation of gst_socketsrc_start() and gst_socketsrc_stop() is largely based on tcpclientsrc itself with the main difference being usage of AF_UNIX sockets instead of AF_INET/AF_INET6.

Example usage where raw frames are pushed to unix socket

gst-launch-1.0 socketsrc socket-path=/tmp/video.socket ! autovideosink

or more specifically:

gst-launch-1.0 socketsrc socket-path=/tmp/video.socket ! rawvideoparse use-sink-caps=false width=360 height=288 format=y42b frame-size=207360 framerate=25/1 ! autovideosink

Edited by Piotr Gasiorowski

Merge request reports

Loading