Commit f7d7adb9 authored by David I. Lehn's avatar David I. Lehn
Browse files

last second merge from HEAD

Original commit message from CVS:
last second merge from HEAD
parent eb226bd2
......@@ -14,4 +14,10 @@ SUBDIRS=gst-libs gst sys $(EXT_DIR) examples tools $(GCONF_DIR) ## testsuite
DIST_SUBDIRS=gst-libs gst sys ext examples tools gconf ## testsuite
EXTRA_DIST=gst-plugins.spec depcomp AUTHORS COPYING README RELEASE ChangeLog autogen.sh
EXTRA_DIST=gst-plugins.spec depcomp \
AUTHORS COPYING README RELEASE LICENSE LICENSE_readme \
ChangeLog autogen.sh common m4
dist-hook:
rm -rf `find $(distdir)/common -name CVS`
rm -rf `find $(distdir)/m4 -name CVS`
......@@ -230,7 +230,7 @@ SUBDIRS=$(A52DEC_DIR) $(AALIB_DIR) $(ALSA_DIR) \
$(ARTS_DIR) $(ARTSC_DIR) $(AUDIOFILE_DIR) \
$(AVIFILE_DIR) $(CDPARANOIA_DIR) $(DV_DIR) \
$(DVDREAD_DIR) $(DVDNAV_DIR) $(ESD_DIR) \
$(FLAC_DIR) $(GNOMEVFS_DIR) $(GSM_DIR) \
$(FESTIVAL_DIR) $(FLAC_DIR) $(GNOMEVFS_DIR) $(GSM_DIR) \
$(HERMES_DIR) $(HTTP_DIR) $(JACK_DIR) $(JPEG_DIR) \
$(LADSPA_DIR) $(LAME_DIR) $(LCS_DIR) $(LIBFAME_DIR) \
$(MAD_DIR) $(MIKMOD_DIR) $(MJPEGTOOLS_DIR) $(MPEG2DEC_DIR) \
......@@ -242,7 +242,7 @@ DIST_SUBDIRS=\
a52dec aalib alsa \
arts artsd avifile \
audiofile cdparanoia dv \
dvdread dvdnav esd ffmpeg \
dvdread dvdnav esd festival ffmpeg \
flac gnomevfs gsm \
hermes http jack jpeg \
ladspa lame lcs libfame \
......
......@@ -64,6 +64,7 @@ static GstElementDetails gst_jack_src_details = {
};
static GHashTable *port_name_counts = NULL;
static GstElementClass *parent_class = NULL;
static void gst_jack_init(GstJack *this);
......@@ -188,6 +189,7 @@ gst_jack_class_init(GstJackClass *klass)
{
GObjectClass *object_class;
GstElementClass *element_class;
gchar *prefix;
object_class = (GObjectClass *)klass;
element_class = (GstElementClass *)klass;
......@@ -198,10 +200,15 @@ gst_jack_class_init(GstJackClass *klass)
object_class->get_property = gst_jack_get_property;
object_class->set_property = gst_jack_set_property;
if (GST_IS_JACK_SINK_CLASS (klass))
prefix = "gst-out-";
else
prefix = "gst-in-";
g_object_class_install_property(G_OBJECT_CLASS(klass), ARG_PORT_NAME_PREFIX,
g_param_spec_string("port-name-prefix","Port name prefix",
"String to prepend to jack port names",
"gst-",
prefix,
G_PARAM_READWRITE | G_PARAM_CONSTRUCT));
element_class->change_state = gst_jack_change_state;
......@@ -230,6 +237,7 @@ gst_jack_request_new_pad (GstElement *element, GstPadTemplate *templ, const gcha
gchar *newname;
GList *l, **pad_list;
GstJackPad *pad;
gint count;
g_return_val_if_fail ((this = GST_JACK (element)), NULL);
......@@ -238,7 +246,7 @@ gst_jack_request_new_pad (GstElement *element, GstPadTemplate *templ, const gcha
else if (this->direction == GST_PAD_SRC)
pad_list = &this->bin->src_pads;
else
pad_list = &this->bin->src_pads;
pad_list = &this->bin->sink_pads;
if (name) {
l = *pad_list;
......@@ -251,12 +259,22 @@ gst_jack_request_new_pad (GstElement *element, GstPadTemplate *templ, const gcha
}
newname = g_strdup (name);
} else {
newname = g_strdup ("alsa_pcm:out_1");
if (this->direction == GST_PAD_SINK)
newname = g_strdup ("alsa_pcm:out_1");
else
newname = g_strdup ("alsa_pcm:in_1");
}
pad = g_new0(GstJackPad, 1);
pad->name = g_strdup_printf ("%s%d", this->port_name_prefix, 1); /* fixme :) */
if (!port_name_counts)
port_name_counts = g_hash_table_new (g_str_hash, g_str_equal);
count = GPOINTER_TO_INT (g_hash_table_lookup (port_name_counts, this->port_name_prefix));
g_hash_table_insert (port_name_counts, g_strdup (this->port_name_prefix), GINT_TO_POINTER (count+1));
pad->name = g_strdup_printf ("%s%d", this->port_name_prefix, count);
pad->peer_name = newname;
pad->pad = gst_pad_new_from_template (templ, newname);
gst_element_add_pad (GST_ELEMENT (this), pad->pad);
......
......@@ -160,14 +160,14 @@ gst_jack_bin_change_state (GstElement *element)
l = this->src_pads;
while (l) {
pad = GST_JACK_PAD (l);
g_message ("jack: registering pad %s:%s", pad->name, pad->peer_name);
g_message ("jack: registering output port %s (peer %s)", pad->name, pad->peer_name);
pad->port = jack_port_register (this->client, pad->name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput|JackPortIsTerminal, 0);
l = g_list_next (l);
}
l = this->sink_pads;
while (l) {
pad = GST_JACK_PAD (l);
g_message ("jack: registering pad %s:%s", pad->name, pad->peer_name);
g_message ("jack: registering input port %s (peer %s)", pad->name, pad->peer_name);
pad->port = jack_port_register (this->client, pad->name, JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput|JackPortIsTerminal, 0);
l = g_list_next (l);
}
......@@ -186,7 +186,7 @@ gst_jack_bin_change_state (GstElement *element)
pad = GST_JACK_PAD (l);
g_message ("connecting gst jack port %s to jack port %s", jack_port_name (pad->port), pad->peer_name);
if (jack_connect (this->client, jack_port_name (pad->port), pad->peer_name)) {
g_warning ("could not connect %s and %s", pad->peer_name, jack_port_name (pad->port));
g_warning ("jack: could not connect %s and %s", pad->peer_name, jack_port_name (pad->port));
return GST_STATE_FAILURE;
}
l = g_list_next (l);
......@@ -196,7 +196,7 @@ gst_jack_bin_change_state (GstElement *element)
pad = GST_JACK_PAD (l);
g_message ("connecting gst jack port %s to jack port %s", jack_port_name (pad->port), pad->peer_name);
if (jack_connect (this->client, jack_port_name (pad->port), pad->peer_name)) {
g_warning ("could not connect %s and %s", pad->peer_name, jack_port_name (pad->port));
g_warning ("jack: could not connect %s and %s", pad->peer_name, jack_port_name (pad->port));
return GST_STATE_FAILURE;
}
l = g_list_next (l);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment