diff options
author | Gerald Begumisa <ben_g@users.sourceforge.net> | 2008-03-07 08:54:25 +0000 |
---|---|---|
committer | Gerald Begumisa <ben_g@users.sourceforge.net> | 2008-03-07 08:54:25 +0000 |
commit | a6d2e0b990df35b552ef5fa25d695f043b120d70 (patch) | |
tree | 9d836d3c505f1786038603f392e9093e406b9051 /orkbasecxx/Config.cpp | |
parent | c8218d259f148e5eb267369a2e508d43570291c0 (diff) |
Added feature that allows control over the CPU time which is given for transcoding purposes. Two configuration parameters, TranscodingSleepEveryNumFrames and TranscodingSleepUs have been added to config.xml. If both parameters have non-zero values then the transcoding thread will sleep for TranscodingSleepUs microseconds every TranscodingSleepEveryNumFrames which are transcoded.
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@528 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkbasecxx/Config.cpp')
-rw-r--r-- | orkbasecxx/Config.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/orkbasecxx/Config.cpp b/orkbasecxx/Config.cpp index 2da7141..08038f7 100644 --- a/orkbasecxx/Config.cpp +++ b/orkbasecxx/Config.cpp @@ -71,6 +71,8 @@ Config::Config() m_stereoRecording = STEREO_RECORDING_DEFAULT; m_tapeNumChannels = TAPE_NUM_CHANNELS_DEFAULT; m_tapeDurationMinimumSec = TAPE_DURATION_MINIMUM_SEC_DEFAULT; + m_transcodingSleepEveryNumFrames = TRANSCODING_SLEEP_EVERY_NUM_FRAMES_DEFAULT; + m_transcodingSleepUs = TRANSCODING_SLEEP_US_DEFAULT; } void Config::Define(Serializer* s) @@ -146,6 +148,8 @@ void Config::Define(Serializer* s) s->BoolValue(STEREO_RECORDING_PARAM, m_stereoRecording); s->IntValue(TAPE_NUM_CHANNELS_PARAM, m_tapeNumChannels); s->IntValue(TAPE_DURATION_MINIMUM_SEC_PARAM, m_tapeDurationMinimumSec); + s->IntValue(TRANSCODING_SLEEP_EVERY_NUM_FRAMES_PARAM, m_transcodingSleepEveryNumFrames); + s->IntValue(TRANSCODING_SLEEP_US_PARAM, m_transcodingSleepUs); } void Config::Validate() @@ -195,6 +199,19 @@ void Config::Validate() exception.Format("Config::Validate: please set a valid number for TapeNumChannels - currently:%d", m_tapeNumChannels); throw(exception); } + + if(m_transcodingSleepEveryNumFrames < 0) + { + CStdString exception; + exception.Format("Config::Validate: please set a valid value for TranscodingSleepEveryNumFrames - currently:%d", m_transcodingSleepEveryNumFrames); + throw(exception); + } + if(m_transcodingSleepUs < 0) + { + CStdString exception; + exception.Format("Config::Validate: please set a valid value for TranscodingSleepUs - currently:%d", m_transcodingSleepUs); + throw(exception); + } } CStdString Config::GetClassName() |