<commit_before>// Copyright (c) 2015 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "realsense/enhanced_photography/enhanced_photography_object.h"

#include <string>

#include "base/bind.h"
#include "base/logging.h"

namespace realsense {
namespace enhanced_photography {

// TODO(qjia7): Allow user to config the capture size and framerate
const int kCaptureWidth = 320;
const int kCaptureHeight = 240;
const float kCaptureFramerate = 30.0;

EnhancedPhotographyObject::EnhancedPhotographyObject()
    : state_(IDLE),
      on_image_(false),
      on_preview_(false),
      is_snapshot_(false),
      ep_preview_thread_("EnhancedPhotoPreviewThread"),
      message_loop_(base::MessageLoopProxy::current()),
      session_(nullptr),
      sense_manager_(nullptr),
      ep_(nullptr),
      photo_(nullptr),
      preview_image_(nullptr) {
  handler_.Register("startPreview",
                    base::Bind(&EnhancedPhotographyObject::OnStartPreview,
                               base::Unretained(this)));
  handler_.Register("stopPreview",<commit_msg>Fix SP and EP API cannot work togehter<commit_after>// Copyright (c) 2015 Intel Corporation. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "realsense/enhanced_photography/enhanced_photography_object.h"

#include <string>

#include "base/bind.h"
#include "base/logging.h"

namespace realsense {
namespace enhanced_photography {

// TODO(qjia7): Allow user to config the capture size and framerate
const int kCaptureWidth = 320;
const int kCaptureHeight = 240;
// Align to SP to allow SP and EP work together.
// See https://github.com/otcshare/realsense-extensions-crosswalk/issues/86
const float kCaptureFramerate = 60.0;

EnhancedPhotographyObject::EnhancedPhotographyObject()
    : state_(IDLE),
      on_image_(false),
      on_preview_(false),
      is_snapshot_(false),
      ep_preview_thread_("EnhancedPhotoPreviewThread"),
      message_loop_(base::MessageLoopProxy::current()),
      session_(nullptr),
      sense_manager_(nullptr),
      ep_(nullptr),
      photo_(nullptr),
      preview_image_(nullptr) {
  handler_.Register("startPreview",
                    base::Bind(&EnhancedPhotographyObject::OnStartPreview,
                               base::Unretained(this)));
  handler_.Register("stopPreview",
{'fraction_non_alphanumeric': 0.10170178282009724, 'fraction_numerical': 0.012155591572123177, 'mean_word_length': 3.8988095238095237, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6986029', 'n_tokens_mistral': 739, 'n_tokens_neox': 705, 'n_words': 175}