Skip to content

Commit c19860b

Browse files
Added Video Stream support
1 parent faad88b commit c19860b

35 files changed

Lines changed: 1866 additions & 35 deletions

ACT/LibMC.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,7 @@
755755
</enum>
756756

757757
<enum name="StreamConnectionType">
758+
<option name="Unknown" value="0"/>
758759
<option name="JSONEventStream" value="1"/>
759760
<option name="JPEGImageStream" value="2"/>
760761
</enum>

ACT/LibMCEnv.xml

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,13 @@
293293
<error name="NOCONFIGURATIONVERSIONFOUND" code="10253" description="No configuration version found." />
294294
<error name="NOCONFIGURATIONVERSIONACTIVE" code="10254" description="No configuration version active." />
295295
<error name="TELEMETRYCHANNELNOTFOUND" code="10255" description="Telemetry channel not found." />
296+
<error name="VIDEOSTREAMNOTFOUND" code="10256" description="Video stream not found." />
297+
<error name="INVALIDVIDEOSTREAMWIDTH" code="10257" description="Invalid video stream width." />
298+
<error name="INVALIDVIDEOSTREAMHEIGHT" code="10258" description="Invalid video stream height." />
299+
<error name="INVALIDFRAMEDURATION" code="10259" description="Invalid frame duration." />
300+
<error name="INVALIDPAUSETOLERANCE" code="10260" description="Invalid pause tolerance." />
301+
<error name="INVALIDFRAMECACHEDURATION" code="10261" description="Invalid frame cache duration." />
302+
<error name="VIDEOSTREAMFRAMEENCODINGERROR" code="10262" description="Video stream frame encoding error." />
296303

297304

298305
</errors>
@@ -4114,7 +4121,21 @@
41144121
<method name="CreateImageLoader" description="creates an image loader object.">
41154122
<param name="ImageLoaderInstance" type="class" class="ImageLoader" pass="return" description="Image loader instance." />
41164123
</method>
4117-
4124+
4125+
<method name="CreateVideoStream" description="creates a video stream object for MJPEG streaming.">
4126+
<param name="PixelSizeX" type="uint32" pass="in" description="Width of the video stream in pixels. MUST be positive." />
4127+
<param name="PixelSizeY" type="uint32" pass="in" description="Height of the video stream in pixels. MUST be positive." />
4128+
<param name="DesiredFrameDurationInMicroseconds" type="uint32" pass="in" description="Duration of a frame in microseconds. MUST be between 10000 and 60000000." />
4129+
<param name="PauseToleranceInMicroseconds" type="uint32" pass="in" description="How many microseconds can pass without new frames until the stream becomes inactive. MUST exceed frame duration." />
4130+
<param name="FrameCacheDurationInMicroseconds" type="uint32" pass="in" description="How long frames will be cached. MUST not be smaller than DesiredFrameDuration or exceed 100 times DesiredFrameDuration." />
4131+
<param name="VideoStreamInstance" type="class" class="VideoStream" pass="return" description="Video stream instance." />
4132+
</method>
4133+
4134+
<method name="FindVideoStream" description="Finds a video stream by UUID. Returns null if the stream does not exist.">
4135+
<param name="StreamUUID" type="string" pass="in" description="UUID of the video stream to find." />
4136+
<param name="VideoStreamInstance" type="optionalclass" class="VideoStream" pass="return" description="Video stream instance, or null if not found." />
4137+
</method>
4138+
41184139
<method name="CreateDiscreteField2D" description="Creates an empty discrete field.">
41194140
<param name="PixelCountX" type="uint32" pass="in" description="Pixel count in X. MUST be positive." />
41204141
<param name="PixelCountY" type="uint32" pass="in" description="Pixel count in Y. MUST be positive." />
@@ -5491,6 +5512,20 @@
54915512
<param name="ImageLoaderInstance" type="class" class="ImageLoader" pass="return" description="Image loader instance." />
54925513
</method>
54935514

