1 /***************************************************************** 2 * gmerlin - a general purpose multimedia framework and applications 3 * 4 * Copyright (c) 2001 - 2011 Members of the Gmerlin project 5 * gmerlin-general@lists.sourceforge.net 6 * http://gmerlin.sourceforge.net 7 * 8 * This program is free software: you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation, either version 2 of the License, or 11 * (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program. If not, see <http://www.gnu.org/licenses/>. 20 * *****************************************************************/ 21 22 #include <jack/jack.h> 23 #include <jack/ringbuffer.h> 24 25 #include <config.h> 26 #include <gmerlin/translation.h> 27 28 #include <gmerlin/plugin.h> 29 30 #include <gmerlin/log.h> 31 32 33 typedef struct 34 { 35 gavl_channel_id_t channel_id; 36 const char * ext_name; 37 jack_ringbuffer_t * buffer; 38 jack_port_t * int_port; 39 int active; 40 int index; /* In format */ 41 } port_t; 42 43 typedef struct 44 { 45 jack_client_t *client; 46 47 gavl_audio_format_t format; 48 49 const char ** ext_ports; 50 51 /* Thread is running */ 52 int running; 53 pthread_mutex_t running_mutex; 54 55 /* Do stop */ 56 int active; 57 pthread_mutex_t active_mutex; 58 59 int num_ports; 60 port_t * ports; 61 62 int samples_per_frame; 63 int samplerate; 64 65 int connect_ports; 66 67 int64_t samples_read; /* For i_jack only */ 68 } jack_t; 69 70 const bg_parameter_info_t * bg_jack_get_parameters(void * p); 71 72 void 73 bg_jack_set_parameter(void * p, const char * name, 74 const bg_parameter_value_t * val); 75 76 77 void * bg_jack_create(); 78 79 int bg_jack_start(void * data); 80 81 void bg_jack_stop(void * data); 82 83 int bg_jack_open_client(jack_t * priv, int output, 84 int (*process)(jack_nframes_t, void *)); 85 86 int bg_jack_close_client(jack_t * priv); 87 88 void bg_jack_destroy(void * p); 89