[camera] Source code refactoring (#31)
Changes: * Source code refactoring * Add temporary code for camera image stream APIs
This commit is contained in:
@@ -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_
|
||||
|
||||
Reference in New Issue
Block a user