diff --git a/definitions/CMakeLists.txt b/definitions/CMakeLists.txt index d2a15c56..98be2070 100644 --- a/definitions/CMakeLists.txt +++ b/definitions/CMakeLists.txt @@ -35,6 +35,16 @@ set(WORKING_VARIABLE ${JSONRPC_PATTERNS}) list(TRANSFORM WORKING_VARIABLE PREPEND "${CMAKE_SOURCE_DIR}/jsonrpc/") file(GLOB JSON_FILE ${WORKING_VARIABLE}) +if(NOT ENABLE_LEGACY_INTERFACE_SUPPORT) + list(REMOVE_ITEM JSON_FILE + "${CMAKE_SOURCE_DIR}/jsonrpc/DeviceInfo.json" + "${CMAKE_SOURCE_DIR}/jsonrpc/Monitor.json" + "${CMAKE_SOURCE_DIR}/jsonrpc/OCDM.json" + "${CMAKE_SOURCE_DIR}/jsonrpc/SecurityAgent.json" + "${CMAKE_SOURCE_DIR}/jsonrpc/StateControl.json" + ) +endif() + separate_arguments(JSONRPC_PATTERNS) set(WORKING_VARIABLE ${JSONRPC_PATTERNS}) list(TRANSFORM WORKING_VARIABLE PREPEND "${CMAKE_SOURCE_DIR}/qa_jsonrpc/") diff --git a/definitions/Definitions.cpp b/definitions/Definitions.cpp index 8a7b9329..24cc8d2c 100644 --- a/definitions/Definitions.cpp +++ b/definitions/Definitions.cpp @@ -186,6 +186,7 @@ ENUM_CONVERSION_BEGIN(Exchange::IBrightness::Brightness) { Exchange::IBrightness::SdrToHdrGraphicsBrightness_Max, _TXT("max") }, ENUM_CONVERSION_END(Exchange::IBrightness::Brightness) +#if ENABLE_LEGACY_INTERFACE_SUPPORT ENUM_CONVERSION_BEGIN(Exchange::IDeviceAudioCapabilities::AudioOutput) { Exchange::IDeviceAudioCapabilities::AudioOutput::AUDIO_OTHER, _TXT("OTHER") }, { Exchange::IDeviceAudioCapabilities::AudioOutput::AUDIO_ANALOG, _TXT("ANALOG") }, @@ -264,6 +265,7 @@ ENUM_CONVERSION_BEGIN(Exchange::IDeviceVideoCapabilities::CopyProtection) { Exchange::IDeviceVideoCapabilities::CopyProtection::HDCP_21, _TXT("2.1") }, { Exchange::IDeviceVideoCapabilities::CopyProtection::HDCP_22, _TXT("2.2") }, ENUM_CONVERSION_END(Exchange::IDeviceVideoCapabilities::CopyProtection) +#endif ENUM_CONVERSION_BEGIN(Exchange::IValuePoint::basic) { Exchange::IValuePoint::basic::regulator, _TXT("regulator") }, diff --git a/interfaces/IBrowser.h b/interfaces/IBrowser.h index 895d6a70..983792dd 100644 --- a/interfaces/IBrowser.h +++ b/interfaces/IBrowser.h @@ -68,7 +68,15 @@ namespace Exchange { ONLY_FROM_MAIN_DOCUMENT_DOMAIN = 2 /* @text:onlyfrommaindocumentdomain */, EXCLUSIVELY_FROM_MAIN_DOCUMENT_DOMAIN = 3 /* @text:exclusivelyfrommaindocumentdomain */ }; - + + struct HeadersInfo { + string name /* @brief Header name */; + string value /* @brief Header value */; + }; + + using IHeadersIterator = RPC::IIteratorType; + using IStringIterator = RPC::IIteratorType; + // @event @uncompliant:extended // NOTE: extended format is deprecated!! Do not just copy this line! struct INotification : virtual public Core::IUnknown { enum { ID = ID_WEBKITBROWSER_NOTIFICATION }; @@ -90,8 +98,12 @@ namespace Exchange { virtual void VisibilityChange(const bool hidden) = 0; // @brief Notifies that the web page requests to close its window virtual void PageClosure() = 0; - /* @json:omit */ + // @brief A Base64 encoded JSON message from legacy $badger bridge + // @param message BridgeQuery string virtual void BridgeQuery(const string& message) = 0; + // @brief Signals a state change of the Browser + // @param suspended Suspended(true) or Resumed (false) + virtual void StateChange(const bool& suspended) = 0; }; virtual void Register(INotification* sink) = 0; @@ -149,6 +161,17 @@ namespace Exchange { // @brief Initiate garbage collection virtual uint32_t CollectGarbage() = 0; + // @brief Delete directory + // @param path: Path to be deleted + virtual uint32_t Delete(const string& path) = 0; + // @property + // @brief Languages: Browser prefered languages + virtual uint32_t Languages(IStringIterator*& languages /* @out */) const = 0; + virtual uint32_t Languages(IStringIterator* const languages) = 0; + // @property + // @brief Headers: Headers to send on all requests that the browser makes + virtual uint32_t Headers(IHeadersIterator*& headers /* @out */) const = 0; + virtual uint32_t Headers(IHeadersIterator* const headers) = 0; }; // @json 1.0.0 @uncompliant:extended diff --git a/interfaces/IContentDecryption.h b/interfaces/IContentDecryption.h index 2da91789..7f6fc845 100644 --- a/interfaces/IContentDecryption.h +++ b/interfaces/IContentDecryption.h @@ -46,7 +46,7 @@ namespace Exchange { /* @event */ struct EXTERNAL INotification : virtual public Core::IUnknown { - enum {ID = ID_CONTENTDECRYPTION_NOTIFICATION}; + enum { ID = ID_CONTENTDECRYPTION_NOTIFICATION }; /* @brief initialization status. */ virtual void initializationStatus(const std::string& drm, diff --git a/interfaces/IDeviceInfo.h b/interfaces/IDeviceInfo.h index 8410b80e..286dda8b 100644 --- a/interfaces/IDeviceInfo.h +++ b/interfaces/IDeviceInfo.h @@ -25,136 +25,271 @@ namespace Thunder { namespace Exchange { - + /* @json 1.0.0 */ struct EXTERNAL IDeviceInfo : virtual public Core::IUnknown { enum { ID = ID_DEVICE_INFO }; - virtual ~IDeviceInfo() override = default; + struct FirmwareInfo { + enum Yocto : uint8_t { + dunfell, + morty, + daisy, + kirkstone + }; + + string imageName /* @brief Name of firmware image */; + string sdk /* @brief SDK version string */; + string mediarite /* @brief Mediarite value */; + Yocto yocto /* @brief Yocto version */; + }; + struct Device { + string deviceType /* @brief Device type */; + string distributorId /* @brief Partner ID or distributor ID for device */; + string friendlyName /* @brief Friendly name */; + string make /* @brief Device manufacturer */; + string modelName /* @brief Model Name */; + uint16_t modelYear /* @brief Model Year */; + string platformName /* @brief Platform name */; + string serialNumber /* Device serial number */; + string sku /* Device model number or SKU */; + }; + struct System { + struct CPULoadAvgs { + uint64_t avg1min /* @brief 1min cpuload average */; + uint64_t avg5min /* @brief 5min cpuload average */; + uint64_t avg15min /* @brief 15min cpuload average */; + }; + string version /* @brief Software version (in form *version#hashtag*) */; + uint64_t uptime /* @brief System uptime (in seconds) */; + uint64_t totalRAM /* @brief Total installed system RAM memory (in bytes) */; + uint64_t freeRAM /* @brief Free system RAM memory (in bytes) */; + uint64_t totalSwap /* @brief Total swap space (in bytes) */; + uint64_t freeSwap /* @brief Swap space still available (in bytes) */; + string deviceName /* @brief Host name */; + string cpuLoad /* @brief Current CPU load (percentage) */; + CPULoadAvgs cpuLoadAvg /* @brief CPU load average */; + string serialNumber /* @brief Device serial number */; + string time /* @brief Current system date and time */; + }; + struct Socket { + uint32_t total /* @brief Number of total */; + uint32_t open /* @brief Number of open */; + uint32_t link /* @brief Number of link */; + uint32_t exception /* @brief Number of exception */; + uint32_t shutdown /* @brief Number of shutdown */; + uint32_t runs /* @brief Number of runs */; + }; + + struct Address { + string name /* @brief Interface name */; + string mac /* @brief Interface MAC address */; + string /* @opaque */ ip /* @brief An array of Interface IP address */; + }; + using IAddressIterator = RPC::IIteratorType; + + // @property + // @brief Retrieves Firware Information + virtual Core::hresult FirmwareVersion(FirmwareInfo& value /* @out */) const = 0; + // @property + // @brief Retrieves Device Info + virtual Core::hresult DeviceData(Device& value /* @out */) const = 0; + // @property + // @brief Retrieves SystemInfo + virtual Core::hresult SystemInfo(System& value /* @out */) const = 0; + // @property + // @brief Retrieves SocketInfo + virtual Core::hresult SocketInfo(Socket& value /* @out */) const = 0; - virtual uint32_t Configure(const PluginHost::IShell* service) = 0; + // @brief Retrieves AddressInfo + // @param addresses: An array of Interface address + virtual Core::hresult AddressInfo(IAddressIterator*& ip /* @out */) const = 0; - virtual uint32_t SerialNumber(string& value /* @out */) const = 0; - virtual uint32_t Sku(string& value /* @out */) const = 0; - virtual uint32_t Make(string& value /* @out */) const = 0; - virtual uint32_t ModelName(string& value/*@out*/) const = 0; - virtual uint32_t ModelYear(uint16_t& value/*@out*/) const = 0; - virtual uint32_t FriendlyName(string& value/*@out*/) const = 0; - virtual uint32_t DeviceType(string& value /* @out */) const = 0; - virtual uint32_t PlatformName(string& value/*@out*/) const = 0; - virtual uint32_t DistributorId(string& value /* @out */) const = 0; + /* @json:omit */ + virtual Core::hresult Configure(const PluginHost::IShell* service) = 0; + // @property + // @brief Retrieves Serial Number + virtual Core::hresult SerialNumber(string& value /* @out */) const = 0; + // @alt modelid + // @property + // @brief Retrieves ModelID/Sku + virtual Core::hresult Sku(string& value /* @out */) const = 0; + // @property + // @brief Retrieves Make + virtual Core::hresult Make(string& value /* @out */) const = 0; + // @property + // @brief Retrieves Model Name + virtual Core::hresult ModelName(string& value /*@out*/) const = 0; + // @property + // @brief Retrieves Model Year + virtual Core::hresult ModelYear(uint16_t& value /*@out*/) const = 0; + // @property + // @brief Retrieves Friendly Name + virtual Core::hresult FriendlyName(string& value /*@out*/) const = 0; + // @property + // @brief Retrieves Device Type + virtual Core::hresult DeviceType(string& value /* @out */) const = 0; + // @property + // @brief Retrieves Platform Name + virtual Core::hresult PlatformName(string& value /*@out*/) const = 0; + // @property + // @brief Retrieves Distributor Id + virtual Core::hresult DistributorId(string& value /* @out */) const = 0; }; + /* @json 1.0.0 */ struct EXTERNAL IDeviceAudioCapabilities : virtual public Core::IUnknown { enum { ID = ID_DEVICE_CAPABILITIES_AUDIO }; virtual ~IDeviceAudioCapabilities() override = default; enum AudioOutput : uint8_t { - AUDIO_OTHER, - AUDIO_RF_MODULATOR, - AUDIO_ANALOG, - AUDIO_SPDIF, //over RCA or TOSLINK - AUDIO_HDMI0, - AUDIO_HDMI1, - AUDIO_DISPLAYPORT + AUDIO_OTHER = 0x00 /* @text: OTHER */, + AUDIO_RF_MODULATOR = 0x01 /* @text: RF_MODULATOR */, + AUDIO_ANALOG = 0x02 /* @text: ANALOG */, + AUDIO_SPDIF = 0x04 /* @text: SPDIF0 */, //over RCA or TOSLINK + AUDIO_HDMI0 = 0x08 /* @text: HDMI0 */, + AUDIO_HDMI1 = 0x10 /* @text: HDMI1 */, + AUDIO_DISPLAYPORT = 0x20 /* @text: DISPLAYPORT */ }; enum AudioCapability : uint8_t { - AUDIOCAPABILITY_NONE, - ATMOS, - DD, - DDPLUS, - DAD, - DAPV2, - MS12 + AUDIOCAPABILITY_NONE = 0x00 /* @text: audiocapability_none */, + ATMOS = 0x01 /* @text: atmos */, + DD = 0x02 /* @text: dd */, + DDPLUS = 0x04 /* @text: ddplus */, + DAD = 0x08 /* @text: dad */, + DAPV2 = 0x10 /* @text: dapv2 */, + MS12 = 0x20 /* @text: ms12 */ }; enum MS12Capability : uint8_t { - MS12CAPABILITY_NONE, - DOLBYVOLUME, - INTELIGENTEQUALIZER, - DIALOGUEENHANCER + MS12CAPABILITY_NONE = 0x00 /* @text: ms12capability_none */, + DOLBYVOLUME = 0x01 /* @text: dolbyvolume */, + INTELIGENTEQUALIZER = 0x02 /* @text: inteligentequalizer */, + DIALOGUEENHANCER = 0x04 /* @text: dialogueenhancer */ }; enum MS12Profile : uint8_t { - MS12PROFILE_NONE, - MUSIC, - MOVIE, - VOICE + MS12PROFILE_NONE = 0x00 /* @text: ms12profile_none */, + MUSIC = 0x01 /* @text: music */, + MOVIE = 0x02 /* @text: movie */, + VOICE = 0x04 /* @text: voice */ + }; + + struct AudioOutputCaps { + IDeviceAudioCapabilities::AudioOutput audioOutput /* @brief Audio Output support */; + IDeviceAudioCapabilities::AudioCapability audioCapabilities /* @bitmask @brief Retrieves AudioCapabilities */; + IDeviceAudioCapabilities::MS12Capability ms12Capabilities /* @bitmask @brief Retrieves MS12 Capabilities */; + IDeviceAudioCapabilities::MS12Profile ms12Profiles /* @bitmask @brief Retrieves MS12 Audio Profiles */; }; - typedef RPC::IIteratorType IAudioOutputIterator; - typedef RPC::IIteratorType IAudioCapabilityIterator; - typedef RPC::IIteratorType IMS12CapabilityIterator; - typedef RPC::IIteratorType IMS12ProfileIterator; + using IAudioOutputCapsIterator = RPC::IIteratorType; + + // @alt supportedaudioports + // @property + // @brief Retrieves AudioOutputs + virtual Core::hresult AudioOutputs(AudioOutput& audioOutputs /* @out @bitmask */) const = 0; + // @property + // @brief Retrieves AudioCapabilities + virtual Core::hresult AudioCapabilities(const AudioOutput audioOutput /* @index */, AudioCapability& audioCapabilities /* @out @bitmask */) const = 0; + // @brief Retrieves MS12 Capabilities + virtual Core::hresult MS12Capabilities(const AudioOutput audioOutput /* @index */, MS12Capability& ms12Capabilities /* @out @bitmask */) const = 0; + // @alt supportedms12audioprofiles + // @brief Retrieves MS12 Audio Profiles + virtual Core::hresult MS12AudioProfiles(const AudioOutput audioOutput /* @index */, MS12Profile& ms12Profiles /* @out @bitmask */) const = 0; - virtual uint32_t AudioOutputs(IAudioOutputIterator*& audioOutputs /* @out */) const = 0; - virtual uint32_t AudioCapabilities(const AudioOutput audioOutput /* @in */, IAudioCapabilityIterator*& audioCapabilities /* @out */) const = 0; - virtual uint32_t MS12Capabilities(const AudioOutput audioOutput /* @in */, IMS12CapabilityIterator*& ms12Capabilities /* @out */) const = 0; - virtual uint32_t MS12AudioProfiles(const AudioOutput audioOutput /* @in */, IMS12ProfileIterator*& ms12Profiles /* @out */) const = 0; + // @brief Retrieves DeviceAudioCapabilities + virtual Core::hresult DeviceAudioCapabilities(IAudioOutputCapsIterator*& audioOutputCaps /* @out */) const = 0; }; + /* @json 1.0.0 */ struct EXTERNAL IDeviceVideoCapabilities : virtual public Core::IUnknown { enum { ID = ID_DEVICE_CAPABILITIES_VIDEO }; virtual ~IDeviceVideoCapabilities() override = default; enum VideoOutput : uint8_t { - VIDEO_OTHER, - VIDEO_RF_MODULATOR, - VIDEO_COMPOSITE, // also composite over SCART - VIDEO_SVIDEO, - VIDEO_COMPONENT, - VIDEO_SCART_RGB, - VIDEO_HDMI0, - VIDEO_HDMI1, - VIDEO_DISPLAYPORT // also DisplayPort over USB-C + VIDEO_OTHER = 0x00 /* @text: OTHER */, + VIDEO_RF_MODULATOR = 0x01 /* @text: RF_MODULATOR */, + VIDEO_COMPOSITE = 0x02 /* @text: COMPOSITE */, // also composite over SCART + VIDEO_SVIDEO = 0x04 /* @text: SVIDEO */, + VIDEO_COMPONENT = 0x08 /* @text: COMPONENT */, + VIDEO_SCART_RGB = 0x10 /* @text: SCART_RGB */, + VIDEO_HDMI0 = 0x20 /* @text: HDMI0 */, + VIDEO_HDMI1 = 0x40 /* @text: HDMI1*/, + VIDEO_DISPLAYPORT = 0x80 /* @text: DISPLAYPORT */ // also DisplayPort over USB-C }; - enum ScreenResolution : uint8_t { - ScreenResolution_Unknown = 0, - ScreenResolution_480i = 1, - ScreenResolution_480p = 2, - ScreenResolution_576i = 3, - ScreenResolution_576p = 4, - ScreenResolution_576p50Hz = 5, - ScreenResolution_720p = 6, - ScreenResolution_720p50Hz = 7, - ScreenResolution_1080i = 8, - ScreenResolution_1080i25Hz = 9, - ScreenResolution_1080i50Hz = 10, - ScreenResolution_1080p = 11, - ScreenResolution_1080p24Hz = 12, - ScreenResolution_1080p25Hz = 13, - ScreenResolution_1080p30Hz = 14, - ScreenResolution_1080p50Hz = 15, - ScreenResolution_1080p60Hz = 16, - ScreenResolution_2160p30Hz = 17, - ScreenResolution_2160p50Hz = 18, - ScreenResolution_2160p60Hz = 19, - ScreenResolution_4320p30Hz = 20, - ScreenResolution_4320p60Hz = 21 + enum ScreenResolution : uint32_t { + ScreenResolution_Unknown = 0x000000 /* @text: Unknown */, + ScreenResolution_480i = 0x000001 /* @text: 480i */, + ScreenResolution_480p = 0x000002 /* @text: 480p */, + ScreenResolution_576i = 0x000004 /* @text: 576i */, + ScreenResolution_576p = 0x000008 /* @text: 576p */, + ScreenResolution_576p50Hz = 0x000010 /* @text: 576p50 */, + ScreenResolution_720p = 0x000020 /* @text: 720p */, + ScreenResolution_720p50Hz = 0x000040 /* @text: 720p50 */, + ScreenResolution_1080i = 0x000080 /* @text: 1080i */, + ScreenResolution_1080i25Hz = 0x000100 /* @text: 1080i25 */, + ScreenResolution_1080i50Hz = 0x000200 /* @text: 1080i50 */, + ScreenResolution_1080p = 0x000400 /* @text: 1080p */, + ScreenResolution_1080p24Hz = 0x000800 /* @text: 1080p24 */, + ScreenResolution_1080p25Hz = 0x001000 /* @text: 1080p25 */, + ScreenResolution_1080p30Hz = 0x002000 /* @text: 1080p30 */, + ScreenResolution_1080p50Hz = 0x004000 /* @text: 1080p50 */, + ScreenResolution_1080p60Hz = 0x008000 /* @text: 1080p60 */, + ScreenResolution_2160p30Hz = 0x010000 /* @text: 2160p30 */, + ScreenResolution_2160p50Hz = 0x020000 /* @text: 2160p50 */, + ScreenResolution_2160p60Hz = 0x040000 /* @text: 2160p60 */, + ScreenResolution_4320p30Hz = 0x080000 /* @text: 4320p30 */, + ScreenResolution_4320p60Hz = 0x100000 /* @text: 4320p60 */ }; enum CopyProtection : uint8_t { - HDCP_UNAVAILABLE, - HDCP_14, - HDCP_20, - HDCP_21, - HDCP_22 + HDCP_UNAVAILABLE /* @text: unavailable */, + HDCP_14 /* @text: 1.4 */, + HDCP_20 /* @text: 2.0 */, + HDCP_21 /* @text: 2.1 */, + HDCP_22 /* @text: 2.2 */ }; - typedef RPC::IIteratorType IVideoOutputIterator; - typedef RPC::IIteratorType IScreenResolutionIterator; - - virtual uint32_t VideoOutputs(IVideoOutputIterator*& videoOutputs /* @out */) const = 0; - virtual uint32_t DefaultResolution(const VideoOutput videoOutput /* @in */, ScreenResolution& defaultResolution /* @out */) const = 0; - virtual uint32_t Resolutions(const VideoOutput videoOutput /* @in */, IScreenResolutionIterator*& resolutions /* @out */) const = 0; - virtual uint32_t Hdcp(const VideoOutput videoOutput /* @in */, CopyProtection& hdcpVersion /* @out */) const = 0; - virtual uint32_t HostEDID(string& edid /* @out */) const = 0; - virtual uint32_t HDR(bool& supportsHDR /*@out*/) const = 0; - virtual uint32_t Atmos(bool& supportsAtmos /*@out*/) const = 0; - virtual uint32_t CEC(bool& supportsCEC /*@out*/) const = 0; + struct VideoOutputCaps { + IDeviceVideoCapabilities::VideoOutput videoOutput /* @brief Video Output support */; + IDeviceVideoCapabilities::CopyProtection hdcp /* @brief Video Output support */; + IDeviceVideoCapabilities::ScreenResolution outputResolutions /* @bitmask @brief Supported resolutions */; + IDeviceVideoCapabilities::ScreenResolution defaultResolution /* @brief Default resolution */; + }; + + using IVideoOutputCapsIterator = RPC::IIteratorType; + + // @alt supportedvideodisplays + // @property + // @brief Retrieves VideoOutputs + virtual Core::hresult VideoOutputs(VideoOutput& videoOutputs /* @out @bitmask */) const = 0; + // @brief Retrieves DefaultResolution against given video Output + virtual Core::hresult DefaultResolution(const VideoOutput videoOutput /* @index */, ScreenResolution& defaultResolution /* @out */) const = 0; + // @alt supportedresolutions + // @brief Retrieves Resolution against given video Output + virtual Core::hresult Resolutions(const VideoOutput videoOutput /* @index */, ScreenResolution& resolutions /* @out @bitmask */) const = 0; + // @alt supportedhdcp + // @brief Retrieves Hdcp + virtual Core::hresult Hdcp(const VideoOutput videoOutput /* @index */, CopyProtection& hdcpVersion /* @out */) const = 0; + // @property + // @brief Retrieves Host EDID + virtual Core::hresult HostEDID(string& edid /* @out */) const = 0; + // @brief Retrieves HDR + virtual Core::hresult HDR(bool& supportsHDR /*@out*/) const = 0; + // @property + // @brief Retrieves Atoms + virtual Core::hresult Atmos(bool& supportsAtmos /*@out*/) const = 0; + // @property + // @brief Retrieves cec + virtual Core::hresult CEC(bool& supportsCEC /*@out*/) const = 0; + + // @brief Retrieves DeviceVideoCapabilities + virtual Core::hresult DeviceVideoCapabilities(string& edid /* @out */, + bool& hdr /* @out */, bool& atmos /* @out */, bool& cec /* @out */, + IVideoOutputCapsIterator*& videoOutputCaps /* @out */) const = 0; }; } } diff --git a/interfaces/IMonitor.h b/interfaces/IMonitor.h new file mode 100644 index 00000000..febecf02 --- /dev/null +++ b/interfaces/IMonitor.h @@ -0,0 +1,80 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2024 Metrological + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#pragma once + +#include "Module.h" + +// @stubgen:include + +namespace Thunder { +namespace Exchange { + /* @json 1.0.0 */ + struct EXTERNAL IMonitor : virtual public Core::IUnknown { + enum { ID = ID_MONITOR }; + struct Measurement { + uint64_t min /* @brief Minimal value measured */; + uint64_t max /* @brief Maximal value measured */; + uint64_t average /* @brief Average of all measurements */; + uint64_t last /* @brief Last measured value */; + }; + struct Measurements { + Measurement resident /* @brief Resident memory measurement */; + Measurement allocated /* @brief Allocated memory measurement */; + Measurement shared /* @brief Shared memory measurement */; + Measurement process /* @brief Processes measurement */; + bool operational /* @brief Whether the service is up and running */; + uint32_t count /* @brief Number of measurements */; + }; + struct RestartInfo { + uint8_t limit /* @brief Maximum number or restarts to be attempted */; + uint16_t window /* @brief Time period (in seconds) within which failures must happen for the limit to be considered crossed */; + }; + struct Statistics { + Measurements measurements /* @brief Measurements for the service */; + string observable /* @brief A callsign of the watched service */; + RestartInfo restart /* @brief Restart limits for failures applying to the service */; + }; + struct ActionParams { + string callsign /* @brief Callsign of the service the Monitor acted upon */; + string action /* @brief The action executed by the Monitor on a service. One of: "Activate", "Deactivate", "StoppedRestarting" */; + string reason /* @brief A message describing the reason the action was taken */; + }; + struct RestartLimitsInfo { + string callsign /* @brief The callsign of a service to reset measurements snapshot of */; + RestartInfo restart /* @brief Restart limits for failures applying to the service */; + }; + + struct EXTERNAL INotification : virtual public Core::IUnknown { + enum { ID = ID_MONITOR_NOTIFICATION }; + virtual void Action(const string& callsign, const string& action, const string& reason) = 0; + }; + + using IStatisticsIterator = RPC::IIteratorType; + // @brief RestartLimits: Sets new restart limits for a plugin + virtual uint32_t RestartLimits(const RestartLimitsInfo& params) = 0; + // @brief ResetStats: Resets memory and process statistics for a single plugin watched by the Monitor + virtual uint32_t ResetStats(const string& callsign, Statistics& statistics /* @out */) = 0; + // @property + // @brief Status: The memory and process statistics either for a single plugin or + // all plugins watched by the Monitor + virtual uint32_t Status(const string& callsign /* @index */, IStatisticsIterator*& statistics /* @out */) const = 0; + }; +} +} diff --git a/interfaces/IOCDM.h b/interfaces/IOCDM.h index d7d75d48..5e532412 100644 --- a/interfaces/IOCDM.h +++ b/interfaces/IOCDM.h @@ -392,6 +392,29 @@ class EXTERNAL KeyId { ISession::KeyStatus _status; }; +// @stubgen:include +// @json 1.0.0 +struct EXTERNAL IOCDM : virtual public Core::IUnknown { + enum { ID = ID_OCDM_INFO }; + + virtual ~IOCDM() = default; + + using IStringIterator = RPC::IIteratorType; + struct Drm { + string name /* @brief Name of the DRM */; + string /* @opaque */ keySystems /* @brief Supported key Systems */; + }; + using IDrmIterator = RPC::IIteratorType; + + // @alt Drms + // @property + // @brief Systems - Retrieves all key systems available in the system (e.g. Nagra, PlayReady, WideVine etc) + virtual Core::hresult Systems(IDrmIterator*& drms /* @out */) const = 0; + // @alt KeySystems + // @property + // @brief Designators - Retrieves all designators associated with a Key System (Nagra, PlayReady, WideVine). + virtual Core::hresult Designators(const string& drm /* @index */, IStringIterator*& keys /* @out */) const = 0; +}; } //namespace Exchange } //namespace Thunder diff --git a/interfaces/ISecurityAgent.h b/interfaces/ISecurityAgent.h new file mode 100644 index 00000000..1f694346 --- /dev/null +++ b/interfaces/ISecurityAgent.h @@ -0,0 +1,43 @@ +/* + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2024 Metrological + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. +*/ + +#pragma once + +#include "Module.h" + +// @stubgen:include + +namespace Thunder { +namespace Exchange { + /* @json 1.0.0 */ + struct EXTERNAL ISecurityAgent : virtual public Core::IUnknown { + enum { ID = ID_SECURITYAGENT }; + struct TokenInput { + string url /* @brief Url of application origin */; + string user /* @brief Username */; + string hash /* @brief Random hash */; + }; + + // @brief Creates Token + virtual uint32_t CreateToken(const TokenInput& input, string& token /* @out */) = 0; + // @brief Validate Token + virtual uint32_t Validate(const string& token, bool& valid /* @out */) = 0; + }; +} +} diff --git a/interfaces/Ids.h b/interfaces/Ids.h index e132d4fa..e54880f6 100644 --- a/interfaces/Ids.h +++ b/interfaces/Ids.h @@ -61,6 +61,7 @@ namespace Exchange { ID_BROWSER_SCRIPTING = ID_BROWSER + 7, ID_BROWSER_COOKIEJAR = ID_BROWSER + 8, ID_BROWSER_COOKIEJAR_NOTIFICATION = ID_BROWSER + 9, + ID_WEB_BROWSER_HEADERS_ITERATOR = ID_BROWSER + 0xA, ID_POWER = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x010, ID_POWER_NOTIFICATION = ID_POWER + 1, @@ -248,14 +249,11 @@ namespace Exchange { ID_CONFIGURATION = ID_APPLICATION + 2, ID_DEVICE_INFO = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x370, - ID_DEVICE_CAPABILITIES_AUDIO = ID_DEVICE_INFO + 1, - ID_DEVICE_CAPABILITIES_AUDIO_OUTPUT = ID_DEVICE_INFO + 2, - ID_DEVICE_CAPABILITIES_AUDIO_CAPABILITY = ID_DEVICE_INFO + 3, - ID_DEVICE_CAPABILITIES_AUDIO_MS12_CAPABILITY = ID_DEVICE_INFO + 4, - ID_DEVICE_CAPABILITIES_AUDIO_MS12_PROFILE = ID_DEVICE_INFO + 5, - ID_DEVICE_CAPABILITIES_VIDEO = ID_DEVICE_INFO + 6, - ID_DEVICE_CAPABILITIES_VIDEO_OUTPUT = ID_DEVICE_INFO + 7, - ID_DEVICE_CAPABILITIES_RESOLUTION = ID_DEVICE_INFO + 8, + ID_DEVICE_INFO_ADDRESSES = ID_DEVICE_INFO + 1, + ID_DEVICE_CAPABILITIES_AUDIO = ID_DEVICE_INFO + 2, + ID_DEVICE_CAPABILITIES_AUDIO_OUTPUT = ID_DEVICE_INFO + 3, + ID_DEVICE_CAPABILITIES_VIDEO = ID_DEVICE_INFO + 4, + ID_DEVICE_CAPABILITIES_VIDEO_OUTPUT = ID_DEVICE_INFO + 5, ID_DIALSERVER = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x380, ID_DIALSERVER_APPLICATION = ID_DIALSERVER + 1, @@ -273,6 +271,8 @@ namespace Exchange { ID_SESSION = ID_ACCESSOROCDM + 2, ID_SESSION_CALLBACK = ID_ACCESSOROCDM + 3, ID_SESSION_EXTENSION = ID_ACCESSOROCDM + 4, + ID_OCDM_INFO = ID_ACCESSOROCDM + 5, + ID_OCDM_DRMS_ITERATOR = ID_ACCESSOROCDM + 6, //Butler ID_BUTLER = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x3D0, @@ -372,8 +372,13 @@ namespace Exchange { ID_TESTAUTOMATIONMEMORY = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4F0, ID_TESTAUTOMATIONCOMRPC = ID_TESTAUTOMATIONMEMORY + 1, - ID_TESTAUTOMATIONCOMRPCINTERNAL = ID_TESTAUTOMATIONMEMORY + 2 + ID_TESTAUTOMATIONCOMRPCINTERNAL = ID_TESTAUTOMATIONMEMORY + 2, + ID_MONITOR = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x500, + ID_MONITOR_NOTIFICATION = ID_MONITOR + 1, + ID_MONITOR_STATISTICS_ITERATOR = ID_MONITOR + 2, + + ID_SECURITYAGENT = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x510 }; } }