Commit dda1354a authored by sletz's avatar sletz
Browse files

Fix for CELT and netjack1 in progress.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4227 0c269be4-1314-0410-8aa9-9f06e86f4224
parent 8efcb5d1
......@@ -157,11 +157,14 @@ namespace Jack
if( netj.bitdepth == CELT_MODE ) {
#if HAVE_CELT
#if HAVE_CELT_API_0_7 || HAVE_CELT_API_0_8
#if HAVE_CELT_API_0_11
celt_int32 lookahead;
CELTMode *celt_mode = celt_mode_create( netj.sample_rate, netj.period_size, NULL );
//netj.capture_srcs = jack_slist_append(netj.capture_srcs, celt_decoder_create( celt_mode, 1, NULL ) );
netj.capture_srcs = jack_slist_append(netj.capture_srcs, celt_decoder_create_custom( celt_mode, 1, NULL ) );
#elif HAVE_CELT_API_0_7 || HAVE_CELT_API_0_8
celt_int32 lookahead;
CELTMode *celt_mode = celt_mode_create( netj.sample_rate, netj.period_size, NULL );
netj.capture_srcs = jack_slist_append(netj.capture_srcs, celt_decoder_create( celt_mode, 1, NULL ) );
#else
celt_int32_t lookahead;
CELTMode *celt_mode = celt_mode_create( netj.sample_rate, 1, netj.period_size, NULL );
......@@ -205,10 +208,12 @@ namespace Jack
netj.playback_ports = jack_slist_append (netj.playback_ports, (void *)(intptr_t)port_id);
if( netj.bitdepth == CELT_MODE ) {
#if HAVE_CELT
#if HAVE_CELT_API_0_7 || HAVE_CELT_API_0_8
#if HAVE_CELT_API_0_11
CELTMode *celt_mode = celt_mode_create( netj.sample_rate, netj.period_size, NULL );
//netj.playback_srcs = jack_slist_append(netj.playback_srcs, celt_encoder_create( celt_mode, 1, NULL ) );
netj.playback_srcs = jack_slist_append(netj.playback_srcs, celt_encoder_create_custom( celt_mode, 1, NULL ) );
#elif HAVE_CELT_API_0_7 || HAVE_CELT_API_0_8
CELTMode *celt_mode = celt_mode_create( netj.sample_rate, netj.period_size, NULL );
netj.playback_srcs = jack_slist_append(netj.playback_srcs, celt_encoder_create( celt_mode, 1, NULL ) );
#else
CELTMode *celt_mode = celt_mode_create( netj.sample_rate, 1, netj.period_size, NULL );
netj.playback_srcs = jack_slist_append(netj.playback_srcs, celt_encoder_create( celt_mode ) );
......
......@@ -365,7 +365,7 @@ void netjack_attach( netjack_driver_state_t *netj )
if( netj->bitdepth == CELT_MODE )
{
#if HAVE_CELT
#if HAVE_CELT_API_0_7 || HAVE_CELT_API_0_8
#if HAVE_CELT_API_0_7 || HAVE_CELT_API_0_8 || HAVE_CELT_API_0_11
celt_int32 lookahead;
netj->celt_mode = celt_mode_create( netj->sample_rate, netj->period_size, NULL );
#else
......@@ -398,7 +398,9 @@ void netjack_attach( netjack_driver_state_t *netj )
if( netj->bitdepth == CELT_MODE ) {
#if HAVE_CELT
#if HAVE_CELT_API_0_7 || HAVE_CELT_API_0_8
#if HAVE_CELT_API_0_11
netj->capture_srcs = jack_slist_append(netj->capture_srcs, celt_decoder_create_custom( netj->celt_mode, 1, NULL ) );
#elif HAVE_CELT_API_0_7 || HAVE_CELT_API_0_8
netj->capture_srcs = jack_slist_append(netj->capture_srcs, celt_decoder_create( netj->celt_mode, 1, NULL ) );
#else
netj->capture_srcs = jack_slist_append(netj->capture_srcs, celt_decoder_create( netj->celt_mode ) );
......@@ -444,7 +446,10 @@ void netjack_attach( netjack_driver_state_t *netj )
jack_slist_append (netj->playback_ports, port);
if( netj->bitdepth == CELT_MODE ) {
#if HAVE_CELT
#if HAVE_CELT_API_0_7 || HAVE_CELT_API_0_8
#if HAVE_CELT_API_0_11
CELTMode *celt_mode = celt_mode_create( netj->sample_rate, netj->period_size, NULL );
netj->playback_srcs = jack_slist_append(netj->playback_srcs, celt_decoder_create_custom( celt_mode, 1, NULL ) );
#elif HAVE_CELT_API_0_7 || HAVE_CELT_API_0_8
CELTMode *celt_mode = celt_mode_create( netj->sample_rate, netj->period_size, NULL );
netj->playback_srcs = jack_slist_append(netj->playback_srcs, celt_encoder_create( celt_mode, 1, NULL ) );
#else
......
......@@ -1368,21 +1368,20 @@ render_payload_to_jack_ports_celt (void *packet_payload, jack_nframes_t net_peri
if (jack_port_is_audio (porttype))
{
// audio port, decode celt data.
CELTDecoder *decoder = src_node->data;
#if HAVE_CELT_API_0_8
if( !packet_payload )
celt_decode_float( decoder, NULL, net_period_down, buf, nframes );
else
celt_decode_float( decoder, packet_bufX, net_period_down, buf, nframes );
#else
if( !packet_payload )
celt_decode_float( decoder, NULL, net_period_down, buf );
else
celt_decode_float( decoder, packet_bufX, net_period_down, buf );
#endif
CELTDecoder *decoder = src_node->data;
#if HAVE_CELT_API_0_8
if( !packet_payload )
celt_decode_float( decoder, NULL, net_period_down, buf, nframes );
else
celt_decode_float( decoder, packet_bufX, net_period_down, buf, nframes );
#else
if( !packet_payload )
celt_decode_float( decoder, NULL, net_period_down, buf );
else
celt_decode_float( decoder, packet_bufX, net_period_down, buf );
#endif
src_node = jack_slist_next (src_node);
src_node = jack_slist_next (src_node);
}
else if (jack_port_is_midi (porttype))
{
......@@ -1390,8 +1389,8 @@ render_payload_to_jack_ports_celt (void *packet_payload, jack_nframes_t net_peri
// convert the data buffer to a standard format (uint32_t based)
unsigned int buffer_size_uint32 = net_period_down / 2;
uint32_t * buffer_uint32 = (uint32_t*) packet_bufX;
if( packet_payload )
decode_midi_buffer (buffer_uint32, buffer_size_uint32, buf);
if( packet_payload )
decode_midi_buffer (buffer_uint32, buffer_size_uint32, buf);
}
packet_bufX = (packet_bufX + net_period_down);
node = jack_slist_next (node);
......
......@@ -129,23 +129,33 @@ def configure(conf):
conf.fatal('jackdbus was explicitly requested but cannot be built')
conf.sub_config('example-clients')
if conf.check_cfg(package='celt', atleast_version='0.8.0', args='--cflags --libs'):
if conf.check_cfg(package='celt', atleast_version='0.11.0', args='--cflags --libs'):
conf.define('HAVE_CELT', 1)
conf.define('HAVE_CELT_API_0_11', 1)
conf.define('HAVE_CELT_API_0_8', 0)
conf.define('HAVE_CELT_API_0_7', 0)
conf.define('HAVE_CELT_API_0_5', 0)
elif conf.check_cfg(package='celt', atleast_version='0.8.0', args='--cflags --libs'):
conf.define('HAVE_CELT', 1)
conf.define('HAVE_CELT_API_0_11', 0)
conf.define('HAVE_CELT_API_0_8', 1)
conf.define('HAVE_CELT_API_0_7', 0)
conf.define('HAVE_CELT_API_0_5', 0)
elif conf.check_cfg(package='celt', atleast_version='0.7.0', args='--cflags --libs'):
conf.define('HAVE_CELT', 1)
conf.define('HAVE_CELT_API_0_11', 0)
conf.define('HAVE_CELT_API_0_8', 0)
conf.define('HAVE_CELT_API_0_7', 1)
conf.define('HAVE_CELT_API_0_5', 0)
elif conf.check_cfg(package='celt', atleast_version='0.5.0', args='--cflags --libs', required=True):
conf.define('HAVE_CELT', 1)
conf.define('HAVE_CELT_API_0_11', 0)
conf.define('HAVE_CELT_API_0_8', 0)
conf.define('HAVE_CELT_API_0_7', 0)
conf.define('HAVE_CELT_API_0_5', 1)
else:
conf.define('HAVE_CELT', 0)
conf.define('HAVE_CELT_API_0_11', 0)
conf.define('HAVE_CELT_API_0_8', 0)
conf.define('HAVE_CELT_API_0_7', 0)
conf.define('HAVE_CELT_API_0_5', 0)
......
Supports Markdown
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