blob: 9bea59bb12e0b9c043acec3409b7a6991d46673f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#include "encoder.h"
#include "encoders/lame_encoder.h"
#include <map>
namespace encoder {
typedef boost::function<EncoderBase*()> EncoderFactory;
std::map<std::string, EncoderFactory> encoder_factories;
void init() {
encoder_factories["lame"] = boost::factory<EncoderLame*>();
}
EncoderBase *get_encoder(const std::string& name) {
return encoder_factories[name]();
}
};
|