Browse Source

Merge branch 'develop' of github.com:jackaudio/jack2 into develop

Signed-off-by: falkTX <falktx@falktx.com>

Conflicts:
	common/JackEngine.cpp
	common/JackEngine.h
tags/v1.9.13
falkTX 6 years ago
parent
commit
1557c4fddf
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
59 changed files with 534 additions and 466 deletions
  1. +3
    -0
      AUTHORS.rst
  2. +123
    -121
      common/JackAC3Encoder.cpp
  3. +23
    -23
      common/JackAC3Encoder.h
  4. +2
    -2
      common/JackAPI.cpp
  5. +4
    -4
      common/JackChannel.h
  6. +3
    -3
      common/JackClient.cpp
  7. +1
    -1
      common/JackClient.h
  8. +6
    -6
      common/JackClientControl.h
  9. +13
    -13
      common/JackCompilerDeps.h
  10. +8
    -7
      common/JackConstants.h
  11. +3
    -3
      common/JackControlAPI.cpp
  12. +1
    -1
      common/JackDebugClient.cpp
  13. +1
    -1
      common/JackDebugClient.h
  14. +3
    -2
      common/JackDriver.cpp
  15. +16
    -16
      common/JackDriverLoader.h
  16. +48
    -21
      common/JackEngine.cpp
  17. +4
    -3
      common/JackEngine.h
  18. +15
    -15
      common/JackException.cpp
  19. +15
    -15
      common/JackException.h
  20. +2
    -2
      common/JackExternalClient.cpp
  21. +1
    -1
      common/JackExternalClient.h
  22. +3
    -3
      common/JackGenericClientChannel.cpp
  23. +4
    -4
      common/JackGenericClientChannel.h
  24. +3
    -3
      common/JackInternalClient.cpp
  25. +3
    -3
      common/JackInternalClient.h
  26. +2
    -2
      common/JackInternalClientChannel.h
  27. +1
    -1
      common/JackLibClient.cpp
  28. +1
    -1
      common/JackLibClient.h
  29. +2
    -2
      common/JackLockedEngine.h
  30. +1
    -1
      common/JackNetOneDriver.cpp
  31. +15
    -15
      common/JackNetSocket.h
  32. +1
    -1
      common/JackNetTool.cpp
  33. +38
    -38
      common/JackRequest.h
  34. +3
    -3
      common/JackServer.cpp
  35. +3
    -3
      common/JackServer.h
  36. +15
    -15
      common/JackSystemDeps.h
  37. +1
    -7
      common/JackTools.cpp
  38. +3
    -3
      common/jack/metadata.h
  39. +4
    -4
      common/promiscuous.c
  40. +4
    -4
      common/promiscuous.h
  41. +6
    -4
      common/varargs.h
  42. +1
    -0
      common/wscript
  43. +5
    -7
      dbus/controller_iface_patchbay.c
  44. +3
    -1
      dbus/sigsegv.c
  45. +4
    -0
      example-clients/netsource.c
  46. +6
    -6
      example-clients/property.c
  47. +4
    -1
      linux/JackLinuxFutex.cpp
  48. +14
    -1
      linux/alsa/alsa_driver.c
  49. +7
    -7
      linux/alsarawmidi/JackALSARawMidiDriver.cpp
  50. +1
    -1
      linux/firewire/ffado_driver.h
  51. +15
    -15
      posix/JackCompilerDeps_os.h
  52. +15
    -15
      posix/JackNetUnixSocket.h
  53. +16
    -16
      posix/JackShmMem_os.h
  54. +1
    -1
      posix/JackSocketClientChannel.cpp
  55. +1
    -1
      posix/JackSocketClientChannel.h
  56. +15
    -15
      posix/JackSystemDeps_os.h
  57. +1
    -1
      windows/JackWinNamedPipeClientChannel.cpp
  58. +1
    -1
      windows/JackWinNamedPipeClientChannel.h
  59. +16
    -0
      wscript

+ 3
- 0
AUTHORS.rst View File

@@ -12,6 +12,7 @@ Andrew Kelley
Andrzej Szombierski
Andy Wingo
Anthony Van Groningen
Arnout Diels
Arnaud Rebillout
Arnold Krille
Bernhard M. Wiedemann
@@ -62,6 +63,7 @@ Marc-Olivier Barre
Mario Lang
Markus Seeber
Matt Flax
Matthias Geier
Maxim Grishin
Melanie Thielker
Michael Voigt
@@ -96,5 +98,6 @@ Tom Szilagyi
Torben Hohn
Valentin David
Valerio Pilo
Viktor Wilhelmsson
Yasuhiro Fujii
Youri Westerman

+ 123
- 121
common/JackAC3Encoder.cpp View File

@@ -29,93 +29,89 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

