From 5b8a8d3b6f6f508a4fb737255ec73ba033735fbd Mon Sep 17 00:00:00 2001 From: Siva Thandayuthapani Date: Tue, 14 May 2024 20:41:45 +0530 Subject: [PATCH 1/8] RDK-48604: New UserSettings Thunder Plugin --- interfaces/IUserSettings.h | 144 +++++++++++++++++++++++++++++++++++++ interfaces/Ids.h | 5 +- 2 files changed, 148 insertions(+), 1 deletion(-) create mode 100755 interfaces/IUserSettings.h diff --git a/interfaces/IUserSettings.h b/interfaces/IUserSettings.h new file mode 100755 index 00000000..aec64390 --- /dev/null +++ b/interfaces/IUserSettings.h @@ -0,0 +1,144 @@ +/* +* If not stated otherwise in this file or this component's LICENSE file the +* following copyright and licenses apply: +* +* Copyright 2024 RDK Management +* +* 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" + +namespace WPEFramework { +namespace Exchange { + // @json +struct EXTERNAL IUserSettings : virtual public Core::IUnknown { + enum { ID = ID_USER_SETTINGS }; + + // @event + struct EXTERNAL INotification : virtual public Core::IUnknown { + enum { ID = ID_USER_SETTINGS_NOTIFICATION }; + + // @brief The AudioDescription setting has changed. + // @param enabled: Enabled/Disabled. + virtual void OnAudioDescriptionChanged(const bool enabled) = 0; + + // @brief The preferredLanguages setting has changed. + // @param preferredLanguages: PreferredLanguages. + virtual void OnPreferredAudioLanguagesChanged(const string preferredLanguages) = 0; + + // @brief The PresentationLanguages setting has changed. + // @param presentationLanguages: PresentationLanguages. + virtual void OnPresentationLanguageChanged(const string presentationLanguages) = 0; + + // @brief The Captions setting has changed. + // @param enabled: Enabled/Disabled. + virtual void OnCaptionsChanged(const bool enabled) = 0; + + // @brief The PreferredCaptionsLanguages setting has changed. + // @param preferredLanguages: PreferredLanguages. + virtual void OnPreferredCaptionsLanguagesChanged(const string preferredLanguages) = 0; + + // @brief The PreferredClosedCaptionService setting has changed. + // @param service: "CC[1-4]", "TEXT[1-4]", "SERVICE[1-64]". + virtual void OnPreferredClosedCaptionServiceChanged(const string service) = 0; + }; + + virtual uint32_t Register(Exchange::IUserSettings::INotification* notification /* @in */) = 0; + virtual uint32_t Unregister(Exchange::IUserSettings::INotification* notification /* @in */) = 0; + + // @property + // @brief Sets AudioDescription ON/OFF. Players should preferred Audio Descriptive tracks over normal audio track when enabled + // @param enabled: Enabled/Disabled + virtual uint32_t SetAudioDescription(const bool enabled /* @in */) = 0; + + // @property + // @brief Gets the current AudioDescription setting + // @param enabled: Enabled/Disabled + virtual uint32_t GetAudioDescription(bool &enabled /* @out */) const = 0; + + // @property + // @brief A prioritized list of ISO 639-2/B codes for the preferred audio languages, + // expressed as a comma separated lists of languages of zero of more elements. + // The players will pick the audio track that has the best match compared with + // this list. In the absence of a matching track, the player should by best + // effort select the preferred audio track.*/ + // @param preferredLanguages: PreferredLanguages + virtual uint32_t SetPreferredAudioLanguages(const string preferredLanguages /* @in */) = 0; + + // @property + // @brief Gets the current PreferredAudioLanguages setting + // @param preferredLanguages: PreferredLanguages + virtual uint32_t GetPreferredAudioLanguages(string &preferredLanguages /* @out */) const = 0; + + // @property + // @brief Sets the presentationLanguages in a full BCP 47 value, including script, region, variant + // @param presentationLanguages: "en-US", "es-US", "en-CA", "fr-CA" + virtual uint32_t SetPresentationLanguage(const string presentationLanguages /* @in */) = 0; + + // @property + // @brief Gets the presentationLanguages + // @param presentationLanguages: "en-US", "es-US", "en-CA", "fr-CA" + virtual uint32_t GetPresentationLanguage(string &presentationLanguages /* @out */) const = 0; + + // @property + // @brief brief Sets Captions ON/OFF. + // @details A setting of ON indicates that Players should select a subtitle track for presentation + // The Setting does not influence any running sessions. It is up to the player to enforce the setting. + // This is a global state persisted by the TextTrack plug-in applying to all forms of text; closed captions, Captions + // and timed text types. + // Media players should to listen to OnCaptionsChanged notifications to react to platform wide dynamic state changes + // of this state while a playback is active. + // When media players start playback, they should also call the GetCaptions method to retrieve the current enabled state. + // This holds true for media players that utilize TextTrack render sessions for text track decode-display and also for media + // players or apps that decode-display internally + // @param enabled Sets the state + virtual uint32_t SetCaptions(const bool enabled /* @in */) = 0; + + // @property + // @brief Gets the Captions setting. + // @param enabled Receives the state + virtual uint32_t GetCaptions(bool &enabled /* @out */) const = 0; + + // @property + // @brief Set preferred languages for captions. + // @details A prioritized list of ISO 639-2/B codes for the preferred Captions languages, + // expressed as a comma separated lists of languages of zero of more elements. + // The players will pick the subtitle track that has the best match compared with + // this list. In the absence of a matching track, the player should by best + // effort select the preferred subtitle track. + // @param preferredLanguages Is the list to set (e.g. "eng,fra") + virtual uint32_t SetPreferredCaptionsLanguages(const string preferredLanguages /* @in */) = 0; + + // @property + // @brief Gets the current PreferredCaptionsLanguages setting. + // @param preferredLanguages (e.g. "eng,fra") + virtual uint32_t GetPreferredCaptionsLanguages(string &preferredLanguages /* @out */) const = 0; + + // @property + // @brief Sets the PreferredClosedCaptionService. + // @details The setting should be honored by the player. The behaviour of AUTO may be player specific. + // Valid input for service is "CC[1-4]", "TEXT[1-4]", "SERVICE[1-64]" + // @param service Identifies the service to display e.g. "CC3". + + virtual uint32_t SetPreferredClosedCaptionService(const string service /* @in */) = 0; + + // @property + // @brief Gets the current PreferredClosedCaptionService setting. + // @param service Identifies the service to display e.g. "CC3". + virtual uint32_t GetPreferredClosedCaptionService(string &service /* @out */) const = 0; +}; +} // namespace Exchange +} // namespace WPEFramework diff --git a/interfaces/Ids.h b/interfaces/Ids.h index c2ee007f..2f611c99 100644 --- a/interfaces/Ids.h +++ b/interfaces/Ids.h @@ -378,7 +378,10 @@ namespace Exchange { ID_DNS_SERVER = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4E0, ID_DNS_ZONE = ID_DNS_SERVER + 1, - ID_DNS_RECORD = ID_DNS_SERVER + 2 + ID_DNS_RECORD = ID_DNS_SERVER + 2, + + ID_USER_SETTINGS = RPC::IDS::ID_EXTERNAL_INTERFACE_OFFSET + 0x4F0, + ID_USER_SETTINGS_NOTIFICATION = ID_USER_SETTINGS + 1 }; } } From 7262cd2847fcb30764090363e4c967034d31be20 Mon Sep 17 00:00:00 2001 From: Siva Thandayuthapani Date: Wed, 15 May 2024 14:24:54 +0530 Subject: [PATCH 2/8] RDK-48604: New UserSettings Thunder Plugin --- interfaces/IUserSettings.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/interfaces/IUserSettings.h b/interfaces/IUserSettings.h index aec64390..832a55c1 100755 --- a/interfaces/IUserSettings.h +++ b/interfaces/IUserSettings.h @@ -37,11 +37,11 @@ struct EXTERNAL IUserSettings : virtual public Core::IUnknown { // @brief The preferredLanguages setting has changed. // @param preferredLanguages: PreferredLanguages. - virtual void OnPreferredAudioLanguagesChanged(const string preferredLanguages) = 0; + virtual void OnPreferredAudioLanguagesChanged(const string& preferredLanguages) = 0; // @brief The PresentationLanguages setting has changed. // @param presentationLanguages: PresentationLanguages. - virtual void OnPresentationLanguageChanged(const string presentationLanguages) = 0; + virtual void OnPresentationLanguageChanged(const string& presentationLanguages) = 0; // @brief The Captions setting has changed. // @param enabled: Enabled/Disabled. @@ -49,11 +49,11 @@ struct EXTERNAL IUserSettings : virtual public Core::IUnknown { // @brief The PreferredCaptionsLanguages setting has changed. // @param preferredLanguages: PreferredLanguages. - virtual void OnPreferredCaptionsLanguagesChanged(const string preferredLanguages) = 0; + virtual void OnPreferredCaptionsLanguagesChanged(const string& preferredLanguages) = 0; // @brief The PreferredClosedCaptionService setting has changed. // @param service: "CC[1-4]", "TEXT[1-4]", "SERVICE[1-64]". - virtual void OnPreferredClosedCaptionServiceChanged(const string service) = 0; + virtual void OnPreferredClosedCaptionServiceChanged(const string& service) = 0; }; virtual uint32_t Register(Exchange::IUserSettings::INotification* notification /* @in */) = 0; From 30c24793ba24bcc7391c63798940602407056abd Mon Sep 17 00:00:00 2001 From: Siva Thandayuthapani Date: Wed, 15 May 2024 17:49:53 +0530 Subject: [PATCH 3/8] RDK-48604: New UserSettings Thunder Plugin --- NOTICE | 3 +++ interfaces/IUserSettings.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NOTICE b/NOTICE index 0129f363..46d961d8 100644 --- a/NOTICE +++ b/NOTICE @@ -15,3 +15,6 @@ Licensed under the Apache License, Version 2.0 Copyright 2023 RDK Management Licensed under the Apache License, Version 2.0 + +Copyright 2024 Synamedia Ltd. +Licensed under the Apache License, Version 2.0 diff --git a/interfaces/IUserSettings.h b/interfaces/IUserSettings.h index 832a55c1..8996f4e7 100755 --- a/interfaces/IUserSettings.h +++ b/interfaces/IUserSettings.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: * -* Copyright 2024 RDK Management +* Copyright 2024 Synamedia Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 3dcba4b264e2748477e5fa19695786b73168efd3 Mon Sep 17 00:00:00 2001 From: Siva Thandayuthapani Date: Thu, 16 May 2024 15:56:05 +0530 Subject: [PATCH 4/8] RDK-48604: New UserSettings Thunder Plugin --- NOTICE | 3 --- interfaces/IUserSettings.h | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/NOTICE b/NOTICE index 46d961d8..0129f363 100644 --- a/NOTICE +++ b/NOTICE @@ -15,6 +15,3 @@ Licensed under the Apache License, Version 2.0 Copyright 2023 RDK Management Licensed under the Apache License, Version 2.0 - -Copyright 2024 Synamedia Ltd. -Licensed under the Apache License, Version 2.0 diff --git a/interfaces/IUserSettings.h b/interfaces/IUserSettings.h index 8996f4e7..4c8eb4b3 100755 --- a/interfaces/IUserSettings.h +++ b/interfaces/IUserSettings.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: * -* Copyright 2024 Synamedia Ltd. +* Copyright 2023 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From e4ed2e8dd1d9be742b984c266ac063331c68435b Mon Sep 17 00:00:00 2001 From: Siva Thandayuthapani Date: Thu, 16 May 2024 16:00:34 +0530 Subject: [PATCH 5/8] RDK-48604: New UserSettings Thunder Plugin --- interfaces/IUserSettings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/IUserSettings.h b/interfaces/IUserSettings.h index 4c8eb4b3..c5930b7b 100755 --- a/interfaces/IUserSettings.h +++ b/interfaces/IUserSettings.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: * -* Copyright 2023 RDK Management +* Copyright 2023 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From b5f3dcbe8c37e84cff5954279ab3e9c554fd8429 Mon Sep 17 00:00:00 2001 From: Siva Thandayuthapani Date: Thu, 16 May 2024 16:09:54 +0530 Subject: [PATCH 6/8] RDK-48604: New UserSettings Thunder Plugin --- interfaces/IUserSettings.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/interfaces/IUserSettings.h b/interfaces/IUserSettings.h index c5930b7b..acd38336 100755 --- a/interfaces/IUserSettings.h +++ b/interfaces/IUserSettings.h @@ -1,21 +1,21 @@ /* -* If not stated otherwise in this file or this component's LICENSE file the -* following copyright and licenses apply: -* -* Copyright 2023 RDK Management -* -* 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. -*/ + * If not stated otherwise in this file or this component's LICENSE file the + * following copyright and licenses apply: + * + * Copyright 2023 RDK Management + * + * 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 From 3b9e2b3b2266a262dd8e42762dd24b4fe1562b0e Mon Sep 17 00:00:00 2001 From: Siva Thandayuthapani Date: Thu, 16 May 2024 16:12:49 +0530 Subject: [PATCH 7/8] RDK-48604: New UserSettings Thunder Plugin --- interfaces/IUserSettings.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interfaces/IUserSettings.h b/interfaces/IUserSettings.h index acd38336..d28e7094 100755 --- a/interfaces/IUserSettings.h +++ b/interfaces/IUserSettings.h @@ -2,7 +2,7 @@ * If not stated otherwise in this file or this component's LICENSE file the * following copyright and licenses apply: * - * Copyright 2023 RDK Management + * Copyright 2024 RDK Management * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From ab9290d15c29a584498a48be6c596719ea819789 Mon Sep 17 00:00:00 2001 From: Siva Thandayuthapani Date: Tue, 21 May 2024 12:42:48 +0530 Subject: [PATCH 8/8] RDK-48604: New UserSettings Thunder Plugin --- interfaces/IUserSettings.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/interfaces/IUserSettings.h b/interfaces/IUserSettings.h index d28e7094..eb4a9a68 100755 --- a/interfaces/IUserSettings.h +++ b/interfaces/IUserSettings.h @@ -76,7 +76,7 @@ struct EXTERNAL IUserSettings : virtual public Core::IUnknown { // this list. In the absence of a matching track, the player should by best // effort select the preferred audio track.*/ // @param preferredLanguages: PreferredLanguages - virtual uint32_t SetPreferredAudioLanguages(const string preferredLanguages /* @in */) = 0; + virtual uint32_t SetPreferredAudioLanguages(const string& preferredLanguages /* @in */) = 0; // @property // @brief Gets the current PreferredAudioLanguages setting @@ -86,7 +86,7 @@ struct EXTERNAL IUserSettings : virtual public Core::IUnknown { // @property // @brief Sets the presentationLanguages in a full BCP 47 value, including script, region, variant // @param presentationLanguages: "en-US", "es-US", "en-CA", "fr-CA" - virtual uint32_t SetPresentationLanguage(const string presentationLanguages /* @in */) = 0; + virtual uint32_t SetPresentationLanguage(const string& presentationLanguages /* @in */) = 0; // @property // @brief Gets the presentationLanguages @@ -120,7 +120,7 @@ struct EXTERNAL IUserSettings : virtual public Core::IUnknown { // this list. In the absence of a matching track, the player should by best // effort select the preferred subtitle track. // @param preferredLanguages Is the list to set (e.g. "eng,fra") - virtual uint32_t SetPreferredCaptionsLanguages(const string preferredLanguages /* @in */) = 0; + virtual uint32_t SetPreferredCaptionsLanguages(const string& preferredLanguages /* @in */) = 0; // @property // @brief Gets the current PreferredCaptionsLanguages setting. @@ -133,7 +133,7 @@ struct EXTERNAL IUserSettings : virtual public Core::IUnknown { // Valid input for service is "CC[1-4]", "TEXT[1-4]", "SERVICE[1-64]" // @param service Identifies the service to display e.g. "CC3". - virtual uint32_t SetPreferredClosedCaptionService(const string service /* @in */) = 0; + virtual uint32_t SetPreferredClosedCaptionService(const string& service /* @in */) = 0; // @property // @brief Gets the current PreferredClosedCaptionService setting.