Commit 0bf1580f authored by sletz's avatar sletz
Browse files

Correct JackInfoShutdownCallback prototype, two new JackClientProcessFailure...

Correct JackInfoShutdownCallback prototype, two new JackClientProcessFailure and JackClientZombie JackStatus code.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@3732 0c269be4-1314-0410-8aa9-9f06e86f4224
parent a3478c6e
......@@ -25,12 +25,14 @@ Paul Davis
Jackdmp changes log
---------------------------
2009-11-10 Stephane Letz <letz@grame.fr>
* Correct JackInfoShutdownCallback prototype, two new JackClientProcessFailure and JackClientZombie JackStatus code.
2009-11-09 Stephane Letz <letz@grame.fr>
* Correct JackGraphManager::GetBuffer for the "client loop with one connection" case : buffer must be copied.
2009-11-07 Stephane Letz <letz@grame.fr>
* Fix AcquireRealTime and DropRealTime: now distinguish when called from another thread (AcquireRealTime/DropRealTime) and from the thread itself (AcquireSelfRealTime/DropSelfRealTime).
......
......@@ -268,7 +268,7 @@ int JackClient::ClientNotify(int refnum, const char* name, int notify, int sync,
case kShutDownCallback:
jack_log("JackClient::kShutDownCallback");
if (fInfoShutdown) {
fInfoShutdown(value1, message, fInfoShutdownArg);
fInfoShutdown((jack_status_t)value1, message, fInfoShutdownArg);
fInfoShutdown = NULL;
}
break;
......
......@@ -300,8 +300,8 @@ void jack_on_shutdown (jack_client_t *client,
/**
* @param client pointer to JACK client structure.
* @param function The jack_shutdown function pointer.
* @param arg The arguments for the jack_shutdown function.
* @param function The jack_info_shutdown function pointer.
* @param arg The arguments for the jack_info_shutdown function.
*
* Register a function (and argument) to be called if and when the
* JACK server shuts down the client thread. The function must
......
......@@ -226,21 +226,6 @@ typedef void (*JackFreewheelCallback)(int starting, void *arg);
*/
typedef void (*JackShutdownCallback)(void *arg);
/**
* Prototype for the client supplied function that is called
* whenever jackd is shutdown. Note that after server shutdown,
* the client pointer is *not* deallocated by libjack,
* the application is responsible to properly use jack_client_close()
* to release client ressources. Warning: jack_client_close() cannot be
* safely used inside the shutdown callback and has to be called outside of
* the callback context.
* @param code a shuntdown code
* @param reason a string discribing the shuntdown reason (backend failure, server crash... etc...)
* @param arg pointer to a client supplied structure
*/
typedef void (*JackInfoShutdownCallback)(int code, const char* reason, void *arg);
/**
* Used for the type argument of jack_port_register() for default
* audio ports and midi ports.
......@@ -437,9 +422,14 @@ enum JackStatus {
JackVersionError = 0x400,
/**
* Backend failure
* Client process failure
*/
JackBackendError = 0x800
JackClientProcessFailure = 0x800,
/**
* Client zombified failure
*/
JackClientZombie = 0x1000
};
/**
......@@ -664,4 +654,19 @@ typedef struct {
} jack_transport_info_t;
/**
* Prototype for the client supplied function that is called
* whenever jackd is shutdown. Note that after server shutdown,
* the client pointer is *not* deallocated by libjack,
* the application is responsible to properly use jack_client_close()
* to release client ressources. Warning: jack_client_close() cannot be
* safely used inside the shutdown callback and has to be called outside of
* the callback context.
* @param code a status word, formed by OR-ing together the relevant @ref JackStatus bits.
* @param reason a string describing the shutdown reason (backend failure, server crash... etc...)
* @param arg pointer to a client supplied structure
*/
typedef void (*JackInfoShutdownCallback)(jack_status_t code, const char* reason, void *arg);
#endif /* __jack_types_h__ */
......@@ -289,7 +289,7 @@ OSStatus JackCoreAudioDriver::DeviceNotificationCallback(AudioDeviceID inDevice,
case kAudioDevicePropertyStreamConfiguration: {
jack_error("Cannot handle kAudioDevicePropertyStreamConfiguration : server will quit...");
driver->NotifyFailure(JackBackendError, "Another application has changed the device configuration."); // Message length limited to JACK_MESSAGE_SIZE
driver->NotifyFailure(JackClientProcessFailure, "Another application has changed the device configuration."); // Message length limited to JACK_MESSAGE_SIZE
driver->CloseAUHAL();
kill(JackTools::GetPID(), SIGINT);
return kAudioHardwareUnsupportedOperationError;
......@@ -297,7 +297,7 @@ OSStatus JackCoreAudioDriver::DeviceNotificationCallback(AudioDeviceID inDevice,
case kAudioDevicePropertyNominalSampleRate: {
jack_error("Cannot handle kAudioDevicePropertyNominalSampleRate : server will quit...");
driver->NotifyFailure(JackBackendError, "Another application has changed the sample rate."); // Message length limited to JACK_MESSAGE_SIZE
driver->NotifyFailure(JackClientProcessFailure, "Another application has changed the sample rate."); // Message length limited to JACK_MESSAGE_SIZE
driver->CloseAUHAL();
kill(JackTools::GetPID(), SIGINT);
return kAudioHardwareUnsupportedOperationError;
......
......@@ -220,7 +220,7 @@ void jack_shutdown(void *arg)
exit(1);
}
void jack_info_shutdown(int code, const char* reason, void *arg)
void jack_info_shutdown(jack_status_t code, const char* reason, void *arg)
{
printf("JACK server failure : %s\n", reason);
exit(1);
......
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