Skip to content

Commit 95fee11

Browse files
authored
[PlayerInfo] Remove REST support and build the plugin in Linux Actions (#349)
* Remove REST support from PlayerInfo * Try building PlayerInfo in Linux Actions with installing a GStreamer lib * Make sure that PlayerInfo will also built on 32-bit
1 parent 20e260b commit 95fee11

File tree

3 files changed

+4
-66
lines changed

3 files changed

+4
-66
lines changed

.github/workflows/Linux build template.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
echo "deb http://archive.ubuntu.com/ubuntu/ jammy-updates main universe restricted multiverse" | sudo tee -a /etc/apt/sources.list
2929
sudo dpkg --add-architecture i386
3030
sudo apt-get update
31-
sudo apt install python3-pip build-essential cmake ninja-build libusb-1.0-0-dev autoconf automake libtool libtool-bin pkg-config ${{matrix.architecture == '32' && 'zlib1g-dev:i386 libssl-dev:i386 gcc-13-multilib g++-13-multilib libarchive-dev:i386 libcurl4-openssl-dev:i386 libgpgme-dev:i386 libgpg-error-dev:i386' || 'zlib1g-dev libssl-dev libarchive-dev libcurl4-openssl-dev libgpgme-dev libgpg-error-dev'}}
31+
sudo apt install python3-pip build-essential cmake ninja-build libusb-1.0-0-dev autoconf automake libtool libtool-bin pkg-config ${{matrix.architecture == '32' && 'zlib1g-dev:i386 libssl-dev:i386 gcc-13-multilib g++-13-multilib libarchive-dev:i386 libcurl4-openssl-dev:i386 libgpgme-dev:i386 libgpg-error-dev:i386 libgstreamer1.0-dev:i386' || 'zlib1g-dev libssl-dev libarchive-dev libcurl4-openssl-dev libgpgme-dev libgpg-error-dev libgstreamer1.0-dev'}}
3232
python3 -m venv venv
3333
source venv/bin/activate
3434
pip install jsonref
@@ -84,7 +84,7 @@ jobs:
8484
- name: Build ThunderNanoServicesRDK
8585
run: |
8686
source venv/bin/activate
87-
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
87+
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/${{matrix.architecture == '32' && 'i386' || 'x86_64'}}-linux-gnu/pkgconfig:$PKG_CONFIG_PATH
8888
cmake -G Ninja -S ThunderNanoServicesRDK -B ${{matrix.build_type}}/build/ThunderNanoServicesRDK \
8989
-DCMAKE_CXX_FLAGS="-Wall -Wextra -Wpedantic -Werror -m${{matrix.architecture}}" \
9090
-DCMAKE_C_FLAGS="-Wall -Wextra -Wpedantic -Werror -m${{matrix.architecture}}" \
@@ -98,6 +98,7 @@ jobs:
9898
-DPLUGIN_MONITOR=ON \
9999
-DPLUGIN_OPENCDMI=ON \
100100
-DPLUGIN_PERFORMANCEMETRICS=ON \
101+
-DPLUGIN_PLAYERINFO=ON \
101102
-DPLUGIN_PACKAGER=ON \
102103
${{steps.plugins.outputs.first_match}}
103104
cmake --build ${{matrix.build_type}}/build/ThunderNanoServicesRDK --target install

PlayerInfo/PlayerInfo.cpp

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ namespace Plugin {
3737
);
3838
}
3939

