summaryrefslogtreecommitdiff
path: root/server/libfame_wrapper.cc
diff options
context:
space:
mode:
Diffstat (limited to 'server/libfame_wrapper.cc')
-rw-r--r--server/libfame_wrapper.cc27
1 files changed, 20 insertions, 7 deletions
diff --git a/server/libfame_wrapper.cc b/server/libfame_wrapper.cc
index 1b0694a..058a158 100644
--- a/server/libfame_wrapper.cc
+++ b/server/libfame_wrapper.cc
@@ -29,7 +29,7 @@
#include <errno.h>
-#include "miav_config.h"
+#include "configuration.h"
#include "info.h"
#include "frame.h"
@@ -94,13 +94,22 @@ LibFAMEWrapper::LibFAMEWrapper()
// to JPEG), whereas P and B frames are motion compressed, respectively
// predicted from past reference (I or P) frame, or bidirectionally predicted
// from past and future reference frame.
- fame_par.coding = MIaV::config->readString("frame_sequence")->c_str();
+ std::string coding;
+ if(MIaV::config->get("frame_sequence", &coding))
+ MIaV::info->error("Could not read symbol [frame_sequence] from conf file!");
+ fame_par.coding = coding.c_str();
// quality is a percentage, which controls compression versus quality.
- fame_par.quality = MIaV::config->readInt("video_quality");
+ int quality;
+ if(MIaV::config->get("video_quality", &quality))
+ MIaV::info->error("Could not read symbol [video_quality] from conf file!");
+ fame_par.quality = quality;
// Bitrate
- fame_par.bitrate = MIaV::config->readInt("video_bitrate") * 1000; // video bitrate in bytes pr second (0=VBR)
+ int bitrate;
+ if(MIaV::config->get("video_bitrate", &bitrate))
+ MIaV::info->error("Could not read symbol [video_bitrate] from conf file!");
+ fame_par.bitrate = bitrate * 1000; // video bitrate in bytes pr second (0=VBR)
// slices_per_frame is the number of frame slices per frame. More slices provide
// better error recovery. There must be at least one slice per frame, and at most
@@ -133,7 +142,11 @@ LibFAMEWrapper::LibFAMEWrapper()
fame_par.profile = profilename; // profile name
fame_par.total_frames = 0; // total number of frames
- if(strcmp(MIaV::config->readString("encoding_codec")->c_str(), "mpeg4") == 0) {
+ std::string codec;
+ if(MIaV::config->get("encoding_codec", &codec))
+ MIaV::info->error("Could not read symbol [encoding_codec] from conf file!");
+
+ if(strcmp(codec.c_str(), "mpeg4") == 0) {
MIaV::info->info("Using mpeg4 compression.");
fame_object_t *object;
@@ -141,7 +154,7 @@ LibFAMEWrapper::LibFAMEWrapper()
object = fame_get_object(fame_context, "profile/mpeg4/simple");
if(object) fame_register(fame_context, "profile", object);
- } else if(strcmp(MIaV::config->readString("encoding_codec")->c_str(), "mpeg1") == 0) {
+ } else if(strcmp(codec.c_str(), "mpeg1") == 0) {
MIaV::info->info("Using mpeg1 compression.");
fame_object_t *object;
@@ -149,7 +162,7 @@ LibFAMEWrapper::LibFAMEWrapper()
object = fame_get_object(fame_context, "profile/mpeg1");
if(object) fame_register(fame_context, "profile", object);
- } else if(strcmp(MIaV::config->readString("encoding_codec")->c_str(), "mpeg1") == 0) {
+ } else if(strcmp(codec.c_str(), "mpeg1") == 0) {
} else {
MIaV::info->info("Using default (mpeg1) compression.");
}