Skip to content

Commit

Permalink
[IOpenCDM] Update with JSON-RPC interface (#413)
Browse files Browse the repository at this point in the history
* Add IOpenCDMi interface

* Rename to IOpenCDM

* Move the new interface to the top of the file

* Adjust the Windows project files

* Change the error code to ERROR_UNKNOWN_KEY

* Update the @brief

* Update the ID to match the new interface name

* Make sure the formatting matches the rest of the file

* See if the hack also works in Actiosn

* Bring back the correct name
  • Loading branch information
VeithMetro authored Feb 11, 2025
1 parent 86df6c9 commit f537f4a
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 4 deletions.
15 changes: 15 additions & 0 deletions definitions/Definitions.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
<ClCompile Include="..\interfaces\json\JsonEnum_Netflix.cpp" />
<ClCompile Include="..\interfaces\json\JsonEnum_NetworkControl.cpp" />
<ClCompile Include="..\interfaces\json\JsonEnum_OCDM.cpp" />
<ClCompile Include="..\interfaces\json\JsonEnum_OpenCDM.cpp" />
<ClCompile Include="..\interfaces\json\JsonEnum_PerformanceMonitor.cpp" />
<ClCompile Include="..\interfaces\json\JsonEnum_Power.cpp" />
<ClCompile Include="..\interfaces\json\JsonEnum_Provisioning.cpp" />
Expand Down Expand Up @@ -132,6 +133,20 @@
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)../interfaces/json/JDeviceIdentification.h</Outputs>
<OutputItemType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ClInclude</OutputItemType>
</CustomBuild>
<CustomBuild Include="..\interfaces\IOCDM.h">
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force</Command>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">python "$(ToolPath)\JsonGenerator\JsonGenerator.py" -I "$(FrameworkPath)\" -I "$(ProjectDir)\" --keep-empty --case-convention legacy -c -j "$(ProjectDir)../interfaces" -o "$(ProjectDir)../interfaces/json" "%(FullPath)" --force</Command>
<OutputItemType Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">ClInclude</OutputItemType>
<OutputItemType Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">ClInclude</OutputItemType>
<OutputItemType Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">ClInclude</OutputItemType>
<OutputItemType Condition="'$(Configuration)|$(Platform)'=='Release|x64'">ClInclude</OutputItemType>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)../interfaces/json/JOpenCDM.h</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)../interfaces/json/JOpenCDM.h</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)../interfaces/json/JOpenCDM.h</Outputs>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)../interfaces/json/JOpenCDM.h</Outputs>
</CustomBuild>
<ClInclude Include="ValuePoint.h" />
<CustomBuild Include="..\interfaces\IMath.h">
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)../interfaces/json/JMath.h</Outputs>
Expand Down
10 changes: 9 additions & 1 deletion definitions/Definitions.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
<ClCompile Include="..\interfaces\json\JsonEnum_Netflix.cpp">
<Filter>Generated Files</Filter>
</ClCompile>
<ClCompile Include="..\interfaces\json\JsonEnum_OCDM.cpp">
<Filter>Generated Files</Filter>
</ClCompile>
<ClCompile Include="..\interfaces\json\JsonEnum_PerformanceMonitor.cpp">
Expand Down Expand Up @@ -141,6 +140,12 @@
<ClCompile Include="..\interfaces\json\JsonEnum_ZigWave.cpp">
<Filter>Generated Files</Filter>
</ClCompile>
<ClCompile Include="..\interfaces\json\JsonEnum_OCDM.cpp">
<Filter>Generated Files</Filter>
</ClCompile>
<ClCompile Include="..\interfaces\json\JsonEnum_OpenCDM.cpp">
<Filter>Generated Files</Filter>
</ClCompile>
<ClCompile Include="..\interfaces\json\JsonEnum_MemoryMonitor.cpp">
<Filter>Generated Files</Filter>
</ClCompile>
Expand Down Expand Up @@ -285,5 +290,8 @@
<CustomBuild Include="..\interfaces\IDeviceIdentification.h">
<Filter>Interfaces</Filter>
</CustomBuild>
<CustomBuild Include="..\interfaces\IOCDM.h">
<Filter>Interfaces</Filter>
</CustomBuild>
</ItemGroup>
</Project>
2 changes: 0 additions & 2 deletions interfaces/IContentDecryption.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,10 @@ namespace Exchange {
FAILED
};

/* @event */
struct EXTERNAL INotification : virtual public Core::IUnknown {

enum {ID = ID_CONTENTDECRYPTION_NOTIFICATION};

/* @brief initialization status. */
virtual void initializationStatus(const std::string& drm,
const Status status) = 0;
};
Expand Down
20 changes: 19 additions & 1 deletion interfaces/IOCDM.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,28 @@

#include "Module.h"

// @insert <com/IIteratorType.h>

namespace Thunder {
namespace Exchange {

// @json 1.0.0 @text:legacy_lowercase
struct EXTERNAL IOpenCDM : virtual public Core::IUnknown {

enum { ID = ID_OPENCDM };

using IStringIterator = RPC::IIteratorType<string, RPC::ID_STRINGITERATOR>;

// @property
// @brief Supported DRM systems
virtual Core::hresult Systems(IStringIterator*& keySystems /* @out */) const = 0;

// @property
// @brief Designators of a specified DRM system
// @retval ERROR_UNKNOWN_KEY Invalid DRM name
virtual Core::hresult Designators(const string& keySystem /* @index */, IStringIterator*& designators /* @out */) const = 0;
};

enum OCDM_RESULT : uint32_t {
OCDM_SUCCESS = 0,
OCDM_S_FALSE = 1,
Expand Down Expand Up @@ -392,7 +411,6 @@ class EXTERNAL KeyId {
ISession::KeyStatus _status;
};


} //namespace Exchange
} //namespace Thunder

1 change: 1 addition & 0 deletions interfaces/Ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ namespace Exchange {
ID_SESSION = ID_ACCESSOROCDM + 2,
ID_SESSION_CALLBACK = ID_ACCESSOROCDM + 3,
ID_SESSION_EXTENSION = ID_ACCESSOROCDM + 4,
ID_OPENCDM = ID_ACCESSOROCDM + 5,

//Butler
ID_BUTLER = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x3D0,
Expand Down

0 comments on commit f537f4a

Please sign in to comment.