5515+
<method name="CreateVideoStream" description="creates a video stream object for MJPEG streaming.">
5516+
<param name="PixelSizeX" type="uint32" pass="in" description="Width of the video stream in pixels. MUST be positive." />
5517+
<param name="PixelSizeY" type="uint32" pass="in" description="Height of the video stream in pixels. MUST be positive." />
5518+
<param name="DesiredFrameDurationInMicroseconds" type="uint32" pass="in" description="Duration of a frame in microseconds. MUST be between 10000 and 60000000." />
5519+
<param name="PauseToleranceInMicroseconds" type="uint32" pass="in" description="How many microseconds can pass without new frames until the stream becomes inactive. MUST exceed frame duration." />
5520+
<param name="FrameCacheDurationInMicroseconds" type="uint32" pass="in" description="How long frames will be cached. MUST not be smaller than DesiredFrameDuration or exceed 100 times DesiredFrameDuration." />
5521+
<param name="VideoStreamInstance" type="class" class="VideoStream" pass="return" description="Video stream instance." />
5522+
</method>
5523+
5524+
<method name="FindVideoStream" description="Finds a video stream by UUID. Returns null if the stream does not exist.">
5525+
<param name="StreamUUID" type="string" pass="in" description="UUID of the video stream to find." />
5526+
<param name="VideoStreamInstance" type="optionalclass" class="VideoStream" pass="return" description="Video stream instance, or null if not found." />
5527+
</method>
5528+
54945529
<method name="CreateMachineConfigurationHandler" description="creates a machine configuration handler, dealing with all persistent machine settings that the user will store in the local database.">
54955530
<param name="MachineConfigurationHandlerInstance" type="class" class="MachineConfigurationHandler" pass="return" description="MachineConfigurationHandler instance." />
54965531
</method>
@@ -5926,6 +5961,20 @@
59265961
<param name="ImageLoaderInstance" type="class" class="ImageLoader" pass="return" description="Image loader instance." />
59275962
</method>
59285963

5964+
<method name="CreateVideoStream" description="creates a video stream object for MJPEG streaming.">
5965+
<param name="PixelSizeX" type="uint32" pass="in" description="Width of the video stream in pixels. MUST be positive." />
5966+
<param name="PixelSizeY" type="uint32" pass="in" description="Height of the video stream in pixels. MUST be positive." />
5967+
<param name="DesiredFrameDurationInMicroseconds" type="uint32" pass="in" description="Duration of a frame in microseconds. MUST be between 10000 and 60000000." />
5968+
<param name="PauseToleranceInMicroseconds" type="uint32" pass="in" description="How many microseconds can pass without new frames until the stream becomes inactive. MUST exceed frame duration." />
5969+
<param name="FrameCacheDurationInMicroseconds" type="uint32" pass="in" description="How long frames will be cached. MUST not be smaller than DesiredFrameDuration or exceed 100 times DesiredFrameDuration." />
5970+
<param name="VideoStreamInstance" type="class" class="VideoStream" pass="return" description="Video stream instance." />
5971+
</method>
5972+
5973+
<method name="FindVideoStream" description="Finds a video stream by UUID. Returns null if the stream does not exist.">
5974+
<param name="StreamUUID" type="string" pass="in" description="UUID of the video stream to find." />
5975+
<param name="VideoStreamInstance" type="optionalclass" class="VideoStream" pass="return" description="Video stream instance, or null if not found." />
5976+
</method>
5977+
59295978
<method name="GetGlobalTimerInMilliseconds" description="Returns the global timer in milliseconds.">
59305979
<param name="TimerValue" type="uint64" pass="return" description="Timer value in Milliseconds" />
59315980
</method>

Framework/HeadersCore/CppDynamic/libmc_types.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1392,6 +1392,7 @@ namespace LibMC {
13921392
};
13931393

13941394
enum class eStreamConnectionType : LibMC_int32 {
1395+
Unknown = 0,
13951396
JSONEventStream = 1,
13961397
JPEGImageStream = 2
13971398
};

