git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1318 0c269be4-1314-0410-8aa9-9f06e86f4224tags/0.61
| @@ -2,9 +2,13 @@ | |||||
| Jackdmp changes log | 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> | 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> | 2006-11-29 Stephane Letz <letz@grame.fr> | ||||
| @@ -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) | void JackConnectionManager::InitRefNum(int refnum) | ||||
| { | { | ||||
| fInputPort[refnum].Init(); | fInputPort[refnum].Init(); | ||||
| @@ -265,7 +237,6 @@ void JackConnectionManager::InitRefNum(int refnum) | |||||
| fInputCounter[refnum].SetValue(0); | fInputCounter[refnum].SetValue(0); | ||||
| } | } | ||||
| /*! | /*! | ||||
| \brief Reset all clients activation. | \brief Reset all clients activation. | ||||
| */ | */ | ||||
| @@ -442,11 +442,8 @@ class JackConnectionManager | |||||
| const jack_int_t* GetOutputPorts(int refnum); | const jack_int_t* GetOutputPorts(int refnum); | ||||
| // Client management | // 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; | int GetOutputRefNum(jack_port_id_t port_index) const; | ||||
| // Connect/Disconnect 2 refnum "directly" | // Connect/Disconnect 2 refnum "directly" | ||||
| @@ -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) | 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); | JackLog("JackEngine::ClientNew: name = %s \n", name); | ||||
| //int refnum = fGraphManager->AllocateRefNum(); | |||||
| int refnum = Allocate(); | int refnum = Allocate(); | ||||
| if (refnum < 0) { | if (refnum < 0) { | ||||
| @@ -395,12 +394,6 @@ int JackEngine::ClientExternalNew(const char* name, int* ref, int* shared_engine | |||||
| *ref = refnum; | *ref = refnum; | ||||
| return 0; | return 0; | ||||
| /* | |||||
| error1: | |||||
| fGraphManager->ReleaseRefNum(refnum); | |||||
| return -1; | |||||
| */ | |||||
| error: | error: | ||||
| ClientCloseAux(refnum, client, false); | ClientCloseAux(refnum, client, false); | ||||
| client->Close(); | client->Close(); | ||||
| @@ -411,7 +404,6 @@ error: | |||||
| int JackEngine::ClientInternalNew(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client) | int JackEngine::ClientInternalNew(const char* name, int* ref, JackEngineControl** shared_engine, JackGraphManager** shared_manager, JackClientInterface* client) | ||||
| { | { | ||||
| JackLog("JackEngine::ClientInternalNew: name = %s\n", name); | JackLog("JackEngine::ClientInternalNew: name = %s\n", name); | ||||
| //int refnum = fGraphManager->AllocateRefNum(); | |||||
| int refnum = Allocate(); | int refnum = Allocate(); | ||||
| if (refnum < 0) { | if (refnum < 0) { | ||||
| @@ -421,12 +413,12 @@ int JackEngine::ClientInternalNew(const char* name, int* ref, JackEngineControl* | |||||
| if (!fSynchroTable[refnum]->Allocate(name, 0)) { | if (!fSynchroTable[refnum]->Allocate(name, 0)) { | ||||
| jack_error("Cannot allocate synchro"); | jack_error("Cannot allocate synchro"); | ||||
| goto error; | |||||
| return -1; | |||||
| } | } | ||||
| if (NotifyAddClient(client, name, refnum) < 0) { | if (NotifyAddClient(client, name, refnum) < 0) { | ||||
| jack_error("Cannot notify add client"); | jack_error("Cannot notify add client"); | ||||
| goto error; | |||||
| return -1; | |||||
| } | } | ||||
| fClientTable[refnum] = client; | fClientTable[refnum] = client; | ||||
| @@ -436,10 +428,6 @@ int JackEngine::ClientInternalNew(const char* name, int* ref, JackEngineControl* | |||||
| *shared_manager = fGraphManager; | *shared_manager = fGraphManager; | ||||
| *ref = refnum; | *ref = refnum; | ||||
| return 0; | return 0; | ||||
| error: | |||||
| // fGraphManager->ReleaseRefNum(refnum); | |||||
| return -1; | |||||
| } | } | ||||
| // Used for externall clients | // Used for externall clients | ||||
| @@ -493,8 +481,6 @@ int JackEngine::ClientCloseAux(int refnum, JackClientInterface* client, bool wai | |||||
| // Cleanup... | // Cleanup... | ||||
| fSynchroTable[refnum]->Destroy(); | fSynchroTable[refnum]->Destroy(); | ||||
| //fGraphManager->ReleaseRefNum(refnum); | |||||
| fEngineTiming->ResetRollingUsecs(); | fEngineTiming->ResetRollingUsecs(); | ||||
| return 0; | return 0; | ||||
| } | } | ||||
| @@ -67,26 +67,6 @@ int JackGraphManager::GetConnectionsNum(jack_port_id_t port_index) | |||||
| } | } | ||||
| // Server | // 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) | void JackGraphManager::InitRefNum(int refnum) | ||||
| { | { | ||||
| JackConnectionManager* manager = WriteNextStateStart(); | JackConnectionManager* manager = WriteNextStateStart(); | ||||
| @@ -81,10 +81,6 @@ class JackGraphManager : public JackShmMem, public JackAtomicState<JackConnectio | |||||
| void DisconnectAllOutput(jack_port_id_t port_index); | void DisconnectAllOutput(jack_port_id_t port_index); | ||||
| int DisconnectAll(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); | bool IsDirectConnection(int ref1, int ref2); | ||||
| void DirectConnect(int ref1, int ref2); | void DirectConnect(int ref1, int ref2); | ||||
| void DirectDisconnect(int ref1, int ref2); | void DirectDisconnect(int ref1, int ref2); | ||||