ext/musicbrainz/gsttrm.*: Add support for using a proxy server when getting a trm id from the MusicBrainz database (#...
Original commit message from CVS: Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net> * ext/musicbrainz/gsttrm.c: (gst_musicbrainz_class_init), (gst_musicbrainz_init), (gst_musicbrainz_chain), (gst_musicbrainz_set_property), (gst_musicbrainz_get_property): * ext/musicbrainz/gsttrm.h: Add support for using a proxy server when getting a trm id from the MusicBrainz database (#149613).
This commit is contained in:
parent
c0bff003be
commit
1ca4ad9399
11
ChangeLog
11
ChangeLog
@ -1,3 +1,14 @@
|
|||||||
|
2004-12-16 James Bowes <bowes@cs.dal.ca>
|
||||||
|
|
||||||
|
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
|
||||||
|
* ext/musicbrainz/gsttrm.c: (gst_musicbrainz_class_init),
|
||||||
|
(gst_musicbrainz_init), (gst_musicbrainz_chain),
|
||||||
|
(gst_musicbrainz_set_property), (gst_musicbrainz_get_property):
|
||||||
|
* ext/musicbrainz/gsttrm.h:
|
||||||
|
Add support for using a proxy server when getting a trm id from
|
||||||
|
the MusicBrainz database (#149613).
|
||||||
|
|
||||||
2004-12-16 Christophe Fergeau <teuf@gnome.org>
|
2004-12-16 Christophe Fergeau <teuf@gnome.org>
|
||||||
|
|
||||||
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
Reviewed by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
@ -38,7 +38,9 @@ enum
|
|||||||
{
|
{
|
||||||
ARG_0,
|
ARG_0,
|
||||||
ARG_SIGNATURE,
|
ARG_SIGNATURE,
|
||||||
ARG_ASCII_SIGNATURE
|
ARG_ASCII_SIGNATURE,
|
||||||
|
ARG_PROXY_ADDRESS,
|
||||||
|
ARG_PROXY_PORT
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -149,6 +151,13 @@ gst_musicbrainz_class_init (GstMusicBrainzClass * klass)
|
|||||||
g_param_spec_string ("ascii_signature", "ascii_signature",
|
g_param_spec_string ("ascii_signature", "ascii_signature",
|
||||||
"ascii_signature", NULL, G_PARAM_READABLE));
|
"ascii_signature", NULL, G_PARAM_READABLE));
|
||||||
|
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PROXY_ADDRESS,
|
||||||
|
g_param_spec_string ("proxy_address", "proxy address", "proxy address",
|
||||||
|
NULL, G_PARAM_READWRITE));
|
||||||
|
g_object_class_install_property (G_OBJECT_CLASS (klass), ARG_PROXY_PORT,
|
||||||
|
g_param_spec_uint ("proxy_port", "proxy port", "proxy port",
|
||||||
|
1, 65535, 8080, G_PARAM_READWRITE));
|
||||||
|
|
||||||
gobject_class->set_property = gst_musicbrainz_set_property;
|
gobject_class->set_property = gst_musicbrainz_set_property;
|
||||||
gobject_class->get_property = gst_musicbrainz_get_property;
|
gobject_class->get_property = gst_musicbrainz_get_property;
|
||||||
|
|
||||||
@ -212,6 +221,8 @@ gst_musicbrainz_init (GstMusicBrainz * musicbrainz)
|
|||||||
"src");
|
"src");
|
||||||
gst_element_add_pad (GST_ELEMENT (musicbrainz), musicbrainz->srcpad);
|
gst_element_add_pad (GST_ELEMENT (musicbrainz), musicbrainz->srcpad);
|
||||||
|
|
||||||
|
musicbrainz->proxy_port = 8080;
|
||||||
|
|
||||||
musicbrainz->trm = NULL;
|
musicbrainz->trm = NULL;
|
||||||
musicbrainz->linked = FALSE;
|
musicbrainz->linked = FALSE;
|
||||||
musicbrainz->data_available = FALSE;
|
musicbrainz->data_available = FALSE;
|
||||||
@ -265,6 +276,13 @@ gst_musicbrainz_chain (GstPad * pad, GstData * data)
|
|||||||
GST_BUFFER_SIZE (buf))) {
|
GST_BUFFER_SIZE (buf))) {
|
||||||
GST_DEBUG ("Signature");
|
GST_DEBUG ("Signature");
|
||||||
|
|
||||||
|
if (musicbrainz->proxy_address != NULL) {
|
||||||
|
if (!trm_SetProxy (musicbrainz->trm, musicbrainz->proxy_address,
|
||||||
|
musicbrainz->proxy_port))
|
||||||
|
GST_ELEMENT_ERROR (musicbrainz, RESOURCE, SETTINGS, (NULL),
|
||||||
|
("Unable to set proxy server for trm lookup"));
|
||||||
|
}
|
||||||
|
|
||||||
trm_FinalizeSignature (musicbrainz->trm, musicbrainz->signature, NULL);
|
trm_FinalizeSignature (musicbrainz->trm, musicbrainz->signature, NULL);
|
||||||
trm_ConvertSigToASCII (musicbrainz->trm, musicbrainz->signature,
|
trm_ConvertSigToASCII (musicbrainz->trm, musicbrainz->signature,
|
||||||
musicbrainz->ascii_signature);
|
musicbrainz->ascii_signature);
|
||||||
@ -296,6 +314,14 @@ gst_musicbrainz_set_property (GObject * object, guint prop_id,
|
|||||||
case ARG_SIGNATURE:
|
case ARG_SIGNATURE:
|
||||||
case ARG_ASCII_SIGNATURE:
|
case ARG_ASCII_SIGNATURE:
|
||||||
break;
|
break;
|
||||||
|
case ARG_PROXY_ADDRESS:{
|
||||||
|
musicbrainz->proxy_address = g_value_dup_string (value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ARG_PROXY_PORT:{
|
||||||
|
musicbrainz->proxy_port = g_value_get_uint (value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
@ -321,6 +347,14 @@ gst_musicbrainz_get_property (GObject * object, guint prop_id, GValue * value,
|
|||||||
g_value_set_string (value, musicbrainz->ascii_signature);
|
g_value_set_string (value, musicbrainz->ascii_signature);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case ARG_PROXY_ADDRESS:{
|
||||||
|
g_value_set_string (value, musicbrainz->proxy_address);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ARG_PROXY_PORT:{
|
||||||
|
g_value_set_uint (value, musicbrainz->proxy_port);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:{
|
default:{
|
||||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||||
break;
|
break;
|
||||||
|
@ -56,6 +56,9 @@ struct _GstMusicBrainz {
|
|||||||
gchar signature[17];
|
gchar signature[17];
|
||||||
gchar ascii_signature[37];
|
gchar ascii_signature[37];
|
||||||
|
|
||||||
|
gchar *proxy_address;
|
||||||
|
guint proxy_port;
|
||||||
|
|
||||||
guint depth;
|
guint depth;
|
||||||
guint rate;
|
guint rate;
|
||||||
guint channels;
|
guint channels;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user