namespace Jack
{
#ifndef __ppc__

JackAC3Encoder::JackAC3Encoder(const JackAC3EncoderParams& params)
{
aften_set_defaults(&fAftenContext);
fAftenContext.channels = params.channels;
aften_set_defaults(&fAftenContext);
fAftenContext.channels = params.channels;
fAftenContext.samplerate = params.sample_rate;
fAftenContext.params.bitrate = params.bitrate;

int acmod = A52_ACMOD_MONO;
int lfe = params.lfe;
switch (params.channels) {
case 1: acmod = A52_ACMOD_MONO; break;
case 2: acmod = A52_ACMOD_STEREO; break;
case 3: acmod = A52_ACMOD_3_0; break;
case 4: acmod = A52_ACMOD_2_2; break;
case 5: acmod = A52_ACMOD_3_2; break;
break;
default:
break;
case 1: acmod = A52_ACMOD_MONO; break;
case 2: acmod = A52_ACMOD_STEREO; break;
case 3: acmod = A52_ACMOD_3_0; break;
case 4: acmod = A52_ACMOD_2_2; break;
case 5: acmod = A52_ACMOD_3_2; break;
default:
break;
}

if (lfe) {
fAftenContext.channels += 1;
}
fAftenContext.acmod = acmod;
fAftenContext.lfe = lfe;
fAftenContext.sample_format = A52_SAMPLE_FMT_FLT;
fAftenContext.verbose = 1;

fAftenContext.system.n_threads = 1;
// create interleaved framebuffer for MAX_AC3_CHANNELS
// create interleaved framebuffer for MAX_AC3_CHANNELS
fSampleBuffer = new float[MAX_AC3_CHANNELS * A52_SAMPLES_PER_FRAME];
// create AC3 buffer
// create AC3 buffer
fAC3Buffer = new unsigned char[A52_MAX_CODED_FRAME_SIZE];
memset(fAC3Buffer, 0, A52_MAX_CODED_FRAME_SIZE);
fZeroBuffer = new unsigned char[SPDIF_FRAME_SIZE];
fZeroBuffer = new unsigned char[SPDIF_FRAME_SIZE];
memset(fZeroBuffer, 0, SPDIF_FRAME_SIZE);
fRingBuffer = jack_ringbuffer_create(32768);
fRingBuffer = jack_ringbuffer_create(32768);
fOutSizeByte = 0;
fFramePos = 0;
fSampleRate = 0;
fByteRate = 0;
fOutSizeByte = 0;
fFramePos = 0;
fSampleRate = 0;
fByteRate = 0;
}

bool JackAC3Encoder::Init(jack_nframes_t sample_rate)
{
fSampleRate = sample_rate;
fSampleRate = sample_rate;
fByteRate = fSampleRate * sizeof(short) * 2;
return (aften_encode_init(&fAftenContext) == 0);
return (aften_encode_init(&fAftenContext) == 0);
}
JackAC3Encoder::~JackAC3Encoder()
{
aften_encode_close(&fAftenContext);
delete [] fSampleBuffer;
delete [] fAC3Buffer;
delete [] fZeroBuffer;
if (fRingBuffer) {
jack_ringbuffer_free(fRingBuffer);
}
aften_encode_close(&fAftenContext);
delete [] fSampleBuffer;
delete [] fAC3Buffer;
delete [] fZeroBuffer;
if (fRingBuffer) {
jack_ringbuffer_free(fRingBuffer);
}
}

void JackAC3Encoder::Process(float** inputs_buffer, float** outputs_buffer, int nframes)
{
// fill and process frame buffers as appropriate
// fill and process frame buffers as appropriate
jack_nframes_t frames_left = A52_SAMPLES_PER_FRAME - fFramePos;
jack_nframes_t offset = 0;

while (offset < nframes)
{
if ((nframes - offset) >= frames_left) {
// copy only frames_left more data
jack_nframes_t pos = fFramePos * fAftenContext.channels;
for (jack_nframes_t spos = offset; spos < offset + frames_left; ++spos) {
@@ -124,33 +120,39 @@ void JackAC3Encoder::Process(float** inputs_buffer, float** outputs_buffer, int
}
pos += fAftenContext.channels;
}
// use interleaved version
int res = aften_encode_frame(&fAftenContext, fAC3Buffer + SPDIF_HEADER_SIZE, fSampleBuffer);
if (res < 0) {
jack_error("aften_encode_frame error !!");
return;
}
fOutSizeByte = res;
#ifdef HAVE_AFTEN_NEW_API
// note additional parameter 'nframes'
// added in commit e1cbb66628de8aa496a75092d8d694234c67aa95 git://aften.git.sourceforge.net/gitroot/aften/aften
int res = aften_encode_frame(&fAftenContext, fAC3Buffer + SPDIF_HEADER_SIZE, fSampleBuffer, nframes);
#else
// released version 0.0.8 hasn't the 'count' parameter
int res = aften_encode_frame(&fAftenContext, fAC3Buffer + SPDIF_HEADER_SIZE, fSampleBuffer);
#endif

if (res < 0) {
jack_error("aften_encode_frame error !!");
return;
}

fOutSizeByte = res;

FillSpdifHeader(fAC3Buffer, fOutSizeByte + SPDIF_HEADER_SIZE);
// push AC3 output to SPDIF ring buffer
float calc_ac3byterate = (fOutSizeByte * fSampleRate / (float) A52_SAMPLES_PER_FRAME);
jack_nframes_t silencebytes = (jack_nframes_t) (fOutSizeByte * (fByteRate / calc_ac3byterate)) - fOutSizeByte - SPDIF_HEADER_SIZE;
jack_ringbuffer_write(fRingBuffer, (const char *)fAC3Buffer, fOutSizeByte + SPDIF_HEADER_SIZE);

// write the proper remainder of zero padding (inefficient, should be memsetting)
jack_ringbuffer_write(fRingBuffer, (const char *)fZeroBuffer, silencebytes);
jack_ringbuffer_write(fRingBuffer, (const char *)fAC3Buffer, fOutSizeByte + SPDIF_HEADER_SIZE);

// write the proper remainder of zero padding (inefficient, should be memsetting)
jack_ringbuffer_write(fRingBuffer, (const char *)fZeroBuffer, silencebytes);

offset += frames_left;
frames_left = A52_SAMPLES_PER_FRAME;
fFramePos = 0;
} else {
// copy incoming data into frame buffers without processing
jack_nframes_t pos = fFramePos * fAftenContext.channels;
for (jack_nframes_t spos = offset; spos < nframes; ++spos) {
@@ -172,7 +174,7 @@ void JackAC3Encoder::FillSpdifHeader(unsigned char* buf, int outsize)
{
// todo, use outsize and not assume the fixed frame size?
int ac3outsize = outsize - SPDIF_HEADER_SIZE;
buf[0] = 0x72; buf[1] = 0xf8; /* spdif syncword */
buf[2] = 0x1f; buf[3] = 0x4e; /* .............. */
buf[4] = 0x01; /* AC3 data */
@@ -189,24 +191,24 @@ int JackAC3Encoder::Output2Driver(float** outputs, jack_nframes_t nframes)
{
int wrotebytes = 0;
jack_nframes_t nframes_left = nframes;
if (jack_ringbuffer_read_space(fRingBuffer) == 0) {
// just write silence
memset(outputs[0], 0, nframes * sizeof(jack_default_audio_sample_t));
memset(outputs[1], 0, nframes * sizeof(jack_default_audio_sample_t));
} else {
jack_ringbuffer_data_t rb_data[2];
jack_ringbuffer_data_t rb_data[2];

jack_ringbuffer_get_read_vector(fRingBuffer, rb_data);
while (nframes_left > 0 && rb_data[0].len > 4) {
jack_nframes_t towrite_frames = (rb_data[0].len) / (sizeof(short) * 2);
towrite_frames = min(towrite_frames, nframes_left);
// write and deinterleave into the two channels
#if 1
sample_move_dS_s16(outputs[0] + (nframes - nframes_left), (char *) rb_data[0].buf, towrite_frames, sizeof(short) * 2);
@@ -217,7 +219,7 @@ int JackAC3Encoder::Output2Driver(float** outputs, jack_nframes_t nframes)
#endif
wrotebytes = towrite_frames * sizeof(short) * 2;
nframes_left -= towrite_frames;
jack_ringbuffer_read_advance(fRingBuffer, wrotebytes);
jack_ringbuffer_get_read_vector(fRingBuffer, rb_data);
}
@@ -254,64 +256,64 @@ void JackAC3Encoder::sample_move_dS_s16_24ph(jack_default_audio_sample_t* dst, c

void JackAC3Encoder::GetChannelName(const char* name, const char* alias, char* portname, int channel)
{
/*
/*
* 2 channels = L, R
* 3 channels = L, C, R
* 4 channels = L, R, LS, RS
* 5 ch = L, C, R, LS, RS
* 6 ch = L, C, R, LS, RS, LFE
*/
const char* AC3_name = "";
switch (channel) {
case 0:
AC3_name = "AC3_1_Left";
break;
case 1:
if (fAftenContext.channels == 2 || fAftenContext.channels == 4) {
AC3_name = "AC3_2_Right";
} else {
AC3_name = "AC3_2_Center";
}
break;
case 2:
if (fAftenContext.channels == 4) {
AC3_name = "AC3_3_LeftSurround";
} else {
AC3_name = "AC3_3_Right";
}
break;
case 3:
if (fAftenContext.channels == 4) {
AC3_name = "AC3_4_RightSurround";
} else {
AC3_name = "AC3_4_LeftSurround";
}
break;
case 4:
if (fAftenContext.channels > 4) {
AC3_name = "AC3_5_RightSurround";

const char* AC3_name = "";

switch (channel) {

case 0:
AC3_name = "AC3_1_Left";
break;

case 1:
if (fAftenContext.channels == 2 || fAftenContext.channels == 4) {
AC3_name = "AC3_2_Right";
} else {
AC3_name = "AC3_2_Center";
}
break;
default:
break;
}
// Last channel
if (fAftenContext.lfe && (channel == fAftenContext.channels - 1)) {
sprintf(portname, "%s:%s:AC3_%d_LFE", name, alias, fAftenContext.channels);
} else {
sprintf(portname, "%s:%s:%s", name, alias, AC3_name);
}
break;

case 2:
if (fAftenContext.channels == 4) {
AC3_name = "AC3_3_LeftSurround";
} else {
AC3_name = "AC3_3_Right";
}
break;

case 3:
if (fAftenContext.channels == 4) {
AC3_name = "AC3_4_RightSurround";
} else {
AC3_name = "AC3_4_LeftSurround";
}
break;

case 4:
if (fAftenContext.channels > 4) {
AC3_name = "AC3_5_RightSurround";
}
break;

default:
break;
}

// Last channel
if (fAftenContext.lfe && (channel == fAftenContext.channels - 1)) {
sprintf(portname, "%s:%s:AC3_%d_LFE", name, alias, fAftenContext.channels);
} else {
sprintf(portname, "%s:%s:%s", name, alias, AC3_name);
}
}
#endif

} // end of namespace
} // end of namespace

+ 23
- 23
common/JackAC3Encoder.h View File

@@ -53,43 +53,43 @@ class JackAC3Encoder

private:

AftenContext fAftenContext;
jack_ringbuffer_t* fRingBuffer;
AftenContext fAftenContext;
jack_ringbuffer_t* fRingBuffer;

float* fSampleBuffer;
unsigned char* fAC3Buffer;
unsigned char* fZeroBuffer;
float* fSampleBuffer;
unsigned char* fAC3Buffer;
unsigned char* fZeroBuffer;

int fOutSizeByte;
int fOutSizeByte;

jack_nframes_t fFramePos;
jack_nframes_t fSampleRate;
jack_nframes_t fByteRate;
jack_nframes_t fFramePos;
jack_nframes_t fSampleRate;
jack_nframes_t fByteRate;

void FillSpdifHeader(unsigned char* buf, int outsize);
int Output2Driver(float** outputs, jack_nframes_t nframes);
void FillSpdifHeader(unsigned char* buf, int outsize);
int Output2Driver(float** outputs, jack_nframes_t nframes);

void sample_move_dS_s16(jack_default_audio_sample_t* dst, char *src, jack_nframes_t nsamples, unsigned long src_skip);
void sample_move_dS_s16_24ph(jack_default_audio_sample_t* dst, char *src, jack_nframes_t nsamples, unsigned long src_skip);
void sample_move_dS_s16(jack_default_audio_sample_t* dst, char *src, jack_nframes_t nsamples, unsigned long src_skip);
void sample_move_dS_s16_24ph(jack_default_audio_sample_t* dst, char *src, jack_nframes_t nsamples, unsigned long src_skip);

public:

#ifdef __ppc__
JackAC3Encoder(const JackAC3EncoderParams& params) {}
virtual ~JackAC3Encoder() {}
JackAC3Encoder(const JackAC3EncoderParams& params) {}
virtual ~JackAC3Encoder() {}

bool Init(jack_nframes_t sample_rate) {return false;}
bool Init(jack_nframes_t sample_rate) {return false;}

void Process(float** inputs, float** outputs, int nframes) {}
void GetChannelName(const char* name, const char* alias, char* portname, int channel) {}
void Process(float** inputs, float** outputs, int nframes) {}
void GetChannelName(const char* name, const char* alias, char* portname, int channel) {}
#else
JackAC3Encoder(const JackAC3EncoderParams& params);
virtual ~JackAC3Encoder();
JackAC3Encoder(const JackAC3EncoderParams& params);
virtual ~JackAC3Encoder();

bool Init(jack_nframes_t sample_rate);
bool Init(jack_nframes_t sample_rate);

void Process(float** inputs, float** outputs, int nframes);
void GetChannelName(const char* name, const char* alias, char* portname, int channel);
void Process(float** inputs, float** outputs, int nframes);
void GetChannelName(const char* name, const char* alias, char* portname, int channel);
#endif
};



+ 2
- 2
common/JackAPI.cpp View File

@@ -1982,8 +1982,8 @@ LIB_EXPORT char *jack_client_get_uuid(jack_client_t* ext_client)
jack_error("jack_client_get_uuid called with a NULL client");
return NULL;
} else {
char retval[16];
snprintf(retval, sizeof(retval), "%d", client->GetClientControl()->fSessionID);
char retval[JACK_UUID_STRING_SIZE];
jack_uuid_unparse(client->GetClientControl()->fSessionID, retval);
return strdup(retval);
}
}


+ 4
- 4
common/JackChannel.h View File

@@ -99,7 +99,7 @@ class JackClientChannelInterface
{}

// Open the Server/Client connection
virtual int Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status)
virtual int Open(const char* server_name, const char* name, jack_uuid_t uuid, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status)
{
return 0;
}
@@ -123,9 +123,9 @@ class JackClientChannelInterface
return -1;
}

virtual void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result, int open)
virtual void ClientCheck(const char* name, jack_uuid_t uuid, char* name_res, int protocol, int options, int* status, int* result, int open)
{}
virtual void ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result)
virtual void ClientOpen(const char* name, int pid, jack_uuid_t uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result)
{}
virtual void ClientOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, int* result)
{}
@@ -169,7 +169,7 @@ class JackClientChannelInterface
{}
virtual void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result)
{}
virtual void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result)
virtual void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, jack_uuid_t uuid, int* result)
{}
virtual void InternalClientUnload(int refnum, int int_ref, int* status, int* result)
{}


