blob: ae21604479c3cca153bb9f22cda80326a32ef3c2 [file] [log] [blame]
* Copyright 2019 The Chromium OS Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
#include <memory>
#include <base/time/time.h>
#include "cros-camera/export.h"
namespace cros {
enum class JpegProcessType { kDecode, kEncode };
enum class JpegProcessMethod { kHardware, kSoftware };
class CROS_CAMERA_EXPORT CameraMetrics {
static std::unique_ptr<CameraMetrics> New();
virtual ~CameraMetrics() = default;
// Records the process time of JDA/JEA in microseconds.
virtual void SendJpegProcessLatency(JpegProcessType process_type,
JpegProcessMethod process_layer,
base::TimeDelta latency) = 0;
// Records the resolution of image that JDA/JEA process in pixels.
virtual void SendJpegResolution(JpegProcessType process_type,
JpegProcessMethod process_layer,
int width,
int height) = 0;
// Records the process time of ConfigureStreams().
virtual void SendConfigureStreamsLatency(base::TimeDelta latency) = 0;
// Records the resolution of streams that configured.
virtual void SendConfigureStreamResolution(int width,
int height,
int format) = 0;
// Records the process time of OpenDevice().
virtual void SendOpenDeviceLatency(base::TimeDelta latency) = 0;
// Records the error type which triggers Notify().
virtual void SendError(int error_code) = 0;
// Records the camera facing of current session.
virtual void SendCameraFacing(int facing) = 0;
// Records the duration of the closing session.
virtual void SendSessionDuration(base::TimeDelta duration) = 0;
} // namespace cros