summaryrefslogtreecommitdiff
path: root/server/libfame_wrapper.cc
diff options
context:
space:
mode:
authordeva <deva>2006-08-16 23:49:23 +0000
committerdeva <deva>2006-08-16 23:49:23 +0000
commit347b1d8ed3a4f780f3a5c0d57a04eab05ca517a2 (patch)
treedc21975923fb440c78ee4bbffc645a138071978f /server/libfame_wrapper.cc
parent6c07f9219bed6ccddc9b65ad40414cf0a9f7d633 (diff)
Replaced the old MiavConfig class with the new Configuration class in all the the appropriate places.
Crippled the MulticastConfiguration class. This must be rewritten to use the new configuration interface.
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.");
}