mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 20:51:13 +00:00
bb595d8fd8
Original commit message from CVS: * ext/gio/gstgiobasesrc.c: (gst_gio_base_src_finalize), (gst_gio_base_src_create): * ext/gio/gstgiobasesrc.h: Try to read the requested number of bytes, even if the first read returns less than requested, until nothing is read anymore or we have the requested amount of bytes. This fixes playback of files via Samba as Samba only allows to read 64k at once. Implement a caching algorithm that makes sure that we read at least 4k of data every time. Some elements will try to read a few bytes, then seek, read again a few bytes and so on and this is painfully slow as every operation has to go over DBus if GVfs is used as backend. Fixes bug #536849 and #536848. * ext/gio/gstgiosrc.c: (gst_gio_src_class_init), (gst_gio_src_check_get_range): Override check_get_range() to blacklist http/https URIs and whitelist file URIs. More to be added on demand.
67 lines
1.9 KiB
C
67 lines
1.9 KiB
C
/* GStreamer
|
|
*
|
|
* Copyright (C) 2007 Rene Stadler <mail@renestadler.de>
|
|
* Copyright (C) 2007 Sebastian Dröge <slomo@circular-chaos.org>
|
|
*
|
|
* This library is free software; you can redistribute it and/or
|
|
* modify it under the terms of the GNU Library General Public
|
|
* License as published by the Free Software Foundation; either
|
|
* version 2 of the License, or (at your option) any later version.
|
|
*
|
|
* This library is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
* Library General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU Library General Public
|
|
* License along with this library; if not, write to the
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
* Boston, MA 02111-1307, USA.
|
|
*/
|
|
|
|
#ifndef __GST_GIO_BASE_SRC_H__
|
|
#define __GST_GIO_BASE_SRC_H__
|
|
|
|
#include "gstgio.h"
|
|
|
|
#include <gst/base/gstbasesrc.h>
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
#define GST_TYPE_GIO_BASE_SRC \
|
|
(gst_gio_base_src_get_type())
|
|
#define GST_GIO_BASE_SRC(obj) \
|
|
(G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_GIO_BASE_SRC,GstGioBaseSrc))
|
|
#define GST_GIO_BASE_SRC_CLASS(klass) \
|
|
(G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_GIO_BASE_SRC,GstGioBaseSrcClass))
|
|
#define GST_IS_GIO_BASE_SRC(obj) \
|
|
(G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_GIO_BASE_SRC))
|
|
#define GST_IS_GIO_BASE_SRC_CLASS(klass) \
|
|
(G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GIO_BASE_SRC))
|
|
|
|
typedef struct _GstGioBaseSrc GstGioBaseSrc;
|
|
typedef struct _GstGioBaseSrcClass GstGioBaseSrcClass;
|
|
|
|
struct _GstGioBaseSrc
|
|
{
|
|
GstBaseSrc src;
|
|
|
|
GCancellable *cancel;
|
|
guint64 position;
|
|
GInputStream *stream;
|
|
|
|
GstBuffer *cache;
|
|
};
|
|
|
|
struct _GstGioBaseSrcClass
|
|
{
|
|
GstBaseSrcClass parent_class;
|
|
};
|
|
|
|
GType gst_gio_base_src_get_type (void);
|
|
|
|
void gst_gio_base_src_set_stream (GstGioBaseSrc *src, GInputStream *stream);
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __GST_GIO_BASE_SRC_H__ */
|