return EOS instead of NULL

Original commit message from CVS:
return EOS instead of NULL
This commit is contained in:
Thomas Vander Stichele 2004-06-08 14:45:33 +00:00
parent fbd9b71c3a
commit 6cb4ae72f9
3 changed files with 18 additions and 13 deletions

View file

@ -1,3 +1,9 @@
2004-06-08 Thomas Vander Stichele <thomas at apestaart dot org>
* gst/tcp/gsttcpclientsrc.c: (gst_tcpclientsrc_get):
* gst/tcp/gsttcpserversrc.c: (gst_tcpserversrc_get):
return EOS instead of NULL in _get
2004-06-08 Wim Taymans <wim@fluendo.com> 2004-06-08 Wim Taymans <wim@fluendo.com>
* gst/tcp/gsttcp.c: (gst_tcp_gdp_read_header), * gst/tcp/gsttcp.c: (gst_tcp_gdp_read_header),

View file

@ -221,7 +221,7 @@ gst_tcpclientsrc_get (GstPad * pad)
if (ret <= 0) { if (ret <= 0) {
GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
("select failed: %s", g_strerror (errno))); ("select failed: %s", g_strerror (errno)));
return NULL; return GST_DATA (gst_event_new (GST_EVENT_EOS));
} }
/* ask how much is available for reading on the socket */ /* ask how much is available for reading on the socket */
@ -229,7 +229,7 @@ gst_tcpclientsrc_get (GstPad * pad)
if (ret < 0) { if (ret < 0) {
GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
("ioctl failed: %s", g_strerror (errno))); ("ioctl failed: %s", g_strerror (errno)));
return NULL; return GST_DATA (gst_event_new (GST_EVENT_EOS));
} }
GST_LOG_OBJECT (src, "ioctl says %d bytes available", readsize); GST_LOG_OBJECT (src, "ioctl says %d bytes available", readsize);
buf = gst_buffer_new_and_alloc (readsize); buf = gst_buffer_new_and_alloc (readsize);
@ -242,7 +242,7 @@ gst_tcpclientsrc_get (GstPad * pad)
if (!(caps = gst_tcp_gdp_read_caps (GST_ELEMENT (src), src->sock_fd))) { if (!(caps = gst_tcp_gdp_read_caps (GST_ELEMENT (src), src->sock_fd))) {
GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
("Could not read caps through GDP")); ("Could not read caps through GDP"));
return NULL; return GST_DATA (gst_event_new (GST_EVENT_EOS));
} }
src->caps_received = TRUE; src->caps_received = TRUE;
string = gst_caps_to_string (caps); string = gst_caps_to_string (caps);
@ -251,7 +251,7 @@ gst_tcpclientsrc_get (GstPad * pad)
if (!gst_pad_try_set_caps (pad, caps)) { if (!gst_pad_try_set_caps (pad, caps)) {
g_warning ("Could not set caps"); g_warning ("Could not set caps");
return NULL; return GST_DATA (gst_event_new (GST_EVENT_EOS));
} }
} }
@ -259,7 +259,7 @@ gst_tcpclientsrc_get (GstPad * pad)
if (!(data = gst_tcp_gdp_read_header (GST_ELEMENT (src), src->sock_fd))) { if (!(data = gst_tcp_gdp_read_header (GST_ELEMENT (src), src->sock_fd))) {
GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
("Could not read data header through GDP")); ("Could not read data header through GDP"));
return NULL; return GST_DATA (gst_event_new (GST_EVENT_EOS));
} }
if (GST_IS_EVENT (data)) if (GST_IS_EVENT (data))
return data; return data;
@ -280,7 +280,7 @@ gst_tcpclientsrc_get (GstPad * pad)
if (ret < 0) { if (ret < 0) {
GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), GST_ERROR_SYSTEM); GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), GST_ERROR_SYSTEM);
gst_buffer_unref (buf); gst_buffer_unref (buf);
return NULL; return GST_DATA (gst_event_new (GST_EVENT_EOS));
} }
/* if we read 0 bytes, and we're blocking, we hit eos */ /* if we read 0 bytes, and we're blocking, we hit eos */
@ -335,7 +335,6 @@ gst_tcpclientsrc_get (GstPad * pad)
return GST_DATA (buf); return GST_DATA (buf);
} }
static void static void
gst_tcpclientsrc_set_property (GObject * object, guint prop_id, gst_tcpclientsrc_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec) const GValue * value, GParamSpec * pspec)

View file

@ -317,14 +317,14 @@ gst_tcpserversrc_get (GstPad * pad)
if (ret <= 0) { if (ret <= 0) {
GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
("select failed: %s", g_strerror (errno))); ("select failed: %s", g_strerror (errno)));
return NULL; return GST_DATA (gst_event_new (GST_EVENT_EOS));
} }
/* ask how much is available for reading on the socket */ /* ask how much is available for reading on the socket */
ret = ioctl (src->client_sock_fd, FIONREAD, &readsize); ret = ioctl (src->client_sock_fd, FIONREAD, &readsize);
if (ret < 0) { if (ret < 0) {
GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
("ioctl failed: %s", g_strerror (errno))); ("ioctl failed: %s", g_strerror (errno)));
return NULL; return GST_DATA (gst_event_new (GST_EVENT_EOS));
} }
buf = gst_buffer_new_and_alloc (readsize); buf = gst_buffer_new_and_alloc (readsize);
@ -337,7 +337,7 @@ gst_tcpserversrc_get (GstPad * pad)
if (!(caps = gst_tcpserversrc_gdp_read_caps (src))) { if (!(caps = gst_tcpserversrc_gdp_read_caps (src))) {
GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
("Could not read caps through GDP")); ("Could not read caps through GDP"));
return NULL; return GST_DATA (gst_event_new (GST_EVENT_EOS));
} }
src->caps_received = TRUE; src->caps_received = TRUE;
string = gst_caps_to_string (caps); string = gst_caps_to_string (caps);
@ -346,7 +346,7 @@ gst_tcpserversrc_get (GstPad * pad)
if (!gst_pad_try_set_caps (pad, caps)) { if (!gst_pad_try_set_caps (pad, caps)) {
g_warning ("Could not set caps"); g_warning ("Could not set caps");
return NULL; return GST_DATA (gst_event_new (GST_EVENT_EOS));
} }
} }
@ -354,7 +354,7 @@ gst_tcpserversrc_get (GstPad * pad)
if (!(data = gst_tcpserversrc_gdp_read_header (src))) { if (!(data = gst_tcpserversrc_gdp_read_header (src))) {
GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
("Could not read data header through GDP")); ("Could not read data header through GDP"));
return NULL; return GST_DATA (gst_event_new (GST_EVENT_EOS));
} }
if (GST_IS_EVENT (data)) if (GST_IS_EVENT (data))
return data; return data;
@ -377,7 +377,7 @@ gst_tcpserversrc_get (GstPad * pad)
if (ret < 0) { if (ret < 0) {
GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), GST_ERROR_SYSTEM); GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), GST_ERROR_SYSTEM);
gst_buffer_unref (buf); gst_buffer_unref (buf);
return NULL; return GST_DATA (gst_event_new (GST_EVENT_EOS));
} }
/* if we read 0 bytes, and we're blocking, we hit eos */ /* if we read 0 bytes, and we're blocking, we hit eos */