libmm ported to 0.9. It works fine, but print some error messages. I'll fix them soon. Tested with mmssrc location=m...
Original commit message from CVS: libmm ported to 0.9. It works fine, but print some error messages. I'll fix them soon. Tested with mmssrc location=mms:// ! filesink.
This commit is contained in:
parent
07e2ec5f95
commit
85d3362e34
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
|||||||
|
2005-11-28 Edgard Lima <edgard.lima@indt.org.br>
|
||||||
|
|
||||||
|
* PORTED_09:
|
||||||
|
* configure.ac:
|
||||||
|
* ext/Makefile.am:
|
||||||
|
* ext/libmms/Makefile.am:
|
||||||
|
* ext/libmms/gstmms.c:
|
||||||
|
* ext/libmms/gstmms.h:
|
||||||
|
libmm ported to 0.9. It works fine, but print some error messages. I
|
||||||
|
ll fix them soon. Tested with mmssrc location=mms:// ! filesink.
|
||||||
|
|
||||||
2005-11-28 Edward Hervey <edward@fluendo.com>
|
2005-11-28 Edward Hervey <edward@fluendo.com>
|
||||||
|
|
||||||
* ext/faad/gstfaad.c: (gst_faad_srcgetcaps):
|
* ext/faad/gstfaad.c: (gst_faad_srcgetcaps):
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
When porting a plugin start with 0.8 CVS head, not the old code in this module. There are many bugfixes which have gone into 0.8 which you want to keep.
|
When porting a plugin start with 0.8 CVS head, not the old code in this module. There are many bugfixes which have gone into 0.8 which you want to keep.
|
||||||
|
|
||||||
List of ported plugins (update when you commit a ported plugin):
|
List of ported plugins (update when you commit a ported plugin):
|
||||||
|
libmms (alima)
|
||||||
wavpack (alima)
|
wavpack (alima)
|
||||||
musepack (alima)
|
musepack (alima)
|
||||||
ivorbis (alima)
|
ivorbis (alima)
|
||||||
|
2
common
2
common
@ -1 +1 @@
|
|||||||
Subproject commit f31468e933b5b980398cf636a37abf16ca46c4a0
|
Subproject commit 33084fbe0531733bc02aa1d9de608206d5553a15
|
@ -411,6 +411,14 @@ GST_CHECK_FEATURE(MUSEPACK, [musepackdec], musepack, [
|
|||||||
AC_LANG_C
|
AC_LANG_C
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl *** libmms ***
|
||||||
|
translit(dnm, m, l) AM_CONDITIONAL(USE_LIBMMS, true)
|
||||||
|
GST_CHECK_FEATURE(LIBMMS, [mms protocol library], libmms, [
|
||||||
|
dnl check with pkg-config first
|
||||||
|
PKG_CHECK_MODULES(LIBMMS, libmms >= 0.1, HAVE_LIBMMS="yes", HAVE_LIBMMS="no")
|
||||||
|
])
|
||||||
|
AC_SUBST(LIBMMS_LIBS)
|
||||||
|
|
||||||
|
|
||||||
dnl *** SDL ***
|
dnl *** SDL ***
|
||||||
translit(dnm, m, l) AM_CONDITIONAL(USE_SDL, true)
|
translit(dnm, m, l) AM_CONDITIONAL(USE_SDL, true)
|
||||||
@ -530,6 +538,7 @@ ext/faad/Makefile
|
|||||||
ext/wavpack/Makefile
|
ext/wavpack/Makefile
|
||||||
ext/ivorbis/Makefile
|
ext/ivorbis/Makefile
|
||||||
ext/gsm/Makefile
|
ext/gsm/Makefile
|
||||||
|
ext/libmms/Makefile
|
||||||
ext/musepack/Makefile
|
ext/musepack/Makefile
|
||||||
ext/sdl/Makefile
|
ext/sdl/Makefile
|
||||||
docs/Makefile
|
docs/Makefile
|
||||||
|
@ -106,11 +106,11 @@ LCS_DIR=
|
|||||||
LIBFAME_DIR=
|
LIBFAME_DIR=
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
# if USE_LIBMMS
|
if USE_LIBMMS
|
||||||
# LIBMMS_DIR=libmms
|
LIBMMS_DIR=libmms
|
||||||
# else
|
else
|
||||||
LIBMMS_DIR=
|
LIBMMS_DIR=
|
||||||
# endif
|
endif
|
||||||
|
|
||||||
# if USE_MPEG2ENC
|
# if USE_MPEG2ENC
|
||||||
# MPEG2ENC_DIR=mpeg2enc
|
# MPEG2ENC_DIR=mpeg2enc
|
||||||
@ -236,6 +236,7 @@ DIST_SUBDIRS= \
|
|||||||
faad \
|
faad \
|
||||||
gsm \
|
gsm \
|
||||||
ivorbis \
|
ivorbis \
|
||||||
|
libmms \
|
||||||
musepack \
|
musepack \
|
||||||
sdl \
|
sdl \
|
||||||
wavpack
|
wavpack
|
||||||
|
@ -2,8 +2,8 @@ plugin_LTLIBRARIES = libgstmms.la
|
|||||||
|
|
||||||
libgstmms_la_SOURCES = gstmms.c
|
libgstmms_la_SOURCES = gstmms.c
|
||||||
|
|
||||||
libgstmms_la_CFLAGS = $(GST_CFLAGS) $(LIBMMS_CFLAGS)
|
libgstmms_la_CFLAGS = $(GST_CFLAGS) $(LIBMMS_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS)
|
||||||
libgstmms_la_LIBADD = $(GST_LIBS) $(LIBMMS_LIBS)
|
libgstmms_la_LIBADD = $(GST_LIBS) $(LIBMMS_LIBS) $(GST_PLUGINS_BASE_LIBS) $(GST_BASE_LIBS)
|
||||||
libgstmms_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
libgstmms_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS)
|
||||||
|
|
||||||
noinst_HEADERS = gstmms.h
|
noinst_HEADERS = gstmms.h
|
||||||
|
@ -52,8 +52,8 @@ static GstStaticPadTemplate src_factory = GST_STATIC_PAD_TEMPLATE ("src",
|
|||||||
);
|
);
|
||||||
|
|
||||||
static void gst_mms_class_init (GstMMSClass * klass);
|
static void gst_mms_class_init (GstMMSClass * klass);
|
||||||
static void gst_mms_base_init (GstMMSClass * klass);
|
static void gst_mms_base_init (gpointer g_class);
|
||||||
static void gst_mms_init (GstMMS * mmssrc);
|
static void gst_mms_init (GstMMS * mmssrc, GstMMSClass * g_class);
|
||||||
|
|
||||||
static void gst_mms_uri_handler_init (gpointer g_iface, gpointer iface_data);
|
static void gst_mms_uri_handler_init (gpointer g_iface, gpointer iface_data);
|
||||||
|
|
||||||
@ -64,14 +64,11 @@ static void gst_mms_get_property (GObject * object, guint prop_id,
|
|||||||
GValue * value, GParamSpec * pspec);
|
GValue * value, GParamSpec * pspec);
|
||||||
|
|
||||||
static const GstQueryType *gst_mms_get_query_types (GstPad * pad);
|
static const GstQueryType *gst_mms_get_query_types (GstPad * pad);
|
||||||
static const GstFormat *gst_mms_get_formats (GstPad * pad);
|
static gboolean gst_mms_src_query (GstPad * pad, GstQuery * query);
|
||||||
static gboolean gst_mms_srcpad_query (GstPad * pad, GstQueryType type,
|
|
||||||
GstFormat * fmt, gint64 * value);
|
|
||||||
static GstStateChangeReturn gst_mms_change_state (GstElement * elem);
|
|
||||||
|
|
||||||
static GstData *gst_mms_get (GstPad * pad);
|
|
||||||
|
|
||||||
static GstElementClass *parent_class = NULL;
|
static gboolean gst_mms_start (GstBaseSrc * bsrc);
|
||||||
|
static GstFlowReturn gst_mms_create (GstPushSrc * psrc, GstBuffer ** buf);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_urihandler_init (GType mms_type)
|
_urihandler_init (GType mms_type)
|
||||||
@ -84,34 +81,15 @@ _urihandler_init (GType mms_type)
|
|||||||
|
|
||||||
g_type_add_interface_static (mms_type, GST_TYPE_URI_HANDLER,
|
g_type_add_interface_static (mms_type, GST_TYPE_URI_HANDLER,
|
||||||
&urihandler_info);
|
&urihandler_info);
|
||||||
|
|
||||||
|
GST_DEBUG_CATEGORY_INIT (mmssrc_debug, "mmssrc", 0, "MMS Source Element");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GST_BOILERPLATE_FULL (GstMMS, gst_mms, GstPushSrc, GST_TYPE_PUSH_SRC,
|
||||||
GType
|
_urihandler_init);
|
||||||
gst_mms_get_type (void)
|
|
||||||
{
|
|
||||||
static GType plugin_type = 0;
|
|
||||||
|
|
||||||
if (!plugin_type) {
|
|
||||||
static const GTypeInfo plugin_info = {
|
|
||||||
sizeof (GstMMSClass),
|
|
||||||
(GBaseInitFunc) gst_mms_base_init,
|
|
||||||
NULL,
|
|
||||||
(GClassInitFunc) gst_mms_class_init,
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
sizeof (GstMMS),
|
|
||||||
0,
|
|
||||||
(GInstanceInitFunc) gst_mms_init,
|
|
||||||
};
|
|
||||||
plugin_type = g_type_register_static (GST_TYPE_ELEMENT,
|
|
||||||
"GstMMS", &plugin_info, 0);
|
|
||||||
}
|
|
||||||
return plugin_type;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_mms_base_init (GstMMSClass * klass)
|
gst_mms_base_init (gpointer g_class)
|
||||||
{
|
{
|
||||||
static GstElementDetails plugin_details = {
|
static GstElementDetails plugin_details = {
|
||||||
"MMS streaming protocol support",
|
"MMS streaming protocol support",
|
||||||
@ -119,9 +97,7 @@ gst_mms_base_init (GstMMSClass * klass)
|
|||||||
"Receive data streamed via MSFT Multi Media Server protocol",
|
"Receive data streamed via MSFT Multi Media Server protocol",
|
||||||
"Maciej Katafiasz <mathrick@users.sourceforge.net>"
|
"Maciej Katafiasz <mathrick@users.sourceforge.net>"
|
||||||
};
|
};
|
||||||
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
|
GstElementClass *element_class = GST_ELEMENT_CLASS (g_class);
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_INIT (mmssrc_debug, "mmssrc", 0, "MMS Source Element");
|
|
||||||
|
|
||||||
gst_element_class_add_pad_template (element_class,
|
gst_element_class_add_pad_template (element_class,
|
||||||
gst_static_pad_template_get (&src_factory));
|
gst_static_pad_template_get (&src_factory));
|
||||||
@ -133,14 +109,15 @@ static void
|
|||||||
gst_mms_class_init (GstMMSClass * klass)
|
gst_mms_class_init (GstMMSClass * klass)
|
||||||
{
|
{
|
||||||
GObjectClass *gobject_class;
|
GObjectClass *gobject_class;
|
||||||
GstElementClass *gstelement_class;
|
GstBaseSrcClass *gstbasesrc_class;
|
||||||
|
GstPushSrcClass *gstpushsrc_class;
|
||||||
|
|
||||||
gobject_class = (GObjectClass *) klass;
|
gobject_class = (GObjectClass *) klass;
|
||||||
gstelement_class = (GstElementClass *) klass;
|
gstbasesrc_class = (GstBaseSrcClass *) klass;
|
||||||
|
gstpushsrc_class = (GstPushSrcClass *) klass;
|
||||||
|
|
||||||
parent_class = g_type_class_ref (GST_TYPE_ELEMENT);
|
gobject_class->set_property = gst_mms_set_property;
|
||||||
|
gobject_class->get_property = gst_mms_get_property;
|
||||||
_urihandler_init (GST_TYPE_MMS);
|
|
||||||
|
|
||||||
g_object_class_install_property (gobject_class, ARG_LOCATION,
|
g_object_class_install_property (gobject_class, ARG_LOCATION,
|
||||||
g_param_spec_string ("location", "location",
|
g_param_spec_string ("location", "location",
|
||||||
@ -153,9 +130,10 @@ gst_mms_class_init (GstMMSClass * klass)
|
|||||||
"How many bytes should be read at once", 0, 65536, 2048,
|
"How many bytes should be read at once", 0, 65536, 2048,
|
||||||
G_PARAM_READWRITE));
|
G_PARAM_READWRITE));
|
||||||
|
|
||||||
gobject_class->set_property = gst_mms_set_property;
|
gstbasesrc_class->start = gst_mms_start;
|
||||||
gobject_class->get_property = gst_mms_get_property;
|
|
||||||
gstelement_class->change_state = gst_mms_change_state;
|
gstpushsrc_class->create = gst_mms_create;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initialize the new element
|
/* initialize the new element
|
||||||
@ -164,18 +142,13 @@ gst_mms_class_init (GstMMSClass * klass)
|
|||||||
* initialize structure
|
* initialize structure
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
gst_mms_init (GstMMS * mmssrc)
|
gst_mms_init (GstMMS * mmssrc, GstMMSClass * g_class)
|
||||||
{
|
{
|
||||||
GstElementClass *klass = GST_ELEMENT_GET_CLASS (mmssrc);
|
gst_base_src_set_live (GST_BASE_SRC (mmssrc), TRUE);
|
||||||
|
|
||||||
mmssrc->srcpad =
|
gst_pad_set_query_function (GST_BASE_SRC (mmssrc)->srcpad, gst_mms_src_query);
|
||||||
gst_pad_new_from_template (gst_element_class_get_pad_template (klass,
|
gst_pad_set_query_type_function (GST_BASE_SRC (mmssrc)->srcpad,
|
||||||
"src"), "src");
|
gst_mms_get_query_types);
|
||||||
gst_pad_set_get_function (mmssrc->srcpad, gst_mms_get);
|
|
||||||
gst_pad_set_query_function (mmssrc->srcpad, gst_mms_srcpad_query);
|
|
||||||
gst_pad_set_query_type_function (mmssrc->srcpad, gst_mms_get_query_types);
|
|
||||||
gst_pad_set_formats_function (mmssrc->srcpad, gst_mms_get_formats);
|
|
||||||
gst_element_add_pad (GST_ELEMENT (mmssrc), mmssrc->srcpad);
|
|
||||||
|
|
||||||
mmssrc->uri_name = NULL;
|
mmssrc->uri_name = NULL;
|
||||||
mmssrc->connection = NULL;
|
mmssrc->connection = NULL;
|
||||||
@ -190,131 +163,145 @@ static const GstQueryType *
|
|||||||
gst_mms_get_query_types (GstPad * pad)
|
gst_mms_get_query_types (GstPad * pad)
|
||||||
{
|
{
|
||||||
static const GstQueryType types[] = {
|
static const GstQueryType types[] = {
|
||||||
GST_QUERY_TOTAL,
|
|
||||||
GST_QUERY_POSITION,
|
GST_QUERY_POSITION,
|
||||||
|
GST_QUERY_DURATION,
|
||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
return types;
|
return types;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const GstFormat *
|
|
||||||
gst_mms_get_formats (GstPad * pad)
|
|
||||||
{
|
|
||||||
static const GstFormat formats[] = {
|
|
||||||
GST_FORMAT_BYTES,
|
|
||||||
0,
|
|
||||||
};
|
|
||||||
|
|
||||||
return formats;
|
|
||||||
}
|
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_mms_srcpad_query (GstPad * pad, GstQueryType type,
|
gst_mms_src_query (GstPad * pad, GstQuery * query)
|
||||||
GstFormat * format, gint64 * value)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
GstMMS *mmssrc = GST_MMS (gst_pad_get_parent (pad));
|
GstMMS *mmssrc = GST_MMS (gst_pad_get_parent (pad));
|
||||||
gboolean res = TRUE;
|
gboolean res = TRUE;
|
||||||
|
GstFormat format;
|
||||||
|
gint64 value;
|
||||||
|
|
||||||
if (*format != GST_FORMAT_BYTES)
|
switch (GST_QUERY_TYPE (query)) {
|
||||||
return FALSE;
|
|
||||||
|
|
||||||
switch (type) {
|
|
||||||
case GST_QUERY_TOTAL:
|
|
||||||
*value = (gint64) mms_get_length (mmssrc->connection);
|
|
||||||
break;
|
|
||||||
case GST_QUERY_POSITION:
|
case GST_QUERY_POSITION:
|
||||||
*value = (gint64) mms_get_current_pos (mmssrc->connection);
|
gst_query_parse_position (query, &format, &value);
|
||||||
|
if (format != GST_FORMAT_BYTES) {
|
||||||
|
res = FALSE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
value = (gint64) mms_get_current_pos (mmssrc->connection);
|
||||||
|
gst_query_set_position (query, format, value);
|
||||||
|
break;
|
||||||
|
case GST_QUERY_DURATION:
|
||||||
|
gst_query_parse_duration (query, &format, &value);
|
||||||
|
if (format != GST_FORMAT_BYTES) {
|
||||||
|
res = FALSE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
value = (gint64) mms_get_length (mmssrc->connection);
|
||||||
|
gst_query_set_duration (query, format, value);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
res = FALSE;
|
res = FALSE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
g_object_unref (mmssrc);
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get function
|
/* get function
|
||||||
* this function generates new data when needed
|
* this function generates new data when needed
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static GstData *
|
|
||||||
gst_mms_get (GstPad * pad)
|
static GstFlowReturn
|
||||||
|
gst_mms_create (GstPushSrc * psrc, GstBuffer ** buf)
|
||||||
{
|
{
|
||||||
GstMMS *mmssrc;
|
GstMMS *mmssrc;
|
||||||
GstBuffer *buf;
|
|
||||||
guint8 *data;
|
guint8 *data;
|
||||||
gint result;
|
gint result;
|
||||||
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
|
|
||||||
/* DEBUG */
|
/* DEBUG */
|
||||||
GstFormat fmt = GST_FORMAT_BYTES;
|
GstFormat fmt = GST_FORMAT_BYTES;
|
||||||
gint64 query_res;
|
gint64 query_res;
|
||||||
|
GstQuery *query;
|
||||||
|
|
||||||
g_return_val_if_fail (GST_IS_PAD (pad), NULL);
|
*buf = NULL;
|
||||||
|
mmssrc = GST_MMS (psrc);
|
||||||
|
*buf = gst_buffer_new ();
|
||||||
|
|
||||||
mmssrc = GST_MMS (GST_OBJECT_PARENT (pad));
|
if (NULL == *buf) {
|
||||||
g_return_val_if_fail (GST_IS_MMS (mmssrc), NULL);
|
ret = GST_FLOW_ERROR;
|
||||||
|
goto done;
|
||||||
buf = gst_buffer_new ();
|
}
|
||||||
g_return_val_if_fail (buf, NULL);
|
|
||||||
|
|
||||||
data = g_malloc0 (mmssrc->blocksize);
|
data = g_malloc0 (mmssrc->blocksize);
|
||||||
GST_BUFFER_DATA (buf) = data;
|
GST_BUFFER_DATA (*buf) = data;
|
||||||
GST_DEBUG ("mms: data: %p\n", data);
|
GST_DEBUG ("mms: data: %p\n", data);
|
||||||
g_return_val_if_fail (GST_BUFFER_DATA (buf) != NULL, NULL);
|
|
||||||
|
|
||||||
GST_BUFFER_SIZE (buf) = 0;
|
if (NULL == GST_BUFFER_DATA (*buf)) {
|
||||||
|
ret = GST_FLOW_ERROR;
|
||||||
|
gst_buffer_unref (*buf);
|
||||||
|
*buf = NULL;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
|
GST_BUFFER_SIZE (*buf) = 0;
|
||||||
GST_DEBUG ("reading %d bytes", mmssrc->blocksize);
|
GST_DEBUG ("reading %d bytes", mmssrc->blocksize);
|
||||||
result = mms_read (NULL, mmssrc->connection, data, mmssrc->blocksize);
|
result =
|
||||||
GST_BUFFER_OFFSET (buf) = mms_get_current_pos (mmssrc->connection) - result;
|
mms_read (NULL, mmssrc->connection, (char *) data, mmssrc->blocksize);
|
||||||
GST_BUFFER_SIZE (buf) = result;
|
GST_BUFFER_OFFSET (*buf) = mms_get_current_pos (mmssrc->connection) - result;
|
||||||
|
GST_BUFFER_SIZE (*buf) = result;
|
||||||
|
|
||||||
|
|
||||||
/* DEBUG */
|
/* DEBUG */
|
||||||
gst_pad_query (gst_element_get_pad (GST_ELEMENT (mmssrc), "src"),
|
query = gst_query_new_position (GST_QUERY_POSITION);
|
||||||
GST_QUERY_POSITION, &fmt, &query_res);
|
gst_pad_query (GST_BASE_SRC (mmssrc)->srcpad, query);
|
||||||
|
gst_query_parse_position (query, &fmt, &query_res);
|
||||||
|
gst_query_unref (query);
|
||||||
GST_DEBUG ("mms position: %lld\n", query_res);
|
GST_DEBUG ("mms position: %lld\n", query_res);
|
||||||
|
|
||||||
|
|
||||||
/* EOS? */
|
/* EOS? */
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (*buf);
|
||||||
|
*buf = NULL;
|
||||||
GST_DEBUG ("Returning EOS");
|
GST_DEBUG ("Returning EOS");
|
||||||
gst_element_set_eos (GST_ELEMENT (mmssrc));
|
if (!gst_pad_send_event (GST_BASE_SRC (mmssrc)->srcpad,
|
||||||
return GST_DATA (gst_event_new (GST_EVENT_EOS));
|
gst_event_new_eos ())) {
|
||||||
|
ret = GST_FLOW_ERROR;
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return GST_DATA (buf);
|
done:
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstStateChangeReturn
|
static gboolean
|
||||||
gst_mms_change_state (GstElement * elem)
|
gst_mms_start (GstBaseSrc * bsrc)
|
||||||
{
|
{
|
||||||
GstMMS *mms = GST_MMS (elem);
|
GstMMS *mms;
|
||||||
|
gboolean ret = TRUE;
|
||||||
|
|
||||||
switch (GST_STATE_TRANSITION (elem)) {
|
mms = GST_MMS (bsrc);
|
||||||
case GST_STATE_CHANGE_NULL_TO_READY:
|
|
||||||
break;
|
if (!mms->uri_name) {
|
||||||
case GST_STATE_CHANGE_READY_TO_NULL:
|
ret = FALSE;
|
||||||
break;
|
goto done;
|
||||||
case GST_STATE_CHANGE_READY_TO_PAUSED:
|
}
|
||||||
if (!mms->uri_name)
|
/* FIXME: pass some sane arguments here */
|
||||||
return GST_STATE_CHANGE_FAILURE;
|
mms->connection = mms_connect (NULL, NULL, mms->uri_name, 128 * 1024);
|
||||||
/* FIXME: pass some sane arguments here */
|
if (!mms->connection) {
|
||||||
mms->connection = mms_connect (NULL, NULL, mms->uri_name, 128 * 1024);
|
ret = FALSE;
|
||||||
if (!mms->connection) {
|
goto done;
|
||||||
return GST_STATE_CHANGE_FAILURE;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case GST_STATE_CHANGE_PAUSED_TO_PLAYING:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
done:
|
||||||
return GST_ELEMENT_CLASS (parent_class)->change_state (elem);
|
return ret;
|
||||||
|
|
||||||
return GST_STATE_CHANGE_SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -323,7 +310,6 @@ gst_mms_set_property (GObject * object, guint prop_id,
|
|||||||
{
|
{
|
||||||
GstMMS *mmssrc;
|
GstMMS *mmssrc;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_MMS (object));
|
|
||||||
mmssrc = GST_MMS (object);
|
mmssrc = GST_MMS (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
@ -345,7 +331,6 @@ gst_mms_get_property (GObject * object, guint prop_id,
|
|||||||
{
|
{
|
||||||
GstMMS *mmssrc;
|
GstMMS *mmssrc;
|
||||||
|
|
||||||
g_return_if_fail (GST_IS_MMS (object));
|
|
||||||
mmssrc = GST_MMS (object);
|
mmssrc = GST_MMS (object);
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
@ -389,6 +374,7 @@ gst_mms_uri_get_protocols (void)
|
|||||||
static const gchar *
|
static const gchar *
|
||||||
gst_mms_uri_get_uri (GstURIHandler * handler)
|
gst_mms_uri_get_uri (GstURIHandler * handler)
|
||||||
{
|
{
|
||||||
|
|
||||||
GstMMS *src = GST_MMS (handler);
|
GstMMS *src = GST_MMS (handler);
|
||||||
|
|
||||||
return src->uri_name;
|
return src->uri_name;
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
#include <libmms/mms.h>
|
#include <libmms/mms.h>
|
||||||
|
#include <gst/base/gstpushsrc.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
@ -27,9 +28,7 @@ typedef struct _GstMMSClass GstMMSClass;
|
|||||||
|
|
||||||
struct _GstMMS
|
struct _GstMMS
|
||||||
{
|
{
|
||||||
GstElement element;
|
GstPushSrc parent;
|
||||||
|
|
||||||
GstPad *srcpad;
|
|
||||||
|
|
||||||
gchar *uri_name;
|
gchar *uri_name;
|
||||||
gpointer connection;
|
gpointer connection;
|
||||||
@ -38,7 +37,7 @@ struct _GstMMS
|
|||||||
|
|
||||||
struct _GstMMSClass
|
struct _GstMMSClass
|
||||||
{
|
{
|
||||||
GstElementClass parent_class;
|
GstPushSrcClass parent_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
GType gst_mms_get_type (void);
|
GType gst_mms_get_type (void);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user