+ 3
- 3
common/JackClient.cpp View File

@@ -304,12 +304,12 @@ int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync,
jack_log("JackClient::kSessionCallback");
if (fSession) {
jack_session_event_t* event = (jack_session_event_t*)malloc( sizeof(jack_session_event_t));
char uuid_buf[JACK_UUID_SIZE];
char uuid_buf[JACK_UUID_STRING_SIZE];
event->type = (jack_session_event_type_t)value1;
event->session_dir = strdup(message);
event->command_line = NULL;
event->flags = (jack_session_flags_t)0;
snprintf(uuid_buf, sizeof(uuid_buf), "%d", GetClientControl()->fSessionID);
jack_uuid_unparse(GetClientControl()->fSessionID, uuid_buf);
event->client_uuid = strdup(uuid_buf);
fSessionReply = kPendingSessionReply;
// Session callback may change fSessionReply by directly using jack_session_reply
@@ -1306,7 +1306,7 @@ int JackClient::SessionReply(jack_session_event_t* ev)

char* JackClient::GetUUIDForClientName(const char* client_name)
{
char uuid_res[JACK_UUID_SIZE];
char uuid_res[JACK_UUID_STRING_SIZE];
int result = -1;
fChannel->GetUUIDForClientName(GetClientControl()->fRefNum, client_name, uuid_res, &result);
return (result) ? NULL : strdup(uuid_res);


+ 1
- 1
common/JackClient.h View File

@@ -131,7 +131,7 @@ class SERVER_EXPORT JackClient : public JackClientInterface, public JackRunnable
JackClient(JackSynchro* table);
virtual ~JackClient();

virtual int Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status) = 0;
virtual int Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status) = 0;
virtual int Close();

virtual JackGraphManager* GetGraphManager() const = 0;


+ 6
- 6
common/JackClientControl.h View File

@@ -46,26 +46,26 @@ struct JackClientControl : public JackShmMemAble
int fPID;
bool fActive;

int fSessionID;
jack_uuid_t fSessionID;
char fSessionCommand[JACK_SESSION_COMMAND_SIZE];
jack_session_flags_t fSessionFlags;

JackClientControl(const char* name, int pid, int refnum, int uuid)
JackClientControl(const char* name, int pid, int refnum, jack_uuid_t uuid)
{
Init(name, pid, refnum, uuid);
}

JackClientControl(const char* name)
JackClientControl(const char* name, jack_uuid_t uuid)
{
Init(name, 0, -1, -1);
Init(name, 0, -1, uuid);
}

JackClientControl()
{
Init("", 0, -1, -1);
Init("", 0, -1, JACK_UUID_EMPTY_INITIALIZER);
}

