2002-05-04 18:57:44 +00:00
|
|
|
/* -*- Mode: C; c-basic-offset: 4 -*- */
|
2002-04-16 17:14:05 +00:00
|
|
|
/*
|
2003-09-30 12:56:27 +00:00
|
|
|
Copyright (C) 2002, 2003 Andy Wingo <wingo@pobox.com>
|
2002-04-16 17:14:05 +00:00
|
|
|
|
|
|
|
This library 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.
|
|
|
|
|
|
|
|
This library 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 this library; if not, write to the Free
|
|
|
|
Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
|
|
|
|
2003-11-07 12:47:02 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2002-04-16 17:14:05 +00:00
|
|
|
#include <stdlib.h>
|
2002-05-04 21:38:56 +00:00
|
|
|
#include <string.h>
|
2003-03-04 15:34:20 +00:00
|
|
|
#include <signal.h>
|
2002-04-16 17:14:05 +00:00
|
|
|
#include "gstjack.h"
|
|
|
|
|
|
|
|
|
|
|
|
static GstBinClass *parent_class = NULL;
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static void gst_jack_bin_init (GstJackBin * this);
|
|
|
|
static void gst_jack_bin_class_init (GstJackBinClass * klass);
|
2002-04-16 17:14:05 +00:00
|
|
|
|
2005-09-05 17:20:29 +00:00
|
|
|
static GstStateChangeReturn gst_jack_bin_change_state (GstElement * element,
|
|
|
|
GstStateChange transition);
|
2002-04-16 17:14:05 +00:00
|
|
|
|
|
|
|
/* jack callbacks */
|
2002-05-13 18:08:33 +00:00
|
|
|
static int process (jack_nframes_t nframes, void *arg);
|
|
|
|
static int sample_rate (jack_nframes_t nframes, void *arg);
|
2003-09-30 12:56:27 +00:00
|
|
|
static int buffer_size (jack_nframes_t nframes, void *arg);
|
2002-04-16 17:14:05 +00:00
|
|
|
static void shutdown (void *arg);
|
|
|
|
|
2003-03-04 15:34:20 +00:00
|
|
|
static void sighup_handler (int sig);
|
|
|
|
static GstJackBin *_jackbin = NULL;
|
|
|
|
static gboolean watchdog_please_set_the_jackbin_to_ready = FALSE;
|
|
|
|
|
|
|
|
/* fixme: we need a watchdog thread to see if we have received a SIGHUP, and if
|
|
|
|
* so set the state of the bin to READY. */
|
2002-04-16 17:14:05 +00:00
|
|
|
|
|
|
|
GType
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_jack_bin_get_type (void)
|
2002-04-16 17:14:05 +00:00
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
static GType jack_bin_type = 0;
|
|
|
|
|
|
|
|
if (!jack_bin_type) {
|
|
|
|
static const GTypeInfo jack_bin_info = {
|
|
|
|
sizeof (GstJackBinClass),
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
(GClassInitFunc) gst_jack_bin_class_init,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
sizeof (GstJackBin),
|
|
|
|
0,
|
|
|
|
(GInstanceInitFunc) gst_jack_bin_init,
|
|
|
|
};
|
2004-03-15 19:32:27 +00:00
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
jack_bin_type =
|
2004-03-15 19:32:27 +00:00
|
|
|
g_type_register_static (GST_TYPE_BIN, "GstJackBin", &jack_bin_info, 0);
|
2004-03-14 22:34:33 +00:00
|
|
|
}
|
|
|
|
return jack_bin_type;
|
2002-04-16 17:14:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_jack_bin_class_init (GstJackBinClass * klass)
|
2002-04-16 17:14:05 +00:00
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
GObjectClass *object_class;
|
|
|
|
GstElementClass *element_class;
|
|
|
|
|
|
|
|
object_class = (GObjectClass *) klass;
|
|
|
|
element_class = (GstElementClass *) klass;
|
|
|
|
|
2006-04-08 21:48:01 +00:00
|
|
|
parent_class = g_type_class_peek_parent (klass);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
|
|
|
element_class->change_state = gst_jack_bin_change_state;
|
2002-04-16 17:14:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2004-03-14 22:34:33 +00:00
|
|
|
gst_jack_bin_init (GstJackBin * this)
|
2002-04-16 17:14:05 +00:00
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
GST_DEBUG ("initializing jack bin");
|
|
|
|
|
|
|
|
/* jack bins are managing bins and iterate themselves */
|
renamed GST_FLAGS macros to GST_OBJECT_FLAGS moved bitshift from macro to enum definition
Original commit message from CVS:
* examples/indexing/indexmpeg.c: (main):
* ext/artsd/gstartsdsink.c: (gst_artsdsink_open_audio),
(gst_artsdsink_close_audio), (gst_artsdsink_change_state):
* ext/artsd/gstartsdsink.h:
* ext/audiofile/gstafparse.c: (gst_afparse_open_file),
(gst_afparse_close_file):
* ext/audiofile/gstafparse.h:
* ext/audiofile/gstafsink.c: (gst_afsink_open_file),
(gst_afsink_close_file), (gst_afsink_chain),
(gst_afsink_change_state):
* ext/audiofile/gstafsink.h:
* ext/audiofile/gstafsrc.c: (gst_afsrc_open_file),
(gst_afsrc_close_file), (gst_afsrc_change_state):
* ext/audiofile/gstafsrc.h:
* ext/cdaudio/gstcdaudio.c: (gst_cdaudio_init):
* ext/directfb/directfbvideosink.c: (gst_directfbvideosink_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_init):
* ext/jack/gstjack.h:
* ext/jack/gstjackbin.c: (gst_jack_bin_init),
(gst_jack_bin_change_state):
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_init):
* ext/musicbrainz/gsttrm.c: (gst_musicbrainz_init):
* ext/nas/nassink.c: (gst_nassink_open_audio),
(gst_nassink_close_audio), (gst_nassink_change_state):
* ext/nas/nassink.h:
* ext/polyp/polypsink.c: (gst_polypsink_init):
* ext/sdl/sdlvideosink.c: (gst_sdlvideosink_change_state):
* ext/sdl/sdlvideosink.h:
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_init):
* ext/sndfile/gstsf.c: (gst_sf_set_property),
(gst_sf_change_state), (gst_sf_release_request_pad),
(gst_sf_open_file), (gst_sf_close_file), (gst_sf_loop):
* ext/sndfile/gstsf.h:
* ext/swfdec/gstswfdec.c: (gst_swfdec_init):
* ext/tarkin/gsttarkindec.c: (gst_tarkindec_init):
* gst/apetag/apedemux.c: (gst_ape_demux_init):
* gst/cdxaparse/gstcdxaparse.c: (gst_cdxaparse_init):
* gst/cdxaparse/gstcdxastrip.c: (gst_cdxastrip_init):
* gst/festival/gstfestival.c: (gst_festival_change_state):
* gst/festival/gstfestival.h:
* gst/mpeg2sub/gstmpeg2subt.c: (gst_mpeg2subt_init):
* gst/multifilesink/gstmultifilesink.c: (gst_multifilesink_init),
(gst_multifilesink_set_location), (gst_multifilesink_open_file),
(gst_multifilesink_close_file), (gst_multifilesink_next_file),
(gst_multifilesink_pad_query), (gst_multifilesink_handle_event),
(gst_multifilesink_chain), (gst_multifilesink_change_state):
* gst/multifilesink/gstmultifilesink.h:
* gst/videodrop/gstvideodrop.c: (gst_videodrop_init):
* sys/cdrom/gstcdplayer.c: (cdplayer_init):
* sys/dxr3/dxr3audiosink.c: (dxr3audiosink_init),
(dxr3audiosink_open), (dxr3audiosink_close),
(dxr3audiosink_chain_pcm), (dxr3audiosink_chain_ac3),
(dxr3audiosink_change_state):
* sys/dxr3/dxr3audiosink.h:
* sys/dxr3/dxr3spusink.c: (dxr3spusink_init), (dxr3spusink_open),
(dxr3spusink_close), (dxr3spusink_chain),
(dxr3spusink_change_state):
* sys/dxr3/dxr3spusink.h:
* sys/dxr3/dxr3videosink.c: (dxr3videosink_init),
(dxr3videosink_open), (dxr3videosink_close),
(dxr3videosink_write_data), (dxr3videosink_change_state):
* sys/dxr3/dxr3videosink.h:
* sys/glsink/glimagesink.c: (gst_glimagesink_init):
* sys/qcam/gstqcamsrc.c: (gst_qcamsrc_change_state),
(gst_qcamsrc_open), (gst_qcamsrc_close):
* sys/qcam/gstqcamsrc.h:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_init):
* sys/vcd/vcdsrc.c: (gst_vcdsrc_set_property), (gst_vcdsrc_get),
(gst_vcdsrc_open_file), (gst_vcdsrc_close_file),
(gst_vcdsrc_change_state), (gst_vcdsrc_recalculate):
* sys/vcd/vcdsrc.h:
renamed GST_FLAGS macros to GST_OBJECT_FLAGS
moved bitshift from macro to enum definition
2005-10-12 14:29:55 +00:00
|
|
|
GST_OBJECT_FLAG_SET (this, GST_BIN_FLAG_MANAGER);
|
|
|
|
GST_OBJECT_FLAG_SET (this, GST_BIN_SELF_SCHEDULABLE);
|
2004-03-14 22:34:33 +00:00
|
|
|
|
|
|
|
/* make a new scheduler and associate it with the bin */
|
|
|
|
gst_scheduler_factory_make (NULL, GST_ELEMENT (this));
|
2002-04-16 17:14:05 +00:00
|
|
|
}
|
|
|
|
|
2005-09-05 17:20:29 +00:00
|
|
|
static GstStateChangeReturn
|
|
|
|
gst_jack_bin_change_state (GstElement * element, GstStateChange transition)
|
2002-04-16 17:14:05 +00:00
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
GstJackBin *this;
|
|
|
|
GList *l = NULL;
|
|
|
|
GstJackPad *pad;
|
|
|
|
|
|
|
|
g_return_val_if_fail (element != NULL, FALSE);
|
|
|
|
this = GST_JACK_BIN (element);
|
|
|
|
|
|
|
|
switch (GST_STATE_PENDING (element)) {
|
2002-04-16 17:14:05 +00:00
|
|
|
case GST_STATE_NULL:
|
2004-03-14 22:34:33 +00:00
|
|
|
JACK_DEBUG ("jackbin: NULL state");
|
|
|
|
if (this->client) {
|
2004-03-15 19:32:27 +00:00
|
|
|
JACK_DEBUG ("jackbin: closing client");
|
|
|
|
jack_client_close (this->client);
|
|
|
|
this->client = NULL;
|
2004-03-14 22:34:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (_jackbin)
|
2004-03-15 19:32:27 +00:00
|
|
|
signal (SIGHUP, SIG_DFL);
|
2004-03-14 22:34:33 +00:00
|
|
|
_jackbin = NULL;
|
|
|
|
|
|
|
|
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
2005-09-05 17:20:29 +00:00
|
|
|
return GST_ELEMENT_CLASS (parent_class)->change_state (element,
|
|
|
|
transition);
|
2004-03-14 22:34:33 +00:00
|
|
|
break;
|
|
|
|
|
2002-04-16 17:14:05 +00:00
|
|
|
case GST_STATE_READY:
|
2004-03-14 22:34:33 +00:00
|
|
|
JACK_DEBUG ("jackbin: READY");
|
|
|
|
|
|
|
|
_jackbin = this;
|
|
|
|
signal (SIGHUP, sighup_handler);
|
|
|
|
|
|
|
|
if (!this->client) {
|
2004-03-15 19:32:27 +00:00
|
|
|
if (!(this->client = jack_client_new ("gst-jack"))) {
|
|
|
|
g_warning ("jack server not running?");
|
2005-09-05 17:20:29 +00:00
|
|
|
return GST_STATE_CHANGE_FAILURE;
|
2004-03-15 19:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gst_scheduler_setup (GST_ELEMENT_SCHED (this));
|
|
|
|
|
|
|
|
jack_set_process_callback (this->client, process, this);
|
|
|
|
jack_set_sample_rate_callback (this->client, sample_rate, this);
|
|
|
|
jack_set_buffer_size_callback (this->client, buffer_size, this);
|
|
|
|
this->nframes = jack_get_buffer_size (this->client);
|
|
|
|
jack_on_shutdown (this->client, shutdown, this);
|
2004-03-14 22:34:33 +00:00
|
|
|
}
|
|
|
|
|
renamed GST_FLAGS macros to GST_OBJECT_FLAGS moved bitshift from macro to enum definition
Original commit message from CVS:
* examples/indexing/indexmpeg.c: (main):
* ext/artsd/gstartsdsink.c: (gst_artsdsink_open_audio),
(gst_artsdsink_close_audio), (gst_artsdsink_change_state):
* ext/artsd/gstartsdsink.h:
* ext/audiofile/gstafparse.c: (gst_afparse_open_file),
(gst_afparse_close_file):
* ext/audiofile/gstafparse.h:
* ext/audiofile/gstafsink.c: (gst_afsink_open_file),
(gst_afsink_close_file), (gst_afsink_chain),
(gst_afsink_change_state):
* ext/audiofile/gstafsink.h:
* ext/audiofile/gstafsrc.c: (gst_afsrc_open_file),
(gst_afsrc_close_file), (gst_afsrc_change_state):
* ext/audiofile/gstafsrc.h:
* ext/cdaudio/gstcdaudio.c: (gst_cdaudio_init):
* ext/directfb/directfbvideosink.c: (gst_directfbvideosink_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_init):
* ext/jack/gstjack.h:
* ext/jack/gstjackbin.c: (gst_jack_bin_init),
(gst_jack_bin_change_state):
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_init):
* ext/musicbrainz/gsttrm.c: (gst_musicbrainz_init):
* ext/nas/nassink.c: (gst_nassink_open_audio),
(gst_nassink_close_audio), (gst_nassink_change_state):
* ext/nas/nassink.h:
* ext/polyp/polypsink.c: (gst_polypsink_init):
* ext/sdl/sdlvideosink.c: (gst_sdlvideosink_change_state):
* ext/sdl/sdlvideosink.h:
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_init):
* ext/sndfile/gstsf.c: (gst_sf_set_property),
(gst_sf_change_state), (gst_sf_release_request_pad),
(gst_sf_open_file), (gst_sf_close_file), (gst_sf_loop):
* ext/sndfile/gstsf.h:
* ext/swfdec/gstswfdec.c: (gst_swfdec_init):
* ext/tarkin/gsttarkindec.c: (gst_tarkindec_init):
* gst/apetag/apedemux.c: (gst_ape_demux_init):
* gst/cdxaparse/gstcdxaparse.c: (gst_cdxaparse_init):
* gst/cdxaparse/gstcdxastrip.c: (gst_cdxastrip_init):
* gst/festival/gstfestival.c: (gst_festival_change_state):
* gst/festival/gstfestival.h:
* gst/mpeg2sub/gstmpeg2subt.c: (gst_mpeg2subt_init):
* gst/multifilesink/gstmultifilesink.c: (gst_multifilesink_init),
(gst_multifilesink_set_location), (gst_multifilesink_open_file),
(gst_multifilesink_close_file), (gst_multifilesink_next_file),
(gst_multifilesink_pad_query), (gst_multifilesink_handle_event),
(gst_multifilesink_chain), (gst_multifilesink_change_state):
* gst/multifilesink/gstmultifilesink.h:
* gst/videodrop/gstvideodrop.c: (gst_videodrop_init):
* sys/cdrom/gstcdplayer.c: (cdplayer_init):
* sys/dxr3/dxr3audiosink.c: (dxr3audiosink_init),
(dxr3audiosink_open), (dxr3audiosink_close),
(dxr3audiosink_chain_pcm), (dxr3audiosink_chain_ac3),
(dxr3audiosink_change_state):
* sys/dxr3/dxr3audiosink.h:
* sys/dxr3/dxr3spusink.c: (dxr3spusink_init), (dxr3spusink_open),
(dxr3spusink_close), (dxr3spusink_chain),
(dxr3spusink_change_state):
* sys/dxr3/dxr3spusink.h:
* sys/dxr3/dxr3videosink.c: (dxr3videosink_init),
(dxr3videosink_open), (dxr3videosink_close),
(dxr3videosink_write_data), (dxr3videosink_change_state):
* sys/dxr3/dxr3videosink.h:
* sys/glsink/glimagesink.c: (gst_glimagesink_init):
* sys/qcam/gstqcamsrc.c: (gst_qcamsrc_change_state),
(gst_qcamsrc_open), (gst_qcamsrc_close):
* sys/qcam/gstqcamsrc.h:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_init):
* sys/vcd/vcdsrc.c: (gst_vcdsrc_set_property), (gst_vcdsrc_get),
(gst_vcdsrc_open_file), (gst_vcdsrc_close_file),
(gst_vcdsrc_change_state), (gst_vcdsrc_recalculate):
* sys/vcd/vcdsrc.h:
renamed GST_FLAGS macros to GST_OBJECT_FLAGS
moved bitshift from macro to enum definition
2005-10-12 14:29:55 +00:00
|
|
|
if (GST_OBJECT_FLAG_IS_SET (GST_OBJECT (this), GST_JACK_OPEN)) {
|
2004-03-15 19:32:27 +00:00
|
|
|
l = this->src_pads;
|
|
|
|
while (l) {
|
|
|
|
JACK_DEBUG ("jackbin: unregistering pad %s:%s",
|
|
|
|
GST_JACK_PAD (l)->name, GST_JACK_PAD (l)->peer_name);
|
|
|
|
jack_port_unregister (this->client, GST_JACK_PAD (l)->port);
|
|
|
|
l = g_list_next (l);
|
|
|
|
}
|
|
|
|
l = this->sink_pads;
|
|
|
|
while (l) {
|
|
|
|
JACK_DEBUG ("jackbin: unregistering pad %s:%s",
|
|
|
|
GST_JACK_PAD (l)->name, GST_JACK_PAD (l)->peer_name);
|
|
|
|
jack_port_unregister (this->client, GST_JACK_PAD (l)->port);
|
|
|
|
l = g_list_next (l);
|
|
|
|
}
|
renamed GST_FLAGS macros to GST_OBJECT_FLAGS moved bitshift from macro to enum definition
Original commit message from CVS:
* examples/indexing/indexmpeg.c: (main):
* ext/artsd/gstartsdsink.c: (gst_artsdsink_open_audio),
(gst_artsdsink_close_audio), (gst_artsdsink_change_state):
* ext/artsd/gstartsdsink.h:
* ext/audiofile/gstafparse.c: (gst_afparse_open_file),
(gst_afparse_close_file):
* ext/audiofile/gstafparse.h:
* ext/audiofile/gstafsink.c: (gst_afsink_open_file),
(gst_afsink_close_file), (gst_afsink_chain),
(gst_afsink_change_state):
* ext/audiofile/gstafsink.h:
* ext/audiofile/gstafsrc.c: (gst_afsrc_open_file),
(gst_afsrc_close_file), (gst_afsrc_change_state):
* ext/audiofile/gstafsrc.h:
* ext/cdaudio/gstcdaudio.c: (gst_cdaudio_init):
* ext/directfb/directfbvideosink.c: (gst_directfbvideosink_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_init):
* ext/jack/gstjack.h:
* ext/jack/gstjackbin.c: (gst_jack_bin_init),
(gst_jack_bin_change_state):
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_init):
* ext/musicbrainz/gsttrm.c: (gst_musicbrainz_init):
* ext/nas/nassink.c: (gst_nassink_open_audio),
(gst_nassink_close_audio), (gst_nassink_change_state):
* ext/nas/nassink.h:
* ext/polyp/polypsink.c: (gst_polypsink_init):
* ext/sdl/sdlvideosink.c: (gst_sdlvideosink_change_state):
* ext/sdl/sdlvideosink.h:
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_init):
* ext/sndfile/gstsf.c: (gst_sf_set_property),
(gst_sf_change_state), (gst_sf_release_request_pad),
(gst_sf_open_file), (gst_sf_close_file), (gst_sf_loop):
* ext/sndfile/gstsf.h:
* ext/swfdec/gstswfdec.c: (gst_swfdec_init):
* ext/tarkin/gsttarkindec.c: (gst_tarkindec_init):
* gst/apetag/apedemux.c: (gst_ape_demux_init):
* gst/cdxaparse/gstcdxaparse.c: (gst_cdxaparse_init):
* gst/cdxaparse/gstcdxastrip.c: (gst_cdxastrip_init):
* gst/festival/gstfestival.c: (gst_festival_change_state):
* gst/festival/gstfestival.h:
* gst/mpeg2sub/gstmpeg2subt.c: (gst_mpeg2subt_init):
* gst/multifilesink/gstmultifilesink.c: (gst_multifilesink_init),
(gst_multifilesink_set_location), (gst_multifilesink_open_file),
(gst_multifilesink_close_file), (gst_multifilesink_next_file),
(gst_multifilesink_pad_query), (gst_multifilesink_handle_event),
(gst_multifilesink_chain), (gst_multifilesink_change_state):
* gst/multifilesink/gstmultifilesink.h:
* gst/videodrop/gstvideodrop.c: (gst_videodrop_init):
* sys/cdrom/gstcdplayer.c: (cdplayer_init):
* sys/dxr3/dxr3audiosink.c: (dxr3audiosink_init),
(dxr3audiosink_open), (dxr3audiosink_close),
(dxr3audiosink_chain_pcm), (dxr3audiosink_chain_ac3),
(dxr3audiosink_change_state):
* sys/dxr3/dxr3audiosink.h:
* sys/dxr3/dxr3spusink.c: (dxr3spusink_init), (dxr3spusink_open),
(dxr3spusink_close), (dxr3spusink_chain),
(dxr3spusink_change_state):
* sys/dxr3/dxr3spusink.h:
* sys/dxr3/dxr3videosink.c: (dxr3videosink_init),
(dxr3videosink_open), (dxr3videosink_close),
(dxr3videosink_write_data), (dxr3videosink_change_state):
* sys/dxr3/dxr3videosink.h:
* sys/glsink/glimagesink.c: (gst_glimagesink_init):
* sys/qcam/gstqcamsrc.c: (gst_qcamsrc_change_state),
(gst_qcamsrc_open), (gst_qcamsrc_close):
* sys/qcam/gstqcamsrc.h:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_init):
* sys/vcd/vcdsrc.c: (gst_vcdsrc_set_property), (gst_vcdsrc_get),
(gst_vcdsrc_open_file), (gst_vcdsrc_close_file),
(gst_vcdsrc_change_state), (gst_vcdsrc_recalculate):
* sys/vcd/vcdsrc.h:
renamed GST_FLAGS macros to GST_OBJECT_FLAGS
moved bitshift from macro to enum definition
2005-10-12 14:29:55 +00:00
|
|
|
GST_OBJECT_FLAG_UNSET (GST_OBJECT (this), GST_JACK_OPEN);
|
2004-03-15 19:32:27 +00:00
|
|
|
|
renamed GST_FLAGS macros to GST_OBJECT_FLAGS moved bitshift from macro to enum definition
Original commit message from CVS:
* examples/indexing/indexmpeg.c: (main):
* ext/artsd/gstartsdsink.c: (gst_artsdsink_open_audio),
(gst_artsdsink_close_audio), (gst_artsdsink_change_state):
* ext/artsd/gstartsdsink.h:
* ext/audiofile/gstafparse.c: (gst_afparse_open_file),
(gst_afparse_close_file):
* ext/audiofile/gstafparse.h:
* ext/audiofile/gstafsink.c: (gst_afsink_open_file),
(gst_afsink_close_file), (gst_afsink_chain),
(gst_afsink_change_state):
* ext/audiofile/gstafsink.h:
* ext/audiofile/gstafsrc.c: (gst_afsrc_open_file),
(gst_afsrc_close_file), (gst_afsrc_change_state):
* ext/audiofile/gstafsrc.h:
* ext/cdaudio/gstcdaudio.c: (gst_cdaudio_init):
* ext/directfb/directfbvideosink.c: (gst_directfbvideosink_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_init):
* ext/jack/gstjack.h:
* ext/jack/gstjackbin.c: (gst_jack_bin_init),
(gst_jack_bin_change_state):
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_init):
* ext/musicbrainz/gsttrm.c: (gst_musicbrainz_init):
* ext/nas/nassink.c: (gst_nassink_open_audio),
(gst_nassink_close_audio), (gst_nassink_change_state):
* ext/nas/nassink.h:
* ext/polyp/polypsink.c: (gst_polypsink_init):
* ext/sdl/sdlvideosink.c: (gst_sdlvideosink_change_state):
* ext/sdl/sdlvideosink.h:
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_init):
* ext/sndfile/gstsf.c: (gst_sf_set_property),
(gst_sf_change_state), (gst_sf_release_request_pad),
(gst_sf_open_file), (gst_sf_close_file), (gst_sf_loop):
* ext/sndfile/gstsf.h:
* ext/swfdec/gstswfdec.c: (gst_swfdec_init):
* ext/tarkin/gsttarkindec.c: (gst_tarkindec_init):
* gst/apetag/apedemux.c: (gst_ape_demux_init):
* gst/cdxaparse/gstcdxaparse.c: (gst_cdxaparse_init):
* gst/cdxaparse/gstcdxastrip.c: (gst_cdxastrip_init):
* gst/festival/gstfestival.c: (gst_festival_change_state):
* gst/festival/gstfestival.h:
* gst/mpeg2sub/gstmpeg2subt.c: (gst_mpeg2subt_init):
* gst/multifilesink/gstmultifilesink.c: (gst_multifilesink_init),
(gst_multifilesink_set_location), (gst_multifilesink_open_file),
(gst_multifilesink_close_file), (gst_multifilesink_next_file),
(gst_multifilesink_pad_query), (gst_multifilesink_handle_event),
(gst_multifilesink_chain), (gst_multifilesink_change_state):
* gst/multifilesink/gstmultifilesink.h:
* gst/videodrop/gstvideodrop.c: (gst_videodrop_init):
* sys/cdrom/gstcdplayer.c: (cdplayer_init):
* sys/dxr3/dxr3audiosink.c: (dxr3audiosink_init),
(dxr3audiosink_open), (dxr3audiosink_close),
(dxr3audiosink_chain_pcm), (dxr3audiosink_chain_ac3),
(dxr3audiosink_change_state):
* sys/dxr3/dxr3audiosink.h:
* sys/dxr3/dxr3spusink.c: (dxr3spusink_init), (dxr3spusink_open),
(dxr3spusink_close), (dxr3spusink_chain),
(dxr3spusink_change_state):
* sys/dxr3/dxr3spusink.h:
* sys/dxr3/dxr3videosink.c: (dxr3videosink_init),
(dxr3videosink_open), (dxr3videosink_close),
(dxr3videosink_write_data), (dxr3videosink_change_state):
* sys/dxr3/dxr3videosink.h:
* sys/glsink/glimagesink.c: (gst_glimagesink_init):
* sys/qcam/gstqcamsrc.c: (gst_qcamsrc_change_state),
(gst_qcamsrc_open), (gst_qcamsrc_close):
* sys/qcam/gstqcamsrc.h:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_init):
* sys/vcd/vcdsrc.c: (gst_vcdsrc_set_property), (gst_vcdsrc_get),
(gst_vcdsrc_open_file), (gst_vcdsrc_close_file),
(gst_vcdsrc_change_state), (gst_vcdsrc_recalculate):
* sys/vcd/vcdsrc.h:
renamed GST_FLAGS macros to GST_OBJECT_FLAGS
moved bitshift from macro to enum definition
2005-10-12 14:29:55 +00:00
|
|
|
if (GST_OBJECT_FLAG_IS_SET (GST_OBJECT (this), GST_JACK_ACTIVE)) {
|
2004-03-15 19:32:27 +00:00
|
|
|
JACK_DEBUG ("jackbin: deactivating client");
|
|
|
|
jack_deactivate (this->client);
|
renamed GST_FLAGS macros to GST_OBJECT_FLAGS moved bitshift from macro to enum definition
Original commit message from CVS:
* examples/indexing/indexmpeg.c: (main):
* ext/artsd/gstartsdsink.c: (gst_artsdsink_open_audio),
(gst_artsdsink_close_audio), (gst_artsdsink_change_state):
* ext/artsd/gstartsdsink.h:
* ext/audiofile/gstafparse.c: (gst_afparse_open_file),
(gst_afparse_close_file):
* ext/audiofile/gstafparse.h:
* ext/audiofile/gstafsink.c: (gst_afsink_open_file),
(gst_afsink_close_file), (gst_afsink_chain),
(gst_afsink_change_state):
* ext/audiofile/gstafsink.h:
* ext/audiofile/gstafsrc.c: (gst_afsrc_open_file),
(gst_afsrc_close_file), (gst_afsrc_change_state):
* ext/audiofile/gstafsrc.h:
* ext/cdaudio/gstcdaudio.c: (gst_cdaudio_init):
* ext/directfb/directfbvideosink.c: (gst_directfbvideosink_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_init):
* ext/jack/gstjack.h:
* ext/jack/gstjackbin.c: (gst_jack_bin_init),
(gst_jack_bin_change_state):
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_init):
* ext/musicbrainz/gsttrm.c: (gst_musicbrainz_init):
* ext/nas/nassink.c: (gst_nassink_open_audio),
(gst_nassink_close_audio), (gst_nassink_change_state):
* ext/nas/nassink.h:
* ext/polyp/polypsink.c: (gst_polypsink_init):
* ext/sdl/sdlvideosink.c: (gst_sdlvideosink_change_state):
* ext/sdl/sdlvideosink.h:
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_init):
* ext/sndfile/gstsf.c: (gst_sf_set_property),
(gst_sf_change_state), (gst_sf_release_request_pad),
(gst_sf_open_file), (gst_sf_close_file), (gst_sf_loop):
* ext/sndfile/gstsf.h:
* ext/swfdec/gstswfdec.c: (gst_swfdec_init):
* ext/tarkin/gsttarkindec.c: (gst_tarkindec_init):
* gst/apetag/apedemux.c: (gst_ape_demux_init):
* gst/cdxaparse/gstcdxaparse.c: (gst_cdxaparse_init):
* gst/cdxaparse/gstcdxastrip.c: (gst_cdxastrip_init):
* gst/festival/gstfestival.c: (gst_festival_change_state):
* gst/festival/gstfestival.h:
* gst/mpeg2sub/gstmpeg2subt.c: (gst_mpeg2subt_init):
* gst/multifilesink/gstmultifilesink.c: (gst_multifilesink_init),
(gst_multifilesink_set_location), (gst_multifilesink_open_file),
(gst_multifilesink_close_file), (gst_multifilesink_next_file),
(gst_multifilesink_pad_query), (gst_multifilesink_handle_event),
(gst_multifilesink_chain), (gst_multifilesink_change_state):
* gst/multifilesink/gstmultifilesink.h:
* gst/videodrop/gstvideodrop.c: (gst_videodrop_init):
* sys/cdrom/gstcdplayer.c: (cdplayer_init):
* sys/dxr3/dxr3audiosink.c: (dxr3audiosink_init),
(dxr3audiosink_open), (dxr3audiosink_close),
(dxr3audiosink_chain_pcm), (dxr3audiosink_chain_ac3),
(dxr3audiosink_change_state):
* sys/dxr3/dxr3audiosink.h:
* sys/dxr3/dxr3spusink.c: (dxr3spusink_init), (dxr3spusink_open),
(dxr3spusink_close), (dxr3spusink_chain),
(dxr3spusink_change_state):
* sys/dxr3/dxr3spusink.h:
* sys/dxr3/dxr3videosink.c: (dxr3videosink_init),
(dxr3videosink_open), (dxr3videosink_close),
(dxr3videosink_write_data), (dxr3videosink_change_state):
* sys/dxr3/dxr3videosink.h:
* sys/glsink/glimagesink.c: (gst_glimagesink_init):
* sys/qcam/gstqcamsrc.c: (gst_qcamsrc_change_state),
(gst_qcamsrc_open), (gst_qcamsrc_close):
* sys/qcam/gstqcamsrc.h:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_init):
* sys/vcd/vcdsrc.c: (gst_vcdsrc_set_property), (gst_vcdsrc_get),
(gst_vcdsrc_open_file), (gst_vcdsrc_close_file),
(gst_vcdsrc_change_state), (gst_vcdsrc_recalculate):
* sys/vcd/vcdsrc.h:
renamed GST_FLAGS macros to GST_OBJECT_FLAGS
moved bitshift from macro to enum definition
2005-10-12 14:29:55 +00:00
|
|
|
GST_OBJECT_FLAG_UNSET (GST_OBJECT (this), GST_JACK_ACTIVE);
|
2004-03-15 19:32:27 +00:00
|
|
|
}
|
2004-03-14 22:34:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
2005-09-05 17:20:29 +00:00
|
|
|
return GST_ELEMENT_CLASS (parent_class)->change_state (element,
|
|
|
|
transition);
|
2004-03-14 22:34:33 +00:00
|
|
|
break;
|
|
|
|
|
2002-04-16 17:14:05 +00:00
|
|
|
case GST_STATE_PAUSED:
|
2004-03-14 22:34:33 +00:00
|
|
|
JACK_DEBUG ("jackbin: PAUSED");
|
|
|
|
|
renamed GST_FLAGS macros to GST_OBJECT_FLAGS moved bitshift from macro to enum definition
Original commit message from CVS:
* examples/indexing/indexmpeg.c: (main):
* ext/artsd/gstartsdsink.c: (gst_artsdsink_open_audio),
(gst_artsdsink_close_audio), (gst_artsdsink_change_state):
* ext/artsd/gstartsdsink.h:
* ext/audiofile/gstafparse.c: (gst_afparse_open_file),
(gst_afparse_close_file):
* ext/audiofile/gstafparse.h:
* ext/audiofile/gstafsink.c: (gst_afsink_open_file),
(gst_afsink_close_file), (gst_afsink_chain),
(gst_afsink_change_state):
* ext/audiofile/gstafsink.h:
* ext/audiofile/gstafsrc.c: (gst_afsrc_open_file),
(gst_afsrc_close_file), (gst_afsrc_change_state):
* ext/audiofile/gstafsrc.h:
* ext/cdaudio/gstcdaudio.c: (gst_cdaudio_init):
* ext/directfb/directfbvideosink.c: (gst_directfbvideosink_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_init):
* ext/jack/gstjack.h:
* ext/jack/gstjackbin.c: (gst_jack_bin_init),
(gst_jack_bin_change_state):
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_init):
* ext/musicbrainz/gsttrm.c: (gst_musicbrainz_init):
* ext/nas/nassink.c: (gst_nassink_open_audio),
(gst_nassink_close_audio), (gst_nassink_change_state):
* ext/nas/nassink.h:
* ext/polyp/polypsink.c: (gst_polypsink_init):
* ext/sdl/sdlvideosink.c: (gst_sdlvideosink_change_state):
* ext/sdl/sdlvideosink.h:
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_init):
* ext/sndfile/gstsf.c: (gst_sf_set_property),
(gst_sf_change_state), (gst_sf_release_request_pad),
(gst_sf_open_file), (gst_sf_close_file), (gst_sf_loop):
* ext/sndfile/gstsf.h:
* ext/swfdec/gstswfdec.c: (gst_swfdec_init):
* ext/tarkin/gsttarkindec.c: (gst_tarkindec_init):
* gst/apetag/apedemux.c: (gst_ape_demux_init):
* gst/cdxaparse/gstcdxaparse.c: (gst_cdxaparse_init):
* gst/cdxaparse/gstcdxastrip.c: (gst_cdxastrip_init):
* gst/festival/gstfestival.c: (gst_festival_change_state):
* gst/festival/gstfestival.h:
* gst/mpeg2sub/gstmpeg2subt.c: (gst_mpeg2subt_init):
* gst/multifilesink/gstmultifilesink.c: (gst_multifilesink_init),
(gst_multifilesink_set_location), (gst_multifilesink_open_file),
(gst_multifilesink_close_file), (gst_multifilesink_next_file),
(gst_multifilesink_pad_query), (gst_multifilesink_handle_event),
(gst_multifilesink_chain), (gst_multifilesink_change_state):
* gst/multifilesink/gstmultifilesink.h:
* gst/videodrop/gstvideodrop.c: (gst_videodrop_init):
* sys/cdrom/gstcdplayer.c: (cdplayer_init):
* sys/dxr3/dxr3audiosink.c: (dxr3audiosink_init),
(dxr3audiosink_open), (dxr3audiosink_close),
(dxr3audiosink_chain_pcm), (dxr3audiosink_chain_ac3),
(dxr3audiosink_change_state):
* sys/dxr3/dxr3audiosink.h:
* sys/dxr3/dxr3spusink.c: (dxr3spusink_init), (dxr3spusink_open),
(dxr3spusink_close), (dxr3spusink_chain),
(dxr3spusink_change_state):
* sys/dxr3/dxr3spusink.h:
* sys/dxr3/dxr3videosink.c: (dxr3videosink_init),
(dxr3videosink_open), (dxr3videosink_close),
(dxr3videosink_write_data), (dxr3videosink_change_state):
* sys/dxr3/dxr3videosink.h:
* sys/glsink/glimagesink.c: (gst_glimagesink_init):
* sys/qcam/gstqcamsrc.c: (gst_qcamsrc_change_state),
(gst_qcamsrc_open), (gst_qcamsrc_close):
* sys/qcam/gstqcamsrc.h:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_init):
* sys/vcd/vcdsrc.c: (gst_vcdsrc_set_property), (gst_vcdsrc_get),
(gst_vcdsrc_open_file), (gst_vcdsrc_close_file),
(gst_vcdsrc_change_state), (gst_vcdsrc_recalculate):
* sys/vcd/vcdsrc.h:
renamed GST_FLAGS macros to GST_OBJECT_FLAGS
moved bitshift from macro to enum definition
2005-10-12 14:29:55 +00:00
|
|
|
if (!GST_OBJECT_FLAG_IS_SET (GST_OBJECT (this), GST_JACK_OPEN)) {
|
2004-03-15 19:32:27 +00:00
|
|
|
l = this->src_pads;
|
|
|
|
while (l) {
|
|
|
|
pad = GST_JACK_PAD (l);
|
|
|
|
JACK_DEBUG ("jackbin: registering input 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);
|
|
|
|
JACK_DEBUG ("jackbin: registering output 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);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* must activate before connecting */
|
renamed GST_FLAGS macros to GST_OBJECT_FLAGS moved bitshift from macro to enum definition
Original commit message from CVS:
* examples/indexing/indexmpeg.c: (main):
* ext/artsd/gstartsdsink.c: (gst_artsdsink_open_audio),
(gst_artsdsink_close_audio), (gst_artsdsink_change_state):
* ext/artsd/gstartsdsink.h:
* ext/audiofile/gstafparse.c: (gst_afparse_open_file),
(gst_afparse_close_file):
* ext/audiofile/gstafparse.h:
* ext/audiofile/gstafsink.c: (gst_afsink_open_file),
(gst_afsink_close_file), (gst_afsink_chain),
(gst_afsink_change_state):
* ext/audiofile/gstafsink.h:
* ext/audiofile/gstafsrc.c: (gst_afsrc_open_file),
(gst_afsrc_close_file), (gst_afsrc_change_state):
* ext/audiofile/gstafsrc.h:
* ext/cdaudio/gstcdaudio.c: (gst_cdaudio_init):
* ext/directfb/directfbvideosink.c: (gst_directfbvideosink_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_init):
* ext/jack/gstjack.h:
* ext/jack/gstjackbin.c: (gst_jack_bin_init),
(gst_jack_bin_change_state):
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_init):
* ext/musicbrainz/gsttrm.c: (gst_musicbrainz_init):
* ext/nas/nassink.c: (gst_nassink_open_audio),
(gst_nassink_close_audio), (gst_nassink_change_state):
* ext/nas/nassink.h:
* ext/polyp/polypsink.c: (gst_polypsink_init):
* ext/sdl/sdlvideosink.c: (gst_sdlvideosink_change_state):
* ext/sdl/sdlvideosink.h:
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_init):
* ext/sndfile/gstsf.c: (gst_sf_set_property),
(gst_sf_change_state), (gst_sf_release_request_pad),
(gst_sf_open_file), (gst_sf_close_file), (gst_sf_loop):
* ext/sndfile/gstsf.h:
* ext/swfdec/gstswfdec.c: (gst_swfdec_init):
* ext/tarkin/gsttarkindec.c: (gst_tarkindec_init):
* gst/apetag/apedemux.c: (gst_ape_demux_init):
* gst/cdxaparse/gstcdxaparse.c: (gst_cdxaparse_init):
* gst/cdxaparse/gstcdxastrip.c: (gst_cdxastrip_init):
* gst/festival/gstfestival.c: (gst_festival_change_state):
* gst/festival/gstfestival.h:
* gst/mpeg2sub/gstmpeg2subt.c: (gst_mpeg2subt_init):
* gst/multifilesink/gstmultifilesink.c: (gst_multifilesink_init),
(gst_multifilesink_set_location), (gst_multifilesink_open_file),
(gst_multifilesink_close_file), (gst_multifilesink_next_file),
(gst_multifilesink_pad_query), (gst_multifilesink_handle_event),
(gst_multifilesink_chain), (gst_multifilesink_change_state):
* gst/multifilesink/gstmultifilesink.h:
* gst/videodrop/gstvideodrop.c: (gst_videodrop_init):
* sys/cdrom/gstcdplayer.c: (cdplayer_init):
* sys/dxr3/dxr3audiosink.c: (dxr3audiosink_init),
(dxr3audiosink_open), (dxr3audiosink_close),
(dxr3audiosink_chain_pcm), (dxr3audiosink_chain_ac3),
(dxr3audiosink_change_state):
* sys/dxr3/dxr3audiosink.h:
* sys/dxr3/dxr3spusink.c: (dxr3spusink_init), (dxr3spusink_open),
(dxr3spusink_close), (dxr3spusink_chain),
(dxr3spusink_change_state):
* sys/dxr3/dxr3spusink.h:
* sys/dxr3/dxr3videosink.c: (dxr3videosink_init),
(dxr3videosink_open), (dxr3videosink_close),
(dxr3videosink_write_data), (dxr3videosink_change_state):
* sys/dxr3/dxr3videosink.h:
* sys/glsink/glimagesink.c: (gst_glimagesink_init):
* sys/qcam/gstqcamsrc.c: (gst_qcamsrc_change_state),
(gst_qcamsrc_open), (gst_qcamsrc_close):
* sys/qcam/gstqcamsrc.h:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_init):
* sys/vcd/vcdsrc.c: (gst_vcdsrc_set_property), (gst_vcdsrc_get),
(gst_vcdsrc_open_file), (gst_vcdsrc_close_file),
(gst_vcdsrc_change_state), (gst_vcdsrc_recalculate):
* sys/vcd/vcdsrc.h:
renamed GST_FLAGS macros to GST_OBJECT_FLAGS
moved bitshift from macro to enum definition
2005-10-12 14:29:55 +00:00
|
|
|
if (!GST_OBJECT_FLAG_IS_SET (GST_OBJECT (this), GST_JACK_ACTIVE)) {
|
2004-03-15 19:32:27 +00:00
|
|
|
JACK_DEBUG ("jackbin: activating client");
|
|
|
|
jack_activate (this->client);
|
renamed GST_FLAGS macros to GST_OBJECT_FLAGS moved bitshift from macro to enum definition
Original commit message from CVS:
* examples/indexing/indexmpeg.c: (main):
* ext/artsd/gstartsdsink.c: (gst_artsdsink_open_audio),
(gst_artsdsink_close_audio), (gst_artsdsink_change_state):
* ext/artsd/gstartsdsink.h:
* ext/audiofile/gstafparse.c: (gst_afparse_open_file),
(gst_afparse_close_file):
* ext/audiofile/gstafparse.h:
* ext/audiofile/gstafsink.c: (gst_afsink_open_file),
(gst_afsink_close_file), (gst_afsink_chain),
(gst_afsink_change_state):
* ext/audiofile/gstafsink.h:
* ext/audiofile/gstafsrc.c: (gst_afsrc_open_file),
(gst_afsrc_close_file), (gst_afsrc_change_state):
* ext/audiofile/gstafsrc.h:
* ext/cdaudio/gstcdaudio.c: (gst_cdaudio_init):
* ext/directfb/directfbvideosink.c: (gst_directfbvideosink_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_init):
* ext/jack/gstjack.h:
* ext/jack/gstjackbin.c: (gst_jack_bin_init),
(gst_jack_bin_change_state):
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_init):
* ext/musicbrainz/gsttrm.c: (gst_musicbrainz_init):
* ext/nas/nassink.c: (gst_nassink_open_audio),
(gst_nassink_close_audio), (gst_nassink_change_state):
* ext/nas/nassink.h:
* ext/polyp/polypsink.c: (gst_polypsink_init):
* ext/sdl/sdlvideosink.c: (gst_sdlvideosink_change_state):
* ext/sdl/sdlvideosink.h:
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_init):
* ext/sndfile/gstsf.c: (gst_sf_set_property),
(gst_sf_change_state), (gst_sf_release_request_pad),
(gst_sf_open_file), (gst_sf_close_file), (gst_sf_loop):
* ext/sndfile/gstsf.h:
* ext/swfdec/gstswfdec.c: (gst_swfdec_init):
* ext/tarkin/gsttarkindec.c: (gst_tarkindec_init):
* gst/apetag/apedemux.c: (gst_ape_demux_init):
* gst/cdxaparse/gstcdxaparse.c: (gst_cdxaparse_init):
* gst/cdxaparse/gstcdxastrip.c: (gst_cdxastrip_init):
* gst/festival/gstfestival.c: (gst_festival_change_state):
* gst/festival/gstfestival.h:
* gst/mpeg2sub/gstmpeg2subt.c: (gst_mpeg2subt_init):
* gst/multifilesink/gstmultifilesink.c: (gst_multifilesink_init),
(gst_multifilesink_set_location), (gst_multifilesink_open_file),
(gst_multifilesink_close_file), (gst_multifilesink_next_file),
(gst_multifilesink_pad_query), (gst_multifilesink_handle_event),
(gst_multifilesink_chain), (gst_multifilesink_change_state):
* gst/multifilesink/gstmultifilesink.h:
* gst/videodrop/gstvideodrop.c: (gst_videodrop_init):
* sys/cdrom/gstcdplayer.c: (cdplayer_init):
* sys/dxr3/dxr3audiosink.c: (dxr3audiosink_init),
(dxr3audiosink_open), (dxr3audiosink_close),
(dxr3audiosink_chain_pcm), (dxr3audiosink_chain_ac3),
(dxr3audiosink_change_state):
* sys/dxr3/dxr3audiosink.h:
* sys/dxr3/dxr3spusink.c: (dxr3spusink_init), (dxr3spusink_open),
(dxr3spusink_close), (dxr3spusink_chain),
(dxr3spusink_change_state):
* sys/dxr3/dxr3spusink.h:
* sys/dxr3/dxr3videosink.c: (dxr3videosink_init),
(dxr3videosink_open), (dxr3videosink_close),
(dxr3videosink_write_data), (dxr3videosink_change_state):
* sys/dxr3/dxr3videosink.h:
* sys/glsink/glimagesink.c: (gst_glimagesink_init):
* sys/qcam/gstqcamsrc.c: (gst_qcamsrc_change_state),
(gst_qcamsrc_open), (gst_qcamsrc_close):
* sys/qcam/gstqcamsrc.h:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_init):
* sys/vcd/vcdsrc.c: (gst_vcdsrc_set_property), (gst_vcdsrc_get),
(gst_vcdsrc_open_file), (gst_vcdsrc_close_file),
(gst_vcdsrc_change_state), (gst_vcdsrc_recalculate):
* sys/vcd/vcdsrc.h:
renamed GST_FLAGS macros to GST_OBJECT_FLAGS
moved bitshift from macro to enum definition
2005-10-12 14:29:55 +00:00
|
|
|
GST_OBJECT_FLAG_SET (GST_OBJECT (this), GST_JACK_ACTIVE);
|
2004-03-15 19:32:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
l = this->src_pads;
|
|
|
|
while (l) {
|
|
|
|
pad = GST_JACK_PAD (l);
|
|
|
|
JACK_DEBUG ("connecting jack port %s to gst jack port %s",
|
|
|
|
pad->peer_name, jack_port_name (pad->port));
|
|
|
|
if (jack_connect (this->client, pad->peer_name,
|
|
|
|
jack_port_name (pad->port))) {
|
|
|
|
g_warning ("jackbin: could not connect %s and %s", pad->peer_name,
|
|
|
|
jack_port_name (pad->port));
|
2005-09-05 17:20:29 +00:00
|
|
|
return GST_STATE_CHANGE_FAILURE;
|
2004-03-15 19:32:27 +00:00
|
|
|
}
|
|
|
|
l = g_list_next (l);
|
|
|
|
}
|
|
|
|
l = this->sink_pads;
|
|
|
|
while (l) {
|
|
|
|
pad = GST_JACK_PAD (l);
|
|
|
|
JACK_DEBUG ("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 ("jackbin: could not connect %s and %s", pad->peer_name,
|
|
|
|
jack_port_name (pad->port));
|
2005-09-05 17:20:29 +00:00
|
|
|
return GST_STATE_CHANGE_FAILURE;
|
2004-03-15 19:32:27 +00:00
|
|
|
}
|
|
|
|
l = g_list_next (l);
|
|
|
|
}
|
|
|
|
|
|
|
|
JACK_DEBUG ("jackbin: setting OPEN flag");
|
renamed GST_FLAGS macros to GST_OBJECT_FLAGS moved bitshift from macro to enum definition
Original commit message from CVS:
* examples/indexing/indexmpeg.c: (main):
* ext/artsd/gstartsdsink.c: (gst_artsdsink_open_audio),
(gst_artsdsink_close_audio), (gst_artsdsink_change_state):
* ext/artsd/gstartsdsink.h:
* ext/audiofile/gstafparse.c: (gst_afparse_open_file),
(gst_afparse_close_file):
* ext/audiofile/gstafparse.h:
* ext/audiofile/gstafsink.c: (gst_afsink_open_file),
(gst_afsink_close_file), (gst_afsink_chain),
(gst_afsink_change_state):
* ext/audiofile/gstafsink.h:
* ext/audiofile/gstafsrc.c: (gst_afsrc_open_file),
(gst_afsrc_close_file), (gst_afsrc_change_state):
* ext/audiofile/gstafsrc.h:
* ext/cdaudio/gstcdaudio.c: (gst_cdaudio_init):
* ext/directfb/directfbvideosink.c: (gst_directfbvideosink_init):
* ext/dts/gstdtsdec.c: (gst_dtsdec_init):
* ext/jack/gstjack.h:
* ext/jack/gstjackbin.c: (gst_jack_bin_init),
(gst_jack_bin_change_state):
* ext/musepack/gstmusepackdec.c: (gst_musepackdec_init):
* ext/musicbrainz/gsttrm.c: (gst_musicbrainz_init):
* ext/nas/nassink.c: (gst_nassink_open_audio),
(gst_nassink_close_audio), (gst_nassink_change_state):
* ext/nas/nassink.h:
* ext/polyp/polypsink.c: (gst_polypsink_init):
* ext/sdl/sdlvideosink.c: (gst_sdlvideosink_change_state):
* ext/sdl/sdlvideosink.h:
* ext/smoothwave/gstsmoothwave.c: (gst_smoothwave_init):
* ext/sndfile/gstsf.c: (gst_sf_set_property),
(gst_sf_change_state), (gst_sf_release_request_pad),
(gst_sf_open_file), (gst_sf_close_file), (gst_sf_loop):
* ext/sndfile/gstsf.h:
* ext/swfdec/gstswfdec.c: (gst_swfdec_init):
* ext/tarkin/gsttarkindec.c: (gst_tarkindec_init):
* gst/apetag/apedemux.c: (gst_ape_demux_init):
* gst/cdxaparse/gstcdxaparse.c: (gst_cdxaparse_init):
* gst/cdxaparse/gstcdxastrip.c: (gst_cdxastrip_init):
* gst/festival/gstfestival.c: (gst_festival_change_state):
* gst/festival/gstfestival.h:
* gst/mpeg2sub/gstmpeg2subt.c: (gst_mpeg2subt_init):
* gst/multifilesink/gstmultifilesink.c: (gst_multifilesink_init),
(gst_multifilesink_set_location), (gst_multifilesink_open_file),
(gst_multifilesink_close_file), (gst_multifilesink_next_file),
(gst_multifilesink_pad_query), (gst_multifilesink_handle_event),
(gst_multifilesink_chain), (gst_multifilesink_change_state):
* gst/multifilesink/gstmultifilesink.h:
* gst/videodrop/gstvideodrop.c: (gst_videodrop_init):
* sys/cdrom/gstcdplayer.c: (cdplayer_init):
* sys/dxr3/dxr3audiosink.c: (dxr3audiosink_init),
(dxr3audiosink_open), (dxr3audiosink_close),
(dxr3audiosink_chain_pcm), (dxr3audiosink_chain_ac3),
(dxr3audiosink_change_state):
* sys/dxr3/dxr3audiosink.h:
* sys/dxr3/dxr3spusink.c: (dxr3spusink_init), (dxr3spusink_open),
(dxr3spusink_close), (dxr3spusink_chain),
(dxr3spusink_change_state):
* sys/dxr3/dxr3spusink.h:
* sys/dxr3/dxr3videosink.c: (dxr3videosink_init),
(dxr3videosink_open), (dxr3videosink_close),
(dxr3videosink_write_data), (dxr3videosink_change_state):
* sys/dxr3/dxr3videosink.h:
* sys/glsink/glimagesink.c: (gst_glimagesink_init):
* sys/qcam/gstqcamsrc.c: (gst_qcamsrc_change_state),
(gst_qcamsrc_open), (gst_qcamsrc_close):
* sys/qcam/gstqcamsrc.h:
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_init):
* sys/vcd/vcdsrc.c: (gst_vcdsrc_set_property), (gst_vcdsrc_get),
(gst_vcdsrc_open_file), (gst_vcdsrc_close_file),
(gst_vcdsrc_change_state), (gst_vcdsrc_recalculate):
* sys/vcd/vcdsrc.h:
renamed GST_FLAGS macros to GST_OBJECT_FLAGS
moved bitshift from macro to enum definition
2005-10-12 14:29:55 +00:00
|
|
|
GST_OBJECT_FLAG_SET (GST_OBJECT (this), GST_JACK_OPEN);
|
2004-03-15 19:32:27 +00:00
|
|
|
|
|
|
|
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
2005-09-05 17:20:29 +00:00
|
|
|
return GST_ELEMENT_CLASS (parent_class)->change_state (element,
|
|
|
|
transition);
|
2004-03-14 22:34:33 +00:00
|
|
|
} else {
|
2004-03-15 19:32:27 +00:00
|
|
|
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
2005-09-05 17:20:29 +00:00
|
|
|
return GST_ELEMENT_CLASS (parent_class)->change_state (element,
|
|
|
|
transition);
|
2004-03-14 22:34:33 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
2002-04-16 17:14:05 +00:00
|
|
|
case GST_STATE_PLAYING:
|
2004-03-14 22:34:33 +00:00
|
|
|
JACK_DEBUG ("jackbin: PLAYING");
|
|
|
|
|
|
|
|
if (GST_ELEMENT_CLASS (parent_class)->change_state)
|
2005-09-05 17:20:29 +00:00
|
|
|
return GST_ELEMENT_CLASS (parent_class)->change_state (element,
|
|
|
|
transition);
|
2004-03-14 22:34:33 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
JACK_DEBUG ("jackbin: state change finished");
|
|
|
|
|
2005-09-05 17:20:29 +00:00
|
|
|
return GST_STATE_CHANGE_SUCCESS;
|
2002-04-16 17:14:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* jack callbacks */
|
|
|
|
|
|
|
|
/* keep in mind that these run in another thread, mm-kay? */
|
|
|
|
|
|
|
|
static int
|
2002-05-13 18:08:33 +00:00
|
|
|
process (jack_nframes_t nframes, void *arg)
|
2002-04-16 17:14:05 +00:00
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
GstJackBin *bin = (GstJackBin *) arg;
|
|
|
|
GstJackPad *pad;
|
|
|
|
GList *l;
|
|
|
|
|
|
|
|
g_assert (bin);
|
|
|
|
|
|
|
|
JACK_DEBUG ("jackbin: process()");
|
|
|
|
|
|
|
|
if (GST_STATE (bin) != GST_STATE_PLAYING) {
|
|
|
|
JACK_DEBUG ("jackbin: bin is not PLAYING yet, returning");
|
|
|
|
return 0;
|
|
|
|
} else {
|
|
|
|
JACK_DEBUG ("jackbin: we are PLAYING, let's process()");
|
|
|
|
}
|
|
|
|
|
|
|
|
l = bin->src_pads;
|
|
|
|
while (l) {
|
|
|
|
pad = GST_JACK_PAD (l);
|
|
|
|
pad->data = jack_port_get_buffer (pad->port, nframes);
|
|
|
|
l = g_list_next (l);
|
|
|
|
}
|
|
|
|
|
|
|
|
l = bin->sink_pads;
|
|
|
|
while (l) {
|
|
|
|
pad = GST_JACK_PAD (l);
|
|
|
|
pad->data = jack_port_get_buffer (pad->port, nframes);
|
|
|
|
l = g_list_next (l);
|
|
|
|
}
|
|
|
|
|
|
|
|
bin->nframes = nframes;
|
|
|
|
|
|
|
|
JACK_DEBUG ("jackbin: iterating to process %ld frames of audio...", nframes);
|
|
|
|
if (!gst_bin_iterate (GST_BIN (bin))) {
|
|
|
|
g_warning ("bin failed to iterate");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* that's all folks */
|
|
|
|
|
|
|
|
return 0;
|
2002-04-16 17:14:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2002-05-13 18:08:33 +00:00
|
|
|
sample_rate (jack_nframes_t nframes, void *arg)
|
2002-04-16 17:14:05 +00:00
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
GstJackBin *bin = (GstJackBin *) arg;
|
|
|
|
|
|
|
|
JACK_DEBUG ("the sample rate is now %lu/sec\n", nframes);
|
|
|
|
bin->rate = nframes;
|
|
|
|
return 0;
|
2002-04-16 17:14:05 +00:00
|
|
|
}
|
|
|
|
|
2003-09-30 12:56:27 +00:00
|
|
|
static int
|
|
|
|
buffer_size (jack_nframes_t nframes, void *arg)
|
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
GstJackBin *bin = (GstJackBin *) arg;
|
|
|
|
|
|
|
|
JACK_DEBUG ("the buffer size is now %lu\n", nframes);
|
|
|
|
bin->nframes = nframes;
|
|
|
|
return 0;
|
2003-09-30 12:56:27 +00:00
|
|
|
}
|
|
|
|
|
2002-04-16 17:14:05 +00:00
|
|
|
static void
|
|
|
|
shutdown (void *arg)
|
|
|
|
{
|
|
|
|
/* GstJackClient *client = (GstJackClient*) arg; */
|
2004-03-14 22:34:33 +00:00
|
|
|
printf ("shutdown %p\n", arg);
|
2002-04-16 17:14:05 +00:00
|
|
|
/* gst_element_set_state (GST_ELEMENT (client->manager), GST_STATE_READY); */
|
|
|
|
}
|
|
|
|
|
2004-03-14 22:34:33 +00:00
|
|
|
static void
|
|
|
|
sighup_handler (int sig)
|
2003-03-04 15:34:20 +00:00
|
|
|
{
|
2004-03-14 22:34:33 +00:00
|
|
|
g_message ("got sighup, setting state to READY");
|
|
|
|
watchdog_please_set_the_jackbin_to_ready = TRUE;
|
2003-03-04 15:34:20 +00:00
|
|
|
}
|