VR-Engage  2.2
Loading...
Searching...
No Matches
vreVideoStream.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2025 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6//! \file vreVideoStream.h
7//! \brief Defines custom video stream handling for VR-Engage
8//!
9//! This file contains the DtVreVideoStream class which extends the base
10//! DtVideoStream class to fix issues related to channel destruction and video
11//! stream stopping. It also provides a creator class for instantiating these
12//! customized video streams.
13
14#pragma once
15
17
18#include <vrvVideoStream/DtVideoStream.h>
19
20namespace makVrv
21{
22//! \brief Forward declaration of the display engine class
23class DtDe;
24
25//! \brief Forward declaration of the channel class
26class DtChannel;
27
28//! \brief Forward declaration of the channel manager class
29class DtChannelManager;
30
31//! \brief Forward declaration of the video stream manager class
32class DtVideoStreamManager;
33
34//! \brief Forward declaration of the Unicode string class
35class DtUnicode;
36} // namespace makVrv
37
38namespace makVre
39{
40//! \brief Custom video stream implementation for VR-Engage
41//!
42//! DtVreVideoStream extends the base DtVideoStream class to fix a bug where
43//! closing any channel would break the stopping of video streams. This class
44//! overrides the channel destruction handling to ensure that video streams
45//! are properly stopped only when their associated channel is destroyed,
46//! not when any arbitrary channel is destroyed.
47class PLAYERSTATION_DLL DtVreVideoStream : public makVrv::DtVideoStream
48{
49public:
50 //! \brief Friend declaration for creator class
51 //!
52 //! Only DtVreVideoStreamCreator can construct a DtVideoStream.
54
55 //! \brief Friend declaration for manager class
56 //!
57 //! Only DtVideoStreamManager can save a videoStream.
59
60 //! \brief Destructor
61 //!
62 //! Cleans up resources used by the video stream.
63 virtual ~DtVreVideoStream() override;
64
65protected:
66 //! \brief Protected constructor
67 //! \param de Reference to the display engine
68 //! \param mgr Reference to the video stream manager
69 //! \param className Class name of the video stream
70 //! \param instanceName Unique instance name for this video stream
71 //!
72 //! Creates a new video stream with the specified parameters. This constructor
73 //! is protected and can only be called by the friend DtVreVideoStreamCreator class.
74 //! The instance name must be unique among all video streams.
75 DtVreVideoStream(makVrv::DtDe& de, makVrv::DtVideoStreamManager& mgr, const makVrv::DtUnicode& className,
76 const makVrv::DtUnicode& instanceName);
77
78 //! \brief Channel destruction handler
79 //! \param mgr Pointer to the channel manager
80 //! \param channel Pointer to the channel being destroyed
81 //!
82 //! Overridden from the base class to fix a bug where closing any channel
83 //! would break video stream stopping. This implementation checks that the
84 //! channel being destroyed is actually the one associated with this video
85 //! stream before taking action.
86 virtual void slot_channelToBeDestroyed(makVrv::DtChannelManager* mgr, makVrv::DtChannel* channel) override;
87
88private:
89 //! \brief Default constructor (deleted)
90 //!
91 //! Default construction is not supported for this class.
93
94 //! \brief Copy constructor (deleted)
95 //!
96 //! Copy construction is not supported for this class.
98
99 //! \brief Assignment operator (deleted)
100 //!
101 //! Assignment is not supported for this class.
103};
104
105//! \brief Creator class for VR-Engage video streams
106//!
107//! DtVreVideoStreamCreator is responsible for creating instances of
108//! DtVreVideoStream. It follows the factory pattern, providing a standard
109//! way to instantiate video streams with the correct configuration.
110class PLAYERSTATION_DLL DtVreVideoStreamCreator : public makVrv::DtVideoStreamCreator
111{
112public:
113 //! \brief Friend declaration for manager class
114 //!
115 //! Only DtVreVideoStreamManager can call the create method.
117
118 //! \brief Constructor
119 //!
120 //! Creates a new video stream creator.
122
123 //! \brief Destructor
124 //!
125 //! Cleans up resources used by the video stream creator.
126 virtual ~DtVreVideoStreamCreator() override;
127
128protected:
129 //! \brief Creates a new video stream instance
130 //! \param de Reference to the display engine
131 //! \param mgr Reference to the video stream manager
132 //! \param className Class name of the video stream
133 //! \param instanceName Unique instance name for this video stream
134 //! \return Pointer to the newly created video stream
135 //!
136 //! Factory method that creates a new DtVreVideoStream instance with
137 //! the specified parameters. This method is protected and can only be
138 //! called by the friend DtVreVideoStreamManager class.
139 virtual makVrv::DtVideoStream* create(makVrv::DtDe& de,
140 makVrv::DtVideoStreamManager& mgr,
141 const makVrv::DtUnicode& className,
142 const makVrv::DtUnicode& instanceName) const override;
143};
144} // namespace makVre
virtual ~DtVreVideoStreamCreator() override
Destructor.
virtual makVrv::DtVideoStream * create(makVrv::DtDe &de, makVrv::DtVideoStreamManager &mgr, const makVrv::DtUnicode &className, const makVrv::DtUnicode &instanceName) const override
Creates a new video stream instance.
friend class DtVreVideoStreamManager
Friend declaration for manager class.
Definition vreVideoStream.h:116
friend class DtVideoStreamManager
Friend declaration for manager class.
Definition vreVideoStream.h:58
friend class DtVreVideoStreamCreator
Friend declaration for creator class.
Definition vreVideoStream.h:53
virtual ~DtVreVideoStream() override
Destructor.
DtVreVideoStream & operator=(const DtVreVideoStream &rhs)
Assignment operator (deleted)
virtual void slot_channelToBeDestroyed(makVrv::DtChannelManager *mgr, makVrv::DtChannel *channel) override
Channel destruction handler.
DtVreVideoStream(const DtVreVideoStream &rhs)
Copy constructor (deleted)
DtVreVideoStream(makVrv::DtDe &de, makVrv::DtVideoStreamManager &mgr, const makVrv::DtUnicode &className, const makVrv::DtUnicode &instanceName)
Protected constructor.
DtVreVideoStream()
Default constructor (deleted)
Defines export macros for the VR-Engage Player Station library.
#define PLAYERSTATION_DLL
Definition export.h:24
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
Definition appLauncherComponent.h:28
makVrv::DtDe * de()
Gets the display element pointer used by the plugin.