Commit c3adf7ce authored by W. Michael Petullo's avatar W. Michael Petullo
Browse files

Move g-gst* to dmap-gst* and make DMAPGstInputStream public


Signed-off-by: W. Michael Petullo's avatarW. Michael Petullo <mike@flyn.org>
parent 59782ef8
......@@ -41,9 +41,9 @@ endif
if USE_GSTREAMERAPP
libdmapsharing_3_0_la_SOURCES += \
g-gst-input-stream.c \
g-gst-mp3-input-stream.c \
g-gst-wav-input-stream.c \
dmap-gst-input-stream.c \
dmap-gst-mp3-input-stream.c \
dmap-gst-wav-input-stream.c \
gst-util.c
endif
......@@ -79,6 +79,7 @@ libdmapsharinginclude_HEADERS = \
dmap-container-db.h \
dmap-container-record.h \
dmap-db.h \
dmap-gst-input-stream.h \
dmap-md5.h \
dmap-mdns-browser.h \
dmap-mdns-publisher.h \
......@@ -96,9 +97,8 @@ noinst_HEADERS = \
dmap-config.h \
dmap-mdns-avahi.h \
dmap-utils.h \
g-gst-input-stream.h \
g-gst-mp3-input-stream.h \
g-gst-wav-input-stream.h \
dmap-gst-mp3-input-stream.h \
dmap-gst-wav-input-stream.h \
gst-util.h
dmap-marshal.c: dmap-marshal.list
......
......@@ -41,8 +41,7 @@
#include <libdmapsharing/dmap-utils.h>
#ifdef HAVE_GSTREAMERAPP
#include <libdmapsharing/g-gst-mp3-input-stream.h>
#include <libdmapsharing/g-gst-wav-input-stream.h>
#include <libdmapsharing/dmap-gst-input-stream.h>
#endif /* HAVE_GSTREAMERAPP */
static void daap_share_set_property (GObject *object,
......@@ -96,9 +95,6 @@ enum {
G_DEFINE_TYPE (DAAPShare, daap_share, DMAP_TYPE_SHARE)
/* FIXME: get rid of this global: */
static gchar *transcode_format = NULL;
static void
daap_share_class_init (DAAPShareClass *klass)
{
......@@ -199,8 +195,6 @@ daap_share_new (const char *name,
_dmap_share_server_start (DMAP_SHARE (share));
_dmap_share_publish_start (DMAP_SHARE (share));
transcode_format = mime_to_format (transcode_mimetype);
return share;
}
......@@ -422,19 +416,19 @@ send_chunked_file (SoupServer *server, SoupMessage *message, DAAPRecord *record,
}
g_object_get (record, "format", &format, NULL);
if (transcode_format == NULL || ! strcmp (format, transcode_format)) {
if (transcode_mimetype == NULL || ! strcmp (format, mime_to_format (transcode_mimetype))) {
g_debug ("Not transcoding");
cd->stream = stream;
#ifdef HAVE_GSTREAMERAPP
} else if (! strcmp ("mp3", transcode_format)) {
cd->stream = G_INPUT_STREAM (g_gst_mp3_input_stream_new (stream));
} else if (! strcmp ("wav", transcode_format)) {
cd->stream = G_INPUT_STREAM (g_gst_wav_input_stream_new (stream));
#endif /* HAVE_GSTREAMERAPP */
} else {
g_warning ("Transcode format %s not supported", transcode_format);
cd->stream = dmap_gst_input_stream_new (transcode_mimetype, stream);
}
#else
} else {
g_warning ("Transcode format %s not supported", transcode_mimetype);
cd->stream = stream;
}
#endif /* HAVE_GSTREAMERAPP */
if (cd->stream == NULL) {
g_warning ("Could not set up input stream");
......@@ -462,7 +456,7 @@ send_chunked_file (SoupServer *server, SoupMessage *message, DAAPRecord *record,
* video data after about 2.5MB. Perhaps this is so iTunes
* knows how much data to buffer.
*/
|| transcode_format == NULL) {
|| transcode_mimetype == NULL) {
/* NOTE: iTunes 8 (and other versions?) will not seek
* properly without a Content-Length header.
*/
......@@ -590,8 +584,10 @@ add_entry_to_mlcl (gpointer id,
dmap_structure_add (mlit, DMAP_CC_ASEQ, "");
if (_dmap_share_client_requested (mb->bits, SONG_FORMAT)) {
gchar *format = NULL;
if (transcode_format)
format = g_strdup (transcode_format);
gchar *transcode_mimetype = NULL;
g_object_get (record, "transcode-mimetype", &transcode_mimetype, NULL);
if (transcode_mimetype)
format = g_strdup (mime_to_format (transcode_mimetype));
else
g_object_get (record, "format", &format, NULL);
if (format) {
......
/*
* GGstInputStream class: Open a URI using g_gst_input_stream_new ().
* DMAPGstInputStream class: Open a URI using dmap_gst_input_stream_new ().
* Data is decoded using GStreamer and is then made available by the class's
* read operations.
*
......@@ -20,20 +20,20 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <string.h>
#include <gst/gst.h>
#include <gst/app/gstappsink.h>
#include <gst/app/gstappbuffer.h>
#include "g-gst-input-stream.h"
#include "dmap-gst-input-stream.h"
#include "gst-util.h"
//#include "util.h"
#define GST_APP_MAX_BUFFERS 1024
#define DECODED_BUFFER_SIZE 1024 * 128
#define QUEUE_PUSH_WAIT_SECONDS 10
#define QUEUE_POP_WAIT_SECONDS 1
struct g_gst_format {
struct dmap_gst_format {
gchar *id; /* E.g., used as command line arguments. */
gchar *extension; /* E.g., iTunes uses URI extension to
* determine stream format.
......@@ -41,14 +41,14 @@ struct g_gst_format {
};
/* NOTE: Roku clients require lower case extension. */
static const struct g_gst_format g_gst_formats[] = {
static const struct dmap_gst_format dmap_gst_formats[] = {
{ "raw", "raw" },
{ "wav16", "wav" },
{ "mp3", "mp3" },
{ NULL, NULL }
};
struct GGstInputStreamPrivate {
struct DMAPGstInputStreamPrivate {
GQueue *buffer;
gsize read_request; /* Size of data asked for */
gsize write_request; /* Number of bytes that must be read
......@@ -60,7 +60,7 @@ struct GGstInputStreamPrivate {
};
static goffset
g_gst_input_stream_tell (GSeekable *seekable)
dmap_gst_input_stream_tell (GSeekable *seekable)
{
/* FIXME: implement return current position in stream. */
g_error ("Not implemented");
......@@ -68,22 +68,22 @@ g_gst_input_stream_tell (GSeekable *seekable)
}
static gboolean
g_gst_input_stream_can_seek (GSeekable *seekable)
dmap_gst_input_stream_can_seek (GSeekable *seekable)
{
return TRUE;
}
static gboolean
g_gst_input_stream_seek (GSeekable *seekable,
dmap_gst_input_stream_seek (GSeekable *seekable,
goffset offset,
GSeekType type,
GCancellable *cacellable,
GError **error)
{
GGstInputStream *stream;
DMAPGstInputStream *stream;
goffset absolute;
stream = G_GST_INPUT_STREAM (seekable);
stream = DMAP_GST_INPUT_STREAM (seekable);
switch (type) {
/* FIXME: implement:
......@@ -120,7 +120,7 @@ g_gst_input_stream_seek (GSeekable *seekable,
*/
/* FIXME:
if (! gst_element_seek_simple (G_GST_INPUT_STREAM (seekable)->priv->pipeline,
if (! gst_element_seek_simple (DMAP_GST_INPUT_STREAM (seekable)->priv->pipeline,
GST_FORMAT_BYTES,
GST_SEEK_FLAG_FLUSH | GST_SEEK_FLAG_KEY_UNIT,
absolute)) {
......@@ -136,34 +136,34 @@ g_gst_input_stream_seek (GSeekable *seekable,
}
static gboolean
g_gst_input_stream_can_truncate (GSeekable *seekable)
dmap_gst_input_stream_can_truncate (GSeekable *seekable)
{
return FALSE;
}
static gboolean
g_gst_input_stream_truncate (GSeekable *seekable,
dmap_gst_input_stream_truncate (GSeekable *seekable,
goffset offset,
GCancellable *cancellable,
GError **error)
{
g_set_error (error, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
"Cannot truncate GGstInputStream");
"Cannot truncate DMAPGstInputStream");
return FALSE;
}
static void
g_gst_input_stream_seekable_iface_init (GSeekableIface *iface)
dmap_gst_input_stream_seekable_iface_init (GSeekableIface *iface)
{
iface->tell = g_gst_input_stream_tell;
iface->can_seek = g_gst_input_stream_can_seek;
iface->seek = g_gst_input_stream_seek;
iface->can_truncate = g_gst_input_stream_can_truncate;
iface->truncate_fn = g_gst_input_stream_truncate;
iface->tell = dmap_gst_input_stream_tell;
iface->can_seek = dmap_gst_input_stream_can_seek;
iface->seek = dmap_gst_input_stream_seek;
iface->can_truncate = dmap_gst_input_stream_can_truncate;
iface->truncate_fn = dmap_gst_input_stream_truncate;
}
void
g_gst_input_stream_new_buffer_cb (GstElement *element, GGstInputStream *stream)
dmap_gst_input_stream_new_buffer_cb (GstElement *element, DMAPGstInputStream *stream)
{
gsize i;
guint8 *ptr;
......@@ -172,7 +172,7 @@ g_gst_input_stream_new_buffer_cb (GstElement *element, GGstInputStream *stream)
/* FIXME: Is this necessary? I am trying to protect against this
* thread manipulating data after the pipeline has been destroyed.
* see also g_gst_input_stream_close ().
* see also dmap_gst_input_stream_close ().
*/
g_mutex_lock (stream->priv->buffer_mutex);
......@@ -227,21 +227,28 @@ _return:
g_mutex_unlock (stream->priv->buffer_mutex);
}
GInputStream* g_gst_input_stream_new (const gchar *uri)
GInputStream* dmap_gst_input_stream_new (const gchar *transcode_mimetype, GInputStream *src_stream)
{
GGstInputStream *stream;
stream = G_GST_INPUT_STREAM (g_object_new (TYPE_G_GST_INPUT_STREAM,
NULL));
GInputStream *stream;
if (! transcode_mimetype) {
stream = src_stream;
} else if (! strcmp (transcode_mimetype, "audio/mp3")) {
stream = G_INPUT_STREAM (dmap_gst_mp3_input_stream_new (src_stream));
} else if (! strcmp (transcode_mimetype, "audio/wav")) {
stream = G_INPUT_STREAM (dmap_gst_wav_input_stream_new (src_stream));
} else {
g_warning ("Transcode format %s not supported", transcode_mimetype);
stream = src_stream;
}
g_assert (G_IS_SEEKABLE (stream));
return G_INPUT_STREAM (stream);
return stream;
}
gchar *
dmapd_input_stream_strdup_format_extension (const gint format_code)
{
return g_strdup (g_gst_formats[format_code].extension);
return g_strdup (dmap_gst_formats[format_code].extension);
}
static gssize
......@@ -251,14 +258,14 @@ min (gssize a, gssize b)
}
static gssize
g_gst_input_stream_read (GInputStream *stream,
dmap_gst_input_stream_read (GInputStream *stream,
void *buffer,
gsize count,
GCancellable *cancellable,
GError **error)
{
int i;
GGstInputStream *gst_stream = G_GST_INPUT_STREAM (stream);
DMAPGstInputStream *gst_stream = DMAP_GST_INPUT_STREAM (stream);
GTimeVal time;
g_get_current_time (&time);
......@@ -303,7 +310,7 @@ g_gst_input_stream_read (GInputStream *stream,
}
static gssize
g_gst_input_stream_skip (GInputStream *stream,
dmap_gst_input_stream_skip (GInputStream *stream,
gsize count,
GCancellable *cancellable,
GError **error)
......@@ -313,19 +320,19 @@ g_gst_input_stream_skip (GInputStream *stream,
}
static void
g_gst_input_stream_kill_pipeline (GGstInputStream *stream)
dmap_gst_input_stream_kill_pipeline (DMAPGstInputStream *stream)
{
G_GST_INPUT_STREAM_GET_CLASS (stream)->kill_pipeline (stream);
DMAP_GST_INPUT_STREAM_GET_CLASS (stream)->kill_pipeline (stream);
}
static gboolean
g_gst_input_stream_close (GInputStream *stream,
dmap_gst_input_stream_close (GInputStream *stream,
GCancellable *cancellable,
GError **error)
{
GGstInputStream *gst_stream = G_GST_INPUT_STREAM (stream);
DMAPGstInputStream *gst_stream = DMAP_GST_INPUT_STREAM (stream);
g_gst_input_stream_kill_pipeline (gst_stream);
dmap_gst_input_stream_kill_pipeline (gst_stream);
g_mutex_lock (gst_stream->priv->buffer_mutex);
......@@ -338,7 +345,7 @@ g_gst_input_stream_close (GInputStream *stream,
}
static gssize
g_gst_input_stream_read_finish (GInputStream *stream,
dmap_gst_input_stream_read_finish (GInputStream *stream,
GAsyncResult *result,
GError **error)
{
......@@ -347,7 +354,7 @@ g_gst_input_stream_read_finish (GInputStream *stream,
}
static gssize
g_gst_input_stream_skip_finish (GInputStream *stream,
dmap_gst_input_stream_skip_finish (GInputStream *stream,
GAsyncResult *result,
GError **error)
{
......@@ -356,7 +363,7 @@ g_gst_input_stream_skip_finish (GInputStream *stream,
}
static void
g_gst_input_stream_close_async (GInputStream *stream,
dmap_gst_input_stream_close_async (GInputStream *stream,
int io_priority,
GCancellable *cancellabl,
GAsyncReadyCallback callback,
......@@ -365,7 +372,7 @@ g_gst_input_stream_close_async (GInputStream *stream,
}
static void
g_gst_input_stream_read_async (GInputStream *stream,
dmap_gst_input_stream_read_async (GInputStream *stream,
void *buffer,
gsize count,
int io_priority,
......@@ -376,7 +383,7 @@ g_gst_input_stream_read_async (GInputStream *stream,
}
static void
g_gst_input_stream_skip_async (GInputStream *stream,
dmap_gst_input_stream_skip_async (GInputStream *stream,
gsize count,
int io_priority,
GCancellable *cancellabl,
......@@ -386,7 +393,7 @@ g_gst_input_stream_skip_async (GInputStream *stream,
}
static gboolean
g_gst_input_stream_close_finish (GInputStream *stream,
dmap_gst_input_stream_close_finish (GInputStream *stream,
GAsyncResult *result,
GError **error)
{
......@@ -395,28 +402,28 @@ g_gst_input_stream_close_finish (GInputStream *stream,
}
static void
g_gst_input_stream_class_init (GGstInputStreamClass *klass)
dmap_gst_input_stream_class_init (DMAPGstInputStreamClass *klass)
{
GInputStreamClass *istream_class;
g_type_class_add_private (klass, sizeof (GGstInputStreamPrivate));
g_type_class_add_private (klass, sizeof (DMAPGstInputStreamPrivate));
istream_class = G_INPUT_STREAM_CLASS (klass);
istream_class->read_fn = g_gst_input_stream_read;
istream_class->skip = g_gst_input_stream_skip;
istream_class->close_fn = g_gst_input_stream_close;
istream_class->read_async = g_gst_input_stream_read_async;
istream_class->read_finish = g_gst_input_stream_read_finish;
istream_class->skip_async = g_gst_input_stream_skip_async;
istream_class->skip_finish = g_gst_input_stream_skip_finish;
istream_class->close_async = g_gst_input_stream_close_async;
istream_class->close_finish = g_gst_input_stream_close_finish;
istream_class->read_fn = dmap_gst_input_stream_read;
istream_class->skip = dmap_gst_input_stream_skip;
istream_class->close_fn = dmap_gst_input_stream_close;
istream_class->read_async = dmap_gst_input_stream_read_async;
istream_class->read_finish = dmap_gst_input_stream_read_finish;
istream_class->skip_async = dmap_gst_input_stream_skip_async;
istream_class->skip_finish = dmap_gst_input_stream_skip_finish;
istream_class->close_async = dmap_gst_input_stream_close_async;
istream_class->close_finish = dmap_gst_input_stream_close_finish;
}
static void
g_gst_input_stream_init (GGstInputStream *stream)
dmap_gst_input_stream_init (DMAPGstInputStream *stream)
{
stream->priv = G_GST_INPUT_STREAM_GET_PRIVATE (stream);
stream->priv = DMAP_GST_INPUT_STREAM_GET_PRIVATE (stream);
stream->priv->buffer = g_queue_new ();
stream->priv->read_request = 0;
......@@ -427,7 +434,7 @@ g_gst_input_stream_init (GGstInputStream *stream)
stream->priv->buffer_closed = FALSE;
}
G_DEFINE_TYPE_WITH_CODE (GGstInputStream, g_gst_input_stream,
G_DEFINE_TYPE_WITH_CODE (DMAPGstInputStream, dmap_gst_input_stream,
G_TYPE_INPUT_STREAM,
G_IMPLEMENT_INTERFACE (G_TYPE_SEEKABLE,
g_gst_input_stream_seekable_iface_init))
dmap_gst_input_stream_seekable_iface_init))
/*
* GGstInputStream class: Open a URI using g_gst_input_stream_new ().
* DMAPGstInputStream class: Open a URI using dmap_gst_input_stream_new ().
* Data is decoded using GStreamer and is then made available by the class's
* read operations.
*
......@@ -20,48 +20,48 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef __G_GST_INPUT_STREAM
#define __G_GST_INPUT_STREAM
#ifndef __DMAP_GST_INPUT_STREAM
#define __DMAP_GST_INPUT_STREAM
#include <gio/gio.h>
#include <gst/gst.h>
G_BEGIN_DECLS
#define TYPE_G_GST_INPUT_STREAM (g_gst_input_stream_get_type ())
#define G_GST_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), \
TYPE_G_GST_INPUT_STREAM, \
GGstInputStream))
#define G_GST_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), \
TYPE_G_GST_INPUT_STREAM, \
GGstInputStreamClass))
#define IS_G_GST_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), \
TYPE_G_GST_INPUT_STREAM))
#define IS_G_GST_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), \
TYPE_G_GST_INPUT_STREAM_CLASS))
#define G_GST_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \
TYPE_G_GST_INPUT_STREAM, \
GGstInputStreamClass))
#define G_GST_INPUT_STREAM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
TYPE_G_GST_INPUT_STREAM, \
GGstInputStreamPrivate))
#define DMAP_TYPE_GST_INPUT_STREAM (dmap_gst_input_stream_get_type ())
#define DMAP_GST_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), \
DMAP_TYPE_GST_INPUT_STREAM, \
DMAPGstInputStream))
#define DMAP_GST_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), \
DMAP_TYPE_GST_INPUT_STREAM, \
DMAPGstInputStreamClass))
#define IS_DMAP_GST_INPUT_STREAM(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), \
DMAP_TYPE_GST_INPUT_STREAM))
#define IS_DMAP_GST_INPUT_STREAM_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), \
DMAP_TYPE_GST_INPUT_STREAM_CLASS))
#define DMAP_GST_INPUT_STREAM_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), \
DMAP_TYPE_GST_INPUT_STREAM, \
DMAPGstInputStreamClass))
#define DMAP_GST_INPUT_STREAM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
DMAP_TYPE_GST_INPUT_STREAM, \
DMAPGstInputStreamPrivate))
typedef struct GGstInputStreamPrivate GGstInputStreamPrivate;
typedef struct DMAPGstInputStreamPrivate DMAPGstInputStreamPrivate;
typedef struct {
GInputStream parent;
GGstInputStreamPrivate *priv;
} GGstInputStream;
DMAPGstInputStreamPrivate *priv;
} DMAPGstInputStream;
typedef struct {
GInputStreamClass parent;
void (*kill_pipeline) (GGstInputStream *);
} GGstInputStreamClass;
void (*kill_pipeline) (DMAPGstInputStream *);
} DMAPGstInputStreamClass;
GType g_gst_input_stream_get_type (void);
GType dmap_gst_input_stream_get_type (void);
/* Supported transcode target formats (data read from GGstInputStream
/* Supported transcode target formats (data read from DMAPGstInputStream
* will be in one of these formats): */
enum {
RAW, /* No transcoding performed. */
......@@ -69,13 +69,13 @@ enum {
MP3
};
GInputStream* g_gst_input_stream_new (const gchar *uri);
GInputStream* dmap_gst_input_stream_new (const gchar *transcode_mimetype, GInputStream *src_stream);
void g_gst_input_stream_new_buffer_cb (GstElement *element,
GGstInputStream *stream);
void dmap_gst_input_stream_new_buffer_cb (GstElement *element,
DMAPGstInputStream *stream);
gchar *dmapd_input_stream_strdup_format_extension (const gint format_code);
G_END_DECLS
#endif /* __G_GST_INPUT_STREAM */
#endif /* __DMAP_GST_INPUT_STREAM */
/*
* GGstMP3InputStream class: Open a URI using g_gst_mp3_input_stream_new ().
* DMAPGstMP3InputStream class: Open a URI using dmap_gst_mp3_input_stream_new ().
* Data is decoded using GStreamer and is then reencoded as an MP3
* stream by the class's read operations.
*
......@@ -23,12 +23,12 @@
#include <gst/gst.h>
#include <gst/app/gstappsink.h>
#include "g-gst-mp3-input-stream.h"
#include "dmap-gst-mp3-input-stream.h"
#include "gst-util.h"
#define GST_APP_MAX_BUFFERS 1024
struct GGstMP3InputStreamPrivate {
struct DMAPGstMP3InputStreamPrivate {
GstElement *pipeline;
GstElement *src;
GstElement *decode;
......@@ -41,7 +41,7 @@ static void
new_decoded_pad_cb (GstElement *element,
GstPad *pad,
gboolean arg,
GGstMP3InputStream *stream)
DMAPGstMP3InputStream *stream)
{
/* Link remaining pad after decodebin does its magic. */
GstPad *conv_pad;
......@@ -66,13 +66,13 @@ new_decoded_pad_cb (GstElement *element,
}
}
GInputStream* g_gst_mp3_input_stream_new (GInputStream *src_stream)
GInputStream* dmap_gst_mp3_input_stream_new (GInputStream *src_stream)
{
GstStateChangeReturn sret;
GstState state;
GGstMP3InputStream *stream;
DMAPGstMP3InputStream *stream;
stream = G_GST_MP3_INPUT_STREAM (g_object_new (TYPE_G_GST_MP3_INPUT_STREAM,
stream = DMAP_GST_MP3_INPUT_STREAM (g_object_new (DMAP_TYPE_GST_MP3_INPUT_STREAM,
NULL));
stream->priv->pipeline = gst_pipeline_new ("pipeline");
......@@ -118,7 +118,7 @@ GInputStream* g_gst_mp3_input_stream_new (GInputStream *src_stream)
GST_APP_MAX_BUFFERS);
gst_app_sink_set_drop (GST_APP_SINK (stream->priv->sink), FALSE);
g_signal_connect (stream->priv->sink, "new-buffer", G_CALLBACK (g_gst_input_stream_new_buffer_cb), stream);
g_signal_connect (stream->priv->sink, "new-buffer", G_CALLBACK (dmap_gst_input_stream_new_buffer_cb), stream);
/* FIXME: this technique is shared with dmapd-daap-share.c */
sret = gst_element_set_state (stream->priv->pipeline, GST_STATE_PLAYING);
......@@ -135,29 +135,29 @@ GInputStream* g_gst_mp3_input_stream_new (GInputStream *src_stream)
}
static void
g_gst_mp3_input_stream_kill_pipeline (GGstInputStream *stream)
dmap_gst_mp3_input_stream_kill_pipeline (DMAPGstInputStream *stream)
{
GGstMP3InputStream *mp3_stream = G_GST_MP3_INPUT_STREAM (stream);
DMAPGstMP3InputStream *mp3_stream = DMAP_GST_MP3_INPUT_STREAM (stream);
gst_element_set_state (mp3_stream->priv->pipeline, GST_STATE_NULL);
gst_object_unref (GST_OBJECT (mp3_stream->priv->pipeline));
}
G_DEFINE_TYPE (GGstMP3InputStream, g_gst_mp3_input_stream, TYPE_G_GST_INPUT_STREAM)
G_DEFINE_TYPE (DMAPGstMP3InputStream, dmap_gst_mp3_input_stream, DMAP_TYPE_GST_INPUT_STREAM)
static void
g_gst_mp3_input_stream_class_init (GGstMP3InputStreamClass *klass)
dmap_gst_mp3_input_stream_class_init (DMAPGstMP3InputStreamClass *klass)
{
GGstInputStreamClass *parent_class = G_GST_INPUT_STREAM_CLASS (klass);
DMAPGstInputStreamClass *parent_class = DMAP_GST_INPUT_STREAM_CLASS (klass);
g_type_class_add_private (klass, sizeof (GGstMP3InputStreamPrivate));
g_type_class_add_private (klass, sizeof (DMAPGstMP3InputStreamPrivate));
parent_class->kill_pipeline = g_gst_mp3_input_stream_kill_pipeline;
parent_class->kill_pipeline = dmap_gst_mp3_input_stream_kill_pipeline;
}