Professional Documents
Culture Documents
©2010 IEEE. Personal use of this material is permitted. However, permission to reprint/republish this
material for advertising or promotional purposes or for creating new collective works for resale or
redistribution to servers or lists, or to reuse any copyrighted component of this work in other works must
be obtained from the IEEE. The original publication is available at
http://dx.doi.org/10.1109/MCOM.2010.5473867
GOMES SOARES LAYOUT 5/18/10 11:46 AM Page 74
systems. The article is organized as follows. The licensing, media presentation control, and
next section overviews some related work. We TCP/IP communications. LIME supports not A declarative
then introduce the main NCL concepts. We pre- only user interaction events, but also broadcaster
application is an
sent the Ginga-NCL architecture for IPTV sys- events, by means of bevent and beitem elements.
tems. The last section is dedicated to our final A beitem element describes an event message application whose
remarks. and the corresponding action (usually a function initial entity is of a
written in EcmaScript) to be accomplished when
the event occurs. Note that although spatiotem- declarative content
RELATED WORK poral synchronization among media objects can type. An imperative
DTV applications can be partitioned into a set be controlled by broadcast systems, the behavior
application is an
of declarative applications and a set of impera- must be imperatively defined using scripts.
tive applications [4]. A declarative application is After the advent of broadband TV, broadcast application whose
an application whose initial entity is of a declara- content may share its audience with downloaded initial entity is of
tive content type. An imperative application is widgets and online tasks like browsing and mes-
an application whose initial entity is of an imper- saging. This has pushed broadcasters and service an imperative
ative content type. operators to define standardized platforms that content type.
Most terrestrial DTV systems offer support harmonize and explore this hybrid scenario.
for both paradigms. For example, the European HbbTV [16] supports web technologies like
Digital Video Broadcast (DVB )[5] system and XHTML and EcmaScript for broadcast or down-
the American Advanced Television Systems loaded applications. However, application signal-
Committee (ATSC) [6] system support Java, ing is done in the broadcast domain. The HbbTV
EcmaScript, and XHTML in their middleware standardization process started in the third quar-
specifications; the Association of Radio Indus- ter of 2009 in the European Telecommunica-
tries and Businesses (ARIB) Japanese system tions Standards Institute (ETSI).
also provides both declarative and imperative The BBC’s Project Canvas [17] is an initiative
support, although current products implement to standardize a common platform that broad-
only the declarative language BML [7], with casters can join, making their multimedia con-
EcmaScript as the scripting language. The Brazil- tent available to compatible IPTV terminals.
ian SBTVD system specifies Java and Lua as Some discussions and consultations are still run-
imperative languages for its middleware, called ning at BBC Trust, and there are no technical
Ginga. NCL is the declarative language of Ginga. standards published yet, although web technolo-
Besides offering an application programming gies are said to be a natural choice.
interface (API) for interactive applications like Verizon’s FiOS TV [18] offers a framework
terrestrial DTV, an IPTV middleware integrates for developing TV widgets based on the Lua lan-
specific IPTV components and services. Among guage. The framework incorporates the Lua vir-
those components, the most common are video tual machine and extended Lua APIs such as
on demand (VoD), linear TV, IP communica- Graphics, Events, Timers, and Webservices.
tion, remote software update, and content search Authoring DTV applications using imperative
engines. languages is more complex and more error-
Most IPTV service providers use proprietary prone than using declarative domain-specific
middleware implementations [8] from vendors languages (DSLs). Moreover, imperative inter-
like Microsoft, Minerva, Orca, Siemens, Soft- preted system languages like Java have engines
AtHome, and Alcatel-Lucent. Microsoft Media- that are very resource consuming and have a
room (an evolution of Microsoft TV) [9] is based considerable memory footprint. On the other
on the .NET framework compact for end termi- hand, XHTML carries a legacy from previous
nals, in order to offer a C#/XML API (Sil- technologies developed for text navigation and
verlight) for applications. Minerva Networks has formatting, and lots of add-ons have been creat-
developed a middleware known as iTVManager ed to overcome its limitations. XHTML is
[10], which offers a C language interface for its focused on user interactions for media asset pre-
applications. The RIGHTV middleware [11], sentation synchronization, forcing application
developed by Orca Interactive, is based on authors to solve spatiotemporal synchronization
XHTML browsers. Siemens has acquired Myrio that goes further than simple user interactions,
[12], which offers Java and XHTML APIs. The as well as content and presentation adaptations
SoftAtHome operating platform [13] is a recent and other issues, using imperative objects, usual-
initiative from Orange, Thomson, and Sagem to ly implemented using EcmaScript. Thus, the
provide a declarative application environment great advantage of using declarative DSL is lost,
based on HTML, JavaScript, and Adobe Flash. with the expense of using a scripting language
Alcatel-Lucent’s MiViewTV [14] offers a devel- greedy in CPU and memory consumption.
opment framework totally based on Adobe A declarative approach that fulfills the main
Flash. requirements of a DTV application, relegating
Lightweight Interactive Multimedia Environ- to the imperative approach only particular com-
ment (LIME) [15], like NCL, is an ITU-T Rec- putations, seems to be the right solution for a
ommendation for IPTV multimedia applications DTV middleware API. This approach would
and is based on the Japanese BML standard for boost integration, simplicity and better resource
broadcasting. LIME specifies a small profile of usage in IPTV platforms. Besides that, it would
XHTML, CSS, DOM, and EcmaScript, where make the authoring process easier and less error-
broadcast-specific functions from BML were prone.
removed. The LIME EcmaScript API contains NCL [1] and MPEG-4 Lightweight Applica-
extensions to deal with IPTV-specific functional- tion Scene Representation (LASeR) [19] are the
ities such as IPTV EPG, persistency, content technologies currently closest to fulfilling these
requirements. Based on scalable vector graphics element, <ncl>, and its child elements, <head>
NCL defines the glue (SVG) [20] and other extensions [19], LASeR and <body>, following the terminology adopted
has its focus on media synchronization, as well by Word Wide Web Consortium (W3C) stan-
that holds media as NCL. Both languages support content and dards.
objects together in a presentation adaptability, and provide support The <head> element may have
multimedia for live editing commands. NCL reuse facilities <importedDocumentBase>, <ruleBase>,
[21] are more versatile than LASeR’s. NCL also <transitionBase>, <regionBase>,
presentation. offers more powerful support to applications tar- <descriptorBase>, and <connectorBase>
NCL applications geting multiple exhibition devices. Despite being elements as its children. The <body> element
a good solution, mainly for mobile devices,
only define how LASeR does not have a commercial implemen-
media objects are tation yet.
1: <ncl>
structured and NCL was the first standardized technology of 2: <head>
the ITU-T multimedia application framework 3: <importedDocumentBase>
related, in time and for IPTV services [3, 22]. Using NCL, an author 4: <importNCL/>
can declaratively describe the spatial and tempo- 5: </importedDocumentBase>
space. As a glue 6: <ruleBase>
ral behavior of a multimedia presentation, asso- 7: <importBase/>
language, NCL does ciate hyperlinks (for viewer interactions) with 8: <compositeRule/>
not restrict or media objects, define alternatives for content 9: <rule>
and content presentation (adaptation), and 10: </ruleBase>
prescribe any media- 11: <transitionBase>
describe the presentation layout on multiple 12: <importBase/>
object content type. exhibition devices. In addition, NCL provides an 13: <transition/>
API that allows building and modifying an appli- 14: </transitionBase>
cation on the fly through live editing commands. 15: <regionBase>
16: <importBase/>
NCL does not define any media itself. As a glue 17: <region>
language, NCL bypasses legacy problems embed- 18: <region/>
ding other objects. Moreover, NCL supports a 19: </region>
very efficient and lightweight scripting language 20: </regionBase>
21: <descreiptorBase>
when algorithmic computations are needed. 22: <importBase/>
23: <descriptor>
24: <descriptorParam/>
THE NESTED CONTEXT LANGUAGE 25: </descriptor>
26: <descriptorSwitch>
NCL defines the glue that holds media objects 27: <defaultDescriptor/>
together in a multimedia presentation. NCL 28: <bindRule/>
applications only define how media objects are 29: <descriptor/>
structured and related in time and space. As a 30: </descriptorSwitch>
31: </descriptorBase>
glue language, NCL does not restrict or pre- 32: <connectorBase>
scribe any media object content type. In this 33: <importBase/>
sense, media objects may be image objects 34: <causalConnector>
(JPEG, PNG, etc.), video objects (MPEG, MOV, 35: <connectorParam/>
36: <compoundCondition/>
etc.), audio objects (MP3, WMA, etc.), text 37: <compoundAction/>
objects (TXT, PDF, etc.), imperative objects 38: </causalConnector>
(Xlet, Lua, etc.), other declarative objects 39: </connectorBase>
(HTML, LIME, SVG, nested NCL, etc.), and so 40: </head>
41: <body>
on. Which media objects are supported depends 42: <port/>
on which media players are embedded in the 43: <property/>
NCL engine. It is worth mentioning that NCL 44: <media>
treats main audiovisual streams like all other 45: <area/>
46: <property/>
media objects it can relate. It should also be 47: </media>
stressed that NCL treats an XHTML document 48: <context>
as one of its possible media object types. There- 49: <port/>
fore, NCL does not substitute but embeds 50: <property/>
51: <media/>
XHTML-based documents. 52: <context/>
In the recently approved revision of ITU-R 53: <link/>
Recommendation BT.1699 [23], NCL was intro- 54: <switch/>
duced as a glue language to harmonize declara- 55: </context>
56: <switch>
tive content for DTV. NCL can be viewed as a 57: <defaultComponent/>
feasible solution to promote lightweight integra- 58: <switchPort/>
tion among most multimedia application tech- 59: <bindRule/>
nologies mentioned in the previous section. 60: <media/>
61: <context/>
NCL is an XML application that follows the 62: <switch/>
modularization approach. Several NCL profiles 63: <link>
have been defined. Of special interest is the 64: <linkParam/>
Enhanced DTV (EDTV) Profile, defined for 65: <bind>
66: <bindParam/>
DTV. 67: </bind>
Figure 1 shows an almost complete NCL ele- 68: </link>
ment tree. Figure 3 exemplifies an NCL applica- 69: </body>
tion, discussed below to clarify concepts and to 70: </ncl>
illustrate the use of NCL elements.
The NCL Structure module defines the root Figure 1. Structure of NCL documents.
<transition> elements, and shall be defined device screen. Lines 10 to 12 define the
as a child element of the <head> element. Tran- “advertRg” region as filling the whole “sys-
sition effects can be applied at the beginning or temScreen(2)” secondary display. Lines 13 to
end of a media object presentation, as defined in 18 define the descriptor base, whose
attributes of the <descriptor> element asso- <descriptor> elements define in which region
ciated with the media object. each related media object will be exhibited. The
In order to illustrate an NCL use case, “iconDs” descriptor also specifies the explicit
assume the following simple application: during duration of 40 s for the icon exhibition.
a soccer game animation, an advertisement, tem- Lines 19 to 29 define the connector base. The
porally related with a special scene of the anima- causal connector “onBeginStart” has its con-
tion, is presented, allowing a viewer to interact dition satisfied when a media object’s anchor
to buy the product (soccer shoes). In order to starts its presentation, triggering, as a result, the
avoid annoying other viewers, the interaction starting presentation action on another media
processes will not be exhibited on the TV screen, object’s anchor. The causal connector “onKey
but on secondary device screens, for example, SelectionStart” specifies that the selection
mobile phones. Figure 2 illustrates this applica- of a media object’s anchor, by pressing a key,
tion. The complete NCL code is presented in triggers the starting presentation action on
Fig. 3. another media object’s anchor.
In Fig. 3, lines 5 to 9 define two regions in The <body> element defines the document
the base device (the TV set). The “main- structure. The port in line 32 states from which
ScreenRg” region occupies the whole display media object the document presentation initiates
and the “iconRg” region (with zIndex=“1”) (in this case, the “video” media object). The
overlays the previous region (default zIn- “video” media object (lines 33 to 36) is
dex=“0”) in the bottom right corner of the received from
“rtp://www.ginga.org.br/video.
mp4” to be presented in full screen, as defined
1: <?xml version=”1.0” encoding=”ISO-8859-1”?> by its descriptor. The “icon” is an imperative
2: <ncl id=”merchandisingDocument” media-object with Lua code, implementing a
3: xmlns=”http://www.ncl.org.br/NCL3.0/EDTVProfile:> blinking soccer shoes image. The “advert”
4: <head> media object (lines 39 and 40) is an XHTML
5: <regionBase>
6: <region id=”mainScreenRg”/> content to be presented on secondary devices.
7: <region id=”iconRg” bottom=”10%” right=”10%” Lines 41 to 45 define the first relationship,
8: width=”20% height=”20%” zIndex=”1”/> stating that the “icon” media object must start
9: </regionBase> its exhibition as soon as the “iconA” temporal
10: <regionBase device=”systemScreen(2)”>
11: <region id=”advertRg”/> anchor of the “video” media object begins its
12: </regionBase> presentation. Lines 46 to 50 specify another rela-
13: <descriptorBase> tionship, establishing that a viewer interaction
14: <descriptor id=”mainScreenDs” region=”mainScreenRg”/> with the “icon” image pressing the remote
15: <descriptor id=”iconDs” region=”iconRg”
16: explicitDur=”40s”/> control RED key must start “advert” media
17: <descriptor id=”advertDs” region=”advertDs”/> object presentation (a purchase web page) on
18: </descriptorBase> secondary devices.
19: <connectorBase> The Lua code that carries out the soccer
20: <causalConnector id’”onBeginStart”>
21: <simpleCondition role=”onBegin”/> shoes animation is presented in Fig. 4.
22: <simpleAction role=”start”/> The isON and stop flags (line 1) control
23: </causalConnector> when the soccer shoes icon is presented and
24: <causalConnector id=”onKeySelectionStart”> when the animation stops, respectively. The
25: <connectorParam name=”keyCode”/>
26: <simpleCondition role=”onSelection”key=”$keyCode”/> function myBlinkAnimation is used to
27: <simpleAction role=”start”/> redraw the canvas, performing the blink effect
28: </causalConnector> on the icon. The function starts getting the can-
29: </connectorBase> vas size (line 3), draws a rectangle filling the
30: </head>
31: <body> canvas (line 4), and then combines the soccer
32: <port id=”mainP” component=”video”/> shoes image with the canvas, depending on the
33: <media id=”video” descriptor-”mainScreenDs” isON flag value (lines 5 to 7). Line 8 updates
34: src=”rtp://www.ginga.org.br/video.mp4”> the isON flag, and line 9 calls the canvas flush,
35: <area id=”iconA” begin=”10s” end=”50s”/>
36: </media> in order to update the screen. Line 10 calls
37: <media id=”icon” descriptor=”iconDs” myBlinkAnimation every 1000 ms, while
38: src=” blinkAnimation.lua”/> stop flag is true.
39: <media id=”advert” descriptor=”advertDs” The NCLua API defines an event-oriented
40: src=”http://www.ginga.org.br/buy.xhtml”/>
41: <link xconnector=”onBeginStart”> communication between NCL and Lua codes.
42: <bind role=”onBegin” component=”video” When the Lua object is started, line 18 registers
43: interface=”iconA”/> an event handler for the stop presentation event
44: <bind role=”start” component=”icon”/> to be received from NCL, and starts the blinking
45: </link>
46: <link xconnector=”onKeySelectionStart”> animation (line 19), calling the myBlinkAni-
47: <linkParam name=”keyCode” value=”RED”/> mation function. When an NCL link stops the
48: <bind role=”onSelection” component=”icon”/> Lua object, a “stop” event is received and
49: <bind role=”start” component=”advert”/> treated by lines 13 to 16.
50: </link>
51: </body>
52: </ncl>
THE GINGA-NCL ARCHITECTURE
Figure 3. NCL application code. Ginga-NCL was initially proposed for terrestrial
TCP UDP
IP
tation can be obtained from http://www.ncl.org.br. and suitable solution in such a hybrid scenario
There are several commercial implementa- where harmonization is desirable and now
tions of Ginga-NCL for terrestrial set-top boxes. demanded.
Some of them also offer support for IPTV plat-
forms. Some commercial set-top boxes plan to REFERENCES
offer Ginga-NCL support for both IPTV and [1] ABNT NBR, “Digital Terrestrial Television — Data Coding
satellite TV. and Transmission Specification for Digital Broadcasting
In agreement with the ITU-T multimedia — Part 2: Ginga-NCL for Fixed and Mobile Receivers —
application framework for IPTV [22], this article XML Application Language for Application Coding”;
http://www.abnt.org.br/imagens/Normalizacao_TV_Digi-
proposes Ginga-NCL integration with third party tal/ABNTNBR15606-2_2007Ing_2008.pdf
IPTV middlewares, extending their API to sup- [2] R. Ierusalimschy, Programming in Lua, 2nd ed., Lua.org,
port NCL DTV applications. The integration 2006.
can be done through adapting Ginga-CC to [3] ITU-T Rec. H.761, “Nested Context Language (NCL) and
Ginga-NCL for IPTV Services,” Geneva, Apr. 2009.
IPTV platforms or adapting the third-party [4] S. Morris and A. Smith-Chaigneau, Interactive TV Stan-
IPTV middleware’s core to provide the API dards: A Guide to MHP, OCAP, and JavaTV, Focal Press,
requested by Ginga-NCL. 2005.
Several advantages come from Ginga-NCL [5] ETSI Std. TS 102 812, “Digital Video Broadcasting
(DVB), Multimedia Home Platform (MHP) Specification,”
integration to IPTV platforms. First, Ginga-NCL v. 1.1.1, 2003.
provides a powerful declarative language target- [6] ATSC Std., “Advanced Application Platform (ACAP),”
ed to the DTV application domain, unlike all Doc. A/101, 2005.
other DTV declarative middleware specifica- [7] ARIB STD-B24 v. 3.2, “Volume 3: Data Coding and Trans-
mission Specification for Digital Broadcasting,” 2002.
tions, which are based on general-purpose lan- [8] “IPTV Middleware Market Dynamics,” Light Reading
guages or web technologies. Insider, vol. 6, no 9.
Second, NCL applications are easier to design [9] Microsoft, “Microsoft Mediaroom”; http://www.microsoft.
and usually do not require programming exper- com/mediaroom/
[10] Minerva Networks; http://www.minervanetworks.com
tise, as imperative language approaches do. [11] Orca Interactive; http://www.orcainteractive.com
Imperative approaches occasionally put applica- [12] Myrio and Nokia Siemens Networks; http://www.
tion portability at risk, presentation control is myrio.com
much more difficult to achieve as a rule, and [13] Soft At Home; http://www.softathome.com
[14] Jornada en la Cátedra Alcatel-Lucent, “IPTV Trends,”
they are more prone to errors committed by Madrid, Spain 2009.
application programmers. [15] ITU-T Rec. H.762, “Lightweight Interactive Multimedia
Third, an expressive declarative language Environment,” Geneva, Dec. 2009.
such as NCL can support almost all usual DTV [16] HbbTV, “HbbTV Overview,” EBU/ETSI Hybrid Broadcast
Broadband Wksp., Amsterdam, 2009.
applications, and for those that do not match the [17] The Project Canvas Wiki; http://www.projectcanvas.
NCL model focus, NCL supports the efficient co.uk
and lightweight Lua scripting language. [18] Verizon FiOS TV Development Resources; https://www22.
Finally, it is possible to build hybrid receivers verizon.com/fiosdeveloper/General/Resource.aspx
[19] ISO/IEC 14496-20, “Lightweight Application Scene
supporting both terrestrial DTV and IPTV (and Representation (LASeR) and Simple Aggregation Format
other DTV systems as well), decreasing receiver (SAF),” 2006.
costs and offering both services to users. The [20] W3C Rec., “Scalable Vector Graphics — SVG 1.1 Speci-
glue-language approach of NCL is an efficient fication,” 2003; http://www/w3/org/TR/SVG11
[21] L. F. G. Soares and C. S. Soares Neto, “Nested Context where since 1990 he has headed the TeleMídia Lab. He is a
Language 3.0 — Reúso e Importação,” tech. rep., Infor- board member of the Brazilian Internet Steering Commit-
matics Dept., no. 33, 2009. tee and Chair of the Middleware Working Group for the
[22] ITU-T Rec. H.760, “Overview of Multimedia Application Brazilian Digital TV System.
Frameworks for IPTV,” Geneva, Apr. 2009.
[23] ITU-R Rec. BT-1699, “Harmonization of Declarative M A R C I O F E R R E I R A M O R E N O (mfmoreno@inf.puc-rio.br)
Content Format for Interactive TV Applications,” Gene- received his M.Sc. degree from the Informatics Department
va, 2009. of PUC-Rio, Brazil, in April 2006. At present, he is a Ph.D.
student at PUC-Rio and an associate researcher in the
TeleMídia Lab. He has worked on the terrestrial Brazilian
ADDITIONAL READING DTV specifications and the Ginga-NCL reference implemen-
[1] ISO/IEC Std. 13818-6, “Information Technology — tation.
Generic Coding of Moving Pictures and Associated
Audio Information — Part 6: Extensions for DSM-CC,” CARLOS DE SALLES SOARES NETO (csalles@inf.puc-rio.br) is an
1998. assistant professor at the Federal University of Maranhão
(UFMA). He received his M.Sc. degree from the Informatics
Department of PUC-Rio in August 2003. At present, he is a
BIOGRAPHIES Ph.D. student at PUC-Rio and an associate researcher in the
TeleMídia Lab. He has worked on the terrestrial Brazilian
LUIZ FERNANDO GOMES SOARES (lfgs@inf.puc-rio.br) is a full
DTV specifications.
professor in the Informatics Department of the Pontifical
Catholic University of Rio de Janeiro (PUC-Rio), Brazil,
M ARCELO F ERREIRA M ORENO (moreno@inf.puc-rio.br) is an
SERIES EDITORS
Ying-Dar Lin Erica Johnson Tom McBeath
ydlin@cs.nctu.edu.tw erica.johnson@iol.unh.edu Tom.McBeath@spirent.com
National Chiao Tung University University of New Hampshire Spirent Communications Inc., USA
Network Benchmarking Lab (NCTU-NBL), Taiwan InterOperability Lab (UNH-IOL), USA