camera: Add camera flip config

This commit is contained in:
zhupengfei
2018-06-07 14:57:03 +08:00
parent 8e02c70e82
commit 5ebd466869
16 changed files with 416 additions and 282 deletions
+5 -4
View File
@@ -17,10 +17,11 @@ void RegisterFactory(const std::string& name, std::unique_ptr<CameraFactory> fac
factories[name] = std::move(factory);
}
std::unique_ptr<CameraInterface> CreateCamera(const std::string& name, const std::string& config) {
std::unique_ptr<CameraInterface> CreateCamera(const std::string& name, const std::string& config,
const Service::CAM::Flip& flip) {
auto pair = factories.find(name);
if (pair != factories.end()) {
return pair->second->Create(config);
return pair->second->Create(config, flip);
}
if (name != "blank") {
@@ -31,10 +32,10 @@ std::unique_ptr<CameraInterface> CreateCamera(const std::string& name, const std
std::unique_ptr<CameraInterface> CreateCameraPreview(const std::string& name,
const std::string& config, int width,
int height) {
int height, const Service::CAM::Flip& flip) {
auto pair = factories.find(name);
if (pair != factories.end()) {
return pair->second->CreatePreview(config, width, height);
return pair->second->CreatePreview(config, width, height, flip);
}
if (name != "blank") {