void Init(const char* name, int pid, int refnum, int uuid)
void Init(const char* name, int pid, int refnum, jack_uuid_t uuid)
{
strcpy(fName, name);
for (int i = 0; i < kMaxNotification; i++) {


+ 13
- 13
common/JackCompilerDeps.h View File

@@ -1,19 +1,19 @@
/*
Copyright (C) 2004-2005 Grame
Copyright (C) 2004-2005 Grame

This program 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 program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.

This program 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 program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
This program 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

*/



+ 8
- 7
common/JackConstants.h View File

@@ -2,18 +2,18 @@
Copyright (C) 2004-2008 Grame

This program 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
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program 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
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

*/

@@ -36,6 +36,7 @@
#define JACK_MESSAGE_SIZE 256
#define JACK_UUID_SIZE 36 // to match jack1 and uuid.h
#define JACK_UUID_STRING_SIZE (JACK_UUID_SIZE+1) /* includes trailing null */
#define JACK_UUID_EMPTY_INITIALIZER 0
#define JACK_SESSION_COMMAND_SIZE 256

#define SYNC_MAX_NAME_SIZE 256


+ 3
- 3
common/JackControlAPI.cpp View File

@@ -219,6 +219,7 @@ jackctl_free_driver_parameters(
while (driver_ptr->parameters)
{
next_node_ptr = driver_ptr->parameters->next;
jack_constraint_free(((jackctl_parameter *)driver_ptr->parameters->data)->constraint_ptr);
free(driver_ptr->parameters->data);
free(driver_ptr->parameters);
driver_ptr->parameters = next_node_ptr;
@@ -526,6 +527,7 @@ jackctl_server_free_parameters(
while (server_ptr->parameters)
{
next_node_ptr = server_ptr->parameters->next;
jack_constraint_free(((jackctl_parameter *)server_ptr->parameters->data)->constraint_ptr);
free(server_ptr->parameters->data);
free(server_ptr->parameters);
server_ptr->parameters = next_node_ptr;
@@ -1070,7 +1072,7 @@ jackctl_server_open(

return true;

} catch (std::exception e) {
} catch (std::exception&) {
jack_error("jackctl_server_open error...");
jackctl_destroy_param_list(paramlist);
}
@@ -1433,5 +1435,3 @@ SERVER_EXPORT bool jackctl_server_switch_master(jackctl_server * server_ptr, jac
return false;
}
}



+ 1
- 1
common/JackDebugClient.cpp View File

@@ -79,7 +79,7 @@ JackDebugClient::~JackDebugClient()
delete fClient;
}

int JackDebugClient::Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status)
int JackDebugClient::Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status)
{
int res = fClient->Open(server_name, name, uuid, options, status);
char provstr[256];


+ 1
- 1
common/JackDebugClient.h View File

@@ -68,7 +68,7 @@ class JackDebugClient : public JackClient
JackDebugClient(JackClient* fTheClient);
virtual ~JackDebugClient();

virtual int Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status);
virtual int Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status);
int Close();

virtual JackGraphManager* GetGraphManager() const;


+ 3
- 2
common/JackDriver.cpp View File

@@ -40,8 +40,9 @@ namespace Jack
JackDriver::JackDriver(const char* name, const char* alias, JackLockedEngine* engine, JackSynchro* table)
:fCaptureChannels(0),
fPlaybackChannels(0),
fClientControl(name),
fWithMonitorPorts(false){
fClientControl(name, jack_client_uuid_generate()),
fWithMonitorPorts(false)
{
assert(strlen(name) < JACK_CLIENT_NAME_SIZE);
fSynchroTable = table;
strcpy(fAliasName, alias);


+ 16
- 16
common/JackDriverLoader.h View File

@@ -1,20 +1,20 @@
/*
Copyright (C) 2001-2005 Paul Davis
Copyright (C) 2004-2008 Grame
This program 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 program 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 program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Copyright (C) 2001-2005 Paul Davis
Copyright (C) 2004-2008 Grame
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

*/



+ 48
- 21
common/JackEngine.cpp View File

@@ -42,7 +42,8 @@ JackEngine::JackEngine(JackGraphManager* manager,
JackEngineControl* control,
char self_connect_mode)
: JackLockAble(control->fServerName),
fSignal(control->fServerName)
fSignal(control->fServerName),
fMetadata(NULL) // FIXME use control->fServerName?
{
fGraphManager = manager;
fSynchroTable = table;
@@ -475,7 +476,7 @@ int JackEngine::InternalClientUnload(int refnum, int* status)
// Client management
//-------------------

int JackEngine::ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status)
int JackEngine::ClientCheck(const char* name, jack_uuid_t uuid, char* name_res, int protocol, int options, int* status)
{
// Clear status
*status = 0;
@@ -563,15 +564,17 @@ bool JackEngine::ClientCheckName(const char* name)
return false;
}

void JackEngine::EnsureUUID(int uuid)
void JackEngine::EnsureUUID(jack_uuid_t uuid)
{
if (uuid == 0)
if (jack_uuid_empty(uuid))
return;

for (int i = 0; i < CLIENT_NUM; i++) {
JackClientInterface* client = fClientTable[i];
if (client && (client->GetClientControl()->fSessionID == uuid)) {
client->GetClientControl()->fSessionID = 0;
if (client && jack_uuid_compare(client->GetClientControl()->fSessionID, uuid) == 0) {
// FIXME? this code does nothing, but jack1 has it like this too..
jack_uuid_clear (&uuid);
// client->GetClientControl()->fSessionID = jack_client_uuid_generate();
}
}
}
@@ -601,11 +604,15 @@ int JackEngine::GetClientRefNum(const char* name)
}

// Used for external clients
int JackEngine::ClientExternalOpen(const char* name, int pid, int uuid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager)
int JackEngine::ClientExternalOpen(const char* name, int pid, jack_uuid_t uuid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager)
{
char real_name[JACK_CLIENT_NAME_SIZE + 1];

<<<<<<< HEAD
if (uuid < 0) {
=======
if (jack_uuid_empty(uuid)) {
>>>>>>> f7f2244b07ee0a723853e838de85e25471b8903f
uuid = jack_client_uuid_generate();
strncpy(real_name, name, JACK_CLIENT_NAME_SIZE);
} else {
@@ -737,6 +744,9 @@ int JackEngine::ClientCloseAux(int refnum, bool wait)
JackClientInterface* client = fClientTable[refnum];
fEngineControl->fTransport.ResetTimebase(refnum);

jack_uuid_t uuid = JACK_UUID_EMPTY_INITIALIZER;
jack_uuid_copy (&uuid, client->GetClientControl()->fSessionID);

// Unregister all ports ==> notifications are sent
jack_int_t ports[PORT_NUM_FOR_CLIENT];
int i;
@@ -767,6 +777,12 @@ int JackEngine::ClientCloseAux(int refnum, bool wait)
// Notify running clients
NotifyRemoveClient(client->GetClientControl()->fName, refnum);

fMetadata.RemoveProperties(NULL, uuid);
/* have to do the notification ourselves, since the client argument
to fMetadata->RemoveProperties() was NULL
*/
PropertyChangeNotify(uuid, NULL, PropertyDeleted);

// Cleanup...
fSynchroTable[refnum].Destroy();
fEngineControl->ResetRollingUsecs();
@@ -1075,7 +1091,11 @@ void JackEngine::SessionNotify(int refnum, const char *target, jack_session_even

for (int i = 0; i < CLIENT_NUM; i++) {
JackClientInterface* client = fClientTable[i];
<<<<<<< HEAD
if (client && (client->GetClientControl()->fSessionID < 0)) {
=======
if (client && jack_uuid_empty(client->GetClientControl()->fSessionID)) {
>>>>>>> f7f2244b07ee0a723853e838de85e25471b8903f
client->GetClientControl()->fSessionID = jack_client_uuid_generate();
}
}
@@ -1107,8 +1127,8 @@ void JackEngine::SessionNotify(int refnum, const char *target, jack_session_even
if (result == kPendingSessionReply) {
fSessionPendingReplies += 1;
} else if (result == kImmediateSessionReply) {
char uuid_buf[JACK_UUID_SIZE];
snprintf(uuid_buf, sizeof(uuid_buf), "%d", client->GetClientControl()->fSessionID);
char uuid_buf[JACK_UUID_STRING_SIZE];
jack_uuid_unparse(client->GetClientControl()->fSessionID, uuid_buf);
fSessionResult->fCommandList.push_back(JackSessionCommand(uuid_buf,
client->GetClientControl()->fName,
client->GetClientControl()->fSessionCommand,
@@ -1132,8 +1152,8 @@ int JackEngine::SessionReply(int refnum)
{
JackClientInterface* client = fClientTable[refnum];
assert(client);
char uuid_buf[JACK_UUID_SIZE];
snprintf(uuid_buf, sizeof(uuid_buf), "%d", client->GetClientControl()->fSessionID);
char uuid_buf[JACK_UUID_STRING_SIZE];
jack_uuid_unparse(client->GetClientControl()->fSessionID, uuid_buf);
fSessionResult->fCommandList.push_back(JackSessionCommand(uuid_buf,
client->GetClientControl()->fName,
client->GetClientControl()->fSessionCommand,
@@ -1157,7 +1177,7 @@ int JackEngine::GetUUIDForClientName(const char *client_name, char *uuid_res)
JackClientInterface* client = fClientTable[i];

if (client && (strcmp(client_name, client->GetClientControl()->fName) == 0)) {
snprintf(uuid_res, JACK_UUID_SIZE, "%d", client->GetClientControl()->fSessionID);
jack_uuid_unparse(client->GetClientControl()->fSessionID, uuid_res);
return 0;
}
}
@@ -1165,8 +1185,12 @@ int JackEngine::GetUUIDForClientName(const char *client_name, char *uuid_res)
return -1;
}

int JackEngine::GetClientNameForUUID(const char *uuid, char *name_res)
int JackEngine::GetClientNameForUUID(const char *uuid_buf, char *name_res)
{
jack_uuid_t uuid;
if (jack_uuid_parse(uuid_buf, &uuid) != 0)
return -1;

for (int i = 0; i < CLIENT_NUM; i++) {
JackClientInterface* client = fClientTable[i];

@@ -1174,10 +1198,7 @@ int JackEngine::GetClientNameForUUID(const char *uuid, char *name_res)
continue;
}

char uuid_buf[JACK_UUID_SIZE];
snprintf(uuid_buf, JACK_UUID_SIZE, "%d", client->GetClientControl()->fSessionID);

if (strcmp(uuid,uuid_buf) == 0) {
if (jack_uuid_compare(client->GetClientControl()->fSessionID, uuid) == 0) {
strncpy(name_res, client->GetClientControl()->fName, JACK_CLIENT_NAME_SIZE);
return 0;
}
@@ -1186,17 +1207,23 @@ int JackEngine::GetClientNameForUUID(const char *uuid, char *name_res)
return -1;
}

int JackEngine::ReserveClientName(const char *name, const char *uuid)
int JackEngine::ReserveClientName(const char *name, const char *uuidstr)
{
jack_log("JackEngine::ReserveClientName ( name = %s, uuid = %s )", name, uuid);
jack_log("JackEngine::ReserveClientName ( name = %s, uuid = %s )", name, uuidstr);

if (ClientCheckName(name)) {
jack_log("name already taken");
return -1;
}

EnsureUUID(atoi(uuid));
fReservationMap[atoi(uuid)] = name;
jack_uuid_t uuid;
if (jack_uuid_parse(uuidstr, &uuid) != 0) {
jack_error("JackEngine::ReserveClientName invalid uuid %s", uuidstr);
return -1;
}

EnsureUUID(uuid);
fReservationMap[uuid] = name;
return 0;
}



+ 4
- 3
common/JackEngine.h View File

@@ -55,6 +55,7 @@ class SERVER_EXPORT JackEngine : public JackLockAble
JackServerNotifyChannel fChannel; /*! To communicate between the RT thread and server */
JackProcessSync fSignal;
jack_time_t fLastSwitchUsecs;
JackMetadata fMetadata;

int fSessionPendingReplies;
detail::JackChannelTransactionInterface* fSessionTransaction;
@@ -86,7 +87,7 @@ class SERVER_EXPORT JackEngine : public JackLockAble
void NotifyPortRename(jack_port_id_t src, const char* old_name);
void NotifyActivate(int refnum);

void EnsureUUID(int uuid);
void EnsureUUID(jack_uuid_t uuid);

bool CheckClient(int refnum)
{
@@ -104,9 +105,9 @@ class SERVER_EXPORT JackEngine : public JackLockAble
int Close();

// Client management
int ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status);
int ClientCheck(const char* name, jack_uuid_t uuid, char* name_res, int protocol, int options, int* status);

int ClientExternalOpen(const char* name, int pid, int uuid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager);
int ClientExternalOpen(const char* name, int pid, jack_uuid_t uuid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager);
int ClientInternalOpen(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client, bool wait);

int ClientExternalClose(int refnum);


+ 15
- 15
common/JackException.cpp View File

@@ -1,19 +1,19 @@
/*
Copyright (C) 2008 Grame
This program 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 program 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 program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Copyright (C) 2008 Grame
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

*/



+ 15
- 15
common/JackException.h View File

@@ -1,19 +1,19 @@
/*
Copyright (C) 2008 Grame
This program 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 program 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 program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Copyright (C) 2008 Grame
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

*/



+ 2
- 2
common/JackExternalClient.cpp View File

@@ -41,7 +41,7 @@ int JackExternalClient::ClientNotify(int refnum, const char* name, int notify, i
return result;
}

int JackExternalClient::Open(const char* name, int pid, int refnum, int uuid, int* shared_client)
int JackExternalClient::Open(const char* name, int pid, int refnum, jack_uuid_t uuid, int* shared_client)
{
try {

@@ -64,7 +64,7 @@ int JackExternalClient::Open(const char* name, int pid, int refnum, int uuid, in
jack_log("JackExternalClient::Open name = %s index = %ld base = %x", name, shared_mem->GetShmIndex(), shared_mem->GetShmAddress());
return 0;

} catch (std::exception e) {
} catch (std::exception&) {
return -1;
}
}


+ 1
- 1
common/JackExternalClient.h View File

@@ -46,7 +46,7 @@ class JackExternalClient : public JackClientInterface
JackExternalClient();
virtual ~JackExternalClient();

int Open(const char* name, int pid, int refnum, int uuid, int* shared_client);
int Open(const char* name, int pid, int refnum, jack_uuid_t uuid, int* shared_client);
int Close();

int ClientNotify(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2);


+ 3
- 3
common/JackGenericClientChannel.cpp View File

@@ -97,7 +97,7 @@ void JackGenericClientChannel::ServerAsyncCall(JackRequest* req, JackResult* res
}
}

void JackGenericClientChannel::ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result, int open)
void JackGenericClientChannel::ClientCheck(const char* name, jack_uuid_t uuid, char* name_res, int protocol, int options, int* status, int* result, int open)
{
JackClientCheckRequest req(name, protocol, options, uuid, open);
JackClientCheckResult res;
@@ -106,7 +106,7 @@ void JackGenericClientChannel::ClientCheck(const char* name, int uuid, char* nam
strcpy(name_res, res.fName);
}

void JackGenericClientChannel::ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result)
void JackGenericClientChannel::ClientOpen(const char* name, int pid, jack_uuid_t uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result)
{
JackClientOpenRequest req(name, pid, uuid);
JackClientOpenResult res;
@@ -285,7 +285,7 @@ void JackGenericClientChannel::InternalClientHandle(int refnum, const char* clie
*status = res.fStatus;
}

void JackGenericClientChannel::InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result)
void JackGenericClientChannel::InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, jack_uuid_t uuid, int* result)
{
JackInternalClientLoadRequest req(refnum, client_name, so_name, objet_data, options, uuid);
JackInternalClientLoadResult res;


+ 4
- 4
common/JackGenericClientChannel.h View File

@@ -47,7 +47,7 @@ class JackGenericClientChannel : public detail::JackClientChannelInterface
JackGenericClientChannel();
virtual ~JackGenericClientChannel();

virtual int Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status) { return -1; }
virtual int Open(const char* server_name, const char* name, jack_uuid_t uuid, char* name_res, JackClient* obj, jack_options_t options, jack_status_t* status) { return -1; }
virtual void Close() {}

virtual int Start() { return -1; }
@@ -55,8 +55,8 @@ class JackGenericClientChannel : public detail::JackClientChannelInterface

int ServerCheck(const char* server_name);

void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result, int open);
void ClientOpen(const char* name, int pid, int uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result);
void ClientCheck(const char* name, jack_uuid_t uuid, char* name_res, int protocol, int options, int* status, int* result, int open);
void ClientOpen(const char* name, int pid, jack_uuid_t uuid, int* shared_engine, int* shared_client, int* shared_graph, int* result);
void ClientClose(int refnum, int* result);

void ClientActivate(int refnum, int is_real_time, int* result);
@@ -83,7 +83,7 @@ class JackGenericClientChannel : public detail::JackClientChannelInterface

void GetInternalClientName(int refnum, int int_ref, char* name_res, int* result);
void InternalClientHandle(int refnum, const char* client_name, int* status, int* int_ref, int* result);
void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result);
void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, jack_uuid_t uuid, int* result);
void InternalClientUnload(int refnum, int int_ref, int* status, int* result);

// Session API


+ 3
- 3
common/JackInternalClient.cpp View File

@@ -63,7 +63,7 @@ JackInternalClient::~JackInternalClient()
delete fChannel;
}

int JackInternalClient::Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status)
int JackInternalClient::Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status)
{
int result;
jack_log("JackInternalClient::Open name = %s", name);
@@ -215,7 +215,7 @@ JackLoadableInternalClient::~JackLoadableInternalClient()
}
}

int JackLoadableInternalClient1::Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status)
int JackLoadableInternalClient1::Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status)
{
int res = -1;

@@ -231,7 +231,7 @@ int JackLoadableInternalClient1::Open(const char* server_name, const char* name,
return res;
}

int JackLoadableInternalClient2::Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status)
int JackLoadableInternalClient2::Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status)
{
int res = -1;



+ 3
- 3
common/JackInternalClient.h View File

@@ -46,7 +46,7 @@ class JackInternalClient : public JackClient
JackInternalClient(JackServer* server, JackSynchro* table);
virtual ~JackInternalClient();

int Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status);
int Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status);
void ShutDown(jack_status_t code, const char* message);

JackGraphManager* GetGraphManager() const;
@@ -100,7 +100,7 @@ class JackLoadableInternalClient1 : public JackLoadableInternalClient
{}

int Init(const char* so_name);
int Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status);
int Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status);

};

