|
2 | 2 | * If not stated otherwise in this file or this component's LICENSE file the
|
3 | 3 | * following copyright and licenses apply:
|
4 | 4 | *
|
5 |
| - * Copyright 2024 RDK Management. |
| 5 | + * Copyright 2024-2025 RDK Management. |
6 | 6 | *
|
7 | 7 | * Licensed under the Apache License, Version 2.0 (the "License");
|
8 | 8 | * you may not use this file except in compliance with the License.
|
|
21 | 21 |
|
22 | 22 | #include "Module.h"
|
23 | 23 |
|
24 |
| -#define ITEXTTRACK_VERSION 1 |
| 24 | +#define ITEXTTRACK_VERSION 2 |
25 | 25 |
|
26 | 26 | namespace WPEFramework {
|
27 | 27 | namespace Exchange {
|
@@ -306,11 +306,59 @@ struct EXTERNAL ITextTrackClosedCaptionsStyle : virtual public Core::IUnknown {
|
306 | 306 | /* @} */
|
307 | 307 | };
|
308 | 308 |
|
| 309 | +/* |
| 310 | + * This is the COM-RPC interface for global TTML style overrides. |
| 311 | + */ |
| 312 | +/* @json 1.0.0 @text:keep */ |
| 313 | +struct EXTERNAL ITextTrackTtmlStyle : virtual public Core::IUnknown { |
| 314 | + enum { |
| 315 | + ID = ID_TEXT_TRACK_TTML_STYLE |
| 316 | + }; |
| 317 | + |
| 318 | + /* @event */ |
| 319 | + struct EXTERNAL INotification : virtual public Core::IUnknown { |
| 320 | + enum { |
| 321 | + ID = ID_TEXT_TRACK_TTML_STYLE_NOTIFICATION |
| 322 | + }; |
| 323 | + |
| 324 | + /** |
| 325 | + * @brief The TTML Style override settings has changed. |
| 326 | + * @text onTtmlStyleOverridesChanged |
| 327 | + */ |
| 328 | + virtual void OnTtmlStyleOverridesChanged(const string &style) {}; |
| 329 | + }; |
| 330 | + |
| 331 | + /** Register notification interface. |
| 332 | + * The callback will be called with the current settings. |
| 333 | + */ |
| 334 | + virtual Core::hresult Register(INotification *notification) = 0; |
| 335 | + /** Unregister notification interface */ |
| 336 | + virtual Core::hresult Unregister(const INotification *notification) = 0; |
| 337 | + |
| 338 | + /** |
| 339 | + * @brief Sets global TTML override style. |
| 340 | + * @details The styles given here (as "attr:value;attr:value") will be applied last to TTML sessions, meaning |
| 341 | + * that they will override styles given in the content. |
| 342 | + * The value will be persisted in the system. |
| 343 | + * The style setting will take effect immediately in all running (TTML) sessions, which has not applied a custom style. |
| 344 | + * @param style Contains the chosen override for styles |
| 345 | + * @text setTtmlStyleOverrides |
| 346 | + */ |
| 347 | + virtual Core::hresult SetTtmlStyleOverrides(const string& style) = 0; |
| 348 | + |
| 349 | + /** |
| 350 | + * @briet Gets the global TTML style overrides |
| 351 | + * @param style will receive the style overrides |
| 352 | + * @text getTtmlStyleOverrides |
| 353 | + */ |
| 354 | + virtual Core::hresult GetTtmlStyleOverrides(string& style /* @out */) const = 0; |
| 355 | + |
| 356 | +}; |
309 | 357 |
|
310 | 358 | /*
|
311 | 359 | This is the COM-RPC interface for handling TextTrack sessions.
|
312 | 360 | */
|
313 |
| -/* @json 1.0.0 @text:keep */ |
| 361 | +/* @json 1.1.0 @text:keep */ |
314 | 362 | struct EXTERNAL ITextTrack : virtual public Core::IUnknown {
|
315 | 363 | enum {
|
316 | 364 | ID = ID_TEXT_TRACK
|
@@ -462,6 +510,19 @@ struct EXTERNAL ITextTrack : virtual public Core::IUnknown {
|
462 | 510 | * @text setSessionSCTESelection
|
463 | 511 | */
|
464 | 512 | virtual Core::hresult SetSessionSCTESelection(const uint32_t sessionId) = 0;
|
| 513 | + |
| 514 | + /** |
| 515 | + * @brief Applies a custom TTML styling with overrides that is applied on all elements |
| 516 | + * @details When a custom styling override is applied on a specific TTML session, the styling carried on the data for the specified element is |
| 517 | + * overridden. For styling options, see https://www.w3.org/TR/2018/REC-ttml1-20181108/#styling-vocabulary-style |
| 518 | + * The format of the styling string is "attr:value;attr:value;attr:value" (see vocabulary; NB: not all styling is supported) |
| 519 | + * Styles not mentioned in the list will not be affected. |
| 520 | + * @param sessionId Is the session as returned in the ITextTrack interface. |
| 521 | + * @param style Contains the list of styles to be overridden |
| 522 | + * @text applyCustomTtmlStyleOverridesToSession |
| 523 | + */ |
| 524 | + virtual Core::hresult ApplyCustomTtmlStyleOverridesToSession(const uint32_t sessionId, const string &style) { return Core::ERROR_NOT_SUPPORTED; } |
| 525 | + |
465 | 526 | };
|
466 | 527 | } // namespace Exchange
|
467 | 528 | } // namespace WPEFramework
|
0 commit comments