From 4be3e6fdbf067f75eed9ba59e2768890f6b317fa Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 27 Oct 2004 22:45:31 +0000 Subject: prepare next release git-svn-id: file:///home/lennart/svn/public/gst-pulse/trunk@6 bb39ca4e-bce3-0310-b5d4-eea78a553289 --- src/Makefile.am | 24 ++++++++++++++++++++++-- src/polypsink.c | 49 +++++++++++++++++++++++++++++++++---------------- 2 files changed, 55 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 1bd1fae..8027091 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,14 +1,34 @@ +# $Id$ +# +# This file is part of gst-polyp. +# +# gst-polyp is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# gst-polyp is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with gst-polyp; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 +# USA. + plugindir=/tmp/ -plugin_LTLIBRARIES = libgstpolyp.la +pkglib_LTLIBRARIES = libgstpolyp.la libgstpolyp_la_SOURCES = plugin.c polypsink.c libgstpolyp_la_CFLAGS = $(GST_CFLAGS) $(POLYP_CFLAGS) libgstpolyp_la_LIBADD = $(POLYP_LIBS) $(GST_LIBS) +install-exec-hook: reg reg: - gst-register-0.8 --gst-plugin-path=`pwd` + gst-register-0.8 --gst-plugin-path=$(pkglibdir) inspect: gst-inspect-0.8 polypsink diff --git a/src/polypsink.c b/src/polypsink.c index 70f5b41..6376662 100644 --- a/src/polypsink.c +++ b/src/polypsink.c @@ -29,25 +29,25 @@ static void gst_polypsink_base_init(gpointer g_class) { GST_PAD_ALWAYS, GST_STATIC_CAPS( "audio/x-raw-int, " - "endianness = (int) 1234, " /*{ LITTLE_ENDIAN , BIG_ENDIAN }, "*/ + "endianness = (int) { LITTLE_ENDIAN , BIG_ENDIAN }, " "signed = (boolean) TRUE, " "width = (int) 16, " "depth = (int) 16, " - "rate = (int) 44100, " /*[ 1000, 192000 ], "*/ - "channels = (int) [ 1, 16 ]" /*[ 1, 16 ];"*/ - -/* "audio/x-raw-float, " */ -/* "endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " */ -/* "width = (int) 32, " */ -/* "rate = (int) [ 1000, 192000 ], " */ -/* "channels = (int) [ 1, 16 ];" */ + "rate = (int) [ 1, MAX ], " + "channels = (int) [ 1, 16 ];" + + "audio/x-raw-float, " + "endianness = (int) { LITTLE_ENDIAN, BIG_ENDIAN }, " + "width = (int) 32, " + "rate = (int) [ 1, MAX ], " + "channels = (int) [ 1, 16 ];" -/* "audio/x-raw-int, " */ -/* "signed = (boolean) FALSE, " */ -/* "width = (int) 8, " */ -/* "depth = (int) 8, " */ -/* "rate = (int) [ 1000, 192000 ], " */ - /* "channels = (int) [ 1, 16 ]"*/) + "audio/x-raw-int, " + "signed = (boolean) FALSE, " + "width = (int) 8, " + "depth = (int) 8, " + "rate = (int) [ 1, MAX ], " + "channels = (int) [ 1, 16 ]") ); static const GstElementDetails details = { @@ -294,7 +294,7 @@ static void create_stream(GstPolypSink *polypsink) { pa_stream_set_state_callback(polypsink->stream, stream_state_callback, polypsink); pa_stream_set_write_callback(polypsink->stream, stream_write_callback, polypsink); - pa_stream_connect_playback(polypsink->stream, NULL, NULL, PA_VOLUME_NORM); + pa_stream_connect_playback(polypsink->stream, NULL, NULL, 0, PA_VOLUME_NORM); } static void create_context(GstPolypSink *polypsink) { @@ -506,6 +506,22 @@ static GstPadLinkReturn gst_polypsink_link(GstPad *pad, const GstCaps *caps) { return GST_PAD_LINK_OK; } +static GstCaps* gst_polypsink_sink_fixate(GstPad *pad, const GstCaps *caps) { + GstCaps *newcaps; + GstStructure *structure; + + newcaps = gst_caps_new_full(gst_structure_copy(gst_caps_get_structure(caps, 0)), NULL); + structure = gst_caps_get_structure(newcaps, 0); + + if (gst_caps_structure_fixate_field_nearest_int (structure, "rate", 44100) || + gst_caps_structure_fixate_field_nearest_int (structure, "depth", 16) || + gst_caps_structure_fixate_field_nearest_int (structure, "width", 16) || + gst_caps_structure_fixate_field_nearest_int (structure, "channels", 2)) + return newcaps; + + gst_caps_free (newcaps); + return NULL; +} static void gst_polypsink_init(GTypeInstance* instance, gpointer g_class) { GstPolypSink *polypsink = GST_POLYPSINK(instance); @@ -517,6 +533,7 @@ static void gst_polypsink_init(GTypeInstance* instance, gpointer g_class) { gst_element_add_pad(GST_ELEMENT(polypsink), polypsink->sinkpad); gst_pad_set_chain_function(polypsink->sinkpad, gst_polypsink_chain); gst_pad_set_link_function(polypsink->sinkpad, gst_polypsink_link); + gst_pad_set_fixate_function (polypsink->sinkpad, gst_polypsink_sink_fixate); /* GST_FLAG_SET(polypsink, GST_ELEMENT_THREAD_SUGGESTED); */ GST_FLAG_SET(polypsink, GST_ELEMENT_EVENT_AWARE); -- cgit