summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenri Herscher <henri@oreka.org>2006-03-22 17:27:33 +0000
committerHenri Herscher <henri@oreka.org>2006-03-22 17:27:33 +0000
commit8178222dd0e62ded6193a901fa398bc71ea2a743 (patch)
treefddc327500f20a5c070a22041b650c00f4296719
parent5298d5fadf5ba92a302a0aebd946c093dc54ba61 (diff)
Added BatchProcessingEnhancePriority config parm
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@199 09dcff7a-b715-0410-9601-b79a96267cd0
-rw-r--r--orkaudio/BatchProcessing.cpp11
-rw-r--r--orkaudio/Config.cpp2
-rw-r--r--orkaudio/Config.h3
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;
};