@@ -119,7 +119,7 @@ class JackLoadableInternalClient2 : public JackLoadableInternalClient
{}

int Init(const char* so_name);
int Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status);
int Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status);

};



+ 2
- 2
common/JackInternalClientChannel.h View File

@@ -44,7 +44,7 @@ class JackInternalClientChannel : public detail::JackClientChannelInterface
virtual ~JackInternalClientChannel()
{}

void ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status, int* result, int open)
void ClientCheck(const char* name, jack_uuid_t uuid, char* name_res, int protocol, int options, int* status, int* result, int open)
{
*result = fEngine->ClientCheck(name, uuid, name_res, protocol, options, status);
}
@@ -128,7 +128,7 @@ class JackInternalClientChannel : public detail::JackClientChannelInterface
*result = fEngine->InternalClientHandle(client_name, status, int_ref);
}

void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, int uuid, int* result)
void InternalClientLoad(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int* status, int* int_ref, jack_uuid_t uuid, int* result)
{
*result = fServer->InternalClientLoad1(client_name, so_name, objet_data, options, int_ref, uuid, status);
}


+ 1
- 1
common/JackLibClient.cpp View File

@@ -91,7 +91,7 @@ JackLibClient::~JackLibClient()
delete fChannel;
}

int JackLibClient::Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status)
int JackLibClient::Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status)
{
int shared_engine, shared_client, shared_graph, result;
bool res;


+ 1
- 1
common/JackLibClient.h View File

@@ -44,7 +44,7 @@ class JackLibClient : public JackClient
JackLibClient(JackSynchro* table);
virtual ~JackLibClient();

int Open(const char* server_name, const char* name, int uuid, jack_options_t options, jack_status_t* status);
int Open(const char* server_name, const char* name, jack_uuid_t uuid, jack_options_t options, jack_status_t* status);
void ShutDown(jack_status_t code, const char* message);

int ClientNotifyImp(int refnum, const char* name, int notify, int sync, const char* message, int value1, int value2);


+ 2
- 2
common/JackLockedEngine.h View File

@@ -109,14 +109,14 @@ class SERVER_EXPORT JackLockedEngine
}

// Client management
int ClientCheck(const char* name, int uuid, char* name_res, int protocol, int options, int* status)
int ClientCheck(const char* name, jack_uuid_t uuid, char* name_res, int protocol, int options, int* status)
{
TRY_CALL
JackLock lock(&fEngine);
return fEngine.ClientCheck(name, uuid, name_res, protocol, options, status);
CATCH_EXCEPTION_RETURN
}
int ClientExternalOpen(const char* name, int pid, int uuid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager)
int ClientExternalOpen(const char* name, int pid, jack_uuid_t uuid, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager)
{
TRY_CALL
JackLock lock(&fEngine);


+ 1
- 1
common/JackNetOneDriver.cpp View File

@@ -287,7 +287,7 @@ int JackNetOneDriver::Read()
}

if ((netj.num_lost_packets * netj.period_size / netj.sample_rate) > 2)
JackTools::ThrowJackNetException();
throw JackNetException();

//netjack_read(&netj, netj.period_size);
JackDriver::CycleTakeBeginTime();


+ 15
- 15
common/JackNetSocket.h View File

@@ -1,19 +1,19 @@
/*
Copyright (C) 2008-2011 Romain Moret at Grame
This program 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 program 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 program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Copyright (C) 2008-2011 Romain Moret at Grame
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

*/



+ 1
- 1
common/JackNetTool.cpp View File

@@ -884,7 +884,7 @@ namespace Jack
for (int port_index = 0; port_index < fNPorts; port_index++) {
if (fPortBuffer[port_index]) {
int res = opus_custom_decode_float(fOpusDecoder[port_index], fCompressedBuffer[port_index], fCompressedSizesByte[port_index], fPortBuffer[port_index], ((nframes == -1) ? fPeriodSize : nframes));
if (res < 0 || res != ((nframes == -1) ? fPeriodSize : nframes)) {
if (res < 0 || res != ((nframes == -1) ? (int)fPeriodSize : nframes)) {
jack_error("opus_custom_decode_float error fCompressedSizeByte = %d res = %d", fCompressedSizesByte[port_index], res);
}
}


+ 38
- 38
common/JackRequest.h View File

@@ -161,15 +161,15 @@ struct JackClientCheckRequest : public JackRequest
char fName[JACK_CLIENT_NAME_SIZE+1];
int fProtocol;
int fOptions;
int fUUID;
int fOpen;
jack_uuid_t fUUID;

JackClientCheckRequest() : fProtocol(0), fOptions(0), fUUID(0), fOpen(0)
JackClientCheckRequest() : fProtocol(0), fOptions(0), fOpen(0), fUUID(JACK_UUID_EMPTY_INITIALIZER)
{
memset(fName, 0, sizeof(fName));
}
JackClientCheckRequest(const char* name, int protocol, int options, int uuid, int open = false)
: JackRequest(JackRequest::kClientCheck), fProtocol(protocol), fOptions(options), fUUID(uuid), fOpen(open)
JackClientCheckRequest(const char* name, int protocol, int options, jack_uuid_t uuid, int open = false)
: JackRequest(JackRequest::kClientCheck), fProtocol(protocol), fOptions(options), fOpen(open), fUUID(uuid)
{
memset(fName, 0, sizeof(fName));
snprintf(fName, sizeof(fName), "%s", name);
@@ -181,7 +181,7 @@ struct JackClientCheckRequest : public JackRequest
CheckRes(trans->Read(&fName, sizeof(fName)));
CheckRes(trans->Read(&fProtocol, sizeof(int)));
CheckRes(trans->Read(&fOptions, sizeof(int)));
CheckRes(trans->Read(&fUUID, sizeof(int)));
CheckRes(trans->Read(&fUUID, sizeof(jack_uuid_t)));
return trans->Read(&fOpen, sizeof(int));
}

@@ -191,11 +191,11 @@ struct JackClientCheckRequest : public JackRequest
CheckRes(trans->Write(&fName, sizeof(fName)));
CheckRes(trans->Write(&fProtocol, sizeof(int)));
CheckRes(trans->Write(&fOptions, sizeof(int)));
CheckRes(trans->Write(&fUUID, sizeof(int)));
CheckRes(trans->Write(&fUUID, sizeof(jack_uuid_t)));
return trans->Write(&fOpen, sizeof(int));
}

int Size() { return sizeof(fName) + 4 * sizeof(int); }
int Size() { return sizeof(fName) + 3 * sizeof(int) + sizeof(jack_uuid_t); }

};

