From 8178222dd0e62ded6193a901fa398bc71ea2a743 Mon Sep 17 00:00:00 2001 From: Henri Herscher Date: Wed, 22 Mar 2006 17:27:33 +0000 Subject: Added BatchProcessingEnhancePriority config parm git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@199 09dcff7a-b715-0410-9601-b79a96267cd0 --- orkaudio/BatchProcessing.cpp | 11 +++++++---- orkaudio/Config.cpp | 2 ++ orkaudio/Config.h | 3 +++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/orkaudio/BatchProcessing.cpp b/orkaudio/BatchProcessing.cpp index 43e0563..42816c3 100644 --- a/orkaudio/BatchProcessing.cpp +++ b/orkaudio/BatchProcessing.cpp @@ -233,10 +233,13 @@ void BatchProcessing::ThreadHandler(void *args) } outFileRef->WriteChunk(tmpChunkRef); - // Give up CPU to make sure the actual recording always has priority - ACE_Time_Value yield; - yield.set(0,1); // 1 us - ACE_OS::sleep(yield); + if(CONFIG.m_batchProcessingEnhancePriority == false) + { + // Give up CPU between every audio buffer to make sure the actual recording always has priority + ACE_Time_Value yield; + yield.set(0,1); // 1 us + ACE_OS::sleep(yield); + } } fileRef->Close(); diff --git a/orkaudio/Config.cpp b/orkaudio/Config.cpp index 4a9e295..c72e9de 100644 --- a/orkaudio/Config.cpp +++ b/orkaudio/Config.cpp @@ -40,6 +40,7 @@ Config::Config() m_audioOutputPath = AUDIO_OUTPUT_PATH_DEFAULT; m_immediateProcessingQueueSize = IMMEDIATE_PROCESSING_QUEUE_SIZE_DEFAULT; m_batchProcessingQueueSize = BATCH_PROCESSING_QUEUE_SIZE_DEFAULT; + m_batchProcessingEnhancePriority = BATCH_PROCESSING_ENHANCE_PRIORITY_DEFAULT; char hostname[40]; ACE_OS::hostname(hostname, 40); @@ -76,6 +77,7 @@ void Config::Define(Serializer* s) s->StringValue(AUDIO_OUTPUT_PATH_PARAM, m_audioOutputPath); s->IntValue(IMMEDIATE_PROCESSING_QUEUE_SIZE_PARAM, m_immediateProcessingQueueSize); s->IntValue(BATCH_PROCESSING_QUEUE_SIZE_PARAM, m_batchProcessingQueueSize); + s->BoolValue(BATCH_PROCESSING_ENHANCE_PRIORITY_PARAM, m_batchProcessingEnhancePriority); } void Config::Validate() diff --git a/orkaudio/Config.h b/orkaudio/Config.h index 95a31d9..b7623f4 100644 --- a/orkaudio/Config.h +++ b/orkaudio/Config.h @@ -63,6 +63,8 @@ #define IMMEDIATE_PROCESSING_QUEUE_SIZE_DEFAULT 10000 #define BATCH_PROCESSING_QUEUE_SIZE_PARAM "BatchProcessingQueueSize" #define BATCH_PROCESSING_QUEUE_SIZE_DEFAULT 20000 +#define BATCH_PROCESSING_ENHANCE_PRIORITY_PARAM "BatchProcessingEnhancePriority" +#define BATCH_PROCESSING_ENHANCE_PRIORITY_DEFAULT false class Config : public Object { @@ -99,6 +101,7 @@ public: CStdString m_audioOutputPath; int m_immediateProcessingQueueSize; int m_batchProcessingQueueSize; + bool m_batchProcessingEnhancePriority; }; -- cgit v1.2.3