From cc74df3d69f2be5757e0706bf9f807814c08407f Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 12 May 2005 20:05:19 +0000 Subject: [PATCH] Add working plugins to build. Original commit message from CVS: * configure.ac: * ext/sidplay/gstsiddec.cc: Add working plugins to build. Make sidplay compile again. --- ChangeLog | 7 +++++++ configure.ac | 10 +++++++++- ext/sidplay/gstsiddec.cc | 42 ++++++++++++++++++++++++++-------------- 3 files changed, 44 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 12c6272b82..103b4c152d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-05-12 Wim Taymans + + * configure.ac: + * ext/sidplay/gstsiddec.cc: + Add working plugins to build. + Make sidplay compile again. + 2005-05-12 Wim Taymans * ext/mad/gstid3tag.c: (gst_id3_tag_src_query): diff --git a/configure.ac b/configure.ac index 2cdd92edcf..2a88128523 100644 --- a/configure.ac +++ b/configure.ac @@ -308,7 +308,11 @@ GST_PLUGINS_ALL="\ videofilter \ effectv \ law \ - smpte" + rtp \ + rtsp \ + smpte \ + tcp \ + udp" dnl see if we can build C++ plug-ins if test "x$HAVE_CXX" = "xyes"; then @@ -487,7 +491,11 @@ gst-plugins.spec gst/Makefile gst/effectv/Makefile gst/law/Makefile +gst/rtp/Makefile +gst/rtsp/Makefile gst/smpte/Makefile +gst/tcp/Makefile +gst/udp/Makefile gst/videofilter/Makefile sys/Makefile ext/Makefile diff --git a/ext/sidplay/gstsiddec.cc b/ext/sidplay/gstsiddec.cc index fd733813ee..09e4dd8596 100644 --- a/ext/sidplay/gstsiddec.cc +++ b/ext/sidplay/gstsiddec.cc @@ -110,8 +110,7 @@ static gboolean gst_siddec_sink_event (GstPad * pad, GstEvent * event); static gboolean gst_siddec_src_convert (GstPad * pad, GstFormat src_format, gint64 src_value, GstFormat * dest_format, gint64 * dest_value); -static gboolean gst_siddec_src_query (GstPad * pad, GstQueryType type, - GstFormat * format, gint64 * value); +static gboolean gst_siddec_src_query (GstPad * pad, GstQuery * query); static void gst_siddec_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); @@ -220,7 +219,6 @@ gst_siddec_init (GstSidDec * siddec) gst_pad_new_from_template (gst_static_pad_template_get (&sink_templ), "sink"); gst_pad_set_query_function (siddec->sinkpad, NULL); - gst_pad_set_convert_function (siddec->sinkpad, NULL); gst_pad_set_event_function (siddec->sinkpad, gst_siddec_sink_event); gst_pad_set_chain_function (siddec->sinkpad, gst_siddec_chain); gst_element_add_pad (GST_ELEMENT (siddec), siddec->sinkpad); @@ -229,7 +227,6 @@ gst_siddec_init (GstSidDec * siddec) gst_pad_new_from_template (gst_static_pad_template_get (&src_templ), "src"); gst_pad_set_event_function (siddec->srcpad, NULL); - gst_pad_set_convert_function (siddec->srcpad, gst_siddec_src_convert); gst_pad_set_query_function (siddec->srcpad, gst_siddec_src_query); gst_element_add_pad (GST_ELEMENT (siddec), siddec->srcpad); @@ -369,8 +366,8 @@ play_loop (GstPad * pad) GstFlowReturn ret; GstSidDec *siddec; GstBuffer *out; - GstFormat format; gint64 value, offset, time; + GstFormat format; siddec = GST_SIDDEC (GST_PAD_PARENT (pad)); @@ -383,12 +380,13 @@ play_loop (GstPad * pad) /* get offset in samples */ format = GST_FORMAT_DEFAULT; - gst_siddec_src_query (siddec->srcpad, GST_QUERY_POSITION, &format, &offset); + gst_siddec_src_convert (siddec->srcpad, + GST_FORMAT_BYTES, siddec->total_bytes, &format, &offset); GST_BUFFER_OFFSET (out) = offset; /* get current timestamp */ - format = GST_FORMAT_TIME; - gst_siddec_src_query (siddec->srcpad, GST_QUERY_POSITION, &format, &time); + gst_siddec_src_convert (siddec->srcpad, + GST_FORMAT_BYTES, siddec->total_bytes, &format, &time); GST_BUFFER_TIMESTAMP (out) = time; /* update position and get new timestamp to calculate duration */ @@ -396,11 +394,13 @@ play_loop (GstPad * pad) /* get offset in samples */ format = GST_FORMAT_DEFAULT; - gst_siddec_src_query (siddec->srcpad, GST_QUERY_POSITION, &format, &value); + gst_siddec_src_convert (siddec->srcpad, + GST_FORMAT_BYTES, siddec->total_bytes, &format, &value); GST_BUFFER_OFFSET_END (out) = value; format = GST_FORMAT_TIME; - gst_siddec_src_query (siddec->srcpad, GST_QUERY_POSITION, &format, &value); + gst_siddec_src_convert (siddec->srcpad, + GST_FORMAT_BYTES, siddec->total_bytes, &format, &value); GST_BUFFER_DURATION (out) = value - time; if ((ret = gst_pad_push (siddec->srcpad, out)) != GST_FLOW_OK) @@ -531,6 +531,11 @@ gst_siddec_src_convert (GstPad * pad, GstFormat src_format, gint64 src_value, siddec = GST_SIDDEC (GST_PAD_PARENT (pad)); + if (src_format == *dest_format) { + *dest_value = src_value; + return TRUE; + } + bytes_per_sample = (siddec->config->bitsPerSample >> 3) * siddec->config->channels; @@ -590,20 +595,29 @@ gst_siddec_src_convert (GstPad * pad, GstFormat src_format, gint64 src_value, } static gboolean -gst_siddec_src_query (GstPad * pad, GstQueryType type, - GstFormat * format, gint64 * value) +gst_siddec_src_query (GstPad * pad, GstQuery * query) { gboolean res = TRUE; GstSidDec *siddec; siddec = GST_SIDDEC (GST_PAD_PARENT (pad)); - switch (type) { + switch (GST_QUERY_TYPE (query)) { case GST_QUERY_POSITION: + { + GstFormat format; + gint64 current; + + gst_query_parse_position (query, &format, NULL, NULL); + /* we only know about our bytes, convert to requested format */ res &= gst_siddec_src_convert (pad, - GST_FORMAT_BYTES, siddec->total_bytes, format, value); + GST_FORMAT_BYTES, siddec->total_bytes, &format, ¤t); + if (res) { + gst_query_set_position (query, format, current, -1); + } break; + } default: res = FALSE; break; -- 2.34.1