@@ -246,14 +246,14 @@ struct JackClientOpenRequest : public JackRequest
{

int fPID;
int fUUID;
jack_uuid_t fUUID;
char fName[JACK_CLIENT_NAME_SIZE+1];

JackClientOpenRequest() : fPID(0), fUUID(0)
JackClientOpenRequest() : fPID(0), fUUID(JACK_UUID_EMPTY_INITIALIZER)
{
memset(fName, 0, sizeof(fName));
}
JackClientOpenRequest(const char* name, int pid, int uuid): JackRequest(JackRequest::kClientOpen)
JackClientOpenRequest(const char* name, int pid, jack_uuid_t uuid): JackRequest(JackRequest::kClientOpen)
{
memset(fName, 0, sizeof(fName));
snprintf(fName, sizeof(fName), "%s", name);
@@ -265,7 +265,7 @@ struct JackClientOpenRequest : public JackRequest
{
CheckSize();
CheckRes(trans->Read(&fPID, sizeof(int)));
CheckRes(trans->Read(&fUUID, sizeof(int)));
CheckRes(trans->Read(&fUUID, sizeof(jack_uuid_t)));
return trans->Read(&fName, sizeof(fName));
}

@@ -273,11 +273,11 @@ struct JackClientOpenRequest : public JackRequest
{
CheckRes(JackRequest::Write(trans, Size()));
CheckRes(trans->Write(&fPID, sizeof(int)));
CheckRes(trans->Write(&fUUID, sizeof(int)));
CheckRes(trans->Write(&fUUID, sizeof(jack_uuid_t)));
return trans->Write(&fName, sizeof(fName));
}

int Size() { return 2 * sizeof(int) + sizeof(fName); }
int Size() { return sizeof(int) + sizeof(jack_uuid_t) + sizeof(fName); }

};

@@ -1048,23 +1048,23 @@ struct JackInternalClientLoadRequest : public JackRequest
char fDllName[MAX_PATH+1];
char fLoadInitName[JACK_LOAD_INIT_LIMIT+1];
int fOptions;
int fUUID;
jack_uuid_t fUUID;

JackInternalClientLoadRequest() : fRefNum(0), fOptions(0), fUUID(0)
JackInternalClientLoadRequest() : fRefNum(0), fOptions(0), fUUID(JACK_UUID_EMPTY_INITIALIZER)
{
memset(fName, 0, sizeof(fName));
memset(fDllName, 0, sizeof(fDllName));
memset(fLoadInitName, 0, sizeof(fLoadInitName));
}
JackInternalClientLoadRequest(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, int uuid )
JackInternalClientLoadRequest(int refnum, const char* client_name, const char* so_name, const char* objet_data, int options, jack_uuid_t uuid )
: JackRequest(JackRequest::kInternalClientLoad), fRefNum(refnum), fOptions(options), fUUID(uuid)
{
memset(fName, 0, sizeof(fName));
memset(fDllName, 0, sizeof(fDllName));
memset(fLoadInitName, 0, sizeof(fLoadInitName));
snprintf(fName, sizeof(fName), "%s", client_name);
snprintf(fDllName, sizeof(fDllName), "%s", so_name);
snprintf(fLoadInitName, sizeof(fLoadInitName), "%s", objet_data);
strncpy(fName, client_name, sizeof(fName)-1);
strncpy(fDllName, so_name, sizeof(fDllName)-1);
strncpy(fLoadInitName, objet_data, sizeof(fLoadInitName)-1);
}

int Read(detail::JackChannelTransactionInterface* trans)
@@ -1074,7 +1074,7 @@ struct JackInternalClientLoadRequest : public JackRequest
CheckRes(trans->Read(&fName, sizeof(fName)));
CheckRes(trans->Read(&fDllName, sizeof(fDllName)));
CheckRes(trans->Read(&fLoadInitName, sizeof(fLoadInitName)));
CheckRes(trans->Read(&fUUID, sizeof(int)));
CheckRes(trans->Read(&fUUID, sizeof(jack_uuid_t)));
return trans->Read(&fOptions, sizeof(int));
}

@@ -1085,11 +1085,11 @@ struct JackInternalClientLoadRequest : public JackRequest
CheckRes(trans->Write(&fName, sizeof(fName)));
CheckRes(trans->Write(&fDllName, sizeof(fDllName)));
CheckRes(trans->Write(&fLoadInitName, sizeof(fLoadInitName)));
CheckRes(trans->Write(&fUUID, sizeof(int)));
CheckRes(trans->Write(&fUUID, sizeof(jack_uuid_t)));
return trans->Write(&fOptions, sizeof(int));
}

int Size() { return sizeof(int) + sizeof(fName) + sizeof(fDllName) + sizeof(fLoadInitName) + 2 * sizeof(int); }
int Size() { return sizeof(int) + sizeof(fName) + sizeof(fDllName) + sizeof(fLoadInitName) + sizeof(int) + sizeof(jack_uuid_t); }
};

/*!
@@ -1233,9 +1233,9 @@ struct JackClientNotificationRequest : public JackRequest

struct JackSessionCommand
{
char fUUID[JACK_UUID_SIZE];
char fUUID[JACK_UUID_STRING_SIZE];
char fClientName[JACK_CLIENT_NAME_SIZE+1];
char fCommand[JACK_SESSION_COMMAND_SIZE];
char fCommand[JACK_SESSION_COMMAND_SIZE+1];
jack_session_flags_t fFlags;

JackSessionCommand() : fFlags(JackSessionSaveError)
@@ -1303,8 +1303,8 @@ struct JackSessionNotifyResult : public JackResult
return 0;
}

char terminator[JACK_UUID_SIZE];
terminator[0] = '\0';
char terminator[JACK_UUID_STRING_SIZE];
memset(terminator, 0, sizeof(terminator));

CheckRes(JackResult::Write(trans));
for (std::list<JackSessionCommand>::iterator i = fCommandList.begin(); i != fCommandList.end(); i++) {
@@ -1363,11 +1363,9 @@ struct JackSessionNotifyRequest : public JackRequest
{
memset(fPath, 0, sizeof(fPath));
memset(fDst, 0, sizeof(fDst));
snprintf(fPath, sizeof(fPath), "%s", path);
fPath[JACK_MESSAGE_SIZE] = 0;
strncpy(fPath, path, sizeof(fPath)-1);
if (dst) {
snprintf(fDst, sizeof(fDst), "%s", dst);
fDst[JACK_CLIENT_NAME_SIZE] = 0;
strncpy(fDst, dst, sizeof(fDst)-1);
}
}

@@ -1435,7 +1433,7 @@ struct JackClientNameResult : public JackResult
: JackResult(result)
{
memset(fName, 0, sizeof(fName));
snprintf(fName, sizeof(fName), "%s", name);
strncpy(fName, name, sizeof(fName)-1);
}

int Read(detail::JackChannelTransactionInterface* trans)
@@ -1456,7 +1454,7 @@ struct JackClientNameResult : public JackResult

struct JackUUIDResult : public JackResult
{
char fUUID[JACK_UUID_SIZE];
char fUUID[JACK_UUID_STRING_SIZE];

JackUUIDResult(): JackResult()
{
@@ -1466,7 +1464,7 @@ struct JackUUIDResult : public JackResult
: JackResult(result)
{
memset(fUUID, 0, sizeof(fUUID));
snprintf(fUUID, sizeof(fUUID), "%s", uuid);
strncpy(fUUID, uuid, sizeof(fUUID)-1);
}

int Read(detail::JackChannelTransactionInterface* trans)
@@ -1521,7 +1519,7 @@ struct JackGetUUIDRequest : public JackRequest

struct JackGetClientNameRequest : public JackRequest
{
char fUUID[JACK_UUID_SIZE];
char fUUID[JACK_UUID_STRING_SIZE];

JackGetClientNameRequest()
{
@@ -1557,7 +1555,7 @@ struct JackReserveNameRequest : public JackRequest
{
int fRefNum;
char fName[JACK_CLIENT_NAME_SIZE+1];
char fUUID[JACK_UUID_SIZE];
char fUUID[JACK_UUID_STRING_SIZE];

JackReserveNameRequest() : fRefNum(0)
{
@@ -1634,7 +1632,7 @@ struct JackClientHasSessionCallbackRequest : public JackRequest
struct JackPropertyChangeNotifyRequest : public JackRequest
{
jack_uuid_t fSubject;
char fKey[JACK_UUID_STRING_SIZE];
char fKey[MAX_PATH+1];
jack_property_change_t fChange;

JackPropertyChangeNotifyRequest() : fChange((jack_property_change_t)0)
@@ -1697,8 +1695,10 @@ struct JackClientNotification
{
memset(fName, 0, sizeof(fName));
memset(fMessage, 0, sizeof(fMessage));
snprintf(fName, sizeof(fName), "%s", name);
snprintf(fMessage, sizeof(fMessage), "%s", message);
strncpy(fName, name, sizeof(fName)-1);
if (message) {
strncpy(fMessage, message, sizeof(fMessage)-1);
}
fSize = Size();
}



+ 3
- 3
common/JackServer.cpp View File

@@ -194,21 +194,21 @@ bool JackServer::IsRunning()
// Internal clients
//------------------

int JackServer::InternalClientLoad1(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, int uuid, int* status)
int JackServer::InternalClientLoad1(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, jack_uuid_t uuid, int* status)
{
JackLoadableInternalClient* client = new JackLoadableInternalClient1(JackServerGlobals::fInstance, GetSynchroTable(), objet_data);
assert(client);
return InternalClientLoadAux(client, so_name, client_name, options, int_ref, uuid, status);
}

int JackServer::InternalClientLoad2(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, int uuid, int* status)
int JackServer::InternalClientLoad2(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, jack_uuid_t uuid, int* status)
{
JackLoadableInternalClient* client = new JackLoadableInternalClient2(JackServerGlobals::fInstance, GetSynchroTable(), parameters);
assert(client);
return InternalClientLoadAux(client, so_name, client_name, options, int_ref, uuid, status);
}

int JackServer::InternalClientLoadAux(JackLoadableInternalClient* client, const char* so_name, const char* client_name, int options, int* int_ref, int uuid, int* status)
int JackServer::InternalClientLoadAux(JackLoadableInternalClient* client, const char* so_name, const char* client_name, int options, int* int_ref, jack_uuid_t uuid, int* status)
{
// Clear status
*status = 0;


+ 3
- 3
common/JackServer.h View File

@@ -60,7 +60,7 @@ class SERVER_EXPORT JackServer
JackSynchro fSynchroTable[CLIENT_NUM];
bool fFreewheel;

int InternalClientLoadAux(JackLoadableInternalClient* client, const char* so_name, const char* client_name, int options, int* int_ref, int uuid, int* status);
int InternalClientLoadAux(JackLoadableInternalClient* client, const char* so_name, const char* client_name, int options, int* int_ref, jack_uuid_t uuid, int* status);

public:

@@ -84,8 +84,8 @@ class SERVER_EXPORT JackServer
int SetFreewheel(bool onoff);

// Internals clients
int InternalClientLoad1(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, int uuid, int* status);
int InternalClientLoad2(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, int uuid, int* status);
int InternalClientLoad1(const char* client_name, const char* so_name, const char* objet_data, int options, int* int_ref, jack_uuid_t uuid, int* status);
int InternalClientLoad2(const char* client_name, const char* so_name, const JSList * parameters, int options, int* int_ref, jack_uuid_t uuid, int* status);

// Internal session file
int LoadInternalSessionFile(const char* file);


+ 15
- 15
common/JackSystemDeps.h View File

@@ -1,20 +1,20 @@
/*
Copyright (C) 2004-2006 Grame

This program 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 program 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 program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Copyright (C) 2004-2006 Grame

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

#ifndef __JackSystemDeps__


+ 1
- 7
common/JackTools.cpp View File

@@ -18,7 +18,7 @@
*/

