16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 15:09:19 +02:00

extcam camera: separate preview and recording

This commit is contained in:
milek7
2019-09-20 20:16:55 +02:00
parent ccb2179d5e
commit 5602448caf
7 changed files with 67 additions and 13 deletions

View File

@@ -11,12 +11,22 @@ namespace ui
{
class cameraview_panel : public ui_panel
{
public:
enum state_e {
IDLE,
PREVIEW,
RECORDING
};
private:
std::atomic_bool exit_thread = true;
std::thread workthread;
uint8_t* image_ptr = nullptr;
std::mutex mutex;
state_e state = IDLE;
std::optional<opengl_texture> texture;
void workthread_func();
@@ -27,6 +37,7 @@ class cameraview_panel : public ui_panel
void render() override;
void render_contents() override;
bool set_state(state_e e);
std::string rec_name;
};