Android4TV - SW Architecture v1.5
Android4TV - SW Architecture v1.5
Project: ANDROID4TV
Filename iWedia_Android4TV_SW_Architecture_v1.5
Version v1.5
Classification PUBLIC
Status Approved
Date May 20, 2014
Author iWedia
This document is the intellectual property of iWedia and contains confidential and privileged information. The
reproduction, modification, or communication to third parties (or to other than the addressee) of any part of this document
is strictly prohibited without the prior written consent from iWedia.
SUMMARY
PREFACE .......................................................................................................................................................... 3
AUDIENCE ....................................................................................................................................................... 3
RELATED DOCUMENTS ..................................................................................................................................... 3
DEFINITIONS/ACRONYMS/ABBREVIATIONS ......................................................................................................... 3
1 INTRODUCTION ...................................................................................................................................... 4
1.1 FEATURES ........................................................................................................................................... 4
1.2 HIGH LEVEL SOFTWARE ARCHITECTURE ............................................................................................... 5
2 ANDROID4TV ARCHITECTURE OVERVIEW ......................................................................................... 6
2.1 APPLICATION LAYER ............................................................................................................................. 7
2.2 ANDROID4TV FRAMEWORK................................................................................................................... 7
2.3 NATIVE LAYER ...................................................................................................................................... 9
3 ANDROID4TV MODULES...................................................................................................................... 11
3.1 ANDROID4TV BASIC DTV FEATURES .................................................................................................. 12
3.1.1 Live broadcast.......................................................................................................................... 12
3.1.2 IPTV ......................................................................................................................................... 13
3.1.3 EPG ......................................................................................................................................... 15
3.1.4 PVR .......................................................................................................................................... 15
3.1.5 Teletext module ....................................................................................................................... 16
3.1.6 Subtitle ..................................................................................................................................... 17
3.2 ANDROID4TV EXTENDED DTV FEATURES ........................................................................................... 17
3.2.1 Common Interface (CI) ............................................................................................................ 17
3.2.2 HbbTV ...................................................................................................................................... 18
3.2.3 MHEG ...................................................................................................................................... 20
3.2.4 Local Media module ................................................................................................................. 21
3.2.5 DLNA ....................................................................................................................................... 22
3.2.6 Insight client ............................................................................................................................. 23
4 PRODUCT DELIVERABLES ................................................................................................................. 26
4.1 CHANGES TO THE ANDROID BASE SOURCE .......................................................................................... 26
4.1.1 Changes to WebCore library ................................................................................................... 27
This document is intended for the people who are involved in the process of evaluation,
implementation, integration or testing of the Android4TV components. It provides a high-level
overview of the Android4TV solution and should help the user to better understand the capabilities
of the individual modules or the solution in its entirety.
RELATED DOCUMENTS
DEFINITIONS/ACRONYMS/ABBREVIATIONS
Definition/Acronym/Abbreviation Description
PVR Personal Video Recorder
EPG Electronic Program Guide
MHEG Multimedia And Hypermedia Experts Group
HBBTV Hybrid Broadcast Broadband Television
CA Conditional Access
CI/CI+ Common Interface/Common Interface Plus
POSIX Portable Operating System Interface
SDK Software Development Kit
GUI Graphic User Interface
API Application Programming Interface
NPAPI Netscape Plugin Application Programming Interface
HAL Hardware Abstraction Layer
DTV Digital Television
DVB Digital Video Broadcasting
DVB-S, DVB-C, DVB-T Digital Video Broadcasting – Satellite, Cable, Terrestrial
AIT Application Information Table
JNI Java Native Interface
DLNA Digital Living Network Alliance
DTCP Digital Transmission Content Protection
DMP, DMR, DMS, DMC Digital Media Player, Renderer, Server, Controller
UPnP Universal Plug and Play
DTG Digital TV Group
HD High Definition
RTOS Real Time Operating System
Table 2 : Definitions/acronyms/abbreviations
1.1 FEATURES
Android4TV main goal is to extend the Android application framework in order to provide
following features:
DTV features like channel list, channel setting, now-next info, EPG, Teletext, Subtitles.
Remote Control Navigation (TV can be remotely controlled by another Android mobile
phone or tablet).
Main use cases for Android4TV software solution in Android OS are as following:
Support for both, web and broadcast based services (HbbTV, MHEG, IPTV, SAT>IP)
Android4TV software solution is divided into several software layers and each belongs to
specific part of the Android OS. Each layer provides some specialized service for others and
provides modular structure where specific blocks can be potentially replaced by others with same
functionality (Figure 1).
Java
Android4TV app - UI
Other TV Android Apps
Related
Android4TV app - Apps
buissines logic
Android4TV Framework
Native
Insight CWMP client
DTV Middleware Abstraction Layer
Android Libraries
DTV Middleware
Kernel
Media
Navigator EPG CA MMI HbbTV Calendar Games
player
Embedded
Widgets OTT client IPTV …
browser Widgets …
Java Classes
Stream Activity Window Content
Setup Service list EIM
play manager manager providers
TTX / View Package
PVR CA MMI MHEG …
Subtitle system manager
… …
TV HAL
Linux / drivers
Tuner Demultiplexer Peripherals Display
HW
Application layer
Native layer
Most important modules that compose ANDROID4TV building blocks are also shown on
Figure 2. Detailed description of building blocks and relations between modules from which
modules are consisted of can be found in Chapter Error! Reference source not found..
Application layer contains Java applications which are written as all other Android applica-
tions by all means, using the standard Java Android SDK and Android4TV application framework
extension.
Android4TV application is consisted of two processes that communicate between each other
and follow client-server model.
Android4TV application that has server role is called business logic. Bussiness logic is
Android Java service that is running continuously in the background, even when there is no client
application. Most important roles of business logic are:
Providing asynchronous events
Maintaining and tracking the life cycle of the client applications
Android4TV application that takes client role is simple UI with only graphic blocks (dialogs,
menus etc.) without any unnecessary logic inside. It is a single Android activity. Graphic blocks are
enchanced graphic elements from Android application framework in the way that they can be easily
customized.
All DTV features are integrated within single DTV application aimed to be used as a tool for
demonstration of the framework capabilities. Together with basic DTV features, DTV application
contains other features like local/network multimedia playback, network settings etc.
Android4TV framework layer encapsulates DTV features into Java classes, interfaces and
enumerations. The main role of this layer is to provide the interface for creating Android
applications with DTV features.
Android4TV framework is using underlying native services to provide basic DTV and
multimedia playback features. For IPC calls in an Android environment Binder mechanism is used.
In this case, native services are acting as “server” for Binder IPC calls from Java.
Android4TV Framework API comprises following set of Java packages:
com.iwedia.dtv.audio
o provides volume control, audio track manipulation and audio decoding events
com.iwedia.dtv.ci
o provides conditional access routines required for encrypted DTV service playback
com.iwedia.dtv.display
o provides display layers manipulation, changing z-order, size/position etc.
com.iwedia.dtv.dtvmanager
o provides the DTV Service implemented as DTVManager, that is available via Binder service
com.iwedia.dtv.framework.service
o provides interface definitions for asynchronous events
com.iwedia.dtv.hbbtv
o provides HbbTV control routines such as show/hide, load URL, set keys
com.iwedia.dtv.mheg
o provides MHEG control routines such as show/hide, send key
com.iwedia.dtv.parental
o provides parental rating setup and control utilities
com.iwedia.dtv.picture
o provides video post-processing routines (de-interlacing, noise reduction, ..)
com.iwedia.dtv.pvr
o provides DTV broadcast recording, playback of recorded content and timeshifted playback
com.iwedia.dtv.reminder
o provides reminder control functionality
com.iwedia.dtv.route
o provides route manipulation routines, creating route and obtaining device descriptors
com.iwedia.dtv.scan
o provides service scan setup and control routines for different signal types
com.iwedia.dtv.service
o provides service and service list control routines
com.iwedia.dtv.setup
o provides country and language settings
com.iwedia.dtv.sound
o provides audio post-processing routines (equalizer, audio presets ..)
com.iwedia.dtv.streamcomponent
o provides broadcast stream components manipulation routines
com.iwedia.dtv.subtitle
o provides subtitle control functionality
com.iwedia.dtv.swupdate
o provides system software update control functionality
com.iwedia.dtv.systemmanager
o provides power management utilities and setting wake up sources
com.iwedia.dtv.teletext
o provides teletext manipulation utilities
com.iwedia.dtv.types
o provides basic type definitions used in module
com.iwedia.dtv.video
o provides video manipulation utilities and video decoding events
Traditionally, DTV software stack is implemented in native “C” code. Due to the fact that most field-
proven software stacks are already implemented in “C” (migration from various embedded
systems) and to achieve significant performance gain, an important portion of DTV software stack
is implemented in native.
DTV software stack in native consists of following software layers:
DTV Middleware Abstraction Layer exposes middleware features to the upper layers. It
abstracts the middleware services and provides simpler middleware usage. When
integrated in Android environment, this layer needs to be adapted to suit Android Binder
IPC.
DTV middleware layer, written in native (C/C++) code, uses Linux drivers for managing
DTV hardware. Implementation of this layer is vendor-specific. The main task of middleware
module is to hide the complexity of underlying driver layer logic in order to provide simple API
which can be used by the upper layer software modules. Beside that, core middleware
module provides essential features required for DTV, which are:
PSI/SI engine – provides simple interface for service scan implementation
PVR engine – provides broadcast stream recording, recorded content playback
and time-shifted playback
Service database – provides storage (in non-volatile memory) of services found
during service scan
Settings database – provides storage (in non-volatile memory) of various settings
such as sound and picture settings, country and language settings and other
OAD – provides Over-The-Air software update
DSMCC – provides support for Digital Storage Media Command and Control toolkit
Beside afore mentioned features provided by core middleware module, most important
features provided by middleware module are:
Service scan
Service playback
Teletext
Subtitles
EPG
SSU
DTV Hardware Abstraction Layer (HAL) defines the way how DTV middleware interacts
with Android and low level code. It defines the interface that middleware layer requires Linux
drivers to implement. This layer enables porting of middleware layer (without changes) on
any platform that complies with defined interface. DTV HAL interface is expected to provide:
Power handling
Security module
In Android4TV software solution the DTV application is responsible for the presentation of
the video and graphic content, therefore it provides:
The board support package (BSP) low level drivers will be used to:
Tuner/demodulator control
DTV inputs/interfaces
A/V post-processing
Android4TV DTV HAL coexists without interference with existing Android Media Framework
as there is no overlapping functionality with one exception to Media Player and AV HAL module as
they share the same resources.
Android4TV framework consists of software modules that cover basic DTV features:
Live Broadcast
IPTV
EPG
PVR
Teletext
Subtitle
HbbTV
MHEG
Insight client
Implementation of each module is spread through software layers mentioned above. Layers
and modules are designed in such way that any modules part from one layer can be replaced
without changing of modules parts from other layers.
Java
Native
DTV MAL
DTV Middleware
Kernel
Video Layer
Acqusition protocols:
RTP, UDP for multicast
HTTP, RTP, UDP for unicast
Technologies that are pre-integrated with the client SDKs of major Video over IP Content Delivery
Networks include:
VQE for Cisco Videoscape
FCC/RET – Fast Channel Change/transmission RETry – for Alcatel-Lucent Multiscreen
Video Platform
Pre-integrated with the client SDKs of major Digital Right Management (DRM) systems and
Conditional Access Systems (CAS):
Verimatrix
Microsoft PlayReady
Technologies that are pre-integrated with the client stacks of major adaptive streaming protocols:
Microsoft Smooth Streaming
HLS
MPEG DASH
DTV MW
DTV HAL
IPTV External
tuner:
libraries:
ALU
VQE libvqe
HLS libhls
RTP
liblive
DRM libverimatrix
Kernel
FCC module
One of the modules that strongly relies on IPTV support is SAT>IP module. The SAT>IP client
engine is implemented within the Android4TV SAT>IP client library named libsipcl. As it is shown
on a figure 5, from middleware perspective there will be no differences between the built-in satellite
tuner and the SAT>IP library acting as a remote tuner. Also SAT>IP library is providing unique API
for all supported IP protocol types, as well as set of helper functions that are reducing effort
needed for porting on embedded platforms.
Java
Android4TV Framework
Native
DTV MAL
DTV Middleware
Kernel
DVB-S drivers for built-in tuner
Listing of scheduled events for all services on current frequency as well as listing of events
recorded in database during previous channel switching
3.1.4 PVR
TV Application has integrated PVR (Personal Video Recorder) module which provides
recording of DTV service to a storage device (hard disc, USB drive) as well as reproducing the
recorded content (media playback).
PVR module implementation can be divided into three functional components: PVR dialog as
part of TV Application, PVR package as part of Android4TV framework and PVR engine which is
part of TV middleware.
PVR engine, which is part of TV middleware, hides the complexity of underlying driver logic
and it is responsible for routing of transport stream in a PVR context for all supported PVR
scenarios. This engine also manages memory storage used for recording of DTV service and
handles trick play modes during playback of recoded content.
PVR module supports following features:
Time Shifting – provides pausing of live DTV service and resume it after some time interval.
How long can be pausing time interval depends on available memory space
Watch & Record – provides recording and watching of the same TV service in the same
time
Playback and Dual Recording – provides watching of one TV service and recording of two
TV services in the same time (architecture with two tuners)
Instant Recording - one key press to start recording
Scheduled Recording (manual or via EPG) – provides making of schedules for recording of
DTV services. Integration of PVR with EPG module enables making of schedules by using
of data from EPG.
Recording format is Single Program Transport Stream (SPTS) format – transport stream that
contains only one program stream. When PVR playback is requested, recorded transport stream
must be routed through demux device that will send elementary streams to A/V decoders.
Java
Android4TV Framework
Native
DTV MAL
DTV Middleware
Kernel
Browsing of pages with tabbing navigation through page (by cursor moving)
FLOF support – browsing of TTX pages by using of four colour buttons (red, green, yellow
and blue)
3.1.6 Subtitle
Android4TV framework implements subtitle module which encapsulates subtitle functionality
and provides subtitle API to application.
Subtitle module implementation can be divided into following functional components: TV
application which provides Java UI to subtitle functionality, subtitle package as part of Android4TV
framework, and subtitle engine as part of TV middleware layer.
Application is responsible for creating of SurfaceView object which has its Surface that will
be used for drawing subtitle graphics. Subtitle graphics drawing is done inside of TV middleware
graphics layer, so Surface object is packed into SurfaceBundle object that can be passed through
Android4TV framework from TV application to TV middleware.
Android4TV framework display package contains SurfaceBundle and functionalities to set
and get SurfaceBundle from Android4TV framework.
Mechanism of extracting of subtitle bitmaps from transport stream is provided by subtitle
engine from TV middleware layer. After subtitle bitmap is extracted from the stream, graphics
module of the DTV middleware layer draws this bitmap on the Surface that is provided through
Android4TV framework.
TV application is able to show subtitles extracted from transport stream. Application extracts
subtitle data from transport stream and makes appropriate subtitle bitmaps which are displayed on
the screen.
TV Application covers following subtitle functionality:
Show/Hide subtitle
3.2.2 HbbTV
HbbTV or Hybrid Broadcast Broadband TV is a pan-European initiative aimed at harmonising
the broadcast and broadband delivery of entertainment to the end consumer through connected
TVs and set-top boxes.
HbbTV module consists of three functional components. On top is web browser (WebView
instance placed in a separate dialog which is part of Android4TV application) where HbbTV
application is executing. Middle one is HbbTV middleware module (HbbTV engine) and it is using
DVB software stack. It is most important module and it is comprised of HbbTV JavaScript plug-ins
and HbbTV Application Manager.
DTV Application creates Dialog object that holds instance of WebView object. WebView is class
from Android SDK made to allow Java applications to use Webkit browser engine. TV Application
provides WebView with HbbTV URL received from HbbTV Application Manager.
In order to expose DVB stack functionality to HbbTV applications, JavaScript plug-ins are used.
Plug-ins are implemented using NPAPI (Netscape Plugin Application Programming Interface),
which is a cross-platform plug-in architecture used by many web browsers.
The list of implemented JavaScript plug-ins is following:
ApplicationManager plug-in provides currently running application possibility to manage life
cycle of applications (start new one or destroy itself), to control visibility of currently running
application or to choose which keys it wants to receive
Broadcast plug-in provides interface for integration of content from both broadcast and
broadband network into single service. It also provides interface for controlling DTV (service
change, access of channel list, selection of AV components which will be rendered). This plug-in
communicate with Comedia engine through Application Manager
A/V plug-in provides support for playing and control of streamed multimedia content; this
plug-in uses Android Media Framework in order to play audio/video content.
Configuration plug-in provides interface for reading some user preferences such are
preferred audio language, preferred subtitle language or country code where DTV is deployed
Capabilities plug-in provides interface for getting information about addition HbbTV
capabilities or number of additional HD and SD video decodes available. It is also responsible for
send DTV capabilities in XML format to application
ParentalControlManager plug-in provides interface related to parental control system. It
contains supported parental rating schemes. Only “dvb-si” scheme shall be supported.
Interfaces of implemented JavaScript plug-ins are defined by [HbbTV] and [DAE]
specifications.
Application Manager provides, among other things, communication between web browser and
Comedia module. It is responsible for analyzing AIT tables (lifecycle), communication with DSM-
CC client etc.
Android4TV app -
bussines logic
Android4TV Framework
AIT AM
Manag Control Webkit
er
DTV MAL
Plugins
App Manager
AIT DSMCC
Parser Client
A/V
Kernel
When DVB stack connects to the new service, AIT manager will acquire and parse AIT table.
Upon application descriptor acquisition from AIT, descriptors are delivered to application manager.
Application manager selects proper autostart application and send URL to Android4TV application.
After autostart application is loaded, red button is displayed. User can decide to launch
different HbbTV application (EPG, teletext etc). Applications can be loaded using http or dvb
(DSMCC) protocol.
Since HbbTV module is part of TV Application (as well as all other modules - live broadcast,
MHEG, TTX, SUB, Media Browser), screen sharing between all modules is controlled by TV
Application and achieved by using of Dialogs. There is a separate Dialog that handles HbbTV
functionality as for other modules functionalities such as EPG, TTX or Media Browser.
TV Application supports HbbTV standard for delivery of various services included enhanced
teletext, EPG, video-on-demand, interactive advertising, personalization, voting and games.
3.2.3 MHEG
MHEG-5, or ISO/IEC 13522-5 is part of a set of international standards relating to the
presentation of multimedia information, standardized by the Multimedia and Hypermedia Experts
Group (MHEG). The MHEG-5 standard was developed to support the distribution of interactive
multimedia applications in client/server architecture across platforms of different types and brands.
MHEG-5 defines a final-form representation for application interchange.
MHEG module implementation can be divided on MHEG Dialog as part of TV Application
that holds GUI of MHEG application, MHEG package as part of Android4TV framework and MHEG
Engine inside of DTV middleware layer.
MHEG Engine is control logic part that interacts with the rest of DTV Middleware. It covers
following functions:
Requests application to process user requests that results in new MHEG file
TV Application has integrated MHEG engine which has ability to display visual objects in a
rectangular co-ordinate system with a fixed size, and to play audible objects. A user input device
(e.g. remote control or another Android device) can be used with the runtime to allow interaction
between the user and the applications. MHEG engine also allows the application to exchange
information with a remote server via an IP connection.
The MHEG-5 engine is currently compliant with the D-Book 6.1 specification and the DTG
Test Suite. Following features are supported:
Ancillary connections
Free-moving cursor
Bitmap scaling
Trick mode
Java
Media Browser App
VideoView
FSLib JNI
Native
Android Media Framework
FS Lib
Vendor Player Android
Player
Kernel
3.2.5 DLNA
DLNA module implements multimedia content sharing feature between devices according to
interoperability guidelines defined by Digital Living Network Alliance. DLNA module covers
functionality of following DLNA devices: DMP (Digital Media Player), DMR (Digital Media
Renderer), and DMS (Digital Media Server).
DLNA offers following features:
DLNA uses Universal Plug and Play (UPnP) for media management, discovery and control. In
case when data transferred between DLNA devices on local network have to be secured, DLNA
engine will use the DTCP protocol to protect data against unauthorized retransmission and
copying. DTCP is a method of protecting audio and audiovisual entertainment content over high-
speed, high-bandwidth bidirectional digital interfaces on consumer electronics entertainment and
information products. Using DTCP, content can travel between these devices or across a digital
home network. In example, when user wants to share recorded TV stream to other DLNA devices,
data must be secured with DTCP method.
DLNA player device covers following features:
Extracting various stream information provided by server: meta information (EXIF, ID3),
stream location on network – URL, codec information
4. Extracting stream location (URL) and meta information about target stream from controller
request
DLNA server device implements multimedia content sharing to other DLNA devices available
on local network. It covers following features:
TR-069 Communication
CPE
Management
TR-069 RPC processing
Firmaware
Upgrade
Data repository engine
TR-XXX
API
Generator QoE QoE QoE
Vendor –
Common TR-135 TR-106 TR-XXX
specific
API API API API
API
Decoupling layer
Data
Model
XML TR-135 TR-106 TR-135 Vendor –
libCPE API specific
API API XXX
API
Other middleware
Comedia plugin OpenTV plugin
plugin ...
Platform SDK
Client is being integrated to the device host software. Host application uses the decoupling layer
of the client to invoke all needed functionalities (e.g. to set value of a parameter or to get informed
when a value is changed from the ACS). Decoupling layer is provided for a target operating
system. Upon function invocation, a message is being posted to the target daemon or service
running client core library.
Host application implements an appropriate plugin from which all parameter values are
populated and host software updated on request. Client already provides plugins for various target
DTV/IPTV middleware, in which case the integration is straightforward. Middleware plugin, once
developed, may be reused across different target platforms.
Within the build system of the client, a TR-XXX API generator application is provided. Pre build
Android4TV based application is developed using the Java programming language and the
official Android SDK. After being compiled binaries are packaged into .apk bundle, the container for
the application binary. It contains all of the information necessary to run application on a device,
such as compiled .dex files (.class files converted to Dalvik byte code), a binary version of the
AndroidManifest.xml file, compiled resources (resources.arsc) and uncompiled resource files for
the application.
Android4TV framework as described throughout the document, contains all necesery Java
framework extensions required to expose the DTV middleware functionality to the application layer.
Its upper layers and API are written in Java programming language, while the lower layer contains
native calls to the DTV middeware.
DTV middleware is implemented in native programming language C/C++ and provided within
libcomedias.so library.
DTV Hardware Abstraction Layer (HAL) contains the SDK dependent calls and it is provided
in the form of libchal.so library.
.
To support HbbTV solution some small amount of changes had to be introduced to the
standard Android base source code.
The HbbTV platform combines a profile of the Open IPTV Forum specification with a profile
of the DVB specification for signalling and carriage of interactive applications and services in
Hybrid Broadcast/Broadband environments. To see full description of HbbTV please see reference
TBD.
HbbTV browser platform is a WebKit-based consisting of WebCore and JavaScriptCore
parts. To support HbbTV solution some changes to WebCore library (libwebcore.so) had to be
introduced (Table 2).
WebCore
WebView class as part of the Android Framework is also modified to support mapping of additional
colored RC’s keys in WebCore library (Table 3).
Android Framework
Webview class
Listed properties are part of the CSS3 specification but are not fully implemented in
available WebCore builds. Web engine should be able to recognize, parse and navigate on
web pages that utilize them.
Colored RC’s keys (red, green, blue and yellow) are specific to CE-HTML/HbbTV and must
be mapped to appropriate Webkit keycodes
CE-HTML MIME type support: it supports parsing and rendering of CE-HTML pages
(.cehtml extension)
OIPF MIME types: changes to overcome the problem when Webkit filters MIME types in
such a way to down case all the letters in registered plug-ins. MIME types should support
capital letters.
Android Focus Fix: Android’s current implementation of external focus must be disabled in
the case of active HbbTV application.