40-
static Core::ProxyPoolType<Web::Response> responseFactory(4);
41-
static Core::ProxyPoolType<Web::JSONBodyType<JsonData::PlayerInfo::CodecsData>> jsonResponseFactory(4);
42-
4340
/* virtual */ const string PlayerInfo::Initialize(PluginHost::IShell* service)
4441
{
4542
ASSERT(service != nullptr);
@@ -141,58 +138,6 @@ namespace Plugin {
141138
return (string());
142139
}
143140

144-
/* virtual */ void PlayerInfo::Inbound(Web::Request& /* request */)
145-
{
146-
}
147-
148-
/* virtual */ Core::ProxyType<Web::Response> PlayerInfo::Process(const Web::Request& request)
149-
{
150-
ASSERT(_skipURL <= request.Path.length());
151-
152-
Core::ProxyType<Web::Response> result(PluginHost::IFactories::Instance().Response());
153-
154-
// By default, we assume everything works..
155-
result->ErrorCode = Web::STATUS_OK;
156-
result->Message = "OK";
157-
158-
// <GET> - currently, only the GET command is supported, returning system info
159-
if (request.Verb == Web::Request::HTTP_GET) {
160-
161-
Core::ProxyType<Web::JSONBodyType<JsonData::PlayerInfo::CodecsData>> response(jsonResponseFactory.Element());
162-
163-
Core::TextSegmentIterator index(Core::TextFragment(request.Path, _skipURL, static_cast<uint32_t>(request.Path.length()) - _skipURL), false, '/');
164-
165-
// Always skip the first one, it is an empty part because we start with a '/' if there are more parameters.
166-
index.Next();
167-
168-
Info(*response);
169-
result->ContentType = Web::MIMETypes::MIME_JSON;
170-
result->Body(Core::ProxyType<Web::IBody>(response));
171-
} else {
172-
result->ErrorCode = Web::STATUS_BAD_REQUEST;
173-
result->Message = _T("Unsupported request for the [PlayerInfo] service.");
174-
}
175-
176-
return result;
177-
}
178-
179-
void PlayerInfo::Info(JsonData::PlayerInfo::CodecsData& playerInfo) const
180-
{
181-
Core::JSON::EnumType<JsonData::PlayerInfo::CodecsData::AudiocodecsType> audioCodec;
182-
_audioCodecs->Reset(0);
183-
Exchange::IPlayerProperties::AudioCodec audio;
184-
while (_audioCodecs->Next(audio) == true) {
185-
playerInfo.Audio.Add(audioCodec = static_cast<JsonData::PlayerInfo::CodecsData::AudiocodecsType>(audio));
186-
}
187-
188-
Core::JSON::EnumType<JsonData::PlayerInfo::CodecsData::VideocodecsType> videoCodec;
189-
Exchange::IPlayerProperties::VideoCodec video;
190-
_videoCodecs->Reset(0);
191-
while (_videoCodecs->Next(video) == true) {
192-
playerInfo.Video.Add(videoCodec = static_cast<JsonData::PlayerInfo::CodecsData::VideocodecsType>(video));
193-
}
194-
}
195-
196141
void PlayerInfo::Deactivated(RPC::IRemoteConnection* connection)
197142
{
198143
// This can potentially be called on a socket thread, so the deactivation (wich in turn kills this object) must be done

PlayerInfo/PlayerInfo.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@
2020
#pragma once
2121

2222
#include "Module.h"
23-
#include <interfaces/json/JsonData_PlayerInfo.h>
2423
#include <interfaces/json/JDolbyOutput.h>
2524
#include <interfaces/json/JPlayerProperties.h>
2625

2726
namespace Thunder {
2827
namespace Plugin {
2928

30-
class PlayerInfo : public PluginHost::IPlugin, public PluginHost::IWeb, public PluginHost::JSONRPC {
29+
class PlayerInfo : public PluginHost::IPlugin, public PluginHost::JSONRPC {
3130
private:
3231
class Notification : public RPC::IRemoteConnection::INotification {
3332
public:
@@ -125,7 +124,6 @@ namespace Plugin {
125124

126125
BEGIN_INTERFACE_MAP(PlayerInfo)
127126
INTERFACE_ENTRY(PluginHost::IPlugin)
128-
INTERFACE_ENTRY(PluginHost::IWeb)
129127
INTERFACE_ENTRY(PluginHost::IDispatcher)
130128
INTERFACE_AGGREGATE(Exchange::IPlayerProperties, _player)
131129
END_INTERFACE_MAP
@@ -137,14 +135,8 @@ namespace Plugin {
137135
void Deinitialize(PluginHost::IShell* service) override;
138136
string Information() const override;
139137

140-
// IWeb methods
141-
// -------------------------------------------------------------------------------------------------------
142-
void Inbound(Web::Request& request) override;
143-
Core::ProxyType<Web::Response> Process(const Web::Request& request) override;
144-
145138
private:
146139
void Deactivated(RPC::IRemoteConnection* connection);
147-
void Info(JsonData::PlayerInfo::CodecsData&) const;
148140

149141
private:
150142
uint8_t _skipURL;

0 commit comments

Comments
 (0)