#include "JackConstants.h"
#include "JackDriverLoader.h"
#include "driver_interface.h"
#include "JackTools.h"
#include "JackError.h"
#include <stdlib.h>
@@ -44,11 +44,6 @@ namespace Jack {
#endif
}

void JackTools::ThrowJackNetException()
{
throw JackNetException();
}

int JackTools::MkDir(const char* path)
{
#ifdef WIN32
@@ -299,4 +294,3 @@ void BuildClientPath(char* path_to_so, int path_len, const char* so_name)


} // end of namespace


+ 3
- 3
common/jack/metadata.h View File

@@ -129,7 +129,7 @@ jack_free_description (jack_description_t* desc, int free_description_itself);
* @param subject The subject to get all properties of.
* @param desc Set to the description of subject if found, or NULL otherwise.
* The caller must free this value with jack_free_description().
* @return 0 on success, -1 if no @p subject with any properties exists.
* @return the number of properties, -1 if no @p subject with any properties exists.
*/
int
jack_get_properties (jack_uuid_t subject,
@@ -137,10 +137,10 @@ jack_get_properties (jack_uuid_t subject,

/**
* Get descriptions for all subjects with metadata.
* @param descs Set to a NULL-terminated array of descriptions.
* @param descs Set to an array of descriptions.
* The caller must free each of these with jack_free_description(),
* and the array itself with jack_free().
* @return 0 on success.
* @return the number of descriptions, or -1 on error.
*/
int
jack_get_all_properties (jack_description_t** descs);


+ 4
- 4
common/promiscuous.c View File

@@ -2,18 +2,18 @@
Copyright (C) 2014-2017 Cédric Schieli

This program 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
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation; either version 2.1
of the License, or (at your option) any later version.

This program 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.
GNU Lesser General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

*/



+ 4
- 4
common/promiscuous.h View File

@@ -2,18 +2,18 @@
Copyright (C) 2014-2017 Cédric Schieli

This program 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
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation; either version 2.1
of the License, or (at your option) any later version.

This program 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.
GNU Lesser General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

*/



+ 6
- 4
common/varargs.h View File

@@ -35,7 +35,7 @@ extern "C"
char *server_name; /* server name */
char *load_name; /* load module name */
char *load_init; /* initialization string */
int session_id; /* requested session_id */
jack_uuid_t session_id; /* requested session_id */
}
jack_varargs_t;

@@ -51,7 +51,6 @@ extern "C"
{
memset (va, 0, sizeof(jack_varargs_t));
va->server_name = (char*)jack_default_server_name();
va->session_id = -1;
}

static inline void jack_varargs_parse (jack_options_t options, va_list ap, jack_varargs_t *va)
@@ -70,8 +69,11 @@ extern "C"
va->load_init = va_arg(ap, char *);
if ((options & JackSessionID)) {
char *sid = va_arg(ap, char *);
if (sid)
va->session_id = atoi( sid );
if (sid) {
const long long id = atoll( sid );
if (id > 0)
va->session_id = id;
}
}
}



+ 1
- 0
common/wscript View File

@@ -250,6 +250,7 @@ def build(bld):
'JackMidiSendQueue.cpp',
'JackMidiUtil.cpp',
'JackMidiWriteQueue.cpp',
'JackMetadata.cpp',
]

if bld.env['IS_LINUX']:


+ 5
- 7
dbus/controller_iface_patchbay.c View File

@@ -1647,7 +1647,7 @@ jack_controller_port_connect_callback(
}
}

