mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 12:09:19 +02:00
Every module unit now includes the standard headers it uses. Declarations reaching a unit only through an imported module's global module fragment are reachable but not visible, so ADL misses the free operators older libstdc++ declares beside a type - reproduced on ubuntu 24.04 (libstdc++ 13), where gl/vao.cpp could not compare vector iterators. Also drops a stale editor/editorSettings.hpp from the MSVC source list, which broke the Windows configure step, silences the deliberate include-in-purview warning in the glm wrapper, and removes GCC support: clang or MSVC only.
65 lines
1.2 KiB
C++
65 lines
1.2 KiB
C++
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
module;
|
|
#include <string>
|
|
#include <atomic>
|
|
#include <condition_variable>
|
|
#include <mutex>
|
|
#include <optional>
|
|
#include <thread>
|
|
|
|
export module eu07.widgets.cameraview_extcam;
|
|
import eu07.model.texture;
|
|
import eu07.application.uilayer;
|
|
|
|
export {
|
|
|
|
|
|
|
|
namespace ui
|
|
{
|
|
class cameraview_panel : public ui_panel
|
|
{
|
|
private:
|
|
|
|
enum thread_state {
|
|
STARTING,
|
|
RUNNING,
|
|
STOPPING,
|
|
STOPPING_DONE,
|
|
STOPPED,
|
|
};
|
|
|
|
std::atomic<thread_state> capture_state = STOPPED;
|
|
std::atomic<thread_state> record_state = STOPPED;
|
|
std::thread capture_workthread;
|
|
std::thread record_workthread;
|
|
|
|
std::condition_variable notify_var;
|
|
uint32_t frame_cnt = 0;
|
|
|
|
uint8_t* image_ptr = nullptr;
|
|
std::mutex mutex;
|
|
|
|
bool recording = false;
|
|
|
|
std::optional<opengl_texture> texture;
|
|
|
|
void capture_func();
|
|
void record_func();
|
|
|
|
public:
|
|
cameraview_panel();
|
|
~cameraview_panel();
|
|
|
|
void render() override;
|
|
void render_contents() override;
|
|
bool set_state(bool rec);
|
|
|
|
std::string rec_name;
|
|
};
|
|
} // namespace ui
|
|
|
|
} // export
|