[camera] Source code refactoring (#31)

Changes:
* Source code refactoring
* Add temporary code for camera image stream APIs
This commit is contained in:
Hidenori Matsubayashi
2021-08-17 17:49:36 +09:00
committed by GitHub
parent 736eb878ee
commit 34feab80cc
11 changed files with 173 additions and 71 deletions
@@ -11,16 +11,10 @@
class CameraStreamHandlerImpl : public CameraStreamHandler {
public:
using OnNotifyInitialized = std::function<void()>;
using OnNotifyFrameDecoded = std::function<void()>;
using OnNotifyCompleted = std::function<void()>;
CameraStreamHandlerImpl(OnNotifyInitialized on_notify_initialized,
OnNotifyFrameDecoded on_notify_frame_decoded,
OnNotifyCompleted on_notify_completed)
: on_notify_initialized_(on_notify_initialized),
on_notify_frame_decoded_(on_notify_frame_decoded),
on_notify_completed_(on_notify_completed) {}
CameraStreamHandlerImpl(OnNotifyFrameDecoded on_notify_frame_decoded)
: on_notify_frame_decoded_(on_notify_frame_decoded) {}
virtual ~CameraStreamHandlerImpl() = default;
// Prevent copying.
@@ -28,13 +22,6 @@ class CameraStreamHandlerImpl : public CameraStreamHandler {
CameraStreamHandlerImpl& operator=(CameraStreamHandlerImpl const&) = delete;
protected:
// |CameraStreamHandler|
void OnNotifyInitializedInternal() {
if (on_notify_initialized_) {
on_notify_initialized_();
}
}
// |CameraStreamHandler|
void OnNotifyFrameDecodedInternal() {
if (on_notify_frame_decoded_) {
@@ -42,16 +29,7 @@ class CameraStreamHandlerImpl : public CameraStreamHandler {
}
}
// |CameraStreamHandler|
void OnNotifyCompletedInternal() {
if (on_notify_completed_) {
on_notify_completed_();
}
}
OnNotifyInitialized on_notify_initialized_;
OnNotifyFrameDecoded on_notify_frame_decoded_;
OnNotifyCompleted on_notify_completed_;
};
#endif // PACKAGES_CAMERA_CAMERA_ELINUX_CAMERA_STREAM_HANDLER_IMPL_H_