Skip to content

Commit 9300b23

Browse files
Merge pull request rdkcentral#2 from rdkcentral/main
sync to Main
2 parents d9ba261 + 49ce949 commit 9300b23

File tree

98 files changed

+3758
-816
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+3758
-816
lines changed

.github/workflows/L1-tests.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,6 @@ jobs:
141141
run: >
142142
cd "${{github.workspace}}/ThunderInterfaces"
143143
&&
144-
git apply "${{github.workspace}}/rdkservices/Tests/L1Tests/patches/0001-Add-IAnalytics-interface-R2.patch"
145-
&&
146144
cd ..
147145
148146
- name: Build ThunderInterfaces
@@ -296,8 +294,6 @@ jobs:
296294
-DPLUGIN_TEXTTOSPEECH=ON
297295
-DPLUGIN_SYSTEMAUDIOPLAYER=ON
298296
-DPLUGIN_MIRACAST=ON
299-
-DPLUGIN_ANALYTICS=ON
300-
-DPLUGIN_ANALYTICS_SIFT_BACKEND=ON
301297
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
302298
&&
303299
cmake --build build/rdkservices -j8

.github/workflows/L2-tests-R4-4-1.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ jobs:
146146
patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/RDKV-48604-User-Settings-Thunder-Plugin.patch
147147
patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/Use_Legact_Alt_In_ThunderInterfaces_Based_On_ThunderTools_R4.4.3.patch
148148
patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/RDK-51362-System-Mode-Thunder-Plugin.patch
149+
patch -p1 < ${{github.workspace}}/rdkservices/Tests/L2Tests/patches/0001-Add-IAnalytics-interface-R4.4.patch
149150
cd ..
150151
151152
- name: Build ThunderInterfaces
@@ -278,6 +279,8 @@ jobs:
278279
-DPLUGIN_L2Tests=ON
279280
-DRDK_SERVICE_L2_TEST=ON
280281
-DDS_FOUND=ON
282+
-DPLUGIN_ANALYTICS=ON
283+
-DPLUGIN_ANALYTICS_SIFT_BACKEND=ON
281284
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
282285
&&
283286
cmake --build build/rdkservices -j8

AVInput/AVInput.cpp

Lines changed: 58 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
#define API_VERSION_NUMBER_MAJOR 1
3434
#define API_VERSION_NUMBER_MINOR 7
35-
#define API_VERSION_NUMBER_PATCH 0
35+
#define API_VERSION_NUMBER_PATCH 1
3636

