"Location of the file to read", NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
GST_PARAM_MUTABLE_READY));
"Location of the file to read", NULL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS |
GST_PARAM_MUTABLE_READY));
g_object_class_install_property (gobject_class, ARG_EOS,
g_param_spec_boolean ("eos",
"EOS recived on downloading pipeline",
"download of clip is over",
0,
G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, ARG_EOS,
g_param_spec_boolean ("eos",
"EOS recived on downloading pipeline",
"download of clip is over",
0,
G_PARAM_READWRITE));
gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_pd_pushsrc_start);
gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_pd_pushsrc_stop);
gstbasesrc_class->is_seekable = GST_DEBUG_FUNCPTR (gst_pd_pushsrc_is_seekable);
gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_pd_pushsrc_start);
gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_pd_pushsrc_stop);
gstbasesrc_class->is_seekable = GST_DEBUG_FUNCPTR (gst_pd_pushsrc_is_seekable);
}
g_object_notify (G_OBJECT (src), "location");
gst_uri_handler_new_uri (GST_URI_HANDLER (src), src->uri);
}
g_object_notify (G_OBJECT (src), "location");
gst_uri_handler_new_uri (GST_URI_HANDLER (src), src->uri);
-
- GST_LOG_OBJECT (src, "read position = %"G_GUINT64_FORMAT ", offset = %"G_GUINT64_FORMAT", length = %d",
- src->read_position, offset, length);
-
+
+ GST_LOG_OBJECT (src, "read position = %"G_GUINT64_FORMAT ", offset = %"G_GUINT64_FORMAT", length = %d",
+ src->read_position, offset, length);
+
GST_DEBUG_OBJECT (src, "Going to wait for %ld msec", timeout.tv_usec);
ret = select (src->fd + 1, &fds, NULL, NULL, &timeout);
GST_DEBUG_OBJECT (src, "Going to wait for %ld msec", timeout.tv_usec);
ret = select (src->fd + 1, &fds, NULL, NULL, &timeout);
- /* No need to read anything if length is 0 */
- if (length > 0) {
- GST_LOG_OBJECT (src, "Reading %d bytes at offset 0x%" G_GINT64_MODIFIER "x",
- length, offset);
- ret = read (src->fd, GST_BUFFER_DATA (buf), length);
- if (G_UNLIKELY (ret < 0))
- goto could_not_read;
+ GST_LOG_OBJECT (src, "Reading %d bytes at offset 0x%" G_GINT64_MODIFIER "x",
+ length, offset);
+ ret = read (src->fd, GST_BUFFER_DATA (buf), length);
+ if (G_UNLIKELY (ret < 0))
+ goto could_not_read;
- /* seekable regular files should have given us what we expected */
- if (G_UNLIKELY ((guint) ret < length && src->seekable))
- goto unexpected_eos;
+ /* seekable regular files should have given us what we expected */
+ if (G_UNLIKELY ((guint) ret < length && src->seekable))
+ goto unexpected_eos;
- /* other files should eos if they read 0 and more was requested */
- if (G_UNLIKELY (ret == 0 && length > 0))
- goto eos;
+ /* other files should eos if they read 0 and more was requested */
+ if (G_UNLIKELY (ret == 0 && length > 0))
+ goto eos;
- length = ret;
- GST_BUFFER_SIZE (buf) = length;
- GST_BUFFER_OFFSET (buf) = offset;
- GST_BUFFER_OFFSET_END (buf) = offset + length;
+ length = ret;
+ GST_BUFFER_SIZE (buf) = length;
+ GST_BUFFER_OFFSET (buf) = offset;
+ GST_BUFFER_OFFSET_END (buf) = offset + length;
- GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),
- ("unexpected end of file."));
+ GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL), ("unexpected end of file."));
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
("Could not get info on \"\"."), (NULL));
close (src->fd);
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
("Could not get info on \"\"."), (NULL));
close (src->fd);
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
("File \"\" is a socket."), (NULL));
close (src->fd);
GST_ELEMENT_ERROR (src, RESOURCE, OPEN_READ,
("File \"\" is a socket."), (NULL));
close (src->fd);
#ifdef G_OS_WIN32
/* Unfortunately, g_filename_from_uri() doesn't handle some UNC paths
* correctly on windows, it leaves them with an extra backslash
#ifdef G_OS_WIN32
/* Unfortunately, g_filename_from_uri() doesn't handle some UNC paths
* correctly on windows, it leaves them with an extra backslash