Browse Source

Move ComputationMicroSec at a more appropriate location.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4392 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.9.8
sletz 14 years ago
parent
commit
f388deb25b
4 changed files with 14 additions and 13 deletions
  1. +1
    -1
      common/JackThreadedDriver.cpp
  2. +12
    -0
      common/JackThreadedDriver.h
  3. +1
    -1
      common/JackWaitThreadedDriver.cpp
  4. +0
    -11
      macosx/JackMachThread.h

+ 1
- 1
common/JackThreadedDriver.cpp View File

@@ -232,7 +232,7 @@ bool JackThreadedDriver::Init()
jack_log("JackThreadedDriver::Init IsRealTime");
// Will do "something" on OSX only...
GetEngineControl()->fPeriod = GetEngineControl()->fConstraint = GetEngineControl()->fPeriodUsecs * 1000;
GetEngineControl()->fComputation = JackMachThread::ComputationMicroSec(GetEngineControl()->fBufferSize) * 1000;
GetEngineControl()->fComputation = ComputationMicroSec(GetEngineControl()->fBufferSize) * 1000;
fThread.SetParams(GetEngineControl()->fPeriod, GetEngineControl()->fComputation, GetEngineControl()->fConstraint);
if (fThread.AcquireSelfRealTime(GetEngineControl()->fServerPriority) < 0) {
jack_error("AcquireSelfRealTime error");


+ 12
- 0
common/JackThreadedDriver.h View File

@@ -110,6 +110,18 @@ class SERVER_EXPORT JackThreadedDriver : public JackDriverClientInterface, publi
virtual bool Execute();
virtual bool Init();

// For OSX only
int ComputationMicroSec(int buffer_size)
{
if (buffer_size < 128) {
return 500;
} else if (buffer_size < 256) {
return 300;
} else {
return 100;
}
}

};

} // end of namespace


+ 1
- 1
common/JackWaitThreadedDriver.cpp View File

@@ -47,7 +47,7 @@ bool JackWaitThreadedDriver::Execute()
jack_log("JackWaitThreadedDriver::Init IsRealTime");
// Will do "something" on OSX only...
GetEngineControl()->fPeriod = GetEngineControl()->fConstraint = GetEngineControl()->fPeriodUsecs * 1000;
GetEngineControl()->fComputation = JackMachThread::ComputationMicroSec(GetEngineControl()->fBufferSize) * 1000;
GetEngineControl()->fComputation = ComputationMicroSec(GetEngineControl()->fBufferSize) * 1000;
fThread.SetParams(GetEngineControl()->fPeriod, GetEngineControl()->fComputation, GetEngineControl()->fConstraint);
if (fThread.AcquireSelfRealTime(GetEngineControl()->fServerPriority) < 0) {
jack_error("AcquireSelfRealTime error");


+ 0
- 11
macosx/JackMachThread.h View File

@@ -134,17 +134,6 @@ class SERVER_EXPORT JackMachThread : public JackPosixThread
}
static int DropRealTimeImp(jack_native_thread_t thread);

static int ComputationMicroSec(int buffer_size)
{
if (buffer_size < 128) {
return 500;
} else if (buffer_size < 256) {
return 300;
} else {
return 100;
}
}

};

} // end of namespace


Loading…
Cancel
Save