int jack_controller_port_rename_callback(jack_port_id_t port, const char * old_name, const char * new_name, void * context)
void jack_controller_port_rename_callback(jack_port_id_t port, const char * old_name, const char * new_name, void * context)
{
struct jack_graph_port * port_ptr;
const char * port_new_short_name;
@@ -1660,7 +1660,7 @@ int jack_controller_port_rename_callback(jack_port_id_t port, const char * old_n
if (port_new_short_name == NULL)
{
jack_error("renamed port new name '%s' does not contain ':' separator char", new_name);
return -1;
return;
}

port_new_short_name++; /* skip ':' separator char */
@@ -1669,7 +1669,7 @@ int jack_controller_port_rename_callback(jack_port_id_t port, const char * old_n
if (port_old_short_name == NULL)
{
jack_error("renamed port old name '%s' does not contain ':' separator char", old_name);
return -1;
return;
}

port_old_short_name++; /* skip ':' separator char */
@@ -1678,14 +1678,14 @@ int jack_controller_port_rename_callback(jack_port_id_t port, const char * old_n
if (port_ptr == NULL)
{
jack_error("renamed port '%s' not found", old_name);
return -1;
return;
}

name_buffer = strdup(port_new_short_name);
if (name_buffer == NULL)
{
jack_error("strdup() call for port name '%s' failed.", port_new_short_name);
return 1;
return;
}

free(port_ptr->name);
@@ -1702,8 +1702,6 @@ int jack_controller_port_rename_callback(jack_port_id_t port, const char * old_n
port_ptr->name);
jack_controller_patchbay_send_signal_graph_changed(patchbay_ptr->graph.version);
pthread_mutex_unlock(&patchbay_ptr->lock);

return 0;
}

#undef controller_ptr


+ 3
- 1
dbus/sigsegv.c View File

@@ -61,10 +61,12 @@ static void signal_segv(int signum, siginfo_t* info, void*ptr)
static void signal_segv(int signum, siginfo_t* info, void*ptr) {
static const char *si_codes[3] = {"", "SEGV_MAPERR", "SEGV_ACCERR"};

size_t i;
const char *si_code_str;
ucontext_t *ucontext = (ucontext_t*)ptr;

#if defined(HAVE_UCONTEXT) && defined(HAVE_NGREG)
size_t i;
#endif
#if defined(SIGSEGV_STACK_X86) || defined(SIGSEGV_STACK_IA64)
int f = 0;
Dl_info dlinfo;


+ 4
- 0
example-clients/netsource.c View File

@@ -62,6 +62,10 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#include <celt/celt.h>
#endif

#ifndef CUSTOM_MODES
#define CUSTOM_MODES // for opus_custom_decoder_init
#endif

#if HAVE_OPUS
#include <opus/opus.h>
#include <opus/opus_custom.h>


+ 6
- 6
example-clients/property.c View File

@@ -11,8 +11,8 @@

static int subject_is_client = 0;
static int subject_is_port = 0;
static jack_uuid_t uuid;
static char* subject;
static jack_uuid_t uuid = JACK_UUID_EMPTY_INITIALIZER;
static char* subject = NULL;

static void
show_usage (void)
@@ -46,7 +46,7 @@ get_subject (jack_client_t* client, char* argv[], int* optind)
}

if (jack_uuid_parse (ustr, &uuid)) {
fprintf (stderr, "cannot parse client UUID as UUID\n");
fprintf (stderr, "cannot parse client UUID as UUID '%s' '%s'\n", cstr, ustr);
return -1;
}

@@ -289,13 +289,13 @@ int main (int argc, char* argv[])
/* list all properties */

jack_description_t* description;
size_t cnt;
int cnt;
size_t p;
size_t n;
int n;
char buf[JACK_UUID_STRING_SIZE];

if ((cnt = jack_get_all_properties (&description)) < 0) {
fprintf (stderr, "could not retrieve properties for %s\n", subject);
fprintf (stderr, "could not retrieve all properties\n");
exit (1);
}



+ 4
- 1
linux/JackLinuxFutex.cpp View File

@@ -138,7 +138,10 @@ bool JackLinuxFutex::Allocate(const char* name, const char* server_name, int val
return false;
}

ftruncate(fSharedMem, sizeof(FutexData));
if (ftruncate(fSharedMem, sizeof(FutexData)) != 0) {
jack_error("Allocate: can't set shared memory size in named futex name = %s err = %s", fName, strerror(errno));
return false;
}

if (fPromiscuous && (jack_promiscuous_perms(fSharedMem, fName, fPromiscuousGid) < 0)) {
close(fSharedMem);


+ 14
- 1
linux/alsa/alsa_driver.c View File

@@ -1213,7 +1213,8 @@ alsa_driver_xrun_recovery (alsa_driver_t *driver, float *delayed_usecs)
< 0) {
jack_error("error preparing after suspend: %s", snd_strerror(res));
}
} else {
}
if (driver->playback_handle) {
if ((res = snd_pcm_prepare(driver->playback_handle))
< 0) {
jack_error("error preparing after suspend: %s", snd_strerror(res));
@@ -1230,6 +1231,18 @@ alsa_driver_xrun_recovery (alsa_driver_t *driver, float *delayed_usecs)
timersub(&now, &tstamp, &diff);
*delayed_usecs = diff.tv_sec * 1000000.0 + diff.tv_usec;
jack_log("**** alsa_pcm: xrun of at least %.3f msecs",*delayed_usecs / 1000.0);
if (driver->capture_handle) {
jack_log("Repreparing capture");
if ((res = snd_pcm_prepare(driver->capture_handle)) < 0) {
jack_error("error preparing after xrun: %s", snd_strerror(res));
}
}
if (driver->playback_handle) {
jack_log("Repreparing playback");
if ((res = snd_pcm_prepare(driver->playback_handle)) < 0) {
jack_error("error preparing after xrun: %s", snd_strerror(res));
}
}
}

if (alsa_driver_restart (driver)) {


+ 7
- 7
linux/alsarawmidi/JackALSARawMidiDriver.cpp View File

@@ -408,7 +408,7 @@ JackALSARawMidiDriver::Open(bool capturing, bool playing, int in_channels,
if (potential_inputs) {
try {
input_ports = new JackALSARawMidiInputPort *[potential_inputs];
} catch (std::exception e) {
} catch (std::exception& e) {
jack_error("JackALSARawMidiDriver::Open - while creating input "
"port array: %s", e.what());
FreeDeviceInfo(&in_info_list, &out_info_list);
@@ -418,7 +418,7 @@ JackALSARawMidiDriver::Open(bool capturing, bool playing, int in_channels,
if (potential_outputs) {
try {
output_ports = new JackALSARawMidiOutputPort *[potential_outputs];
} catch (std::exception e) {
} catch (std::exception& e) {
jack_error("JackALSARawMidiDriver::Open - while creating output "
"port array: %s", e.what());
FreeDeviceInfo(&in_info_list, &out_info_list);
@@ -430,7 +430,7 @@ JackALSARawMidiDriver::Open(bool capturing, bool playing, int in_channels,
try {
input_ports[num_inputs] = new JackALSARawMidiInputPort(info, i);
num_inputs++;
} catch (std::exception e) {
} catch (std::exception& e) {
jack_error("JackALSARawMidiDriver::Open - while creating new "
"JackALSARawMidiInputPort: %s", e.what());
}
@@ -441,7 +441,7 @@ JackALSARawMidiDriver::Open(bool capturing, bool playing, int in_channels,
try {
output_ports[num_outputs] = new JackALSARawMidiOutputPort(info, i);
num_outputs++;
} catch (std::exception e) {
} catch (std::exception& e) {
jack_error("JackALSARawMidiDriver::Open - while creating new "
"JackALSARawMidiOutputPort: %s", e.what());
}
@@ -504,7 +504,7 @@ JackALSARawMidiDriver::Start()
}
try {
poll_fds = new pollfd[poll_fd_count];
} catch (std::exception e) {
} catch (std::exception& e) {
jack_error("JackALSARawMidiDriver::Start - creating poll descriptor "
"structures failed: %s", e.what());
return -1;
@@ -512,7 +512,7 @@ JackALSARawMidiDriver::Start()
if (fPlaybackChannels) {
try {
output_port_timeouts = new jack_nframes_t[fPlaybackChannels];
} catch (std::exception e) {
} catch (std::exception& e) {
jack_error("JackALSARawMidiDriver::Start - creating array for "
"output port timeout values failed: %s", e.what());
goto free_poll_descriptors;
@@ -521,7 +521,7 @@ JackALSARawMidiDriver::Start()
struct pollfd *poll_fd_iter;
try {
CreateNonBlockingPipe(fds);
} catch (std::exception e) {
} catch (std::exception& e) {
jack_error("JackALSARawMidiDriver::Start - while creating wake pipe: "
"%s", e.what());
goto free_output_port_timeouts;


+ 1
- 1
linux/firewire/ffado_driver.h View File

@@ -86,7 +86,7 @@
#define debugError(format, args...) jack_error( "firewire ERR: %s:%d (%s): " format, __FILE__, __LINE__, __FUNCTION__, ##args )
#define debugPrint(Level, format, args...) if(DEBUG_LEVEL & (Level)) jack_error("DEBUG %s:%d (%s) :" format, __FILE__, __LINE__, __FUNCTION__, ##args );
#define debugPrintShort(Level, format, args...) if(DEBUG_LEVEL & (Level)) jack_error( format,##args );
#define debugPrintWithTimeStamp(Level, format, args...) if(DEBUG_LEVEL & (Level)) jack_error( "%16lu: "format, debugGetCurrentUTime(),##args );
#define debugPrintWithTimeStamp(Level, format, args...) if(DEBUG_LEVEL & (Level)) jack_error( "%16lu: " format, debugGetCurrentUTime(), ##args );
#define SEGFAULT int *test=NULL; *test=1;
#else
#define DEBUG_LEVEL


+ 15
- 15
posix/JackCompilerDeps_os.h View File

@@ -1,19 +1,19 @@
/*
Copyright (C) 2004-2005 Grame
This program 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 program 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 program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Copyright (C) 2004-2005 Grame
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

*/



+ 15
- 15
posix/JackNetUnixSocket.h View File

@@ -1,19 +1,19 @@
/*
Copyright (C) 2008-2011 Romain Moret at Grame
This program 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 program 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 program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Copyright (C) 2008-2011 Romain Moret at Grame
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

*/



+ 16
- 16
posix/JackShmMem_os.h View File

@@ -1,20 +1,20 @@
/*
Copyright (C) 2001 Paul Davis
Copyright (C) 2004-2008 Grame
This program 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 program 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 program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Copyright (C) 2001 Paul Davis
Copyright (C) 2004-2008 Grame
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

*/



+ 1
- 1
posix/JackSocketClientChannel.cpp View File

@@ -39,7 +39,7 @@ JackSocketClientChannel::~JackSocketClientChannel()
delete fNotificationSocket;
}

int JackSocketClientChannel::Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* client, jack_options_t options, jack_status_t* status)
int JackSocketClientChannel::Open(const char* server_name, const char* name, jack_uuid_t uuid, char* name_res, JackClient* client, jack_options_t options, jack_status_t* status)
{
int result = 0;
jack_log("JackSocketClientChannel::Open name = %s", name);


+ 1
- 1
posix/JackSocketClientChannel.h View File

@@ -49,7 +49,7 @@ class JackSocketClientChannel : public JackGenericClientChannel, public JackRunn
JackSocketClientChannel();
virtual ~JackSocketClientChannel();

int Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* client, jack_options_t options, jack_status_t* status);
int Open(const char* server_name, const char* name, jack_uuid_t uuid, char* name_res, JackClient* client, jack_options_t options, jack_status_t* status);
void Close();

int Start();


+ 15
- 15
posix/JackSystemDeps_os.h View File

@@ -1,19 +1,19 @@
/*
Copyright (C) 2004-2006 Grame
This program 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 program 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 program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Copyright (C) 2004-2006 Grame
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

*/



+ 1
- 1
windows/JackWinNamedPipeClientChannel.cpp View File

@@ -38,7 +38,7 @@ JackWinNamedPipeClientChannel::~JackWinNamedPipeClientChannel()
delete fRequest;
}

int JackWinNamedPipeClientChannel::Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* client, jack_options_t options, jack_status_t* status)
int JackWinNamedPipeClientChannel::Open(const char* server_name, const char* name, jack_uuid_t uuid, char* name_res, JackClient* client, jack_options_t options, jack_status_t* status)
{
int result = 0;
jack_log("JackWinNamedPipeClientChannel::Open name = %s", name);


+ 1
- 1
windows/JackWinNamedPipeClientChannel.h View File

@@ -49,7 +49,7 @@ class JackWinNamedPipeClientChannel : public JackGenericClientChannel, public Ja
JackWinNamedPipeClientChannel();
virtual ~JackWinNamedPipeClientChannel();

int Open(const char* server_name, const char* name, int uuid, char* name_res, JackClient* client, jack_options_t options, jack_status_t* status);
int Open(const char* server_name, const char* name, jack_uuid_t uuid, char* name_res, JackClient* client, jack_options_t options, jack_status_t* status);
void Close();

int Start();


+ 16
- 0
wscript View File

@@ -216,6 +216,22 @@ def configure(conf):

if conf.env['IS_MACOSX']:
conf.check(lib='aften', uselib='AFTEN', define_name='AFTEN')
conf.check_cxx(
fragment=''
+ '#include <aften/aften.h>\n'
+ 'int\n'
+ 'main(void)\n'
+ '{\n'
+ 'AftenContext fAftenContext;\n'
+ 'aften_set_defaults(&fAftenContext);\n'
+ 'unsigned char *fb;\n'
+ 'float *buf=new float[10];\n'
+ 'int res = aften_encode_frame(&fAftenContext, fb, buf, 1);\n'
+ '}\n',
lib='aften',
msg='Checking for aften_encode_frame()',
define_name='HAVE_AFTEN_NEW_API',
mandatory=False)

conf.load('autooptions')



Loading…
Cancel
Save