NDEVR
API Documentation
VLCOpenGLRenderer.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Widgets
28File: VLCOpenGLRenderer.h
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#pragma once
35#include "Base/Headers/Angle.h"
36#include "VideoDelegate.h"
37#include "YUVVideoFrame.h"
38#include <QOpenGLWindow>
39#include <QOpenGLFunctions>
40#include <QScopedPointer>
41#include <QException>
42#include <QColor>
43class VlcVideoStream;
44class VlcMediaPlayer;
45namespace NDEVR
46{
47 class NDEVRVideoStream;
48 class Time;
49 class File;
56 class VLCOpenGLRenderer : public QOpenGLWindow, public QOpenGLFunctions, public VlcVideoDelegate
57 {
58 Q_OBJECT
59 public:
61 explicit VLCOpenGLRenderer();
63 ~VLCOpenGLRenderer();
64
67 void DisplayVideoFrame(const std::shared_ptr<const VlcAbstractVideoFrame>& data);
68 //VlcVideoStream* videoStream();
71 Time lastFrameTime() const;
74 QSize streamSize() const;
77 void setMediaPlayer(VlcMediaPlayer* player);
78 //QSize sizeHint() const override;
79 //int heightForWidth(int w) const override;
81 void updateFrameTime();
84 void setBackgroundColor(QColor color);
87 QImage image();
91 bool event(QEvent* event);
94 virtual void setCameraRotation(Angle<sint04> rotation);
97 virtual Angle<sint04> cameraRotation() { return m_rotation; }
98
101 virtual void setCameraZoom(fltp04 zoom);
104 virtual fltp04 cameraZoom() { return m_zoom; }
105
108 WId request() override;
109
111 void release() override;
112
113 signals:
116 void vlcCapturedEvent(QEvent* event);
117 protected:
119 void initializeGL() override;
123 void resizeGL(int w, int h) override;
125 void paintGL() override;
126 private slots:
127 void applyPreviousSettings();
128 private:
129 struct OpenGLDisplayImpl;
130 std::shared_ptr<const VlcAbstractVideoFrame> frame;
131
132
133 QScopedPointer<OpenGLDisplayImpl> impl;
134 NDEVRVideoStream* m_video_stream = nullptr;
135 VlcMediaPlayer* m_player = nullptr;
136 Angle<sint04> m_rotation;
137 fltp04 m_zoom;
138 QColor m_background_color;
139 bool m_is_initialized = false;
140 };
142 class OpenGlException : public QException
143 {
144 public:
146 void raise() const { throw* this; }
149 OpenGlException* clone() const { return new OpenGlException(*this); }
150 };
151}
DLL export macros and version definitions for the VLCInterface module.
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
Definition File.h:53
Represents a timestamp with utilities for manipulation and conversion.
Definition Time.h:62
The primary namespace for the NDEVR SDK.
float fltp04
Defines an alias representing a 4 byte floating-point number Bit layout is as follows: -Sign: 1 bit a...