2#if NDEVR_SUPPORTS_QMEDIA_PLAYER
3#include <NDEVR/PhysicalCameraView.h>
6#include <QVideoEncoderSettings>
9 class QTMediaCameraView :
public PhysicalCameraView
11 QTMediaCameraView(DynamicPointer<Camera>& camera, QWidget* parent)
12 : PhysicalCameraView(camera, parent)
13 , m_media_player(nullptr)
14 , m_video_widget(nullptr)
16 m_media_player =
new QMediaPlayer(
this, QMediaPlayer::StreamPlayback);
17 m_video_widget =
new QVideoWidget();
18 connect(m_media_player, SIGNAL(error(QMediaPlayer::Error)),
this, SLOT(vlcError()));
19 uint04 insert_location = ui->stacked_widget->indexOf(ui->view_panel);
20 ui->stacked_widget->insertWidget(insert_location, m_video_widget);
21 ui->stacked_widget->removeWidget(ui->view_panel);
22 m_media_player->setVideoOutput(m_video_widget);
23 String connection_id = m_camera->getProperty<String>(DesignObject::e_file);
24 if (connection_id.size() > 0)
25 setCameraSource(connection_id);
27 bool setCameraSource(
const String& connection_id)
override
29 m_media_player->setMedia(QUrl(connection_id.c_str()));
31 m_media_player->play();
35 void handleError()
override
39 String error(m_media_player->errorString());
42 QTErrorDialog::CreateErrorDialog(Exception(
"Video Error", error));
46 QMediaPlayer* m_media_player;
47 QVideoWidget* m_video_widget;
uint32_t uint04
-Defines an alias representing a 4 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:96