Browse Source

Move client refnum management in JackEngine.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1318 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/0.61
sletz 19 years ago
parent
commit
3ed43196fe
6 changed files with 10 additions and 76 deletions
  1. +5
    -1
      ChangeLog
  2. +1
    -30
      common/JackConnectionManager.cpp
  3. +2
    -5
      common/JackConnectionManager.h
  4. +2
    -16
      common/JackEngine.cpp
  5. +0
    -20
      common/JackGraphManager.cpp
  6. +0
    -4
      common/JackGraphManager.h

+ 5
- 1
ChangeLog View File

@@ -2,9 +2,13 @@
Jackdmp changes log
---------------------------

2006-12-15 Stephane Letz <letz@grame.fr>
* Move client refnum management in JackEngine.

2006-12-12 Stephane Letz <letz@grame.fr>
* Fix memory leak in ringbuffer.c.
* Tom Szilagyi memory leak fix in ringbuffer.c.
2006-11-29 Stephane Letz <letz@grame.fr>


+ 1
- 30
common/JackConnectionManager.cpp View File

@@ -227,36 +227,8 @@ const jack_int_t* JackConnectionManager::GetOutputPorts(int refnum)
}

/*!
\brief Return the first available refnum.
\brief Init the refnum.
*/
/*
int JackConnectionManager::AllocateRefNum()
{
for (int i = 0; i < CLIENT_NUM; i++) {
if (fInputPort[i].IsAvailable()) {
JackLog("JackConnectionManager::AllocateRefNum ref = %ld\n", i);
return i;
}
}

return -1;
}
*/
/*!
\brief Release the refnum.
*/
/*
void JackConnectionManager::ReleaseRefNum(int refnum)
{
JackLog("JackConnectionManager::ReleaseRefNum ref = %ld\n", refnum);
InitClient(refnum);
}
*/

/*!
\brief Release the refnum.
*/

void JackConnectionManager::InitRefNum(int refnum)
{
fInputPort[refnum].Init();
@@ -265,7 +237,6 @@ void JackConnectionManager::InitRefNum(int refnum)
fInputCounter[refnum].SetValue(0);
}


/*!
\brief Reset all clients activation.
*/


+ 2
- 5
common/JackConnectionManager.h View File

@@ -442,11 +442,8 @@ class JackConnectionManager
const jack_int_t* GetOutputPorts(int refnum);

// Client management
//int AllocateRefNum();
//void ReleaseRefNum(int refnum);
void InitRefNum(int refnum);

int GetInputRefNum(jack_port_id_t port_index) const;
void InitRefNum(int refnum);
int GetInputRefNum(jack_port_id_t port_index) const;
int GetOutputRefNum(jack_port_id_t port_index) const;

// Connect/Disconnect 2 refnum "directly"


+ 2
- 16
common/JackEngine.cpp View File

@@ -358,7 +358,6 @@ int JackEngine::ClientNew(const char* name, int* ref, int* shared_engine, int* s
int JackEngine::ClientExternalNew(const char* name, int* ref, int* shared_engine, int* shared_client, int* shared_graph_manager, JackExternalClient* client)
{
JackLog("JackEngine::ClientNew: name = %s \n", name);
//int refnum = fGraphManager->AllocateRefNum();
int refnum = Allocate();

if (refnum < 0) {
@@ -395,12 +394,6 @@ int JackEngine::ClientExternalNew(const char* name, int* ref, int* shared_engine
*ref = refnum;
return 0;

/*
error1:
fGraphManager->ReleaseRefNum(refnum);
return -1;
*/

error:
ClientCloseAux(refnum, client, false);
client->Close();
@@ -411,7 +404,6 @@ error:
int JackEngine::ClientInternalNew(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client)
{
JackLog("JackEngine::ClientInternalNew: name = %s\n", name);
//int refnum = fGraphManager->AllocateRefNum();
int refnum = Allocate();

if (refnum < 0) {
@@ -421,12 +413,12 @@ int JackEngine::ClientInternalNew(const char* name, int* ref, JackEngineControl*

if (!fSynchroTable[refnum]->Allocate(name, 0)) {
jack_error("Cannot allocate synchro");
goto error;
return -1;
}

if (NotifyAddClient(client, name, refnum) < 0) {
jack_error("Cannot notify add client");
goto error;
return -1;
}

fClientTable[refnum] = client;
@@ -436,10 +428,6 @@ int JackEngine::ClientInternalNew(const char* name, int* ref, JackEngineControl*
*shared_manager = fGraphManager;
*ref = refnum;
return 0;

error:
// fGraphManager->ReleaseRefNum(refnum);
return -1;
}

// Used for externall clients
@@ -493,8 +481,6 @@ int JackEngine::ClientCloseAux(int refnum, JackClientInterface* client, bool wai

// Cleanup...
fSynchroTable[refnum]->Destroy();
//fGraphManager->ReleaseRefNum(refnum);
fEngineTiming->ResetRollingUsecs();
return 0;
}


+ 0
- 20
common/JackGraphManager.cpp View File

@@ -67,26 +67,6 @@ int JackGraphManager::GetConnectionsNum(jack_port_id_t port_index)
}

// Server
/*
int JackGraphManager::AllocateRefNum()
{
JackConnectionManager* manager = WriteNextStateStart();
int res = manager->AllocateRefNum();
WriteNextStateStop();
return res;
}
*/

// Server
/*
void JackGraphManager::ReleaseRefNum(int refnum)
{
JackConnectionManager* manager = WriteNextStateStart();
manager->ReleaseRefNum(refnum);
WriteNextStateStop();
}
*/

void JackGraphManager::InitRefNum(int refnum)
{
JackConnectionManager* manager = WriteNextStateStart();


+ 0
- 4
common/JackGraphManager.h View File

@@ -81,10 +81,6 @@ class JackGraphManager : public JackShmMem, public JackAtomicState<JackConnectio
void DisconnectAllOutput(jack_port_id_t port_index);
int DisconnectAll(jack_port_id_t port_index);

// Client management
//int AllocateRefNum();
//void ReleaseRefNum(int refnum);
bool IsDirectConnection(int ref1, int ref2);
void DirectConnect(int ref1, int ref2);
void DirectDisconnect(int ref1, int ref2);


Loading…
Cancel
Save