mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 15:23:28 +00:00
Added function and editor module for handling the video stream paramethers
This commit is contained in:
@@ -4,6 +4,9 @@ class CfgFunctions {
|
|||||||
class init {
|
class init {
|
||||||
file = "\armatak\armatak\armatak_main\functions\fn_init.sqf";
|
file = "\armatak\armatak\armatak_main\functions\fn_init.sqf";
|
||||||
};
|
};
|
||||||
|
class video_init {
|
||||||
|
file = "\armatak\armatak\armatak_main\functions\fn_video_init.sqf";
|
||||||
|
};
|
||||||
class log_message {
|
class log_message {
|
||||||
file = "\armatak\armatak\armatak_main\functions\fn_log_message.sqf";
|
file = "\armatak\armatak\armatak_main\functions\fn_log_message.sqf";
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -49,9 +49,6 @@ class CfgVehicles {
|
|||||||
};
|
};
|
||||||
|
|
||||||
class Attributes: AttributesBase {
|
class Attributes: AttributesBase {
|
||||||
class Units: Units {
|
|
||||||
property = "armatak_module_attached_units";
|
|
||||||
};
|
|
||||||
class armatak_module_tak_server_instance_address: Edit {
|
class armatak_module_tak_server_instance_address: Edit {
|
||||||
property = "armatak_module_tak_server_instance_address";
|
property = "armatak_module_tak_server_instance_address";
|
||||||
displayname = "TAK Server Address";
|
displayname = "TAK Server Address";
|
||||||
@@ -69,6 +66,85 @@ class CfgVehicles {
|
|||||||
class ModuleDescription: ModuleDescription {};
|
class ModuleDescription: ModuleDescription {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class ModuleDescription: ModuleDescription {
|
||||||
|
description = "Generate the initial ARMATAK configuration, syncronizing all players to the TAK server instance";
|
||||||
|
sync[] = {"LocationArea_F"};
|
||||||
|
|
||||||
|
class LocationArea_F {
|
||||||
|
description[] = {
|
||||||
|
"First line",
|
||||||
|
"Second line"
|
||||||
|
};
|
||||||
|
position = 1;
|
||||||
|
direction = 1;
|
||||||
|
optional = 1;
|
||||||
|
duplicate = 1;
|
||||||
|
synced[] = { "BluforUnit", "AnyBrain" };
|
||||||
|
};
|
||||||
|
class BluforUnit
|
||||||
|
{
|
||||||
|
description = "Short description";
|
||||||
|
displayName = "Any BLUFOR unit";
|
||||||
|
icon = "iconMan";
|
||||||
|
side = 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class armatak_module_video_stream_core: armatak_module_core {
|
||||||
|
scope = 2;
|
||||||
|
displayname = "ARMATAK MediaMTX Video Feed Parser";
|
||||||
|
icon = "\a3\Modules_F_Curator\Data\iconcuratorsetcamera_ca.paa";
|
||||||
|
category = "armatak_module_category";
|
||||||
|
function = "armatak_fnc_video_init";
|
||||||
|
functionPriority = 1;
|
||||||
|
isGlobal = 0;
|
||||||
|
isTriggerActivated = 0;
|
||||||
|
isDisposable = 1;
|
||||||
|
is3den = 0;
|
||||||
|
curatorCanAttach = 0;
|
||||||
|
curatorInfoType = "RscDisplayAttributeModuleNuke";
|
||||||
|
|
||||||
|
canSetArea = 0;
|
||||||
|
canSetAreaShape = 0;
|
||||||
|
canSetAreaHeight = 0;
|
||||||
|
|
||||||
|
class AttributesValues {
|
||||||
|
size3[] = { 1, 1, -1 };
|
||||||
|
isRectangle = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
class Attributes: AttributesBase {
|
||||||
|
class armatak_module_mediamtx_video_stream_instance_address: Edit {
|
||||||
|
property = "armatak_module_mediamtx_video_stream_instance_address";
|
||||||
|
displayname = "MediaMTX Provider Address";
|
||||||
|
tooltip = "MediaMTX Provider Instance Address";
|
||||||
|
typeName = "STRING";
|
||||||
|
defaultValue = "localhost";
|
||||||
|
};
|
||||||
|
class armatak_module_mediamtx_video_stream_instance_port: Edit {
|
||||||
|
property = "armatak_module_mediamtx_video_stream_instance_port";
|
||||||
|
displayname = "MediaMTX Provider Port";
|
||||||
|
tooltip = "MediaMTX Provider Port for handling video streams";
|
||||||
|
typeName = "STRING";
|
||||||
|
defaultValue = "8554";
|
||||||
|
};
|
||||||
|
class armatak_module_mediamtx_video_stream_instance_auth_user: Edit {
|
||||||
|
property = "armatak_module_mediamtx_video_stream_instance_auth_user";
|
||||||
|
displayname = "MediaMTX Provider Username";
|
||||||
|
tooltip = "MediaMTX Provider Instance Username";
|
||||||
|
typeName = "STRING";
|
||||||
|
defaultValue = "administrator";
|
||||||
|
};
|
||||||
|
class armatak_module_mediamtx_video_stream_instance_auth_pass: Edit {
|
||||||
|
property = "armatak_module_mediamtx_video_stream_instance_auth_pass";
|
||||||
|
displayname = "MediaMTX Provider Password";
|
||||||
|
tooltip = "MediaMTX Provider Instance Password";
|
||||||
|
typeName = "STRING";
|
||||||
|
defaultValue = "password";
|
||||||
|
};
|
||||||
|
class ModuleDescription: ModuleDescription {};
|
||||||
|
};
|
||||||
|
|
||||||
class ModuleDescription: ModuleDescription {
|
class ModuleDescription: ModuleDescription {
|
||||||
description = "Generate the initial ARMATAK configuration, syncronizing all players to the TAK server instance";
|
description = "Generate the initial ARMATAK configuration, syncronizing all players to the TAK server instance";
|
||||||
sync[] = {"LocationArea_F"};
|
sync[] = {"LocationArea_F"};
|
||||||
|
|||||||
73
addons/main/functions/fn_video_init.sqf
Normal file
73
addons/main/functions/fn_video_init.sqf
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
params [
|
||||||
|
["_logic", objNull, [objNull]],
|
||||||
|
["_units", [], [[]]],
|
||||||
|
["_activated", true, [true]]
|
||||||
|
];
|
||||||
|
|
||||||
|
if (isServer) exitWith {
|
||||||
|
armatak_module_mediamtx_video_stream_instance_address = _logic getVariable "armatak_module_mediamtx_video_stream_instance_address";
|
||||||
|
armatak_module_mediamtx_video_stream_instance_port = _logic getVariable "armatak_module_mediamtx_video_stream_instance_port";
|
||||||
|
armatak_module_mediamtx_video_stream_instance_auth_user = _logic getVariable "armatak_module_mediamtx_video_stream_instance_auth_user";
|
||||||
|
armatak_module_mediamtx_video_stream_instance_auth_pass = _logic getVariable "armatak_module_mediamtx_video_stream_instance_auth_pass";
|
||||||
|
|
||||||
|
missionNamespace setVariable ["armatak_mediamtx_video_stream_instance_address", armatak_module_mediamtx_video_stream_instance_address];
|
||||||
|
missionNamespace setVariable ["armatak_mediamtx_video_stream_instance_port", armatak_module_mediamtx_video_stream_instance_port];
|
||||||
|
missionNamespace setVariable ["armatak_mediamtx_video_stream_instance_auth_user", armatak_module_mediamtx_video_stream_instance_auth_user];
|
||||||
|
missionNamespace setVariable ["armatak_mediamtx_video_stream_instance_auth_pass", armatak_module_mediamtx_video_stream_instance_auth_pass];
|
||||||
|
|
||||||
|
_startAction = [
|
||||||
|
"ArmatakStartStream",
|
||||||
|
"Start Video Feed",
|
||||||
|
"",
|
||||||
|
{
|
||||||
|
_uuid = (_this select 0) call armatak_fnc_extract_uuid;
|
||||||
|
|
||||||
|
armatak_mediamtx_video_stream_instance_address = missionNamespace getVariable "armatak_mediamtx_video_stream_instance_address";
|
||||||
|
armatak_mediamtx_video_stream_instance_port = missionNamespace getVariable "armatak_mediamtx_video_stream_instance_port";
|
||||||
|
armatak_mediamtx_video_stream_instance_auth_user = missionNamespace getVariable "armatak_mediamtx_video_stream_instance_auth_user";
|
||||||
|
armatak_mediamtx_video_stream_instance_auth_pass = missionNamespace getVariable "armatak_mediamtx_video_stream_instance_auth_pass";
|
||||||
|
|
||||||
|
"armatak" callExtension ["video_stream:start", [armatak_mediamtx_video_stream_instance_address, armatak_mediamtx_video_stream_instance_port, _uuid, armatak_mediamtx_video_stream_instance_auth_user, armatak_mediamtx_video_stream_instance_auth_pass]];
|
||||||
|
(_this select 0) setVariable ["armatak_video_feed_is_streaming", true];
|
||||||
|
},
|
||||||
|
{
|
||||||
|
(_this select 0) getVariable "armatak_video_feed_is_streaming" == false
|
||||||
|
}
|
||||||
|
] call ace_interact_menu_fnc_createAction;
|
||||||
|
[
|
||||||
|
"Man",
|
||||||
|
1,
|
||||||
|
["ACE_SelfActions"],
|
||||||
|
_startAction,
|
||||||
|
true
|
||||||
|
] call ace_interact_menu_fnc_addActionToClass;
|
||||||
|
|
||||||
|
_stopAction = [
|
||||||
|
"ArmatakStopStream",
|
||||||
|
"Stop Video Feed",
|
||||||
|
"",
|
||||||
|
{
|
||||||
|
"armatak" callExtension ["video_stream:stop", []];
|
||||||
|
(_this select 0) setVariable ["armatak_video_feed_is_streaming", false];
|
||||||
|
},
|
||||||
|
{
|
||||||
|
(_this select 0) getVariable "armatak_video_feed_is_streaming"
|
||||||
|
}
|
||||||
|
] call ace_interact_menu_fnc_createAction;
|
||||||
|
[
|
||||||
|
"Man",
|
||||||
|
1,
|
||||||
|
["ACE_SelfActions"],
|
||||||
|
_stopAction,
|
||||||
|
true
|
||||||
|
] call ace_interact_menu_fnc_addActionToClass;
|
||||||
|
if (isMultiplayer) then {
|
||||||
|
{
|
||||||
|
_x setVariable ["armatak_video_feed_is_streaming", false];
|
||||||
|
} forEach playableUnits;
|
||||||
|
} else {
|
||||||
|
player setVariable ["armatak_video_feed_is_streaming", false];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
true;
|
||||||
Reference in New Issue
Block a user