#include "encoder.h" #include "encoders/lame_encoder.h" #include EncoderFilter::EncoderFilter(EncoderBase::p encoder_) { encoder = encoder_; } typedef boost::function()> EncoderFactory; std::map encoder_factories; void encoder::init() { encoder_factories["lame"] = boost::factory >(); } EncoderFilter::p encoder::get_encoder(const std::string& name) { return EncoderFilter::p(new EncoderFilter(EncoderBase::p(encoder_factories[name]()))); }