[sound-juicer] Do initial port to GStreamer 1.0
- From: Sebastian DrÃge <sdroege src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sound-juicer] Do initial port to GStreamer 1.0
- Date: Tue, 24 Jul 2012 15:22:30 +0000 (UTC)
commit e229771e8ca665d3f21994dbf7ee30b9ba4bac23
Author: Sebastian DrÃge <sebastian droege collabora co uk>
Date: Tue Jul 3 11:18:12 2012 +0200
Do initial port to GStreamer 1.0
configure.in | 2 +-
libjuicer/sj-extractor.c | 14 ++++++++------
src/egg-play-preview.c | 8 ++------
src/sj-play.c | 7 +++----
4 files changed, 14 insertions(+), 17 deletions(-)
---
diff --git a/configure.in b/configure.in
index 762f2de..2991f53 100644
--- a/configure.in
+++ b/configure.in
@@ -60,7 +60,7 @@ PKG_CHECK_MODULES(UI, gtk+-3.0 >= $GTK_REQUIRED gconf-2.0 gio-2.0 gmodule-export
AC_SUBST(UI_CFLAGS)
AC_SUBST(UI_LIBS)
-PKG_CHECK_MODULES(GSTREAMER, gstreamer-0.10 >= 0.10.32 gstreamer-plugins-base-0.10 gstreamer-pbutils-0.10)
+PKG_CHECK_MODULES(GSTREAMER, gstreamer-1.0 gstreamer-plugins-base-1.0 gstreamer-pbutils-1.0)
AC_SUBST(GSTREAMER_CFLAGS)
AC_SUBST(GSTREAMER_LIBS)
diff --git a/libjuicer/sj-extractor.c b/libjuicer/sj-extractor.c
index 61f771d..2aa6fea 100644
--- a/libjuicer/sj-extractor.c
+++ b/libjuicer/sj-extractor.c
@@ -341,7 +341,7 @@ build_pipeline (SjExtractor *extractor)
g_signal_connect (G_OBJECT (bus), "message::error", G_CALLBACK (error_cb), extractor);
/* Read from CD */
- priv->cdsrc = gst_element_make_from_uri (GST_URI_SRC, "cdda://1", "cd_src");
+ priv->cdsrc = gst_element_make_from_uri (GST_URI_SRC, "cdda://1", "cd_src", NULL);
if (priv->cdsrc == NULL) {
g_set_error (&priv->construct_error,
SJ_ERROR, SJ_ERROR_INTERNAL_ERROR,
@@ -402,7 +402,6 @@ tick_timeout_cb(SjExtractor *extractor)
gint64 nanos;
gint secs;
GstState state, pending_state;
- static GstFormat format = GST_FORMAT_TIME;
g_return_val_if_fail (SJ_IS_EXTRACTOR (extractor), FALSE);
@@ -412,7 +411,7 @@ tick_timeout_cb(SjExtractor *extractor)
return FALSE;
}
- if (!gst_element_query_position (extractor->priv->cdsrc, &format, &nanos)) {
+ if (!gst_element_query_position (extractor->priv->cdsrc, GST_FORMAT_TIME, &nanos)) {
g_warning (_("Could not get current track position"));
return TRUE;
}
@@ -472,6 +471,7 @@ sj_extractor_extract_track (SjExtractor *extractor, const TrackDetails *track, G
GstStateChangeReturn state_ret;
SjExtractorPrivate *priv;
GstIterator *iter;
+ GValue item = {0, };
GstTagSetter *tagger;
gboolean done;
char *uri;
@@ -509,9 +509,10 @@ sj_extractor_extract_track (SjExtractor *extractor, const TrackDetails *track, G
iter = gst_bin_iterate_all_by_interface (GST_BIN (priv->pipeline), GST_TYPE_TAG_SETTER);
done = FALSE;
while (!done) {
- switch (gst_iterator_next (iter, (gpointer)&tagger)) {
+ switch (gst_iterator_next (iter, &item)) {
case GST_ITERATOR_OK:
/* TODO: generate this as a taglist once, and apply it to all elements */
+ tagger = g_value_get_object (&item);
gst_tag_setter_add_tags (tagger,
GST_TAG_MERGE_REPLACE_ALL,
GST_TAG_TITLE, track->title,
@@ -589,7 +590,7 @@ sj_extractor_extract_track (SjExtractor *extractor, const TrackDetails *track, G
GST_TAG_ALBUM_VOLUME_NUMBER, track->album->disc_number,
NULL);
}
- gst_object_unref (tagger);
+ g_value_unset (&item);
break;
case GST_ITERATOR_RESYNC:
/* TODO? */
@@ -604,6 +605,7 @@ sj_extractor_extract_track (SjExtractor *extractor, const TrackDetails *track, G
break;
}
}
+ g_value_unset (&item);
gst_iterator_free (iter);
/* Seek to the right track */
@@ -659,7 +661,7 @@ sj_extractor_supports_encoding (GError **error)
{
GstElement *element = NULL;
- element = gst_element_make_from_uri (GST_URI_SRC, "cdda://1", "test");
+ element = gst_element_make_from_uri (GST_URI_SRC, "cdda://1", "test", NULL);
if (element == NULL) {
g_set_error (error, SJ_ERROR, SJ_ERROR_INTERNAL_ERROR,
_("The plugin necessary for CD access was not found"));
diff --git a/src/egg-play-preview.c b/src/egg-play-preview.c
index 4e88d34..0d7c8c9 100644
--- a/src/egg-play-preview.c
+++ b/src/egg-play-preview.c
@@ -684,10 +684,8 @@ _query_duration (GstElement *element)
GstState state;
GstState pending;
gint64 duration;
- GstFormat format;
duration = 0;
- format = GST_FORMAT_TIME;
result = gst_element_get_state (element, &state, &pending, GST_CLOCK_TIME_NONE);
@@ -702,7 +700,7 @@ _query_duration (GstElement *element)
if (result == GST_STATE_CHANGE_ASYNC)
gst_element_get_state (element, NULL, NULL, GST_CLOCK_TIME_NONE);
- gst_element_query_duration (element, &format, &duration);
+ gst_element_query_duration (element, GST_FORMAT_TIME, &duration);
gst_element_set_state (element, state);
@@ -713,12 +711,10 @@ static gint
_query_position (GstElement *element)
{
gint64 position;
- GstFormat format;
position = 0;
- format = GST_FORMAT_TIME;
- gst_element_query_position (element, &format, &position);
+ gst_element_query_position (element, GST_FORMAT_TIME, &position);
return (gint) (position / GST_SECOND);
}
diff --git a/src/sj-play.c b/src/sj-play.c
index 676e556..2b66ebf 100644
--- a/src/sj-play.c
+++ b/src/sj-play.c
@@ -231,7 +231,6 @@ static gboolean
cb_set_time (gpointer data)
{
GstElement *cd;
- GstFormat fmt = GST_FORMAT_TIME;
gint64 pos, len;
if (seeking)
@@ -239,8 +238,8 @@ cb_set_time (gpointer data)
cd = gst_bin_get_by_name_recurse_up (GST_BIN (pipeline), "cd-source");
- if (gst_element_query_duration (cd, &fmt, &len) &&
- gst_element_query_position (cd, &fmt, &pos)) {
+ if (gst_element_query_duration (cd, GST_FORMAT_TIME, &len) &&
+ gst_element_query_position (cd, GST_FORMAT_TIME, &pos)) {
internal_update = TRUE;
gtk_range_set_value (GTK_RANGE (seek_scale), (gdouble) pos / len);
set_statusbar_pos (pos / GST_SECOND, len / GST_SECOND);
@@ -355,7 +354,7 @@ setup (GError **err)
g_signal_connect (bus, "message::error", G_CALLBACK (cb_error), NULL);
g_signal_connect (bus, "message::state-changed", G_CALLBACK (cb_state), NULL);
- cdp = gst_element_make_from_uri (GST_URI_SRC, "cdda://1", "cd-source");
+ cdp = gst_element_make_from_uri (GST_URI_SRC, "cdda://1", "cd-source", NULL);
if (!cdp) {
gst_object_unref (GST_OBJECT (pipeline));
pipeline = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]