34#define NDEVR_SUPPORTS_LOCAL_CAMERA 1
35#if NDEVR_SUPPORTS_LOCAL_CAMERA
48class QMediaCaptureSession;
50class QCameraImageCapture;
51class QVideoEncoderSettings;
52class QAudioEncoderSettings;
56#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
57 class QCustomComboBox;
91 QMediaDevices* m_devices =
nullptr;
92 QMediaCaptureSession* m_capture_session =
nullptr;
93 QCamera* m_camera =
nullptr;
94 QAudioInput* m_audio_input =
nullptr;
95 QImageCapture* m_image_capture =
nullptr;
96 QVideoWidget* m_video_widget =
nullptr;
97 QMediaRecorder* m_media_recorder =
nullptr;
118 virtual bool setCameraSource(
const String& connection_id)
override;
119 virtual bool setCameraSource(
const QCameraInfo& connection_id);
120 virtual void refreshInstance()
override;
121 void setToDefaultCamera();
122 QAudioEncoderSettings audioSettings()
const;
123 QVideoEncoderSettings videoSettings()
const;
126 void processCapturedImage(
int index,
const QImage& img);
127 void handleCameraError(
int camera_error);
129 bool startRecord(
const File& file)
override;
130 bool finishRecord(
const File& file)
override;
131 virtual bool takeImage(
const File& file)
override;
132 virtual void invertScreenColors(
bool invert)
override;
133 void updateCameraState(
int state);
135 File m_screenshot_location;
137 QCameraImageCapture* imageCapture;
138 QMediaRecorder* mediaRecorder;
139 QVideoWidget* m_video_widget;
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
A core class where all Design Objects including models, materials, and geometries are stored....
Definition DesignObjectLookup.h:65
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:320
Logic for reading or writing to a file as well as navigating filesystems.
Definition File.h:48
Provides an interface to PhysicalCameraViewFactory for creating a LocalPhysicalCameraView.
Definition LocalPhysicalCameraView.h:105
virtual PhysicalCameraView * createView(const DynamicPointer< Camera > &camera, DesignObjectLookup *model_manager, bool auto_add_models, QWidget *parent) override
virtual Buffer< DynamicPointer< Camera > > availableCameraStreams() const override
virtual bool canCreateView(const DynamicPointer< Camera > &camera, DesignObjectLookup *model_manager) override
Provides access to a local camera on the system, such as a webcam or camera for a phone.
Definition LocalPhysicalCameraView.h:63
void updateCameraSources()
virtual bool takeImage(const File &file) override
virtual void refreshInstance() override
bool finishRecord(File file) override
LocalPhysicalCameraView(const DynamicPointer< Camera > &camera, QWidget *parent=nullptr)
Button * m_camera_flash_button
Definition LocalPhysicalCameraView.h:99
LocalPhysicalCameraView()
void handleScreenshotError(int id, int error, const QString &errorString)
virtual bool pauseRecord(bool paused, const File &file) override
virtual ~LocalPhysicalCameraView()
virtual void invertScreenColors(bool invert) override
void setToDefaultCamera()
QCustomComboBox * m_selection_combo
Definition LocalPhysicalCameraView.h:98
void updateRecorderState(int state)
void updateCameraState(bool state)
File m_screenshot_location
Definition LocalPhysicalCameraView.h:90
void updateRecorderTimespan()
virtual bool setCameraSource(const QCameraDevice &connection_id)
void processCapturedImage(int index, const QImage &img)
bool startRecord(const File &file) override
virtual bool setCameraSource(const String &connection_id) override
void handleCameraError(int camera_error)
A compact way to present a list of options to the user.
Definition QCustomCombobox.h:53
The core String class for the NDEVR API.
Definition String.h:69