3737
#define HDMI 0
3838
#define COMPOSITE 1
@@ -168,6 +168,10 @@ void AVInput::InitializeIARM()
168168
IARM_BUS_DSMGR_NAME,
169169
IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_STATUS,
170170
dsAVStatusEventHandler));
171+
IARM_CHECK(IARM_Bus_RegisterEventHandler(
172+
IARM_BUS_DSMGR_NAME,
173+
IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_VIDEO_MODE_UPDATE,
174+
dsAVVideoModeEventHandler));
171175
IARM_CHECK(IARM_Bus_RegisterEventHandler(
172176
IARM_BUS_DSMGR_NAME,
173177
IARM_BUS_DSMGR_EVENT_HDMI_IN_AVI_CONTENT_TYPE,
@@ -204,6 +208,9 @@ void AVInput::DeinitializeIARM()
204208
IARM_BUS_DSMGR_NAME,
205209
IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_STATUS, dsAVStatusEventHandler));
206210
IARM_CHECK(IARM_Bus_RemoveEventHandler(
211+
IARM_BUS_DSMGR_NAME,
212+
IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_VIDEO_MODE_UPDATE, dsAVVideoModeEventHandler));
213+
IARM_CHECK(IARM_Bus_RemoveEventHandler(
207214
IARM_BUS_DSMGR_NAME,
208215
IARM_BUS_DSMGR_EVENT_HDMI_IN_AVI_CONTENT_TYPE, dsAviContentTypeEventHandler));
209216
}
@@ -750,17 +757,18 @@ void AVInput::AVInputStatusChange( int port , bool isPresented, int type)
750757
* @param[in] port HDMI In port id.
751758
* @param[dsVideoPortResolution_t] video resolution data
752759
*/
753-
void AVInput::AVInputVideoModeUpdate( int port , dsVideoPortResolution_t resolution)
760+
void AVInput::AVInputVideoModeUpdate( int port , dsVideoPortResolution_t resolution, int type)
754761
{
755762
LOGWARN("AVInputVideoModeUpdate [%d]", port);
756763

757764
JsonObject params;
758765
params["id"] = port;
759766
std::stringstream locator;
760-
locator << "hdmiin://localhost/deviceid/" << port;
761-
params["locator"] = locator.str();
767+
if(type == HDMI){
768+
769+
locator << "hdmiin://localhost/deviceid/" << port;
770+
switch(resolution.pixelResolution) {
762771

763-
switch(resolution.pixelResolution) {
764772
case dsVIDEO_PIXELRES_720x480:
765773
params["width"] = 720;
766774
params["height"] = 480;
@@ -775,8 +783,8 @@ void AVInput::AVInputVideoModeUpdate( int port , dsVideoPortResolution_t resolut
775783
params["width"] = 1280;
776784
params["height"] = 720;
777785
break;
778-
779-
case dsVIDEO_PIXELRES_1920x1080:
786+
787+
case dsVIDEO_PIXELRES_1920x1080:
780788
params["width"] = 1920;
781789
params["height"] = 1080;
782790
break;
@@ -795,10 +803,31 @@ void AVInput::AVInputVideoModeUpdate( int port , dsVideoPortResolution_t resolut
795803
params["width"] = 1920;
796804
params["height"] = 1080;
797805
break;
806+
}
807+
params["progressive"] = (!resolution.interlaced);
798808
}
809+
else if(type == COMPOSITE)
810+
{
811+
locator << "cvbsin://localhost/deviceid/" << port;
812+
switch(resolution.pixelResolution) {
813+
case dsVIDEO_PIXELRES_720x480:
814+
params["width"] = 720;
815+
params["height"] = 480;
816+
break;
817+
case dsVIDEO_PIXELRES_720x576:
818+
params["width"] = 720;
819+
params["height"] = 576;
820+
break;
821+
default:
822+
params["width"] = 720;
823+
params["height"] = 576;
824+
break;
825+
}
799826

800-
params["progressive"] = (!resolution.interlaced);
827+
params["progressive"] = false;
828+
}
801829

830+
params["locator"] = locator.str();
802831
switch(resolution.frameRate) {
803832
case dsVIDEO_FRAMERATE_24:
804833
params["frameRateN"] = 24000;
@@ -851,16 +880,17 @@ void AVInput::AVInputVideoModeUpdate( int port , dsVideoPortResolution_t resolut
851880

852881
void AVInput::dsAviContentTypeEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len)
853882
{
854-
if(!AVInput::_instance)
855-
return;
883+
if(!AVInput::_instance)
884+
return;
856885

857-
if (IARM_BUS_DSMGR_EVENT_HDMI_IN_AVI_CONTENT_TYPE == eventId)
858-
{
859-
IARM_Bus_DSMgr_EventData_t *eventData = (IARM_Bus_DSMgr_EventData_t *)data;
860-
int hdmi_in_port = eventData->data.hdmi_in_content_type.port;
861-
int avi_content_type = eventData->data.hdmi_in_content_type.aviContentType;
862-
LOGINFO("Received IARM_BUS_DSMGR_EVENT_HDMI_IN_AVI_CONTENT_TYPE event port: %d, Content Type : %d", hdmi_in_port,avi_content_type);
863-
AVInput::_instance->hdmiInputAviContentTypeChange(hdmi_in_port, avi_content_type);
886+
if (IARM_BUS_DSMGR_EVENT_HDMI_IN_AVI_CONTENT_TYPE == eventId)
887+
{
888+
IARM_Bus_DSMgr_EventData_t *eventData = (IARM_Bus_DSMgr_EventData_t *)data;
889+
int hdmi_in_port = eventData->data.hdmi_in_content_type.port;
890+
int avi_content_type = eventData->data.hdmi_in_content_type.aviContentType;
891+
LOGINFO("Received IARM_BUS_DSMGR_EVENT_HDMI_IN_AVI_CONTENT_TYPE event port: %d, Content Type : %d", hdmi_in_port,avi_content_type);
892+
893+
AVInput::_instance->hdmiInputAviContentTypeChange(hdmi_in_port, avi_content_type);
864894
}
865895
}
866896

@@ -943,7 +973,17 @@ void AVInput::dsAVVideoModeEventHandler(const char *owner, IARM_EventId_t eventI
943973
resolution.interlaced = eventData->data.hdmi_in_video_mode.resolution.interlaced;
944974
resolution.frameRate = eventData->data.hdmi_in_video_mode.resolution.frameRate;
945975
LOGWARN("Received IARM_BUS_DSMGR_EVENT_HDMI_IN_VIDEO_MODE_UPDATE event port: %d, pixelResolution: %d, interlaced : %d, frameRate: %d \n", hdmi_in_port,resolution.pixelResolution, resolution.interlaced, resolution.frameRate);
946-
AVInput::_instance->AVInputVideoModeUpdate(hdmi_in_port, resolution);
976+
AVInput::_instance->AVInputVideoModeUpdate(hdmi_in_port, resolution,HDMI);
977+
}
978+
else if (IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_VIDEO_MODE_UPDATE == eventId) {
979+
IARM_Bus_DSMgr_EventData_t *eventData = (IARM_Bus_DSMgr_EventData_t *)data;
980+
int composite_in_port = eventData->data.composite_in_video_mode.port;
981+
dsVideoPortResolution_t resolution = {};
982+
resolution.pixelResolution = eventData->data.composite_in_video_mode.resolution.pixelResolution;
983+
resolution.interlaced = eventData->data.composite_in_video_mode.resolution.interlaced;
984+
resolution.frameRate = eventData->data.composite_in_video_mode.resolution.frameRate;
985+
LOGWARN("Received IARM_BUS_DSMGR_EVENT_COMPOSITE_IN_VIDEO_MODE_UPDATE event port: %d, pixelResolution: %d, interlaced : %d, frameRate: %d \n", composite_in_port,resolution.pixelResolution, resolution.interlaced, resolution.frameRate);
986+
AVInput::_instance->AVInputVideoModeUpdate(composite_in_port, resolution,COMPOSITE);
947987
}
948988
}
949989

AVInput/AVInput.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class AVInput: public PluginHost::IPlugin, public PluginHost::JSONRPC
107107
void AVInputStatusChange( int port , bool isPresented, int type);
108108
static void dsAVStatusEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len);
109109

110-
void AVInputVideoModeUpdate( int port , dsVideoPortResolution_t resolution);
110+
void AVInputVideoModeUpdate( int port , dsVideoPortResolution_t resolution,int type);
111111
static void dsAVVideoModeEventHandler(const char *owner, IARM_EventId_t eventId, void *data, size_t len);
112112

113113
void AVInputALLMChange( int port , bool allmMode);

AVInput/AVInput.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@
765765
}
766766
},
767767
"videoStreamInfoUpdate": {
768-
"summary": "Triggered whenever there is an update in HDMI Input video stream info",
768+
"summary": "Triggered whenever there is an update in HDMI/Composite Input video stream info",
769769
"params": {
770770
"type": "object",
771771
"properties": {

AVInput/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ All notable changes to this RDK Service will be documented in this file.
1616

1717
* For more details, refer to [versioning](https://github.com/rdkcentral/rdkservices#versioning) section under Main README.
1818

19+
20+
##[1.7.1] - 2024-12-02
21+
###Changed
22+
- Added support for handling the videoStreamInfoUpdate for composite Input.
23+
1924
##[1.7.0] - 2024-09-24
2025
###Added
2126
- Added support for Getting the Maximum HDMI Compatibility version for the given port.

Analytics/Analytics.conf.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ if boolean("@PLUGIN_ANALYTICS_SIFT_BACKEND_ENABLED@"):
1515
sift.add("productname", "@PLUGIN_ANALYTICS_SIFT_PRODUCT_NAME@")
1616
sift.add("loggername", "@PLUGIN_ANALYTICS_SIFT_LOGGER_NAME@")
1717
sift.add("loggerversion", "@PLUGIN_ANALYTICS_SIFT_LOGGER_VERSION@")
18+
sift.add("platformdefault", "@PLUGIN_ANALYTICS_SIFT_PLATFORM_DEFAULT@")
1819
sift.add("maxrandomisationwindowtime", "@PLUGIN_ANALYTICS_SIFT_MAX_RANDOMISATION_WINDOW_TIME@")
1920
sift.add("maxeventsinpost", "@PLUGIN_ANALYTICS_SIFT_MAX_EVENTS_IN_POST@")
2021
sift.add("maxretries", "@PLUGIN_ANALYTICS_SIFT_MAX_RETRIES@")

Analytics/Analytics.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ if(PLUGIN_ANALYTICS_SIFT_BACKEND_ENABLED)
2020
kv(productname ${PLUGIN_ANALYTICS_SIFT_PRODUCT_NAME})
2121
kv(loggername ${PLUGIN_ANALYTICS_SIFT_LOGGER_NAME})
2222
kv(loggerversion ${PLUGIN_ANALYTICS_SIFT_LOGGER_VERSION})
23+
kv(platformdefault ${PLUGIN_ANALYTICS_SIFT_PLATFORM_DEFAULT})
2324
kv(maxrandomisationwindowtime, ${PLUGIN_ANALYTICS_SIFT_MAX_RANDOMISATION_WINDOW_TIME})
2425
kv(maxeventsinpost, ${PLUGIN_ANALYTICS_SIFT_MAX_EVENTS_IN_POST})
2526
kv(maxretries, ${PLUGIN_ANALYTICS_SIFT_MAX_RETRIES})

Analytics/Analytics.cpp

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,25 @@ namespace {
4242
namespace Plugin {
4343
SERVICE_REGISTRATION(Analytics, API_VERSION_NUMBER_MAJOR, API_VERSION_NUMBER_MINOR, API_VERSION_NUMBER_PATCH);
4444

45+
Analytics::Analytics(): mConnectionId(0), mAnalytics(nullptr)
46+
{
47+
SYSLOG(Logging::Startup, (_T("Analytics Constructor")));
48+
}
49+
50+
Analytics::~Analytics()
51+
{
52+
SYSLOG(Logging::Shutdown, (string(_T("Analytics Destructor"))));
53+
}
54+
4555
/* virtual */ const string Analytics::Initialize(PluginHost::IShell* service)
4656
{
4757
ASSERT(service != nullptr);
48-
mService = service;
49-
5058
ASSERT(mAnalytics == nullptr);
5159

60+
SYSLOG(Logging::Startup, (_T("Analytics::Initialize: PID=%u"), getpid()));
61+
62+
mService = service;
63+
5264
mAnalytics = service->Root<Exchange::IAnalytics>(mConnectionId, 2000, _T("AnalyticsImplementation"));
5365
ASSERT(mAnalytics != nullptr);
5466

@@ -58,7 +70,12 @@ namespace Plugin {
5870
configConnection->Configure(service);
5971
configConnection->Release();
6072
}
61-
RegisterAll();
73+
// Invoking Plugin API register to wpeframework
74+
Exchange::JAnalytics::Register(*this, mAnalytics);
75+
}
76+
else
77+
{
78+
SYSLOG(Logging::Startup, (_T("Analytics::Initialize: Failed to initialise Analytics plugin")));
6279
}
6380
// On success return empty, to indicate there is no error text.
6481
return ((mAnalytics != nullptr))
@@ -68,10 +85,11 @@ namespace Plugin {
6885

6986
/* virtual */ void Analytics::Deinitialize(PluginHost::IShell* service)
7087
{
71-
TRACE(Trace::Information, (_T("Analytics::Deinitialize")));
88+
SYSLOG(Logging::Shutdown, (string(_T("Analytics::Deinitialize"))));
7289
ASSERT(service == mService);
7390

7491
if (mAnalytics != nullptr) {
92+
Exchange::JAnalytics::Unregister(*this);
7593

7694
RPC::IRemoteConnection *connection(service->RemoteConnection(mConnectionId));
7795
VARIABLE_IS_NOT_USED uint32_t result = mAnalytics->Release();
@@ -93,12 +111,12 @@ namespace Plugin {
93111
connection->Release();
94112
}
95113
}
114+
SYSLOG(Logging::Shutdown, (string(_T("Analytics de-initialised"))));
96115
}
97116

98117
void Analytics::Deactivated(RPC::IRemoteConnection* connection)
99118
{
100119
if (connection->Id() == mConnectionId) {
101-
TRACE(Trace::Information, (_T("Analytics::Deactivated")));
102120

103121
ASSERT(mService != nullptr);
104122

Analytics/Analytics.h

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include "Module.h"
2323

2424
#include <interfaces/IAnalytics.h>
25+
#include <interfaces/json/JsonData_Analytics.h>
26+
#include <interfaces/json/JAnalytics.h>
2527

2628
namespace WPEFramework {
2729

@@ -47,16 +49,8 @@ namespace WPEFramework {
4749
Analytics& operator=(const Analytics&) = delete;
4850

4951
public:
50-
Analytics():
51-
mConnectionId(0),
52-
mAnalytics(nullptr)
53-
{
54-
RegisterAll();
55-
}
56-
virtual ~Analytics()
57-
{
58-
UnregisterAll();
59-
}
52+
Analytics();
53+
virtual ~Analytics();
6054
virtual const string Initialize(PluginHost::IShell* shell) override;
6155
virtual void Deinitialize(PluginHost::IShell* service) override;
6256
virtual string Information() const override { return {}; }
@@ -68,18 +62,9 @@ namespace WPEFramework {
6862
END_INTERFACE_MAP
6963

7064
static const string ANALYTICS_METHOD_SEND_EVENT;
71-
static const string ANALYTICS_METHOD_SET_SESSION_ID;
72-
static const string ANALYTICS_METHOD_SET_TIME_READY;
7365

7466
private:
7567
void Deactivated(RPC::IRemoteConnection* connection);
76-
// JSONRPC methods
77-
void RegisterAll();
78-
void UnregisterAll();
79-
80-
uint32_t SendEventWrapper(const JsonObject& parameters, JsonObject& response);
81-
uint32_t SetSessionIdWrapper(const JsonObject& parameters, JsonObject& response);
82-
uint32_t SetTimeReadyWrapper(const JsonObject& parameters, JsonObject& response);
8368

8469
private:
8570
PluginHost::IShell* mService;

0 commit comments

Comments
 (0)