34#include <NDEVR/PhysicalCameraView.h>
35#define NDEVR_USE_VLC_OPENGLRENDERER 1
36#if NDEVR_USE_VLC_OPENGLRENDERER
37#include "VLCInterface/Headers/VLCOpenGLRenderer.h"
39#include "VLCInterface/Headers/VLCWindow.h"
41#include "Design/Headers/Camera.h"
42#include "Base/Headers/Pointer.hpp"
43#include "Base/Headers/File.h"
44#include "Base/Headers/Translator.h"
46#include "VLCInterface/Headers/Media.h"
47#include "VLCInterface/Headers/MetaManager.h"
48#include "VLCInterface/Headers/Instance.h"
49#include "VLCInterface/Headers/MediaPlayer.h"
50#include "VLCInterface/Headers/Video.h"
51#include "vlc/libvlc.h"
62#define THREADED_INIT = false;
187 VlcInstance* m_vlc_instance;
188 VlcMediaPlayer* m_media_player;
189 VlcMedia* m_vlc_media;
190#if NDEVR_USE_VLC_OPENGLRENDERER
191 VLCOpenGLRenderer* m_gl_renderer =
nullptr;
194 VlcWindow* m_video_window =
nullptr;
197 Time m_start_record_time;
198 uint04 m_connection_retry_count = 0;
Stores an angle in an optimized internal format with support for efficient trigonometric operations.
A thread that executes a user-provided callback function concurrently.
The equivelent of std::vector but with a bit more control.
A core class where all Design Objects including models, materials, and geometries are stored.
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
A light-weight base class for Log that allows processes to update, without the need for additional in...
Serves as the primary program interface for processes to report issues and allows any number of LogSt...
Factory for creating PhysicalCameraView instances and querying supported output formats.
virtual ConstPointer< Camera > camera() const override
Returns a read-only pointer to the Camera.
LogPtr log() const
Returns the current logger.
PhysicalCameraView()
Default constructor for subclass use only.
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
Class which can be used to write a subtitle in real time to a file, which can be played back alongsid...
Represents a timestamp with utilities for manipulation and conversion.
void createVLCInstance()
Creates and initializes the VLC instance.
bool startRecord(const File &file) override
Starts recording to the specified file.
virtual void refreshInstance() override
Refreshes the VLC instance and reconnects the media source.
VLCOutputMux
Output container (mux) formats supported by VLC.
@ MuxSize
Number of mux formats.
@ TS
MPEG Transport Stream.
void imageSaved(int id, const QString &fileName)
Callback invoked when an image has been saved to disk.
static OutputMux ConvertMux(const VLCOutputMux &mux)
Converts a VLCOutputMux to the generic OutputMux type.
virtual QImage grabFramebuffer() override
Captures the current video frame as a QImage.
virtual ~VLCCameraView()
Destroys the VLCCameraView and releases VLC resources.
bool finishRecord(File file) override
Finishes and finalizes the recording.
virtual void setCameraZoom(fltp08 zoom) override
Sets the camera zoom level.
void cleanup() override
Cleans up VLC resources and stops playback.
VLCCameraView()
Constructs a VLCCameraView with default settings.
virtual Angle< fltp08 > cameraRotation() override
Returns the current camera rotation angle.
VLCOutputCodec
Video codecs supported by VLC output.
@ MPEG2Video
MPEG-2 video codec.
@ H264
H.264 / AVC video codec.
@ Theora
Theora video codec.
@ MPEG4Video
MPEG-4 video codec.
@ CodecSize
Number of codec formats.
static VLCOutputMux ConvertMux(const OutputMux &mux)
Converts a generic OutputMux to the VLCOutputMux type.
virtual void invertScreenColors(bool invert) override
Inverts the screen colors for the video display.
static VLCOutputCodec ConvertCodec(const OutputCodec &codec)
Converts a generic OutputCodec to the VLCOutputCodec type.
bool event(QEvent *event) override
Handles Qt events for this widget.
VLCCameraView(const DynamicPointer< Camera > &camera, InfoPipe *log, QWidget *parent=nullptr)
Constructs a VLCCameraView for a specific camera.
Buffer< StringView > vlcArgs()
Builds the VLC initialization argument list.
void updateCameraOrientationSubtitle()
Updates the subtitle overlay with the current camera orientation.
virtual bool takeImage(const File &file) override
Takes a still image and saves it to the specified file.
virtual void setCameraRotation(Angle< fltp08 > rotation) override
Sets the camera rotation angle.
virtual bool setCameraSource(const StringView &connection_id) override
Sets the camera source connection string.
static OutputCodec ConvertCodec(const VLCOutputCodec &codec)
Converts a VLCOutputCodec to the generic OutputCodec type.
void addSubtitle(const String &subtitle)
Adds a subtitle text entry to the subtitle writer.
virtual void setRecordingState(RecordingState recording_state) override
Sets the recording state of this camera view.
Factory for creating VLCCameraView instances.
virtual void resetToDefaults() override
Resets factory settings to their defaults.
virtual CameraView * createView(const DynamicPointer< Camera > &camera, DesignObjectLookup *model_manager, QWidget *parent=nullptr) override
Creates a camera view for the given camera.
virtual bool canCreateView(const DynamicPointer< Camera > &camera, DesignObjectLookup *model_manager, bool ignore_active) override
Checks whether a camera view can be created for the given camera.
virtual Buffer< PhysicalCameraView::OutputCodec > supportedOutputCodecs() override
Returns the list of video codecs supported by VLC output.
virtual Buffer< PhysicalCameraView::OutputMux > supportedOutputMuxes() override
Returns the list of container formats supported by VLC output.
The primary namespace for the NDEVR SDK.
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
double fltp08
Defines an alias representing an 8 byte floating-point number.
Describes a video output codec with an identifier and display name.
Describes a video output muxer/container format with an identifier and display name.