summaryrefslogtreecommitdiff
path: root/PluginRoutingInterfaceAsync/src
diff options
context:
space:
mode:
authorchristian linke <christian.linke@bmw.de>2012-12-17 16:15:11 +0100
committerchristian linke <christian.linke@bmw.de>2012-12-17 16:15:11 +0100
commit54c5e965fe8f9a53a78834028fd65c792493da2b (patch)
tree560d7b1209e6a8d4798de9568e4b4a947c2ab42a /PluginRoutingInterfaceAsync/src
parent215e8a72dc81e8a86dd5b3a8ca40fd2c7c6a0b9c (diff)
downloadaudiomanager-54c5e965fe8f9a53a78834028fd65c792493da2b.tar.gz
* added new interfaces & nsm support + nsm tests + fixed some unit tests + fixed rundown
Signed-off-by: christian linke <christian.linke@bmw.de>
Diffstat (limited to 'PluginRoutingInterfaceAsync/src')
-rw-r--r--PluginRoutingInterfaceAsync/src/CAmRoutingSenderAsync.cpp48
-rw-r--r--PluginRoutingInterfaceAsync/src/IAmRoutingReceiverShadow.cpp12
2 files changed, 43 insertions, 17 deletions
diff --git a/PluginRoutingInterfaceAsync/src/CAmRoutingSenderAsync.cpp b/PluginRoutingInterfaceAsync/src/CAmRoutingSenderAsync.cpp
index 43de210..83415e9 100644
--- a/PluginRoutingInterfaceAsync/src/CAmRoutingSenderAsync.cpp
+++ b/PluginRoutingInterfaceAsync/src/CAmRoutingSenderAsync.cpp
@@ -73,8 +73,8 @@ mNumThreads(numThreads)
mListWorkers.resize(mNumThreads);
for (int i=0;i<mNumThreads;i++)
{
- sem_init(&mListWorkers[i].block,NULL,NULL);
- sem_init(&mListWorkers[i].cancel,NULL,NULL);
+ sem_init(&mListWorkers[i].block,0,0);
+ sem_init(&mListWorkers[i].cancel,0,0);
mListWorkers[i].busy=false;
mListWorkers[i].workerID=++workerID;
pthread_create(&mListWorkers[i].threadID,NULL,&CAmWorkerThreadPool::CAmWorkerThread,(void*)&mListWorkers[i]);
@@ -234,7 +234,7 @@ void CAmRoutingSenderAsync::setRoutingReady(const uint16_t handle)
void CAmRoutingSenderAsync::setRoutingRundown(const uint16_t handle)
{
assert(mReceiveInterface!=0);
- mShadow->confirmRoutingRundown(handle);
+ mShadow->confirmRoutingRundown(handle,E_OK);
}
am_Error_e CAmRoutingSenderAsync::asyncAbort(const am_Handle_s handle)
@@ -315,7 +315,7 @@ am_Error_e CAmRoutingSenderAsync::asyncConnect(const am_Handle_s handle, const a
//save the handle related to the workerID
pthread_mutex_lock(&mMapHandleWorkerMutex);
- mMapHandleWorker.insert(std::make_pair(handle.handle, work));
+ mMapHandleWorker.insert(std::make_pair(+handle.handle, work));
pthread_mutex_unlock(&mMapHandleWorkerMutex);
return (E_OK);
@@ -350,7 +350,7 @@ am_Error_e CAmRoutingSenderAsync::asyncDisconnect(const am_Handle_s handle, cons
//save the handle related to the workerID
pthread_mutex_lock(&mMapHandleWorkerMutex);
- mMapHandleWorker.insert(std::make_pair(handle.handle, work));
+ mMapHandleWorker.insert(std::make_pair(+handle.handle, work));
pthread_mutex_unlock(&mMapHandleWorkerMutex);
return (E_OK);
@@ -392,7 +392,7 @@ am_Error_e CAmRoutingSenderAsync::asyncSetSinkVolume(const am_Handle_s handle, c
//save the handle related to the workerID
pthread_mutex_lock(&mMapHandleWorkerMutex);
- mMapHandleWorker.insert(std::make_pair(handle.handle, work));
+ mMapHandleWorker.insert(std::make_pair(+handle.handle, work));
pthread_mutex_unlock(&mMapHandleWorkerMutex);
return (E_OK);
@@ -434,7 +434,7 @@ am_Error_e CAmRoutingSenderAsync::asyncSetSourceVolume(const am_Handle_s handle,
//save the handle related to the workerID
pthread_mutex_lock(&mMapHandleWorkerMutex);
- mMapHandleWorker.insert(std::make_pair(handle.handle, work));
+ mMapHandleWorker.insert(std::make_pair(+handle.handle, work));
pthread_mutex_unlock(&mMapHandleWorkerMutex);
return (E_OK);
@@ -476,7 +476,7 @@ am_Error_e CAmRoutingSenderAsync::asyncSetSourceState(const am_Handle_s handle,
//save the handle related to the workerID
pthread_mutex_lock(&mMapHandleWorkerMutex);
- mMapHandleWorker.insert(std::make_pair(handle.handle, work));
+ mMapHandleWorker.insert(std::make_pair(+handle.handle, work));
pthread_mutex_unlock(&mMapHandleWorkerMutex);
return (E_OK);
@@ -518,7 +518,7 @@ am_Error_e CAmRoutingSenderAsync::asyncSetSinkSoundProperty(const am_Handle_s ha
//save the handle related to the workerID
pthread_mutex_lock(&mMapHandleWorkerMutex);
- mMapHandleWorker.insert(std::make_pair(handle.handle, work));
+ mMapHandleWorker.insert(std::make_pair(+handle.handle, work));
pthread_mutex_unlock(&mMapHandleWorkerMutex);
return (E_OK);
@@ -607,7 +607,7 @@ am_Error_e CAmRoutingSenderAsync::asyncSetSourceSoundProperty(const am_Handle_s
//save the handle related to the workerID
pthread_mutex_lock(&mMapHandleWorkerMutex);
- mMapHandleWorker.insert(std::make_pair(handle.handle, work));
+ mMapHandleWorker.insert(std::make_pair(+handle.handle, work));
pthread_mutex_unlock(&mMapHandleWorkerMutex);
return (E_OK);
@@ -880,6 +880,32 @@ am_Error_e CAmRoutingSenderAsync::asyncSetSinkSoundProperties(const am_Handle_s
return (E_NOT_USED);
}
+am_Error_e am::CAmRoutingSenderAsync::asyncSetVolumes(const am_Handle_s handle, const std::vector<am_Volumes_s>& listVolumes)
+{
+ (void)handle;
+ (void)listVolumes;
+ //todo: implement
+ return (E_NOT_USED);
+}
+
+am_Error_e am::CAmRoutingSenderAsync::asyncSetSinkNotificationConfiguration(const am_Handle_s handle, const am_sinkID_t sinkID, const am_NotificationConfiguration_s& notificationConfiguration)
+{
+ (void)handle;
+ (void)sinkID;
+ (void)notificationConfiguration;
+ //todo: implement
+ return (E_NOT_USED);
+}
+
+am_Error_e am::CAmRoutingSenderAsync::asyncSetSourceNotificationConfiguration(const am_Handle_s handle, const am_sourceID_t sourceID, const am_NotificationConfiguration_s& notificationConfiguration)
+{
+ (void)handle;
+ (void)sourceID;
+ (void)notificationConfiguration;
+ //todo: implement
+ return (E_NOT_USED);
+}
+
std::vector<am_Gateway_s> CAmRoutingSenderAsync::createGatewayTable()
{
std::vector<am_Gateway_s> table;
@@ -1283,7 +1309,7 @@ void syncRegisterWorker::start2work()
}
mAsyncSender->updateSinkListSafe(mListSinks);
- mShadow->confirmRoutingReady(mHandle);
+ mShadow->confirmRoutingReady(mHandle,E_OK);
}
void syncRegisterWorker::cancelWork()
diff --git a/PluginRoutingInterfaceAsync/src/IAmRoutingReceiverShadow.cpp b/PluginRoutingInterfaceAsync/src/IAmRoutingReceiverShadow.cpp
index 5ab2360..71b0cc5 100644
--- a/PluginRoutingInterfaceAsync/src/IAmRoutingReceiverShadow.cpp
+++ b/PluginRoutingInterfaceAsync/src/IAmRoutingReceiverShadow.cpp
@@ -99,12 +99,12 @@ void IAmRoutingReceiverShadow::hookInterruptStatusChange(const am_sourceID_t sou
void IAmRoutingReceiverShadow::hookSinkAvailablityStatusChange(const am_sinkID_t sinkID, const am_Availability_s & availability)
{
- mSerializer.asyncCall<IAmRoutingReceive, const am_sinkID_t, const am_Availability_s&>(mRoutingReceiveInterface, &IAmRoutingReceive::hookSinkAvailablityStatusChange, sinkID, availability);
+ mSerializer.asyncCall<IAmRoutingReceive, const am_sinkID_t, const am_Availability_s>(mRoutingReceiveInterface, &IAmRoutingReceive::hookSinkAvailablityStatusChange, sinkID, availability);
}
void IAmRoutingReceiverShadow::hookSourceAvailablityStatusChange(const am_sourceID_t sourceID, const am_Availability_s & availability)
{
- mSerializer.asyncCall<IAmRoutingReceive, const am_sourceID_t, const am_Availability_s&>(mRoutingReceiveInterface, &IAmRoutingReceive::hookSourceAvailablityStatusChange, sourceID, availability);
+ mSerializer.asyncCall<IAmRoutingReceive, const am_sourceID_t, const am_Availability_s>(mRoutingReceiveInterface, &IAmRoutingReceive::hookSourceAvailablityStatusChange, sourceID, availability);
}
void IAmRoutingReceiverShadow::hookDomainStateChange(const am_domainID_t domainID, const am_DomainState_e domainState)
@@ -173,14 +173,14 @@ am_Error_e am::IAmRoutingReceiverShadow::registerCrossfader(const am_Crossfader_
return (error);
}
-void am::IAmRoutingReceiverShadow::confirmRoutingReady(uint16_t starupHandle)
+void am::IAmRoutingReceiverShadow::confirmRoutingReady(uint16_t starupHandle, am_Error_e error)
{
- mSerializer.asyncCall<IAmRoutingReceive,uint16_t>(mRoutingReceiveInterface,&IAmRoutingReceive::confirmRoutingReady,starupHandle);
+ mSerializer.asyncCall<IAmRoutingReceive,uint16_t,am_Error_e>(mRoutingReceiveInterface,&IAmRoutingReceive::confirmRoutingReady,starupHandle,error);
}
-void am::IAmRoutingReceiverShadow::confirmRoutingRundown(uint16_t rundownHandle)
+void am::IAmRoutingReceiverShadow::confirmRoutingRundown(uint16_t rundownHandle, am_Error_e error)
{
- mSerializer.asyncCall<IAmRoutingReceive,uint16_t>(mRoutingReceiveInterface,&IAmRoutingReceive::confirmRoutingRundown,rundownHandle);
+ mSerializer.asyncCall<IAmRoutingReceive,uint16_t,am_Error_e>(mRoutingReceiveInterface,&IAmRoutingReceive::confirmRoutingRundown,rundownHandle,error);
}