Framework/HeadersDev/CppDynamic/libmcenv_dynamic.h

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7282,6 +7282,30 @@ typedef LibMCEnvResult (*PLibMCEnvDriverEnvironment_CreateEmptyImagePtr) (LibMCE
72827282
*/
72837283
typedef LibMCEnvResult (*PLibMCEnvDriverEnvironment_CreateImageLoaderPtr) (LibMCEnv_DriverEnvironment pDriverEnvironment, LibMCEnv_ImageLoader * pImageLoaderInstance);
72847284

7285+
/**
7286+
* creates a video stream object for MJPEG streaming.
7287+
*
7288+
* @param[in] pDriverEnvironment - DriverEnvironment instance.
7289+
* @param[in] nPixelSizeX - Width of the video stream in pixels. MUST be positive.
7290+
* @param[in] nPixelSizeY - Height of the video stream in pixels. MUST be positive.
7291+
* @param[in] nDesiredFrameDurationInMicroseconds - Duration of a frame in microseconds. MUST be between 10000 and 60000000.
7292+
* @param[in] nPauseToleranceInMicroseconds - How many microseconds can pass without new frames until the stream becomes inactive. MUST exceed frame duration.
7293+
* @param[in] nFrameCacheDurationInMicroseconds - How long frames will be cached. MUST not be smaller than DesiredFrameDuration or exceed 100 times DesiredFrameDuration.
7294+
* @param[out] pVideoStreamInstance - Video stream instance.
7295+
* @return error code or 0 (success)
7296+
*/
7297+
typedef LibMCEnvResult (*PLibMCEnvDriverEnvironment_CreateVideoStreamPtr) (LibMCEnv_DriverEnvironment pDriverEnvironment, LibMCEnv_uint32 nPixelSizeX, LibMCEnv_uint32 nPixelSizeY, LibMCEnv_uint32 nDesiredFrameDurationInMicroseconds, LibMCEnv_uint32 nPauseToleranceInMicroseconds, LibMCEnv_uint32 nFrameCacheDurationInMicroseconds, LibMCEnv_VideoStream * pVideoStreamInstance);
7298+
7299+
/**
7300+
* Finds a video stream by UUID. Returns null if the stream does not exist.
7301+
*
7302+
* @param[in] pDriverEnvironment - DriverEnvironment instance.
7303+
* @param[in] pStreamUUID - UUID of the video stream to find.
7304+
* @param[out] pVideoStreamInstance - Video stream instance, or null if not found.
7305+
* @return error code or 0 (success)
7306+
*/
7307+
typedef LibMCEnvResult (*PLibMCEnvDriverEnvironment_FindVideoStreamPtr) (LibMCEnv_DriverEnvironment pDriverEnvironment, const char * pStreamUUID, LibMCEnv_VideoStream * pVideoStreamInstance);
7308+
72857309
/**
72867310
* Creates an empty discrete field.
72877311
*
@@ -10097,6 +10121,30 @@ typedef LibMCEnvResult (*PLibMCEnvStateEnvironment_CreateEmptyImagePtr) (LibMCEn
1009710121
*/
1009810122
typedef LibMCEnvResult (*PLibMCEnvStateEnvironment_CreateImageLoaderPtr) (LibMCEnv_StateEnvironment pStateEnvironment, LibMCEnv_ImageLoader * pImageLoaderInstance);
1009910123

10124+
/**
10125+
* creates a video stream object for MJPEG streaming.
10126+
*
10127+
* @param[in] pStateEnvironment - StateEnvironment instance.
10128+
* @param[in] nPixelSizeX - Width of the video stream in pixels. MUST be positive.
10129+
* @param[in] nPixelSizeY - Height of the video stream in pixels. MUST be positive.
10130+
* @param[in] nDesiredFrameDurationInMicroseconds - Duration of a frame in microseconds. MUST be between 10000 and 60000000.
10131+
* @param[in] nPauseToleranceInMicroseconds - How many microseconds can pass without new frames until the stream becomes inactive. MUST exceed frame duration.
10132+
* @param[in] nFrameCacheDurationInMicroseconds - How long frames will be cached. MUST not be smaller than DesiredFrameDuration or exceed 100 times DesiredFrameDuration.
10133+
* @param[out] pVideoStreamInstance - Video stream instance.
10134+
* @return error code or 0 (success)
10135+
*/
10136+
typedef LibMCEnvResult (*PLibMCEnvStateEnvironment_CreateVideoStreamPtr) (LibMCEnv_StateEnvironment pStateEnvironment, LibMCEnv_uint32 nPixelSizeX, LibMCEnv_uint32 nPixelSizeY, LibMCEnv_uint32 nDesiredFrameDurationInMicroseconds, LibMCEnv_uint32 nPauseToleranceInMicroseconds, LibMCEnv_uint32 nFrameCacheDurationInMicroseconds, LibMCEnv_VideoStream * pVideoStreamInstance);
10137+
10138+
/**
10139+
* Finds a video stream by UUID. Returns null if the stream does not exist.
10140+
*
10141+
* @param[in] pStateEnvironment - StateEnvironment instance.
10142+
* @param[in] pStreamUUID - UUID of the video stream to find.
10143+
* @param[out] pVideoStreamInstance - Video stream instance, or null if not found.
10144+
* @return error code or 0 (success)
10145+
*/
10146+
typedef LibMCEnvResult (*PLibMCEnvStateEnvironment_FindVideoStreamPtr) (LibMCEnv_StateEnvironment pStateEnvironment, const char * pStreamUUID, LibMCEnv_VideoStream * pVideoStreamInstance);
10147+
1010010148
/**
1010110149
* creates a machine configuration handler, dealing with all persistent machine settings that the user will store in the local database.
1010210150
*
@@ -10954,6 +11002,30 @@ typedef LibMCEnvResult (*PLibMCEnvUIEnvironment_CreateEmptyImagePtr) (LibMCEnv_U
1095411002
*/
1095511003
typedef LibMCEnvResult (*PLibMCEnvUIEnvironment_CreateImageLoaderPtr) (LibMCEnv_UIEnvironment pUIEnvironment, LibMCEnv_ImageLoader * pImageLoaderInstance);
1095611004

11005+
/**
11006+
* creates a video stream object for MJPEG streaming.
11007+
*
11008+
* @param[in] pUIEnvironment - UIEnvironment instance.
11009+
* @param[in] nPixelSizeX - Width of the video stream in pixels. MUST be positive.
11010+
* @param[in] nPixelSizeY - Height of the video stream in pixels. MUST be positive.
11011+
* @param[in] nDesiredFrameDurationInMicroseconds - Duration of a frame in microseconds. MUST be between 10000 and 60000000.
11012+
* @param[in] nPauseToleranceInMicroseconds - How many microseconds can pass without new frames until the stream becomes inactive. MUST exceed frame duration.
11013+
* @param[in] nFrameCacheDurationInMicroseconds - How long frames will be cached. MUST not be smaller than DesiredFrameDuration or exceed 100 times DesiredFrameDuration.
11014+
* @param[out] pVideoStreamInstance - Video stream instance.
11015+
* @return error code or 0 (success)
11016+
*/
11017+
typedef LibMCEnvResult (*PLibMCEnvUIEnvironment_CreateVideoStreamPtr) (LibMCEnv_UIEnvironment pUIEnvironment, LibMCEnv_uint32 nPixelSizeX, LibMCEnv_uint32 nPixelSizeY, LibMCEnv_uint32 nDesiredFrameDurationInMicroseconds, LibMCEnv_uint32 nPauseToleranceInMicroseconds, LibMCEnv_uint32 nFrameCacheDurationInMicroseconds, LibMCEnv_VideoStream * pVideoStreamInstance);
11018+
11019+
/**
11020+
* Finds a video stream by UUID. Returns null if the stream does not exist.
11021+
*
11022+
* @param[in] pUIEnvironment - UIEnvironment instance.
11023+
* @param[in] pStreamUUID - UUID of the video stream to find.
11024+
* @param[out] pVideoStreamInstance - Video stream instance, or null if not found.
11025+
* @return error code or 0 (success)
11026+
*/
11027+
typedef LibMCEnvResult (*PLibMCEnvUIEnvironment_FindVideoStreamPtr) (LibMCEnv_UIEnvironment pUIEnvironment, const char * pStreamUUID, LibMCEnv_VideoStream * pVideoStreamInstance);
11028+
1095711029
/**
1095811030
* Returns the global timer in milliseconds.
1095911031
*
@@ -12246,6 +12318,8 @@ typedef struct {
1224612318
PLibMCEnvDriverEnvironment_FindTelemetryChannelPtr m_DriverEnvironment_FindTelemetryChannel;
1224712319
PLibMCEnvDriverEnvironment_CreateEmptyImagePtr m_DriverEnvironment_CreateEmptyImage;
1224812320
PLibMCEnvDriverEnvironment_CreateImageLoaderPtr m_DriverEnvironment_CreateImageLoader;
12321+
PLibMCEnvDriverEnvironment_CreateVideoStreamPtr m_DriverEnvironment_CreateVideoStream;
12322+
PLibMCEnvDriverEnvironment_FindVideoStreamPtr m_DriverEnvironment_FindVideoStream;
1224912323
PLibMCEnvDriverEnvironment_CreateDiscreteField2DPtr m_DriverEnvironment_CreateDiscreteField2D;
1225012324
PLibMCEnvDriverEnvironment_CreateDiscreteField2DFromImagePtr m_DriverEnvironment_CreateDiscreteField2DFromImage;
1225112325
PLibMCEnvDriverEnvironment_HasBuildJobPtr m_DriverEnvironment_HasBuildJob;
@@ -12505,6 +12579,8 @@ typedef struct {
1250512579
PLibMCEnvStateEnvironment_LoadResourceStringPtr m_StateEnvironment_LoadResourceString;
1250612580
PLibMCEnvStateEnvironment_CreateEmptyImagePtr m_StateEnvironment_CreateEmptyImage;
1250712581
PLibMCEnvStateEnvironment_CreateImageLoaderPtr m_StateEnvironment_CreateImageLoader;
12582+
PLibMCEnvStateEnvironment_CreateVideoStreamPtr m_StateEnvironment_CreateVideoStream;
12583+
PLibMCEnvStateEnvironment_FindVideoStreamPtr m_StateEnvironment_FindVideoStream;
1250812584
PLibMCEnvStateEnvironment_CreateMachineConfigurationHandlerPtr m_StateEnvironment_CreateMachineConfigurationHandler;
1250912585
PLibMCEnvStateEnvironment_CreateDiscreteField2DPtr m_StateEnvironment_CreateDiscreteField2D;
1251012586
PLibMCEnvStateEnvironment_CreateDiscreteField2DFromImagePtr m_StateEnvironment_CreateDiscreteField2DFromImage;
@@ -12585,6 +12661,8 @@ typedef struct {
1258512661
PLibMCEnvUIEnvironment_SetUIPropertyAsBoolPtr m_UIEnvironment_SetUIPropertyAsBool;
1258612662
PLibMCEnvUIEnvironment_CreateEmptyImagePtr m_UIEnvironment_CreateEmptyImage;
1258712663
PLibMCEnvUIEnvironment_CreateImageLoaderPtr m_UIEnvironment_CreateImageLoader;
12664+
PLibMCEnvUIEnvironment_CreateVideoStreamPtr m_UIEnvironment_CreateVideoStream;
12665+
PLibMCEnvUIEnvironment_FindVideoStreamPtr m_UIEnvironment_FindVideoStream;
1258812666
PLibMCEnvUIEnvironment_GetGlobalTimerInMillisecondsPtr m_UIEnvironment_GetGlobalTimerInMilliseconds;
1258912667
PLibMCEnvUIEnvironment_GetGlobalTimerInMicrosecondsPtr m_UIEnvironment_GetGlobalTimerInMicroseconds;
1259012668
PLibMCEnvUIEnvironment_GetTestEnvironmentPtr m_UIEnvironment_GetTestEnvironment;

0 commit comments

Comments
 (0)