mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-05 23:59:55 +00:00
avtpsink: Prepare code to new synchronization mechanism
This patch refactors gst_avtp_sink_start() by moving all socket initialization code to its own function. This change prepares the code to the next patch which will introduce avtpsink's own rendering synchronization mechanism.
This commit is contained in:
parent
cd03c48f88
commit
4f0dc8cf58
1 changed files with 14 additions and 3 deletions
|
@ -205,13 +205,12 @@ gst_avtp_sink_get_property (GObject * object, guint prop_id,
|
|||
}
|
||||
|
||||
static gboolean
|
||||
gst_avtp_sink_start (GstBaseSink * basesink)
|
||||
gst_avtp_sink_init_socket (GstAvtpSink * avtpsink)
|
||||
{
|
||||
int fd, res;
|
||||
unsigned int index;
|
||||
guint8 addr[ETH_ALEN];
|
||||
struct sockaddr_ll sk_addr;
|
||||
GstAvtpSink *avtpsink = GST_AVTP_SINK (basesink);
|
||||
|
||||
index = if_nametoindex (avtpsink->ifname);
|
||||
if (!index) {
|
||||
|
@ -251,7 +250,6 @@ gst_avtp_sink_start (GstBaseSink * basesink)
|
|||
avtpsink->sk_fd = fd;
|
||||
avtpsink->sk_addr = sk_addr;
|
||||
|
||||
GST_DEBUG_OBJECT (avtpsink, "AVTP sink started");
|
||||
return TRUE;
|
||||
|
||||
err:
|
||||
|
@ -259,6 +257,19 @@ err:
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_avtp_sink_start (GstBaseSink * basesink)
|
||||
{
|
||||
GstAvtpSink *avtpsink = GST_AVTP_SINK (basesink);
|
||||
|
||||
if (!gst_avtp_sink_init_socket (avtpsink))
|
||||
return FALSE;
|
||||
|
||||
GST_DEBUG_OBJECT (avtpsink, "AVTP sink started");
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gst_avtp_sink_stop (GstBaseSink * basesink)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue