WO2006107662A2 - System for running applications in a resource-constrained set-top box environment - Google Patents

System for running applications in a resource-constrained set-top box environment Download PDF

Info

Publication number
WO2006107662A2
WO2006107662A2 PCT/US2006/011353 US2006011353W WO2006107662A2 WO 2006107662 A2 WO2006107662 A2 WO 2006107662A2 US 2006011353 W US2006011353 W US 2006011353W WO 2006107662 A2 WO2006107662 A2 WO 2006107662A2
Authority
WO
WIPO (PCT)
Prior art keywords
top box
application
graphics
class
box system
Prior art date
Application number
PCT/US2006/011353
Other languages
French (fr)
Other versions
WO2006107662A3 (en
Inventor
Logananth Seetharaman
Min Liu
Dennis G. Cronin
Adam T. Mollis
Vijaye G. Raji
Peter T. Barrett
Edmund H. Lui
Original Assignee
Microsoft Corporation
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Microsoft Corporation filed Critical Microsoft Corporation
Priority to EP06748835A priority Critical patent/EP1869883A4/en
Priority to JP2008504271A priority patent/JP2008536384A/en
Publication of WO2006107662A2 publication Critical patent/WO2006107662A2/en
Publication of WO2006107662A3 publication Critical patent/WO2006107662A3/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/20Adaptations for transmission via a GHz frequency band, e.g. via satellite
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/443OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB
    • H04N21/4437Implementing a Virtual Machine [VM]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/44Receiver circuitry for the reception of television signals according to analogue transmission standards
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/16Analogue secrecy systems; Analogue subscription systems
    • H04N7/162Authorising the user terminal, e.g. by paying; Registering the use of a subscription channel, e.g. billing
    • H04N7/163Authorising the user terminal, e.g. by paying; Registering the use of a subscription channel, e.g. billing by receiver means only

Definitions

  • This subject matter relates to developing and running applications in a resource- constrained environment, such as a resource-constrained set-top box environment.
  • Set-top boxes receive media information from a source (such as a head-end distribution site), process the media information, and present the processed media information on an output device (such as a conventional television unit).
  • a source such as a head-end distribution site
  • an output device such as a conventional television unit.
  • Exemplary applications include game applications, video on demand (VOD) and electronic program guide (EPG) applications, news presentation applications, and so forth.
  • One approach to improving the versatility of set-top boxes is to duplicate the features of a "full scale" desktop programming environment in a set-top box platform.
  • One exemplary framework in use today is Microsoft Corporation's .NET Framework.
  • .NET technology provides a virtual machine (VM) environment for executing programs in a manner which is generally independent of the underlying complexities in the physical platform used to implement the execution.
  • VM virtual machine
  • the .NET Framework uses a compiler to convert source code (e.g., C# source code) into intermediate language (IL) code and metadata.
  • IL intermediate language
  • the .NET Framework uses a common language runtime (CLR) loader and a just-in-time (JIT) compiler to transform the IL and metadata into the native code specific to a particular execution platform.
  • CLR common language runtime
  • JIT just-in-time
  • compact JIT-based technology For example, Microsoft Corporation's .NET Compact Framework (.NET CF) adapts the above-described "full scale” .NET Framework for use in resource-constrained computing devices.
  • .NET CF Such compact JIT-based technology can inherit the full .NET Framework architecture of the common language runtime (CLR), supports a subset of the .NET Framework class library, and contains classes designed exclusively for .NET CF. In operation, such compact JIT-based technology can use a JIT compiler to execute the intermediate language instructions.
  • Supported devices include personal data assistants (PDAs) (such as the Pocket PC), mobile phones, some set-top boxes, automotive computing devices, and custom-designed embedded devices.
  • PDAs personal data assistants
  • Such compact JIT- based technology such as .NET CF
  • .NET CF compact JIT- based technology
  • the above compact JIT-based technology provides feasible solutions in many kinds of set-top boxes.
  • this technology is not fully satisfactory for use in all set-top boxes, such as set-top boxes with particularly limited amounts of resources.
  • the popular DCT 2000 set-top box provided by Motorola Inc. of Schaumburg, IL, includes a 27 MHz CPU and a limited amount of memory (e.g., 1.5 MB of RAM and 1.25 MB of flash memory).
  • These resources do not present an optimal platform on which to run compact JIT-based applications.
  • the JIT used in a conventional .NET environment needs to keep both the original IL assembly and also the "jitted" native code in memory. This requirement can overtax the memory resources of the resource- constrained set-top boxes.
  • JIT-based technology works by JIT-compiling all managed code prior to running it. This produces an undesirable delay when starting up an application.
  • a set-top box system comprising: a hardware layer representing hardware functionality provided by the
  • an interpreter-based core runtime engine e.g., an interpreter-based
  • 10 box system is configured to run an application that can perform a function using the
  • the set-top box system includes less than 5
  • the set-top box system further includes an is application manager for managing applications, configured for use in the set-top box
  • the application manager is configured to is pause a current application when another application is activated, and to resume the current
  • the set-top box system further includes a
  • the set-top box system further includes
  • 25 provide a transition effect when switching from one graphical presentation to another (such as decimation, fading, scrolling, exposing and so forth); change a color palette of a graphical presentation; change a resolution of a graphical presentation; simplify font processing by stripping information from font files; and provide anti-aliasing for fonts.
  • the above-mentioned hardware functionality of the set-top box system includes a line control register (LCR) which provides memory locations which correspond to respective lines on a display device, and wherein the set-top box system further comprises graphics functionality configured to provide a graphical effect by manipulating the LCR.
  • LCR line control register
  • Fig. 1 shows an overview of a system that includes set-top boxes that implement an improved system described herein.
  • Fig. 2 shows an overview of a physical construction of an exemplary set-top box used in the system of Fig. 1.
  • Fig. 3 shows a hierarchy of software functionality that can be implemented by the set-top box of Fig. 2.
  • Fig. 4 shows a hierarchical organization of UIpane classes provided by the functionality of Fig. 3.
  • Fig. 5 shows a mechanism used to load and execute applications provided by the functionality of Fig. 3.
  • Fig. 6 illustrates the operation of navigation functionality provided by the functionality of Fig. 3.
  • Fig. 7 shows a procedure that sets forth a manner of operation of the functionality of
  • Series 100 numbers refer to features originally found in Fig. 1
  • series 200 numbers refer to features originally found in Fig. 2
  • series 300 numbers refer to features originally found in Fig. 3, and so on.
  • the system uses an interpreter-based common language runtime (CLR) that is adapted for use in a set-top box environment.
  • CLR common language runtime
  • the interpret-based CLR can be implemented using, but is not limited to, Microsoft Corporation's Smart Personal Objects Technology (SPOT) functionality.
  • SPOT Smart Personal Objects Technology
  • the system provides a flexible and efficient framework to develop rich applications, such as digital video recorder (DVR) applications, tuning-related applications, parental control-related applications, program guide and search applications, video on- demand (VOD) applications, game applications, information (e.g., news) presentation applications, voting applications, instant messenger (IM) applications, and many others.
  • DVR digital video recorder
  • VOD video on- demand
  • game applications game applications
  • information e.g., news presentation applications
  • voting applications e.g., instant messenger (IM) applications
  • IM instant messenger
  • the system also supports user applications written using the C# language (among other languages).
  • the system provides a new "TV" namespace to simplify programming on the set- top box (compared to the "full scale” .NET Framework or known compact versions thereof). Overall, the functionality referenced by the namespace consumes much less resources compared to the full scale .NET environment or compact versions thereof. At the same time, the system uses a programming framework that complements the .NET Framework, allowing programmers to begin programming for the set-top box with very little additional training.
  • the system provides a unique application manager for supporting multiple applications running at the same time.
  • the application manager provides a pause/resume mechanism and a notification framework to manage different applications running at the same time (even though these applications might use different system color palettes, different display resolutions, etc). For example, when a second user interface presentation (associated with a second application) takes the place of a first user interface presentation (associated with a first application), the system can automatically pause the first application, allowing the second application to receive the majority of the system's processing power. In this manner, the system can thereby prevent user interface presentation from overlapping each other.
  • the system provides a UIpane manager to provide more appropriate user controls (tailored to the set-top box environment) with limited set-top box resource. For example, the system adopts new UIpane forms.
  • the system provides graphics functionality that allocates as much rendering as possible to the set-top box hardware. This results in graphics functions that run very quickly, while consuming minimal resources.
  • the graphics functionality provides full 256 color support, and provides the ability to switch color palettes and resolutions upon switching from one application to another.
  • the graphics functionality also provides transition effects when switching from one application to another. The transition effects operate by directly manipulating the set-top boxes line control register (LCR).
  • LCR line control register
  • the system also leverages some of the fastest algorithms provided in other systems, such as algorithms for rendering lines, ellipses, rounded rectangles, and so forth.
  • the system also provides a resource-efficient font installation and management algorithm, and a resource-efficient anti-aliased true type font rendering algorithm. To 1 further reduce resource consumption, the system also uses a font-stripping mechanism to
  • the system can be 9 used on other devices (besides set-top boxes), such as any kind of wearable device (e.g., a 0 wristwatch device), a personal digital assistant (PDA) device, a mobile phone, and so forth.
  • the term media information refers to any data represented in 2 electronic form that can be consumed by a user.
  • the media information can include any 3 information that conveys audio and/or video information, such as audio resources (e.g., 4 music, spoken word subject matter, etc.), still picture resources (e.g., digital photographs, 5 etc.), moving picture resources (e.g., audio-visual television programs, movies, etc.), computer programs (e.g., games, etc.), and so on.
  • the term UIpane represents a graphics object for presentation to the user. In one case, the UIpane may correspond to a WindowsTM-type user interface pane.
  • OSD On Screen Display
  • An assembly refers to collection of one or more files that are versioned and deployed as a unit.
  • An assembly is the primary building block of a .NET Framework application. All managed types and resources are contained within an assembly and are marked either as accessible only within the assembly or as accessible from code in other assemblies.
  • C# pronounced "C sharp" language refers to one programming language designed for building applications that run on the .NET Framework.
  • C# which is an evolution of C and C++, is type safe and object-oriented.
  • a callback function refers to an application-defined function that a system or subsystem calls when a prescribed event happens.
  • a class is a reference type that encapsulates data (constants and fields) and behavior (methods, properties, indexers, events, operators, instance constructors, static constructors, and destructors), and can contain nested types.
  • Class types support inheritance, a mechanism whereby a derived class can extend and specialize a base class.
  • a constructor refers to a special initialization function that is called automatically whenever an instance of a class is declared. The constructor must have the same name as the class itself and must not return a value.
  • a delegate is a reference type that is the managed version of a C++ function pointer.
  • Common language runtime refers to an engine at the core of managed code execution.
  • the runtime supplies managed code with services such as cross-language integration, code access security, object lifetime management, and debugging and profiling support.
  • the term "core runtime engine” is used herein to describe functionality that provides the above-described types of services, and thus encompasses CLR technology, but it not limited to CLR technology (and, indeed, is also not limited to .NET technology).
  • a context refers to an ordered sequence of properties that define an environment for the objects resident inside it.
  • Enumeration refers a special form of value type that inherits from System.Enum and supplies alternate names for the values of an underlying primitive type.
  • An enumeration type has a name, an underlying type, and a set of fields.
  • a form (such as a Windows-type Form) refers to a composite control that provides consistent behavior and user interface within or across applications.
  • GC Garbage collection
  • JIT compilation refers to compilation (in a conventional "full scale” .NET environment) that converts intermediate language (MSIL) into machine code at the point when the code is required at run time.
  • MSIL intermediate language
  • Lifetime refers to the time period that begins when an object is allocated in memory and ends when the garbage collector deletes the object from memory.
  • Managed code refers to code that is executed by the common language runtime environment.
  • Managed data refers to objects having lifetimes that are managed by the common language runtime.
  • a namespace refers to a logical naming scheme for grouping related types. The .NET Framework uses a hierarchical naming scheme for grouping types into logical categories of related functionality.
  • a private assembly refers to an assembly that is available only to clients in the same directory structure as the assembly.
  • Reflection refers to a process of obtaining information about assemblies and the types defined within them, and creating, invoking, and accessing type instances at run time.
  • URI Uniform Resource Identifier
  • URNs Uniform Resource Names
  • URLs Uniform Resource Locators
  • Unmanaged code refers to code that is executed directly outside the common language runtime environment.
  • Extensible Markup Language refers to a subset of Standard Generalized Markup Language (SGML) that is optimized for delivery over the Web. XML provides a uniform method for describing and exchanging structured data that is independent of applications or vendors.
  • any of the functions described with reference to the figures can be implemented using software, firmware (e.g., fixed logic circuitry), manual processing, or a combination of these implementations.
  • the term “logic, “module” or “functionality” as used herein generally represents software, firmware, or a combination of software and firmware.
  • the term “logic,” “module,” or “functionality” represents program code (and/or declarative-type instructions) that performs specified tasks when executed on a processing device or devices (e.g., CPU or CPUs).
  • the program code can be stored in one or more computer readable memory devices.
  • the illustrated separation of logic, modules and functionality into distinct units may reflect an actual physical grouping and allocation of such software and/or hardware, or can correspond to a conceptual allocation of different tasks performed by a single software program and/or hardware unit.
  • the illustrated logic, modules and functionality can be located at a single site (e.g., as implemented by a processing device), or can be distributed over plural locations.
  • Fig. 1 shows an overview of a system 100 in which the improved functionality described herein can be deployed.
  • the system 100 includes a plurality of resource-constrained devices (102, 104) for receiving media information (or other information) from a source 106 via a coupling mechanism 108.
  • the source 106 can represent head-end infrastructure for delivering media information to the receiving devices (102, 104).
  • the source 106 may represent conventional cable media distribution infrastructure, conventional wireless media distribution infrastructure (such as satellite media distribution infrastructure), and so forth.
  • the source 106 may represent a network source of media information that delivers the media information via one or more digital networks.
  • the source 106 may represent an entity (such as a video jukebox, etc.) which supplies media information to the receiving devices (102, 104) from a location which is local with respect to the receiving devices (102, 104).
  • the source 106 can deliver media information to the receiving devices (102, 104) in a number of broadcast channels according to a fixed time schedule, e.g., as reflected by an electronic program guide (EPG). Or the source 106 can deliver media information to the receiving devices (102, 104) using an on-demand method.
  • EPG electronic program guide
  • the coupling mechanism 108 couples the source 106 to the receiving devices (102, 104).
  • This coupling mechanism 108 can be implemented in different ways to suit different technical and commercial environments.
  • the coupling mechanism 108 can include any kind of conventional distribution infrastructure, such as cable routing infrastructure, satellite routing infrastructure, terrestrial antenna routing infrastructure, and so forth (as well as any combination of such routing infrastructures).
  • the coupling mechanism 108 can include a digital network (or combination of networks), such as a wide area network (e.g., the Internet), an intranet, and so forth.
  • DSL Digital Subscriber Line
  • the coupling mechanism 108 can utilize the services, in part, of telephone coupling infrastructure.
  • the source 106 and coupling mechanism 108 provide cable or satellite delivery of media information to the receiving devices (102, 104).
  • the link between the source 106 and the receiving devices (104, 106) can implemented as a one way link (where information flows only from the source 106 to the receiving devices), or preferably as a two way link (where the users of the receiving devices can also send data to the source 106).
  • the device-to-source link can be implemented by the same channel that the devices (102, 104) use to receive media information from the source 106, or by a different channel.
  • the receiving devices include a set-top box 102.
  • the set-top box 102 receives media information from the source 106, performs various processing on the received media information (such as decoding the media information and potentially decompressing it), and forwards the processed information to an output device.
  • the output device can correspond to a television unit 110.
  • the set-top box 102 can be implemented as a separate unit from the television unit 110, and it can couple to the set-top box 102 via any kind of coupling mechanism (e.g., physical wiring, wireless coupling, and so forth).
  • the set-top box 102 can be implemented as an integral unit within the television unit 110.
  • the output device that receives media information from the set-top box 102 can comprise another kind of display device besides a conventional television (such as a computer monitor), an audio output device (such as a stereo system), and so forth.
  • the other receiving devices 104 can comprise any mechanism having processing and output functionality, such as any kind of wearable processing mechanism (e.g., a wristwatch, such as the Microsoft's SPOT watch), a mobile telephone, a personal digital assistant (PDA), a tablet-type device, and so forth.
  • a wristwatch such as the Microsoft's SPOT watch
  • PDA personal digital assistant
  • the remainder of this description will assume that the receiving device corresponds to the set- top box 102 (which, as stated, can be separate from the television unit 110 or integrated with the television unit 110).
  • the set-top box 102 includes functionality (to be described) which can present user interface presentations 112 on a display surface 114 of the television unit 110.
  • the display surface 114 is also referred to herein as the on-screen display (OSD).
  • OSD on-screen display
  • a user can interact with the user interface presentations 112 via a remote control device 116, or some other kind of input device.
  • the set-top box 102 may include input keys (not shown) directly integrated in its housing.
  • Fig. 2 shows the composition of the exemplary set-top box 102.
  • the set-top box 102 can include a number of modules for performing its ascribed tasks, identified below.
  • the set-top box can include an interface module 202.
  • the interface module 202 can represent any functionality for receiving media information from the source 106 using any coupling mechanism.
  • the interface module 202 can include a DSL modem, a cable modem, a wireless network interface, an Ethernet NIC, or other kind of network interface equipment.
  • the set-top box 102 can also include a tuner/decoder module 204 for performing any kind of initial processing on the received media information, such as decoding the media information, potentially decompressing the media information, and so forth.
  • the tuning/decoding module 204 can select one or more channels of media information via any kind of tuning mechanism (such as by tuning to a prescribed physical frequency that provides a desired channel, and so forth).
  • the tuning/decoding mechanism can rely on virtual tuning mechanisms to receive a channel (e.g., by "tuning" to a prescribed unicast or multicast source of media information).
  • the set-top box 102 can include one or more processors 206 for executing instructions to implement the functionality of the set-top box 102.
  • the set-top box 102 can include memory 208 (such as RAM memory, flash memory, etc.). A portion of the memory 208 may comprise a FIFO-type buffer (not shown) for storing media information prior to the information being decoded. Another portion of the memory may comprise a line control register (LCR) 210.
  • the LCR 210 includes respective memory locations corresponding to each line on the display surface of the output device.
  • the set-top box 102 can render information to the output device using the LCR 210. As will be described, the set top box 102 can also provide various graphics effects (such as transition effects) by manipulating the LCR 210.
  • the set-top box 102 can include an I/O interface 212 for interacting with the user via one or more input devices (e.g., a remote controller 116, and so forth).
  • input devices e.g., a remote controller 116, and so forth.
  • the set-top box 102 can include an A/V interface module 214 for providing media information in an appropriate format to the television unit 110 (or other output device).
  • the set-top box 102 can include an optional local store 216 for storing any kind of data and/or program information.
  • the set-top box 102 can include various other modules 218, not specifically enumerated in the figure.
  • the set-top box 102 can include a graphics compositor for combining a video component of the media information from the tuning/decoding module 204 with graphics information.
  • the graphics information may comprise various user interface presentations which are overlaid on the media information.
  • the set-top box 102 can include one or more buses 220 for coupling the above-identified components together. Additional information regarding a wide range of set-top boxes can be found in a number of sources, such as the online TV dictionary, in an online article entitled, "What are Set-top Boxes.”
  • the system to be described below is particularly suited for set-top boxes having constrained processing resources (although it is not restricted to boxes having constrained resources).
  • the popular DCT 2000 box produced by Motorola has limited resources.
  • the processor of this box operates at 27 MHz, and the memory comprises 1.5 MB of RAM and 1.25 MB of flash memory.
  • the challenge met by the invention is to provide suitably diverse functionality for these kinds of resource-constrained environments in which to develop and run applications.
  • the system can employ an interpreter- based common language runtime (CLR) that is adapted for use in the set-top box environment.
  • CLR common language runtime
  • the platform requires JIT- compilation of all of the managed code prior to start-up of an application. This has at least two disadvantages. First, the JIT-compilation produces a lag before the application is run. Second, the JIT-compilation requires a significant amount of memory to store the original assembly and the "jitted" native code.
  • the interpreter-based CLR provides interpretation and execution of code on a piecemeal basis, that is, by interpreting code on an as-needed basis. This reduces both the time required to start up an application and the memory requirements of an application; the latter of the advantages is particularly valuable for resource-constrained devices which have limited memory resources.
  • the interpreter-based CLR can be implemented using different technologies.
  • the interpreter-based CLR can be implemented by Microsoft Corporation's Smart Personal Objects Technology (SPOT). SPOT technology is described in a number of sources, including an online article by Donald
  • interpreter-based functionality can rely on other programming frameworks besides
  • the interpreter-based CLR can be adapted for use in the set-top box environment in
  • interpreter-based CLR can provide a reduced set of functionality compared to that provided
  • a desktop environment receives input from a user via several
  • a set-top box 1 environment receives input from the user typically via a limited number of 2 simple input mechanisms (e.g., a remote controller). Further, a set-top box environment is 3 typically expected to provide multiple applications, but typically does not present these 4 applications in a complex layered fashion (unlike the desktop environment). As such, 5 according to the invention, the interpreter-based CLR platform is adapted to optimally service the set-top box environment.
  • exemplary improvements include: a namespace specifically tailored for the set-top box environment; a unique application manager for pausing and resuming applications; a unique window manager; and various unique graphics and font-related provisions.
  • Fig. 3 provides an overview of the set-top box system's software stack 300, referred to herein as TV.Lite (because it provides relatively "lightweight" functionality for use in the television set-top box environment).
  • the stack 300 can include functionality provided by an interpreter-based CLR, adapted for use in a set-top box environment according to the unique provisions described herein.
  • the layers in the stack 300 refer to the relative dependency of different functionality in the system, with the lowest level performing the most basic functions of the system, and the top level performing the most abstract or high-level functions in the system.
  • the lowest set-top box layer 302 corresponds to the physical structure of the set-top box 102, including its various hardware capabilities.
  • this layer 302 includes the set top box components identified in Fig. 2, including the LCR
  • the next highest layer, the set-top box OS layer 304 provides various base functions performed by the set-top box 102.
  • the set-top box OS layer 304 corresponds to a "GIOS" operating system provided by Motorola. This layer 304 can provide memory management, scheduling, hardware control, and so forth.
  • the next highest layer provides an interpreter-based CLR 306 (such as, but not limited to a SPOT-based CLR) and a GFX library 308.
  • the interpreter-based CLR 306 contains a subset of .NET common language runtime (CLR) functionality, specifically adapted for the demands of the set-top box environment.
  • CLR common language runtime
  • the interpreter-based CLR 306 is relatively low in the stack (compared to the "full scale" .NET Framework); this makes the distinction between application functionality and low-level OS functionality less distinct (compared to conventional systems).
  • the GFX library 308 provides various graphics functionality for use in the set-top box system, which is specifically adapted for use in the set-top box environment.
  • the next highest layer provides an application manager 310, UIpane manager 312, and forms and control 314.
  • the application manager 310 controls the loading, running, and shutting down of multiple applications.
  • the UIpane manager 312 and the forms and control 314 provide various functionality which controls the presentation of UIpanes (such as, but not limited to, display objects similar to those produced in a WindowsTM operating system environment).
  • the number of APIs has been condensed in this UIpane functionality (compared to a conventional desktop environment) in order to eliminate functionality that is not needed for the set-top box environment.
  • the APIs complement the full API set provided in the desktop environment, thereby allowing developers to start writing applications for the set- top box environment without learning an entirely new programming paradigm.
  • the topmost layer provides a number of applications (316, 318, 320, ... 322).
  • These applications can include any code functionality designed to serve any purpose.
  • these applications can provide digital video recorder (DVR) applications, tuning-related applications, parental control- related applications, program guide and search applications, video on demand (VOD) applications, game applications, information (e.g., news) presentation applications, voting applications, instant messenger (IM) applications, and so forth.
  • DVR digital video recorder
  • VOD video on demand
  • game applications e.g., news presentation applications
  • voting applications instant messenger
  • the applications also supports user applications written using the C# language (among other languages).
  • the following subsections provide additional detail regarding the software stack 300 shown in Fig. 3.
  • the functionality in the stack 300 can be implemented, in part, by a unique namespace developed for the set-top box environment.
  • the namespace provides a shell, ABC__Co.TV.Lite. Shell, from which additional functionality can be appended in hierarchical fashion.
  • Child functionality in the hierarchy can rely on the tools provided by parent functionality through inheritance.
  • This subsection describes the functionality grouped into a namespace referred to as TVLiteApplicationBase (referred to below as ApplicationBase for brevity).
  • the ApplicationBase class depends from the ABC_Co.TV.Lite. Shell.
  • ApplicationBase represents a set-top box application. Namely, all applications should derive from the abstract TVLiteApplicationBase interface. Through this relationship, the applications can implement all the abstract methods specified in ApplicationBase.
  • the Appendix, in Section D provides a detailed description of the ApplicationBase functionality; this section provides exemplary salient features of this functionality.
  • the ApplicationBase class can provide the following exemplary and non-exhaustive list of features. (Below-reference to "message pumps" and other features will be clarified in the context of later discussion of the application manager 310.)
  • a Run method begins running a standard application message loop on a current thread, and makes a specified UIpane visible.
  • the Run method will automatically call RegisterUIpane (identified below) to register a main UIpane as a top level UIpane.
  • An Initialize method performs application-defined initialization.
  • the URL of a HTTP request to launch the application along with the parameters that are appended to the URL can be passed to the application via a "url" parameter in a call to Initialize.
  • An Exit() method informs all message pumps that they should terminate, and then closes all application UIpanes after the messages have been processed. The Exit method is typically called from within a message loop, and forces the Run method to return.
  • an application can call the Exit method to inform the application manager 310 that the application is exiting; this allows the application manager 310 to perform appropriate actions, such as cleaning up system resources, and so forth.
  • a RegisterUIpane method allows an application to register its top level UIpanes with the UIpane manager 312. The UIpane manager 312 will dispatch UIpane events to the top level UIpane.
  • a Pause method allows the application manager 310 to send a pause event to the application to request it to pause. The application manager 310 will suspend the thread after requesting the application to pause.
  • a Resume method allows the application manager 310 to send a resume event to the application to request it to resume.
  • a Terminate method allows the application manager 310 to send a terminate event to the application to request it to terminate.
  • the Terminate method can be invoked when an application is to be terminated, such as when the user enters an express quit instruction via appropriate UI commands, when the system is being shut down, when the system resources are running low, and so forth.
  • the application manager 310 calls the Terminate method to instruct the application to terminate.
  • a ReleaseResource method allows the application manager 310 to send a release resource event to the application to request it to release any resource that can be freed. This includes removing references to objects for the garbage collector.
  • the shell also defines a base IUIpane interface that serves as a root base of all Ulpanes. This interface allows the UIpane manager to control all the UIpanes without "knowing" the specifics of the implementation of each UIpane.
  • An ABC_Co.TV.Lite.UIpanes namespace contains classes for creating "light TV applications” that are optimized for execution on low-end set-top boxes (STB). As explained in previous sections, the set-top boxes can run an interpreter-based CLR system.
  • a UIpaneBase class category provides the base functionality for all UIpane controls that are displayed on a TV application. Most classes within the ABC_Co.TV.Lite.UIpanes namespace derive from the UIpaneBase class.
  • the UIpaneBase class is also a container, meaning that it can contain child Ulpanes.
  • a UIpane Forms class category allows for the creation of top level container
  • a UIpane Controls class category allow for the creation of user interfaces.
  • the Button class is a UIpane control.
  • a Button class represents a TV button control.
  • a Control class defines the base class for controls.
  • a control object defines an object with visual representation that performs a specific function.
  • a Form class defines the base class for parentless, top level, container Ulpanes. Objects produced by this class (form objects) have some or no visual representation, and can contain child Ulpanes.
  • a Transition class defines methods to apply a transition to a form object.
  • a UIpaneBase class is an abstract class that defines the base class for a UIpane (which defines an object with visual representation or an object that contains other UIpaneBase objects).
  • a UIpaneEventHandler class represents the methods that will handle any UIpane event.
  • a KeyEventHandler class represents the methods that will handle key events.
  • a TransitionEventHandler class represents the methods that will handle a transition event.
  • a Keys class represents all possible keys codes used in a TV application.
  • a ButtonStyle class represents all possible button styles.
  • Fig. 4 shows an exemplary hierarchical organization of this functionality, which provides a summary of the functionality fully set forth in the Appendix.
  • the application manager 310 provides a mechanism to manage application loading, unloading, and initialization.
  • the application manager 310 also governs the message pump, performs memory management, handles security-related aspects of the system, and so forth.
  • the application manager 310 also manages application behavior by instructing an application to activate, deactivate, pause, resume, terminate, and so forth.
  • the application manager 310 can receive an application launch request to launch an application.
  • the launch request can request
  • the application manager 310 to launch an application in flash memory or to launch an
  • the application shell can use a public Download class in the
  • An application can use the Download object to launch other applications. If the
  • Entity X uses the Download object to launch a game application. Entity X can
  • Entity X can create a separate thread and wait on the gameAppExitEvent in that thread.
  • the Download class contains a public method called ExecuteAssembly to download 4 and execute an assembly.
  • ExecuteAssembly method will start a new application thread 5 to download, load, and execute an assembly.
  • the Download object can support a method called GetFile that will return a byte array of the assembly.
  • Applications can use the GetFile method to read a block of bytes of the assembly data or file.) After the assembly is downloaded and loaded, the application manager can use Reflection to find the application class by looking for the class that is derived from TVLiteApplicationBase. Then, the application manager 310 instantiates an instance of TVLiteApplicationBase and calls the Initialize method with the command/URL that launches the application. Thus, the Initialize method constitutes the entry point for the managed application. The application creates its main UIpane when the Initialize method is called. The application can also use the RegisterUIpane functionality (discussed below) provided in the TVLiteApplicationBase to register additional top-level Ulpanes.
  • the application calls the Run method when it is finished with all the initialization work. This will start a message pump, which allows the application to receive events (e.g. focus events, key events, pause events, resume events, terminate events, and so on).
  • the Run method is a blocking call and will not return until the application calls Exit on itself.
  • the application calls the Exit method provided in the base class TVLiteApplicationBase of the application. In other words, the Run method starts the message loop on the current thread and makes the specified UIpane visible.
  • An application calls the Exit method to exit the message pump and return from the Run method. In the course of running the application, a garbage collector automatically releases the memory allocated to a managed object when that object is no longer used.
  • TVLiteApplicationBase can be implemented as a managed application that has no direct access to native memory handles, open files and streams. Therefore, the memory management of TVLiteApplicationBase can be handled properly by the garbage collector.
  • the application manager 310 can call a Purge method to notify the application thread that the system is running low on memory. The application should free (by removing reference to objects) as many managed objects as possible when the Purge method is called. If the system is still running below the minimum memory threshold, the application manager 310 can terminate applications to bring the amount of available memory above the minimum memory threshold. Namely, the application manager 310 can terminate inactive applications based on a f ⁇ rst-in-i ⁇ rst out algorithm. The application manager 310 will not terminate applications listed in a KeepAlive section in a configuration file.
  • the application manager 310 calls an application's Pause method to indicate the application thread is about to be suspended. For example, the application manager 310 can automatically call the Pause method to pause a currently running application when another application is activated and that new application's UIpane overlaps the current application's UIpane.
  • the Pause method will provide an opportunity for the application t ⁇ prepare for thread suspension. The application will not receive any messages until the thread is resumed.
  • the application manager 310 can te ⁇ ninate an application that does not pause within a pre-determined time period (e.g., 0.5 seconds).
  • the application manager can call the application's Resume method to indicate that the application thread has been resumed. This will provide an opportunity for the application to restore itself to the state existing prior to the thread suspension.
  • the application manager 310 can then restart the message pump of the thread.
  • the application manager 310 can terminate an application that does not resume within a pre-determined time period (e.g., 0.5 seconds).
  • the application manager 310 provides the implementation of the Exit method in its base implementation. Namely, the Exit method notifies the application manager 310 to terminate a current application. The application manager 310 will remove the terminated application and transfer control to a previous active application.
  • the application manager 310 can also call the application's Terminate method to indicate that the application thread should terminate. This will provide an opportunity for the application to exit gracefully. The application manager 310 will terminate an application that does not exit gracefully after a pre-determined period of time.
  • the application manager 310 validates an application's requests against rules specified in a configuration file. For instance, the application manager 310 can check whether an application has permission to launch another application, access network resources, and so on. An application will receive an exception when requesting functionality it does not have permission to use.
  • an application can register its top level UIpanes with the application manager 310 to receive UIpane events. More specifically, the Run method automatically registers the UIpane specified in its UIpane parameter.
  • Fig. 5 provides a summary of the above-identified concepts.
  • an application launcher 502 invokes the launch of an application by contacting download entity 504.
  • the download entity 504 determines whether it has permission to download and execute the application by accessing the sandbox permission entity 506. If so, the download entity 504 adds a task to the task manager entity 508 to execute the application.
  • Running the application creates an application thread 510 devoted to the application.
  • the application manager 310 and the window manager 312 control the execution of the invoked application. Namely, these managers (310, 312) add queue items to a message queue entity 512, resulting in the execution of these items by the application entity 514.
  • the UIpane manager 312 provides a fully managed UIpane management implementation.
  • the UIpane manager 312 is responsible for UIpanes management, events routing, and focus management. This subsection provides details regarding the behavior of the winpage manager 312.
  • UIpanes are displayed in a prescribed priority based on their type.
  • the supported UIpane types comprise: Notification; Floating (Notification with AlwaysOnTop attribute set); and Normal.
  • a Floating UIpane will always be the top-most UIpane. For example, assume that a display simultaneously presents plural UIpanes corresponding to different applications (or corresponding to the same application). The UIpane that has the highest priority level will receive focus, meaning that a user's input activity will be directed to this UIpane. According to one exemplary implementation, however, UIpanes are not allowed to overlap on the display.
  • the UIpane manager 312 works closely with the application manager 310 to pause, resume, and terminate applications. For example, the UIpane manager 312 asks the application manager 310 to send a pause event to a current application's message pump when the current application needs to be suspended (typically because another application's UIpane that is about to come up will interfere with the current UIpane). This will give the current application a chance to perfo ⁇ n required operations before it goes into a suspended state. More specifically, an application receives activate and deactivate events when it receives and loses focus respectively. For example, if a notification shows up on top of a running application, the application will receive a deactivate event (followed by a pause event). When the notification is dismissed, the application will receive an activate event (after it has been sent a resume event).
  • the UIpane manager dispatches all events to the message pump of the application thread. More specifically, user input events will "bubble up" the UIpanes containment hierarchy until the event is handled or the hierarchy ends (that is, when the event reaches a UIpane that does not consume the event and whose parent is null).
  • Paint events are dispatched to the top level UIpane of the containment hierarchy only if the UIpane has not been paused.
  • the top level UIpane is responsible for dispatching paint events to its children. For example, if a UIpane has several buttons as its children, the UIpane will receive a paint event and it is responsible for invoking paint on the buttons.
  • navigation among child UIpanes is accomplished with the directional remote keys (e.g., provided by the remote controller 116). For example if the down key is pressed, the nearest child below the active child UIpane will receive focus. If a directional key event is not handled, the parent UIpane attempts to pass focus to one of its siblings.
  • the directional remote keys e.g., provided by the remote controller 116.
  • the navigation is determined by "hot points" created on various locations of a UIpane.
  • the location of a hot point depends on which arrow key is selected. For example, in Fig. 6, assume that control A currently has focus. If the down key is selected, the hot point of the current focused control will correspond to the middle of control A's lower edge. This hot point is then projected onto the top edge of each of the surrounding controls. The distance between each hot point pair is then measured. The pair with shortest positive distance determines the next control to receive focus. In this case, the hot point distance between controls A and B (line AB) is shorter than the hot point distance between controls A and C (AC), so that control B will receive focus next. (D is not considered because it is located completely above A).
  • control D overlaps control A such that control D's top edge is over control A, then control D will be considered on a down key press. Therefore, in this case, control D will receive focus if line AD is shorter than both lines AB and AC.
  • a principal objective of the graphics-related functionality is to provide an API set that meets a developer's requirements as economically and efficiently as possible (in view of the limitations of a resource-constrained environment).
  • the above objective is achieved, in part, by using an API set that is simplified (compared to a "full" API set provided in the desktop environment).
  • simplified graphics APIs are provided, such as line and ellipse drawing algorithms.
  • the API set is also be flexible, to allow future expansion.
  • the graphics functionality directly interacts with the set-top box hardware, utilizing the processing power of the hardware as much as possible.
  • the drawing primitives can directly write to the hardware.
  • conventional graphics APIs are overly-abstracted behind "heavy" desktop APIs (and therefore would become sluggish when applied in a resource- constrained set-top box environment).
  • the graphics functionality can preset the code path so that calls are made, if possible, to the set top box 102's hardware APIs.
  • the 1 DCT 2000 set-top box hardware provides a block copy function which operates very
  • the M68000 chip has a special feature
  • DBRA 5 referred to as DBRA.
  • the graphics functionality can accommodate the requirements of this
  • the graphics functionality can also leverage the line control
  • LCR 9 register
  • each LCR storage location points to the
  • the set top box 102 will display these two lines in transposed order. is More specifically, exemplary unique graphics features of the set-top box system
  • Transition Effects 4 The set-top box 102 provides a number of transition effects that take effect when 5 switching from one graphical presentation to another.
  • the following functions provide exemplary transition effects. Again, these functions can be implemented by directly manipulating the LCR 210 in the manner described above.
  • a Scroll method scrolls the screen up if the an "offset" parameter specified in the method is a positive number, or down if the "offset” is a negative number. This effect will be provided within the bounds defined by "upBound” and "lowBound” parameters specified in the method.
  • a Decimate method simulates a decimation effect. More specifically, this method takes a percentage number as input to indicate the effect level. The decimation effect is provided between the "upBound” and "lowBound” parameters specified in the method.
  • a RasterFade method simulates a raster fade effect. This method takes a percentage number as input to indicate the effect level. The decimation effect is provided between the "upBound” and "lowBound” parameters specified in the method.
  • An Expose method exposes a number of lines, specified by an "linesToExpose” parameter specified in the method, in the center of the Ulpane-specified “upBound” and “lowBound.”
  • the set-top box system allows a developer to dynamically change resolution and color palette. This can provide a more varied, and therefore a more interesting, user experience. For example, a developer can configure the system such that switching from a first application to a second application will prompt the system to potentially change color palette and resolution (corresponding to the second application).
  • the system provides a SetUserPalette method. This method lets the user specify a custom palette to be associated with a graphics object.
  • a RestoreDefaultPalette method restores the default on-screen color palette.
  • a SetOSDResolution method allows the caller to set the on-screen display resolution.
  • a RestoreDefaultOSDResolution method restores the default on-screen display resolution.
  • a BitBlt method bits contents from one graphics object to another graphics object.
  • application developers especially game programmers, can copy one part of the graphics context to another.
  • the set-top box system can strip unnecessary information from the font to provide more efficient processing of the fonts in the set-top box environment.
  • a FontOptimizer tool optimizes font files by eliminating characters outside of the codeset file, remapping characters and stripping out glyph information to minimize file size. This feature therefore contributes to the general goal of running interesting applications in resource-constrained environments.
  • a SetAntiAliasBackgroundColor method sets a color to be used for anti-aliasing. More specifically, this call establishes a color used to build a table of intermediate colors for use in anti-aliasing.
  • a SetFont method sets a current font to be used for string draw operations.
  • a DrawString method draws a string in a specified color in a specific manner that is governed by its various parameters (e.g., note the Appendix for additional information).
  • a BreakString method using a currently set font, attempts to break a string into words.
  • a GetFontMetrics method fetches the properties of a currently specified font used to provide accurate layout of text.
  • Fig. 7 describes the operation of the set-top box system in flowchart form. To facilitate discussion, certain operations are described as constituting distinct steps performed in a certain order. Such implementations are exemplary and non-limiting. Certain steps described herein can be grouped together and performed in a single operation, and certain steps can be performed in an order that differs from the order employed in the example set forth in this disclosure. As the functions described in this flowchart have already been explained in prior sections, Section C will serve primarily as a brief review of those functions.
  • the set-top box 102 launches and loads an application using the above- described Initialize method. This prompts the set-top box 102 to establish a message thread for the application.
  • step 704 the set-top box 102 pauses and then resumes the application as necessary during the running of the application.
  • the set-top box 102 can pause a current application if another application produces a UIpane that takes precedence over the current application.
  • the set-top box performs memory management during the running of the program in the manner described above by removing stale objects.
  • step 706 the set-top box 102 exits/terminates the application.
  • the shell defines a base IUIpane interface that serves as a root base for all Ulpanes.
  • the IUIpane interface can be expressed formally as: public interface IUIpane.
  • a IUIpane interface can provide the following exemplary and non-exhaustive list of interface functions: • A Graphics CreateGraphics() method obtains a graphics object for the UIpane. • A void Hide() method makes the UIpane invisible. • A void NotifyOnCloseO method is invoked by the shell to notify a UIpane that it has been closed. • A void NotifyOnFocus(bool focus) is invoked by the shell to notify a UIpane that it has either gained or lost focus.
  • the parameter "focus” is a value which indicates if the UIpane has gained or lost focus.
  • a void NotifyOnKey(int keyCode, ref bool handled) method is invoked by the shell to notify the currently active UIpane of a user input event. The UIpane will then appropriately route the event to its currently active child.
  • a void NotifyOnPaint(Rectangle rectangle) method is invoked by the shell to notify the currently active UIpane of a paint event. In this method, the parameter "rectangle” refers to the "dirty" region of the active UIpane. It is the responsibility of the active (parent) UIpane to send paint notifications to all of its children.
  • a void SetPaintThrottling(bool on) method turns paint throttling on or off. ' A void Show() method makes the UIpane visible.
  • ABC_Co.TV.Lite.UIpanes D.2.1. ABC Co.TV.Lite.UIpanes Namespace Overview
  • the ABC_Co.TV.Lite.UIpanes namespace contains classes for creating "light TV applications" that are optimized for execution on low-end set-top boxes. As explained in previous sections, the set-top boxes run a provider's interpreter-based CLR system.
  • the classes in this namespace can be grouped into the following categories: •
  • a UIpaneBase class category provides the base functionality for all UIpane controls that are displayed on a TV application. Most classes within the ABC_Co.TV.Lite.UIpanes namespace derive from the UIpaneBase class.
  • the UIpaneBase class is also a container, meaning that it can contain child Ulpanes.
  • a UIpane Forms class category allows for the creation of top level container Ulpanes.
  • a UIpane Controls class category allow for the creation of user interfaces.
  • the Button class is a UIpane control.
  • Fig. 4 shows an exemplary hierarchical organization of these classes.
  • a Button class represents a TV button control.
  • a Control class defines the base class for controls.
  • a control object defines an object with visual representation that performs a specific function.
  • a Form class defines the base class for parentless, top level, container Ulpanes. Objects produced by this class (form objects) have some or no visual representation, and can contain child Ulpanes.
  • a Transition class defines methods to apply a transition to a form object.
  • a UIpaneBase class is an abstract class that defines the base class for a UIpane (which defines an object with visual representation or an object that contains other UIpaneBase objects). As to delegates:
  • a UIpaneEventHandler class represents the methods that will handle any UIpane event.
  • a KeyEventHandler class represents the methods that will handle key events.
  • a TransitionEventHandler class represents the methods that will handle a transition event.
  • a Keys class represents all possible keys codes used in a TV application.
  • a ButtonStyle class represents all possible button styles. The following subsections provide additional details regarding each of the above- identified features of the ABC_Co.TV.Lite.UIpanes namespace.
  • the ABC_Co.TV.Lite.UIpanes.UIpaneBase class refers to an abstract base class for a UIpane (where a UIpane defines an object with visual representation or an object that contains other UIpaneBase objects).
  • the UIpaneBase class implements very basic functionality required by classes that display information to the user. For instance, it defines the bounds of a UIpane, manages child UIpanes and handles user input through key events. It can be expressed formally as: public abstract class UIpaneBase : IUIpane.
  • the UIpaneBase class is a container, meaning that it can hold any non-top level UIpanes. UIpanes can be added and removed from the container by calling Add, Insert, Remove, and RemoveAt on its children collection. A Ulpane's top, left, width and height values are set during the creation of the UIpane. All children should be within the bounds of a parent UIpane. A user's input key events will first go to the focused UIpane. If the UIpane does not handle the key event, the event will be passed to its parent UIpane. The navigation behavior enabled by the UIpaneBase class was described above (e.g., in Subsection B.5.2).
  • the UIpaneBase class does not implement painting. That is, in one exemplary implementation, the developer is responsible for all painting, including the background. The developer can override an OnPaint method to perform painting. However, UIpaneBase will paint any child control within its children collection.
  • the UIpaneBase class can provide the following exemplary and non-exhaustive list of public constructors:
  • a public UIpaneBase(int left, int top, int width, int height, bool topLevel) constructor initializes a new instance of UIpaneBase class with specific location and size. Exception is thrown if the UIpane is outside the bounds of the screen.
  • the parameter "left” refers to a distance, in pixels, between the left edge of the UIpane and the left edge of its container's client area. The minimum is 0 and the maximum corresponds to the OSD width. If the value is outside these bounds, an exception is thrown.
  • the "top” parameter refers to the distance, in pixels, between the bottom edge of the UIpane and the top edge of its container's client area.
  • the minimum is 0 and the maximum corresponds to the OSD height. If the value is outside these bounds, an exception is thrown.
  • the "width” parameter refers to the width, in pixels, of the UIpane. The minimum is 1 and the maximum corresponds to the OSD width minus the left parameter. If the value is outside these bounds, an exception is thrown.
  • the "height” parameter refers to the height, in pixels, of the UIpane. The minimum is 1 and the maximum corresponds to the OSD height minus the top parameter. If the value is outside these bounds, an exception is thrown.
  • the "topLevel” parameter indicates whether the object is a top level
  • the UIpaneBase class can provide the following exemplary and non-exhaustive list of public properties:
  • a public virtual byte BackColor property gets or sets the background color index for the UIpane.
  • the exemplary default is 224.
  • a public virtual bool CanFocus property gets a value indicating whether a UIpane can receive focus.
  • a public ArrayList Children property gets the collection of UIpanes contained within a Ulpane.
  • a public bool Enabled property gets or sets a value indicating whether the Ulpane can respond to user interaction. Default is true. This property returns false if the Ulpane is not the top level Ulpane and does not have a parent or grandparent that is a top level Ulpane.
  • a public bool Floating property gets or sets a value indicating whether the top level Ulpane is a floating Ulpane.
  • a floating Ulpane is a top level Ulpane that will pass keys onto other top level UIpanes. Non-top level UIpanes cannot be floating UIpanes. Attempts to set the Floating property for non-top level UIpanes will be ignored.
  • a public bool Focused property gets a value indicating whether the Ulpane has the input focus.
  • a public virtual byte ForeColor property gets or sets the foreground color index for the UIpaneBase.
  • the exemplary default is 227.
  • a public int Left property gets the distance, in pixels, between the left edge of the Ulpane and the left edge of its container's client area.
  • a public virtual IUIpane Parent property gets or sets the parent container of the Ulpane. Exception is thrown if Ulpane is outside of the parent's bounds. Top level UIpanes cannot have parents.
  • a public int Top gets the distance, in pixels, between the bottom edge of the Ulpane and the top edge of its container's client area.
  • a public bool Visible property gets a value indicating whether the Ulpane is displayed. Default is false for top level UIpanes, and true for all other UIpanes. This property returns false if the Ulpane is not top level and does not have a parent or grandparent that is a top level Ulpane.
  • the UIpaneBase class can provide the following exemplary and non-exhaustive list of public methods:
  • a public Graphics CreateGraphics() method creates a graphics object for the Ulpane. It returns the graphics object for the Ulpane.
  • a public bool Focus() method sets input focus to the Ulpane. By default, the control does not have focus. Setting focus to a Ulpane removes focus from any previously focused Ulpane. Setting focus is asynchronous, so the Ulpane will not actually obtain focus right away. This method returns "true” if the input focus request is successful; otherwise, "false.” Note, returning true means that the Ulpane is able to notify the Ulpane manager 312 that it is interested in obtaining focus. It does not mean that the Ulpane has already obtained focus; it is up to the Ulpane manager 312 to provide focus.
  • a public void Invalidate(Rectangle region) method invalidates a specified region of the Ulpane (that is, this method adds the region to the Ulpane's update region, which is the area that will be repainted upon the next paint operation) and causes a paint message to be sent to the Ulpane. Also, this method invalidates the child UTpanes assigned to the Ulpane. In this method, the "region" parameter refers to the region to be invalidated. If the region parameter is null, the entire Ulpane is invalidated.
  • a public void Refresh() method forces the Ulpane to invalidate its client area and immediately redraw itself and any child Ulpanes.
  • a public void Show() method displays the Ulpane to the user.
  • a public void SuspendLayout(bool suspend) method temporarily suspends or resumes the layout logic for the Ulpane.
  • the "suspend" parameter indicates whether layout should be suspended.
  • the UIpaneBase class can provide the following exemplary and non-exhaustive list of public events: • A public event UIpaneEventHandler EnabledChanged occurs when the Enabled property value has changed.
  • a public event KeyEventHandler KeyPress occurs when a key is pressed while UIpane has focus.
  • the UIpaneBase class can provide the following exemplary and non-exhaustive list of protected methods:
  • a protected virtual void OnEnabledChanged() method raises an EnabledChanged event.
  • OnKeyPress(Keys keyCode, ref bool handled) method raises a KeyPress event.
  • the "keyCode” parameter refers to a key code to be used by the key event.
  • the “handle” parameter refers to a value indicating whether the key event has been handled.
  • a protected virtual OnPaint(Graphics graphics, Rectangle clipRectangle) method provides a base paint method. Namely, this method paints children within the clipRectangle. That is, the "clipRectangle” parameter refers to a region to be painted. Everything is painted if clipRectange is null. The "graphics” parameter refers to the graphics used to perform the painting. An exception is thrown if graphics is null.
  • a protected virtual OnVisibilityChangedQ method raises a VisibilityChanged event.
  • the ABC_Co.TV.Lite.UIpanes.Form class derives from the above- described UIpaneBase class.
  • the Forms class defines the base class for parentless, top level, container Ulpanes. These objects have some or no visual representation, and can contain child Ulpanes. More specifically, interpreter-based CLR applications can use forms for the main and other top level Ulpanes. An application may contain more than one form; however, each form must be registered with the application. The main UIpane is registered automatically when calling Run; however, subsequent top level Ulpanes (or forms) must be expressly registered in order to receive key and paint events.
  • the Form class can be formally expressed as: public class Form : UIpaneBase
  • the Form class can provide the following exemplary and non-exhaustive list of public constructors: • A public Form() constructor initializes new instances of the Form class with default settings. By default, a form is the same size as the OSD. • A public Form(int left, int top, int width, int height) constructor initializes a new instance of the Form class with a specific location and size. An exception is thrown if the UIpane is outside the bounds of the screen. The left, top, width and height parameters were described above (in the context of the UIpaneBase class).
  • the Form class can provide the following exemplary and non-exhaustive list of public methods: ' A public void CloseQ method closes the form. When the form is closed, all resources created within this object are closed and the form is disposed of. • A public bool DoTransition() method raises a transition event. If the form is overlapping any other form, then a transition event cannot be raised. Before an event is raised, the screen is locked at the horizontal region used by the form. While locked, no other forms can be created or moved to the locked region. This method returns "true” if the event was raised, and "false” otherwise.
  • the Form class can provide the following exemplary and non-exhaustive list of public events:
  • a public event TransitionEventHandler Transition occurs when DoTransitionQ is invoked.
  • the Form class can provide the following exemplary and non-exhaustive list of protected methods:
  • Control class derives from UIpaneBase. This class defines the base class for controls.
  • a control is an object with visual representation that performs a specific function. For example, interpreter-based CLR applications use controls for their user interface elements.
  • An example of a control is an object derived from the Button class.
  • the Control class can be formally expressed as: public class Control : UIpaneBase.
  • the Form class can provide the following exemplary and non-exhaustive list of public constructors:
  • a public Control(int left, int top, int width, int height) constructor initializes a new instance of Control class with specific location and size. An exception is thrown if the control is outside the bounds of the screen.
  • the left, top, width and height parameters were described above (in the context of the UIpaneBase class).
  • Control class can provide the following exemplary and non-exhaustive list of public methods:
  • a public void BringToFront() method brings the UIpane to the front of the z- order.
  • the z-order is determined by an index within the parent's children collection. The greater the index, the closer to the front; that is if the index is 0, then the child appears in the rear.
  • a public void SendToBackQ method sends the UIpane to the back of the z-order.
  • the ABC_Co.TV.Lite.UIpanes.Button class derives from the Control class.
  • the Button class represents a TV button control. That is, a button can be clicked by using the TV remote's OK key if the button has the input focus.
  • a button can also contain children; however, these children will not be painted.
  • the button's appearance can be set using the Style property (see ButtonStyle). For example, to produce a button with a left- rounded edge and text left-aligned, Style can be set equal to ButtonStyle.RoundedLeft
  • the Button class can be formally expressed as: public class Button : Control
  • the Button class can provide the following exemplary and non-exhaustive list of public constructors:
  • a public Button(int left, int top, int width, int height) constructor initializes a new instance of Button class with specific location, size or style.
  • the left, top, width and height parameters were described above (in the context of the UIpaneBase class).
  • Control class can provide the following exemplary and non-exhaustive list of public properties constructors:
  • a public override byte BackColor property gets or sets the background color index for the UIpane.
  • the exemplary default is 224.
  • a public byte BorderColor property gets or sets the border color index for the UIpane.
  • the exemplary default is 227.
  • a public uint BorderWidth property gets or sets the border width, in pixels, for the button.
  • the exemplary default is 4.
  • a public override byte ForeColor property gets or sets the foreground color index for the Ulpane. The exemplary default is 227.
  • a public byte SelectedBorderColor property gets or sets the selected border color of the button.
  • the exemplary default is 211.
  • a public ButtonStyle Style property gets or sets the value representing the button style.
  • the exemplary default value is 0x3, with all rounded edges and text center- aligned.
  • a public String Text property gets or sets the value representing the text label of the button. If Text is set to null, Text is set to an empty string. The exemplary default is an empty string.
  • the Button class can provide the following exemplary and non-exhaustive list of public methods.
  • a public virtual void GetFont(out string name, out int height, out int aspect) gets the font parameters of the button text.
  • the "name” parameter refers to the font name of the button text.
  • the exemplary default for name is "Tiresias” (although, of course, the default name can be set to any name).
  • the "height” parameter refers to the font height of the button text.
  • the exemplary default value height is 20.
  • the “aspect” parameter refers to the font aspect ratio of the button text.
  • the exemplary default value for aspect is 100.
  • a public virtual void SetFont(string name, int height, int aspect) method sets the font parameters of the button text.
  • the exemplary default values are as stated above.
  • the Button class can provide the following exemplary and non-exhaustive list of public events:
  • the Button class can provide the following exemplary and non-exhaustive list of protected methods:
  • OnKeyPress(Keys keyCode, ref bool handled) method raises the KeyPress event.
  • the "keyCode” parameter describes the key code to be used by the key event.
  • the "handle” parameter provides a reference to a value which indicates whether the key event has been handled.
  • a protected override void OnPaint(Graphics graphics, Rectangle clipRectangle) method paints the button and raises the paint event.
  • the graphics parameter refers to the graphics used to paint. An exception is thrown if graphics is null.
  • the "clipRectangle” parameter refers to the region to be painted. Everything is painted if clipRectange is null.
  • OnPaintBackground(Graphics graphics) method draws the background of the button.
  • the developer may want to draw their own background (e.g., to draw a fancy bitmap). In these cases, the developer can override this method.
  • the "graphics" parameter refers to the graphics used to paint. An exception is thrown if graphics is null.
  • the UIpaneEventHandler class represents the methods that will handle UIpane events. This class can be formally expressed as: public delegate void UIpaneEventHandler(object sender). The declaration of the event handler should have the same parameters as the UIpaneEventHandler delegate declaration. In this class, the "sender" parameter refers to the source of the event.
  • the KeyEventHandler class represents the methods that will handle key events. This class can be formally expressed as: public delegate void KeyEventHandler(object sender, Keys keyCode, ref bool handled). The declaration of the event handler should have the same parameters as the KeyEventHandler delegate declaration.
  • the "sender” parameter refers to the source of the event.
  • the "keyCode” parameter refers to the key code of the key event.
  • the "handled” parameter indicates whether this key event has already been handled.
  • the Transition class provides methods to apply a transition to the screen. More specifically, the Transition class can be use to provide visual transitions to a form object. To create a transition object, the developer can first raise a transition event by invoking Form.DoTransition(). This API will lock a specified horizontal screen area and raise a transition event. The developer can then create an event handler to handle the transition event. This event handler will then receive a valid transition object.
  • the Transition class can be formally expressed as: public class Transition.
  • the Transition class can provide the following exemplary and non-exhaustive list of public properties:
  • the Transition class can provide the following exemplary and non-exhaustive list of public methods:
  • a public void Decimate(int numerator, int denominator, int offset, int top, int bottom) method simulates a decimate effect on the transition object.
  • the parameter "numerator” represents the numerator of the percentage value.
  • the parameter “denominator” represents the denominator of the percentage value.
  • the parameter “offset” represents the number of lines (in pixels) from the top that will remain unaffected by the decimation.
  • the parameter "top” refers to the top of the area to be considered when decimating.
  • the upper bound is relative to the transition object. An exception is thrown if the argument is out of range.
  • the “bottom” parameter refers to the bottom of the area to be considered when decimating.
  • the lower bound is relative to the transition object. An exception is thrown if the argument
  • a public void Expose(int linesToExpose, int top, int bottom) method exposes a number of lines, specified by linesToExpose, in the center of the area defined by top and bottom. That is, the parameter "linesToExpose” refers to a number of lines to expose from the center of the area defined by the specified top and bottom.
  • the parameter "top” refers to the top of the area to be considered when exposing the lines.
  • the upper bound is relative to the transition object. Exception is thrown if the argument is out of range.
  • the parameter “bottom” refers to the bottom of the area to be considered when exposing the lines. The lower bound is relative to the transition object. An exception is thrown if the argument is out of range.
  • RasterFade(int numerator, int denominator, int top, int bottom) method simulates a raster fade effect on the transition object.
  • the parameter "numerator” represents the numerator of the percentage value.
  • the parameter “denominator” represents the denominator of the percentage value.
  • the parameter "top” refers to top of the area to be raster-faded. The upper bound is relative to the transition object. An exception is thrown if the argument is out of range.
  • the parameter “bottom” refers to the bottom of the area to be raster-faded. The lower bound is relative to the transition object. An exception is thrown if the argument is out of range.
  • a public void Scroll(int offset, int top, int bottom) method scrolls the area defined by top and bottom either up or down.
  • the parameter "offset” refers to an offset indicating the number of lines to scroll. If value is greater than 0, then the area is scrolled up; otherwise, the area is scrolled down.
  • the parameter "top” refers to the top of the area to be scrolled. The upper bound is relative to the transition object. An exception is thrown if the argument is out of range.
  • the parameter "bottom” represents the bottom of the area to be scrolled. The lower bound is relative to the transition object. An exception is thrown if the argument is out of range.
  • the TransitionEventHandler class represents the methods that will handle transition events.
  • the declaration of the event handler should have the same parameters as the TransitionEventHandler delegate declaration.
  • This class can be formally expressed as: public delegate void TransitionEventHandler (object sender, Transition transition).
  • the parameter "sender” refers to the source of the event.
  • the parameter "transition” refers to the transition object.
  • ButtonStyle specifies the appearance of a Button object. If a button style is equal to 0x0, then the Button object has no curved edges and the text is aligned to the left. If neither LeftAligned nor RightAligned are set, then the text is center-aligned. If both LeftAligned and RightAligned are set, then LeftAligned takes precedence. If neither RoundedLeft nor RoundedRight are set, then the Button object has no curved edges.
  • the ButtonStyle enumeration can be formally expressed as: public enum ButtonStyle
  • the ABC_Co.TV.Lite.Shell namespace contains, among other things, an abstract TVLiteApplicationBase class for creating light TV applications. That is, the ABC ⁇ Co.TV.Lite.Shell.TVLiteApplicationBase (ApplicationBase class) represents a TV application. All interpreter-based CLR applications should derive from the abstract TVLiteApplicationBase interface and provide the required implementation.
  • the ApplicationBase class can be formally expressed as: public abstract class TVLiteApplicationBase.
  • the ApplicationBase class can provide the following exemplary and non-exhaustive list of protected methods:
  • a protected void Run(IUIpane mainUIpane) method begins running a standard application message loop on a current thread, and makes the specified UIpane visible.
  • the run method is a static method.
  • static methods in an interpreter-based CLR environment are global to all running threads. Therefore, the Run method is implemented as a protected method in the abstract base class TVLiteApplicationBase to allow each application to have its own message pump.
  • the Run method will automatically call RegisterUIpane to register the main UIpane as a top level UIpane.
  • the parameter mainUIpane refers to a UIpane that will be made visible.
  • the ApplicationBase class can provide the following exemplary and non-exhaustive list of public properties:
  • a pubic bool EnhancedGraphicsMode property allows an application to enter into "Enhanced Graphics Mode (EGM)."
  • EGM mode allows an application to set user palette, change OSD resolution, and so forth. It is an exclusive mode, so that when an application requests to enter the EGM mode (setting the EnhancedGraphicsMode to true), all other managed application will be suspended.
  • An application that enters the EGM mode should set EnhancedGraphicsMode to false when it wants to leave the EGM mode so that other suspended managed applications can run.
  • the application manager 310 will force an application to leave the EGM mode when the application is exiting.
  • the default value of this property is set to false. This property can only be set to true prior to a call to the Run method. An exception will be thrown if this property is set to true after the Run method is called to start the message loop.
  • the ApplicationBase class can provide the following exemplary and non-exhaustive list of public methods:
  • Initialize(string url) method performs application-defined initialization.
  • the URL of the HTTP request to launch the application along with the parameters that are appended to the URL will be passed to the application via the url parameter in the call to Initialize.
  • a public void RegisterUIpane(IUIpane topLevelUIpane) method allows an application to register its top level UIpanes with the UIpane manager 312.
  • the UIpane manager 312 will dispatch UIpane events to the top level UIpane.
  • the application manager 310 will first generate a pause event to the application to request it to pause.
  • the application manager 310 will first generate a pause event to the application to request it to pause.
  • a pubic abstract void ResumeQ method allows the application manager 310 to
  • the application manager 15 send a resume event to the application to request it to resume.
  • a public abstract void ReleaseResource() method allows the application manager 310 to send a release resource event to the application to request it to release any resource that can be freed. This includes removing references to objects for the garbage collector. D.4. ABC_Co.TV.Lite.Drawing Namespace
  • the ABC_Co.TV.Lite.Drawing (Drawing) namespace provides an API set that can be easily used by developers writing graphics applications on the set-top box platform using the interpreter-based CLR.
  • the Graphics class derives from the Drawing class. It can be expressed formally as: public class Graphics.
  • the Graphics class can provide the following exemplary and non-exhaustive list of public constructors:
  • a public Graphics(int x, int y, int width, int height) constructor provides a method that lets the caller create a graphics object at any location on the screen. The graphics object cannot go beyond the TV display area. If this happens, this constructor automatically clips the graphics being created to the valid TV display area.
  • a public Graphics(int width, int height) constructor provides a method that creates an off-screen graphics object in a memory buffer.
  • the above two Graphics constructors can be provided as "internal" methods. This is because the programming model requires that all applications have a form object (derived from the Form class). The graphics object is controlled by the form object so that all drawings are in sync.
  • a button simply represents a rectangle inside the form, rather than a separate UIpane object in a conventional programming environment.
  • the form object is responsible for painting the button. If the developer is allowed to create the graphics for this form, then it becomes difficult to sync the button and other contents which appear on the same form. (Recall that the form class will have a method CreateGraphics().)
  • the Graphics class can provide the following exemplary and non-exhaustive list of public properties:
  • a public Rectangle ClipBounds property is used for the clipping region that the current graphics object is working on.
  • the Graphics class can provide the following exemplary and non-exhaustive list of public methods:
  • a public void DisposeQ method disposes of the graphics object.
  • a public void SetClip(Rectangle clipRect) method sets a clipping region in current graphics object.
  • a public void ResetCli ⁇ () method resets the clipping region in the graphics object back to its default state
  • a public void SetUserPalette(uint[] punPalette, byte startPos) method lets the user specify a custom palette to be associated with the current graphics object.
  • the maximum number of palette entries that the user can specify is 253.
  • the user can also specify where the custom palette should start in the whole color palette array. If the number of colors in the custom palette plus the starting position for the custom palette is larger than 253, then an INVALID_P ARAMETER exception will be thrown.
  • a caller is not allowed to set the color index to 0 because this is reserved by the OS 304 to indicate transparent color.
  • the index 255 is used as an OSD transparent color index when the image format supported on this platform is encoded.
  • the index 254 is used as the RLE escape key. Therefore, this index is prohibited as well. This explains, in this exemplary implementation, the reason why the number of colors in the custom palette cannot be larger than 253.
  • this method can only be called when the graphics system is in an EGM mode. Otherwise, an "INVALID_EGM_STATE" exception will be thrown. Also, an “INVALID_INPUT_PARAMETER” will be thrown if the input parameter is not valid or the starting position is out of range.
  • a public void SetOSDResolution(OSDResolution resolution) method lets the caller set the OSD display resolution.
  • the enum OSDResolution method is governed by the following definitions:
  • OSD_RES_704 OxO, // 704x480 resolution
  • this method can be only called when the graphics system is in the EGM mode; otherwise, an "INVALID_EGM_STATE" exception will be thrown.
  • a public void SetPixel(int x, int y, byte colorlndex) method lets a user set a color value at a specified location on the graphics context.
  • a public byte GetPixel(int x, int y) method lets a user get the color index value at a specified location on the graphics context.
  • a public void FillRectangle(byte colorlndex, int x, int y, int width, int height) method fills a rectangle in with a specified color.
  • a public void DrawRectangle(byte colorlndex, int penWidth, int x, int y, int width, int height) method draws a rectangle with a specified color and pen width.
  • a public void FillEllipse(byte colorlndex, int x, int y, int width, int height) method fills an ellipse in with a specified color.
  • a public void DrawEllipse(byte colorlndex, int penWidth, int x, int y, int width, int height) method draws an ellipse with a specified color and pen width.
  • a public void DrawLine(byte colorlndex, int penWidth, int startX, int startY, int endX, int endY) method draws a line with a specified color and pen width.
  • a public void FillRoundRectangle(byte colorlndex, int x, int y, int width, int height, int radius, RoundingStyle style ) method fills a rectangle with rounded edges with a specified color.
  • the "radius" parameter must be less than or equal to one half of the minimum of the "height" and "width” parameters. If the radius exceeds this value, it will be truncated to that limit.
  • the "style” parameter can comprise: RoundingStyle.All; RoundingStyle. UpperLeft; RoundingStyle .UpperRight; RoundingStyle.LowerLeft; RoundingStyle.LowerRight; or an OR'd combination.
  • a public void DrawRoundRectangle(byte colorlndex, int line Width, int x, int y, int width, int height, int radius, RoundingStyle style ) method draws a rounded rectangle outline of the specified thickness with the specified color.
  • the "radius” parameter must be less than or equal to one half of the minimum of the "height" and "width” parameters. If the radius exceeds this value, it will be truncated to that limit.
  • the "style” parameter can comprise: RoundingStyle.All; RoundingStyle.UpperLeft; RoundingStyle. UpperRight; RoundingStyle.LowerLeft; RoundingStyle.LowerRight; or an OR'd combination.
  • a public void Drawlmage(byte[] buffer, int x, int y) method draws a special format bitmap currently supported on the platfo ⁇ n.
  • the user can use provided tools to convert a regular image into this special format bitmap.
  • An INVALIDJMAGE JFORMAT exception will be thrown if the image is not one of the formats that this platform supports.
  • the Graphics class can provide the following exemplary and non-exhaustive list of internal methods:
  • An internal GraphicsQ method provides a constructor which creates a graphics object that covers the whole TV display Ulpane.
  • An internal static void EnterEGM() method allows an application to enter "Enhanced Graphics Mode” (EGM).
  • EGM Enhanced Graphics Mode
  • only one application is allowed to enter EGM mode at any particular time.
  • An "INVALID_EGM_STATE" exception will be thrown if the caller attempts to enter EGM mode when the graphics system is already in EGM mode.
  • An application is allowed to set user palette, change OSD resolution, etc. only in EGM mode.
  • LeaveEGM • An internal static void LeaveEGM() method leaves EGM mode. Before calling this API, the caller is responsible for restoring the default color palette and default OSD resolution. An "INVALID_EGM_STATE" exception will be thrown from this API if: (1) the application is not in EGM mode; (2) the application has not restored the default color palette; or (3) the application has not restored the default OSD resolution.
  • Scroll(int offset, int upBound, int lowBound) method scrolls the screen up if the "offset" is a positive number, or down if the "offset” is a negative number. This effect will only happen within the up/low bound.
  • RasterFade(int numerator, int denominator, int upBound, int lowBound) method simulates a raster fade effect. It takes a percentage number as input to indicate the effect level.
  • the platform can use a variety of image formats.
  • Two kinds of proprietary image formats include: an uncompressed bitmap format; and an RLE compressed bitmap format. These proprietary image formats can be generated using an image conversion tool which can be supplied to the customers.
  • this format encodes the current pixel "as is.” If more than two consecutive pixels are encountered that have the same value, this format encodes these pixels as an RLE sequence, which is: RLE_ESCAPE, pixel (index) value and counter.
  • the font is stripped of unnecessary header information (compared to
  • Font names are case sensitive.
  • This method throws an exception: (1) if a font of the same name is already installed but with different data; (2) if the supplied bytes cannot be parsed as a valid stripped true type font; or (3) for other typical error conditions. If a second attempt is made to install a font with identical data, the call will not throw an exception. That is, if the application C installing the font is distinct from the application that originally installed the font, a 1 reference count will be incremented for the font. If the same application installs the same 2 font twice, the second installation attempt does not have effect.
  • a void TVLiteApplicationBase.DeinstallFont(string name) method deinstalls a 5 font. Or, if more than one application has installed the font, the DeinstallFont method releases the reference count for the calling application. More specifically, an installed font will persist for the life of the application and will automatically be removed when the application exits (if this exiting application is the last application using the font). It is usually not necessary to call DeinstallFont before exiting. However, if it is necessary to make only transient use of a font, a developer may consider explicitly deinstalling the font. The DeinstallFont call will throw an exception if the application did not install the font or has already deinstalled the font.
  • the graphics object provides a number of other font-related APIs (methods). Exemplary such methods include: • A void SetAntiAliasBackgroundCoIor(int backlndex) method sets the color to be used for anti-aliasing. More specifically, this call establishes a color used to build a table of intermediate colors to use for anti-aliasing purposes. This is very efficient when the default palette is being used and the foreground and background colors fall within a 6x6x6 color cube. An exhaustive walk of the color table will be performed when a custom palette is used or when colors are being used outside of the 6x6x6 space; the walk finds the best value for each position in the anti-aliasing table.
  • the "height" parameter specifies the height in pixels of the font in the range 4-250 inclusive.
  • the font name is case-sensitive. If the font is a glyph-only font (a font containing no cmap table), then the height and aspect are ignored.
  • Exemplary exception error returns include:
  • FONT_PARAM_OUT_OF_RANGE param out of range.
  • a void DrawString(byte colorlndex, string s, int x, int y) method draws a string in the specified color using the currently set font at location (x,y). This method performs no formatting; it just draws a single line of text.
  • a void DrawString(byte colorlndex, string s, int x, int y, int width, AlignStyle align, char truncation) method draws a string in the specified color using the currently set font, with left, right, or center alignment truncating if necessary so as not to exceed the specified width. If the string is truncated and a non-zero truncation character is supplied, this character is pre-pended or appended to the string. For a truncated centered string, the truncation character is both pre-pended and appended.
  • the align parameter can be: AlignStyle.Left, AlignStyle.Right, or AlignStyle.Center.
  • a void DrawString(byte colorlndex, byte[] utf ⁇ Bytes, int byteOffset, int characterCount, byteQ advances, int x, int y) method draws either a string or a run of glyphs depending on the currently selected font. If the selected font contains only glyphs (no cmap table), then the bytes starting at byteOffset from the head of the byte area are decoded and treated as glyph indices. Otherwise the bytes are treated as a UTF-8 encoded character run. The glyphs are drawn using the specified color index, and anti-aliased to the current anti-alias background color. An "advances array" contains the horizontal advances for each character/glyph to be drawn.
  • Each character advance width is one or two bytes in length. Advance widths in the range 0 to 127 are stored without modification, using 1 byte. Outside this range, the most-significant bit (0x80) indicates the first byte of a two-byte sequence. The next bit (0x40) indicates whether the decoded value should be negated. Bits 4 and 5 (0x30) are ignored but should be set to 0. The lower 4 bits and the next byte represent the magnitude of the advance width. If bit 6 of the first byte is set, then the width is negated. This supports widths up to 12 bits in length. If an advance list is supplied, it must contain at least enough entries to support the number of characterCount characters.
  • Exemplary exception error returns include:
  • FONT_PARAM_OUT_OF_RANGE size or aspect ratio out of range.
  • FONTJPARAM_OUT_OFJRANGE font size or aspect params out of range; and FONT_BAD_UTF8_CODE - invalid UTF8 sequence in string.
  • Exemplary exception error returns include:
  • FONT_PARAM_OUT_OFJRANGE font size or aspect parameters out of range, sep string too long
  • FONT_BAD_UTF8_CODE invalid UTF8 sequence in "sep" string.
  • a void GetFontMetrics(out int ascent, out int descent, out int lineSpacing) method fetches the properties of the currently specified font needed for accurate layout of text.
  • the "ascent” parameter is a positive value describing how many pixels the font glyphs may draw above the baseline.
  • the “descent” parameter is a positive value describing how many pixels the font glyphs may draw below the baseline.
  • the "lineSpacing" parameter is the expected default spacing in pixels needed between lines of text in this font. This is the sum of the font's ascent, descent, and line gap.
  • Exemplary exception error returns include:
  • FONT_PARAM_ERR NULL param, etc.
  • FONT_NOT_FOUND not font at spec'd slot.
  • Font Error Codes Exemplary font error codes include: FONT_PARAM_ERR 0x85000002
  • FONT_DUP_NAME 0x85000003
  • FONT_TABLE_FULL 0x85000004
  • NotifyOnEventCallback is a non-blocking call and the entity does not need to make this call on a separate thread, unless there is some explicit need to do so. There will be a single system thread that will perform the waiting and dispatching for all the callback-oriented events, such as HTTP, MpegFiltering, Tuning, eTV, and so forth. (Exceptions are Userlnput, AppLaunch and PingPong events, which are handled by dedicated system threads).
  • HTTP and GuideDB Search represent typical multiple instance models.
  • a request typically has to be made explicitly (by the entity) to start operation, and multiple threads can be creating different requests.
  • the caller to NotifyOnEvent
  • the caller will pass in the corresponding NSL handle which can be used to distinguish between multiple instances of the same event (for example, multiple HTTP requests from different threads on the same application or from different applications).
  • the entity does not typically need to do anything explicit to initiate a request.
  • the runtime gets these kinds of events automatically and it will dispatch them to the interested party (it is the responsibility of the entity to take that data, parse it appropriately and perform the further dispatching to the consumers of their APIs).
  • Event Type/Handle combination there can be only one outstanding request for an Event Type/Handle combination. For example, in one exemplary implementation, it is not possible to make a second HTTP request on the same handle until the first has successfully completed (e.g., the callback has been invoked). This is not a difficult requirement and can be relaxed to some extent if required and if certain conditions are met.
  • a SpotHost layer will act as an intermediary between the NSL and SPOT environments. With the single instance model, the event will be broadcast to all subscribers.
  • the SpotHost layer will take the event (such as HttpResponse or MpegFilter) from the NSL layer, wrap it into a HALJDISPATCHJEVENT struct and send it to the system queue using the Toba_EnqueueDispatchEvent function.
  • the entity is responsible for implementing the appropriate function in the SpotHost layer.
  • the system takes an event off of the queue for processing, if it cannot find a matching request or if it cannot find any target to dispatch it to (e.g., because the application that made the request has exited), the system will discard the response (after doing appropriate cleanup).
  • the APIs should register for notification first (by calling NotifyOnEvent) before they perform the initiation.
  • a Dispose method should be called on the NativeResponse object (which invokes the function pointed to by NativeResponse.freeNativeDataFunctionPtr and passes in rawNativeDataPtr as the parameter). If it is desirable to hold onto the native data, it is possible to keep the NativeResponse object; alternatively, it is possible to set the freeNativeDataFunctionPtr field to 0 and then call Dispose. If an exception is thrown by the callback, then the system assumes the worst and calls Dispose on the NativeResponse object. There is no point in performing the cleanup using a Finalizer since both the system and the user will be able to provide guaranteed cleanup.
  • the system can also provide an explicit API to un-register too; for example, CancelNotificiation(HalDispatchEvents e, uint nativeHandle). Using this functionality, the system has only to be concerned with abnormal termination cases for automatic un- registration.
  • NotifyOnEventlHalDispatchEvents.MpegFilter, 0 /*no native handle*/, this.MpegFilterCallback) ; ⁇ void MpegFilterCallback(NativeResponse response) ⁇ byte U filterdata new byte [response. rawnativedatasize] ,• Systemutils.CopyToByteArray(filterdata, response. rawnativedataptr) ; /*
  • the goal here is to provide a very light-weight and "thin" layer for users to receive async callbacks and system events from the NSL/PAL layer (without spawning off a separate thread for each request).
  • the API author can build an IAsyncResult/AsyncCallback based callback mechanism on top of this feature, if so desired.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Astronomy & Astrophysics (AREA)
  • Stored Programmes (AREA)
  • User Interface Of Digital Computer (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

A system is described that is specifically adapted for use in a resource-constrained set-top box environment. The system uses an interpreter-based common language runtime (CLR) that is specifically configured for use in the set-top box environment. The system also includes a unique application manager and UIpane manager that are specifically configured for use in the set-top box environment. The application manager pauses a current application when another application presents a user interface presentation which interferes with the current application's user interface presentation. In addition, the system includes graphics functionality for providing transitions effects, for allowing a user to change color palette and resolution, and so forth. The graphics functionality directly uses the graphics capabilities of the set top box (such as the set top box's line control register) whenever possible to enable applications to execute more quickly.

Description

SYSTEM TOR RUNNING APPLICATIONS INA RESOURCE-CONSTRAINED SET-TOP BOX ENVIRONMENT
TECHNICAL BTELD
This subject matter relates to developing and running applications in a resource- constrained environment, such as a resource-constrained set-top box environment.
BACKGROUND
Set-top boxes receive media information from a source (such as a head-end distribution site), process the media information, and present the processed media information on an output device (such as a conventional television unit). There is a growing demand to provide functionality which will enable existing and future television set-top boxes to run more versatile and interesting applications. Exemplary applications include game applications, video on demand (VOD) and electronic program guide (EPG) applications, news presentation applications, and so forth.
One approach to improving the versatility of set-top boxes is to duplicate the features of a "full scale" desktop programming environment in a set-top box platform. One exemplary framework in use today is Microsoft Corporation's .NET Framework. .NET technology provides a virtual machine (VM) environment for executing programs in a manner which is generally independent of the underlying complexities in the physical platform used to implement the execution. By way of broad overview, the .NET Framework uses a compiler to convert source code (e.g., C# source code) into intermediate language (IL) code and metadata. In an execution phase, the .NET Framework uses a common language runtime (CLR) loader and a just-in-time (JIT) compiler to transform the IL and metadata into the native code specific to a particular execution platform.
Other technology extends the above-described virtual machine principles for use in resource-constrained computing devices. (Such technology, which employs the use of a just-in-time compiler in resource-constrained environments, is referred to as "compact JIT- based technology" herein.) For example, Microsoft Corporation's .NET Compact Framework (.NET CF) adapts the above-described "full scale" .NET Framework for use in resource-constrained computing devices. Such compact JIT-based technology can inherit the full .NET Framework architecture of the common language runtime (CLR), supports a subset of the .NET Framework class library, and contains classes designed exclusively for .NET CF. In operation, such compact JIT-based technology can use a JIT compiler to execute the intermediate language instructions. Supported devices include personal data assistants (PDAs) (such as the Pocket PC), mobile phones, some set-top boxes, automotive computing devices, and custom-designed embedded devices. In general, such compact JIT- based technology (such as .NET CF) is optimally designed for systems with at least 8-16 MB of RAM.
The above compact JIT-based technology provides feasible solutions in many kinds of set-top boxes. However, this technology is not fully satisfactory for use in all set-top boxes, such as set-top boxes with particularly limited amounts of resources. For example, the popular DCT 2000 set-top box, provided by Motorola Inc. of Schaumburg, IL, includes a 27 MHz CPU and a limited amount of memory (e.g., 1.5 MB of RAM and 1.25 MB of flash memory). These resources do not present an optimal platform on which to run compact JIT-based applications. For example, the JIT used in a conventional .NET environment needs to keep both the original IL assembly and also the "jitted" native code in memory. This requirement can overtax the memory resources of the resource- constrained set-top boxes. Further, JIT-based technology works by JIT-compiling all managed code prior to running it. This produces an undesirable delay when starting up an application.
As a consequence of the above-identified factors, the use of compact JIT-based technology for severely resource-constrained set-top boxes results in poor performance. For example, this solution may cause the applications to run intolerably slow. This solution may also outright prevent the development of some new application features. 1 For at least the above-identified reasons, there is an exemplary need for more
2 satisfactory systems for developing and running applications on resource-constrained set-
3 top boxes and in other resource-constrained environments.
4
5 SUMMARY
6 According to one exemplary implementation, a set-top box system is described η herein, comprising: a hardware layer representing hardware functionality provided by the
8 set-top box and an interpreter-based core runtime engine (e.g., an interpreter-based
9 common language runtime) configured for use in a set-top box environment. The set-top
10 box system is configured to run an application that can perform a function using the
11 hardware layer and the interpreter-based core runtime engine.
12 According to another exemplary feature, the set-top box system includes less than 5
13 MB of memory.
14 According to another exemplary feature, the set-top box system further includes an is application manager for managing applications, configured for use in the set-top box
16 environment.
17 According to another exemplary feature, the application manager is configured to is pause a current application when another application is activated, and to resume the current
19 application when the other application is deactivated.
20 According to another exemplary feature, the set-top box system further includes a
2.1 UIpane manager for managing user interface presentations, configured for use in the set-top
22 box environment.
23 According to another exemplary feature, the set-top box system further includes
24 graphics functionality configured to perform one or more of:
25 provide a transition effect when switching from one graphical presentation to another (such as decimation, fading, scrolling, exposing and so forth); change a color palette of a graphical presentation; change a resolution of a graphical presentation; simplify font processing by stripping information from font files; and provide anti-aliasing for fonts.
According to another exemplary feature, the above-mentioned hardware functionality of the set-top box system includes a line control register (LCR) which provides memory locations which correspond to respective lines on a display device, and wherein the set-top box system further comprises graphics functionality configured to provide a graphical effect by manipulating the LCR.
Additional exemplary implementations are described in the following.
BRIEF DESCRIPTION OF THE DRAWINGS
Fig. 1 shows an overview of a system that includes set-top boxes that implement an improved system described herein.
Fig. 2 shows an overview of a physical construction of an exemplary set-top box used in the system of Fig. 1.
Fig. 3 shows a hierarchy of software functionality that can be implemented by the set-top box of Fig. 2.
Fig. 4 shows a hierarchical organization of UIpane classes provided by the functionality of Fig. 3.
Fig. 5 shows a mechanism used to load and execute applications provided by the functionality of Fig. 3.
Fig. 6 illustrates the operation of navigation functionality provided by the functionality of Fig. 3.
Fig. 7 shows a procedure that sets forth a manner of operation of the functionality of
Fig. 3. The same numbers are used throughout the disclosure and figures to reference like components and features. Series 100 numbers refer to features originally found in Fig. 1, series 200 numbers refer to features originally found in Fig. 2, series 300 numbers refer to features originally found in Fig. 3, and so on.
DETAILED DESCRIPTION
The following description sets forth a system for developing and running applications in a set-top box environment and in other resource-constrained environments. In one exemplary implementation, the system uses an interpreter-based common language runtime (CLR) that is adapted for use in a set-top box environment. For example, the interpret-based CLR can be implemented using, but is not limited to, Microsoft Corporation's Smart Personal Objects Technology (SPOT) functionality.
Among the improvements, the system described herein provides the following features:
• The system provides a flexible and efficient framework to develop rich applications, such as digital video recorder (DVR) applications, tuning-related applications, parental control-related applications, program guide and search applications, video on- demand (VOD) applications, game applications, information (e.g., news) presentation applications, voting applications, instant messenger (IM) applications, and many others. The system also supports user applications written using the C# language (among other languages).
The system provides a new "TV" namespace to simplify programming on the set- top box (compared to the "full scale" .NET Framework or known compact versions thereof). Overall, the functionality referenced by the namespace consumes much less resources compared to the full scale .NET environment or compact versions thereof. At the same time, the system uses a programming framework that complements the .NET Framework, allowing programmers to begin programming for the set-top box with very little additional training.
• The system provides a unique application manager for supporting multiple applications running at the same time. Among other features, the application manager provides a pause/resume mechanism and a notification framework to manage different applications running at the same time (even though these applications might use different system color palettes, different display resolutions, etc). For example, when a second user interface presentation (associated with a second application) takes the place of a first user interface presentation (associated with a first application), the system can automatically pause the first application, allowing the second application to receive the majority of the system's processing power. In this manner, the system can thereby prevent user interface presentation from overlapping each other.
• The system provides a UIpane manager to provide more appropriate user controls (tailored to the set-top box environment) with limited set-top box resource. For example, the system adopts new UIpane forms.
• The system provides graphics functionality that allocates as much rendering as possible to the set-top box hardware. This results in graphics functions that run very quickly, while consuming minimal resources. Among other features, the graphics functionality provides full 256 color support, and provides the ability to switch color palettes and resolutions upon switching from one application to another. The graphics functionality also provides transition effects when switching from one application to another. The transition effects operate by directly manipulating the set-top boxes line control register (LCR). The system also leverages some of the fastest algorithms provided in other systems, such as algorithms for rendering lines, ellipses, rounded rectangles, and so forth.
The system also provides a resource-efficient font installation and management algorithm, and a resource-efficient anti-aliased true type font rendering algorithm. To 1 further reduce resource consumption, the system also uses a font-stripping mechanism to
2 strip out some of the information from the font files.
3 The strategies described herein confer a number of benefits. According to one
4 principal benefit, the system provides a powerful framework for developing interesting and
5 versatile applications on very resource-constrained set-top boxes. At the same time, the
6 system complements previous frameworks, and therefore can leverage a programmer's η existing knowledge of those frameworks (and associated programming languages, such as s C#).
9 Additional features and attendant benefits of the strategies will be set forth in this 0 description. At the outset, while the following discussion is framed principally in the 1 context of the use of interpreter-based CLR technology for deployment in a set-top box 2 environment (such as the above-described SPOT technology), other types of resource- 3 efficient technology can be used as a foundation to construct to the system. Moreover, 4 such other memory-efficient technology does not need to adopt the .NET paradigm (or any s virtual machine framework paradigm). Further, while the system is optimally suited for 6 deployment in a resource-constrained environment, it is not limited to such an 7 environment; for example, the system can be used in an environment that has enough s processing resources to accommodate a full .NET deployment. Further, the system can be 9 used on other devices (besides set-top boxes), such as any kind of wearable device (e.g., a 0 wristwatch device), a personal digital assistant (PDA) device, a mobile phone, and so forth. 1 As to terminology, the term media information refers to any data represented in 2 electronic form that can be consumed by a user. The media information can include any 3 information that conveys audio and/or video information, such as audio resources (e.g., 4 music, spoken word subject matter, etc.), still picture resources (e.g., digital photographs, 5 etc.), moving picture resources (e.g., audio-visual television programs, movies, etc.), computer programs (e.g., games, etc.), and so on. The term UIpane represents a graphics object for presentation to the user. In one case, the UIpane may correspond to a Windows™-type user interface pane.
The term On Screen Display (OSD) refers to the display presentation enabled by the set-top box.
In addition to the above terms, this disclosure uses many standard .NET terms. The reader is referred to any number of introductory texts for a background understanding of .NET concepts, including: David Chappell, Understanding .NET: A Tutorial and Analysis, Addison-Wesley publishers, 2002; and David S. Platt, Introducing Microsoft .NET, Microsoft Press, 2003. Still additional information regarding the .NET environment can be found on Microsoft Corporation's technical library, provided online by Microsoft's MSDN site. The following glossary,, containing prevalent terms in this disclosure, is derived from information provided at the MSDN site.
• An assembly refers to collection of one or more files that are versioned and deployed as a unit. An assembly is the primary building block of a .NET Framework application. All managed types and resources are contained within an assembly and are marked either as accessible only within the assembly or as accessible from code in other assemblies.
• The C# (pronounced "C sharp") language refers to one programming language designed for building applications that run on the .NET Framework. C#, which is an evolution of C and C++, is type safe and object-oriented.
• A callback function refers to an application-defined function that a system or subsystem calls when a prescribed event happens.
A class is a reference type that encapsulates data (constants and fields) and behavior (methods, properties, indexers, events, operators, instance constructors, static constructors, and destructors), and can contain nested types. Class types support inheritance, a mechanism whereby a derived class can extend and specialize a base class. • A constructor refers to a special initialization function that is called automatically whenever an instance of a class is declared. The constructor must have the same name as the class itself and must not return a value.
A delegate is a reference type that is the managed version of a C++ function pointer.
Common language runtime (CLR) refers to an engine at the core of managed code execution. The runtime supplies managed code with services such as cross-language integration, code access security, object lifetime management, and debugging and profiling support. The term "core runtime engine" is used herein to describe functionality that provides the above-described types of services, and thus encompasses CLR technology, but it not limited to CLR technology (and, indeed, is also not limited to .NET technology).
• A context refers to an ordered sequence of properties that define an environment for the objects resident inside it.
• Enumeration (enwn) refers a special form of value type that inherits from System.Enum and supplies alternate names for the values of an underlying primitive type. An enumeration type has a name, an underlying type, and a set of fields.
• A form (such as a Windows-type Form) refers to a composite control that provides consistent behavior and user interface within or across applications.
• Garbage collection (GC) refers to a process for removing objects that are no longer being used.
• JIT compilation refers to compilation (in a conventional "full scale" .NET environment) that converts intermediate language (MSIL) into machine code at the point when the code is required at run time.
Lifetime refers to the time period that begins when an object is allocated in memory and ends when the garbage collector deletes the object from memory. • Managed code refers to code that is executed by the common language runtime environment. Managed data refers to objects having lifetimes that are managed by the common language runtime. • A namespace refers to a logical naming scheme for grouping related types. The .NET Framework uses a hierarchical naming scheme for grouping types into logical categories of related functionality. • A private assembly refers to an assembly that is available only to clients in the same directory structure as the assembly. • Reflection refers to a process of obtaining information about assemblies and the types defined within them, and creating, invoking, and accessing type instances at run time. • A Uniform Resource Identifier (URI) refers to a number or name that uniquely identifies an element or attribute. URIs include both Uniform Resource Names (URNs) and Uniform Resource Locators (URLs). • Unmanaged code refers to code that is executed directly outside the common language runtime environment. • Extensible Markup Language (XML) refers to a subset of Standard Generalized Markup Language (SGML) that is optimized for delivery over the Web. XML provides a uniform method for describing and exchanging structured data that is independent of applications or vendors.
This disclosure includes the following sections. A. System Overview (Figs. 1 and 2) A.I. The System A.2. The Set-top Box B. Exemplary System Software Functionality (Figs. 3-6)
B.I. Overview of the Functionality
B.2. ApplicationBase Functionality 1 B .3. UIpane Functionality
2 B.4. Application Manager
3 B .4.1. Initialization Behavior
4 B.4.2. Execution and Memory Management Behavior
5 B.4.3. Pause and Resume Behavior β B.4.4. Unloading/Termination Behavior η B.4.5. Miscellaneous Behavior
8 B.4.6. Summary (Fig. 5)
9 B.5. UIpanes Manager
10 B .5.1. UIpane Management Behavior
11 B .5.2. Event Routing Behavior
12 B.5.2. UIpane Focus and Navigation Behavior
13 B.6. Graphics Features
14 B.6.1. Transition Effects is B.6.2. Palette and Resolution Effects
16 B.6.3. Bit Effects π B .6.4. Font Rendering Functionality is C. Exemplary Method of Operation (Fig. 7)
19 D. Appendix 0 D.I. The IUIpane Interface 1 D.2. ABC_Co.TV.Lite.UIρanes 2 D.2.1. ABC_Co.TV.Lite.UIpanes Namespace Overview 3 D.2.2. ABC_Co.TV.Lite.UIpanes.UIρaneBase 4 D.2.3. ABC_Co.TV.Lite.UIpanes.Form 5 D.2.4. ABC_Co.TV.Lite.UIpanes.Control
D.2.5. ABC_Co.TV.Lite.UIpanes.Button
D.2.6. ABC_Co.TV.Lite.UIpanes.UIpaneEventHandler D.2.7. ABC_Co.TV.Lite.UIρanes.KeyEventHandler D.2.8. ABC_Co.TV.Lite.UIpanes.Transition D.2.9. ABC_Co.TV.Lite.UIρanes.TransitionEventHandler D.2.10. ABC_Co.TV.Lite.UIρanes.ButtonStyle D.2.11. ABC_Co.TV.Lite.UIpanes.Keys D3. ABC_Co.TV.Lite.Shell.TVLiteApplicationBase D.4. ABC_Co.TV.Lite.Drawing Namespace D.4.1. Overview D.4.2. ABC_Co.TV.Lite.Drawing.Graphics Class D.4.3. RLE Compressed Image Format Used in ABC_Co.TV.Lite D.5. Font Methods D .5.1. Installing and Deinstalling Fonts D.5.2. Graphics Object Font-Related Methods D.6. Native Events and Managed Async CallBack.
A. System Overview (Figs. 1 and 2) Generally, any of the functions described with reference to the figures can be implemented using software, firmware (e.g., fixed logic circuitry), manual processing, or a combination of these implementations. The term "logic, "module" or "functionality" as used herein generally represents software, firmware, or a combination of software and firmware. For instance, in the case of a software implementation, the term "logic," "module," or "functionality" represents program code (and/or declarative-type instructions) that performs specified tasks when executed on a processing device or devices (e.g., CPU or CPUs). The program code can be stored in one or more computer readable memory devices. More generally, the illustrated separation of logic, modules and functionality into distinct units may reflect an actual physical grouping and allocation of such software and/or hardware, or can correspond to a conceptual allocation of different tasks performed by a single software program and/or hardware unit. The illustrated logic, modules and functionality can be located at a single site (e.g., as implemented by a processing device), or can be distributed over plural locations.
A.l. The System
Fig. 1 shows an overview of a system 100 in which the improved functionality described herein can be deployed. By way of overview, the system 100 includes a plurality of resource-constrained devices (102, 104) for receiving media information (or other information) from a source 106 via a coupling mechanism 108.
In the case of media distribution, the source 106 can represent head-end infrastructure for delivering media information to the receiving devices (102, 104). For example, the source 106 may represent conventional cable media distribution infrastructure, conventional wireless media distribution infrastructure (such as satellite media distribution infrastructure), and so forth. Or the source 106 may represent a network source of media information that delivers the media information via one or more digital networks. In still another case, the source 106 may represent an entity (such as a video jukebox, etc.) which supplies media information to the receiving devices (102, 104) from a location which is local with respect to the receiving devices (102, 104). In any case, the source 106 can deliver media information to the receiving devices (102, 104) in a number of broadcast channels according to a fixed time schedule, e.g., as reflected by an electronic program guide (EPG). Or the source 106 can deliver media information to the receiving devices (102, 104) using an on-demand method.
The coupling mechanism 108 couples the source 106 to the receiving devices (102, 104). This coupling mechanism 108 can be implemented in different ways to suit different technical and commercial environments. For instance, the coupling mechanism 108 can include any kind of conventional distribution infrastructure, such as cable routing infrastructure, satellite routing infrastructure, terrestrial antenna routing infrastructure, and so forth (as well as any combination of such routing infrastructures). Or the coupling mechanism 108 can include a digital network (or combination of networks), such as a wide area network (e.g., the Internet), an intranet, and so forth. In the case where Digital Subscriber Line (DSL) infrastructure is used to disseminate information, the coupling mechanism 108 can utilize the services, in part, of telephone coupling infrastructure.
For the illustrative purposes of this description, the simplifying assumption will be made that the source 106 and coupling mechanism 108 provide cable or satellite delivery of media information to the receiving devices (102, 104). The link between the source 106 and the receiving devices (104, 106) can implemented as a one way link (where information flows only from the source 106 to the receiving devices), or preferably as a two way link (where the users of the receiving devices can also send data to the source 106). In the case in which two way communication is used, the device-to-source link can be implemented by the same channel that the devices (102, 104) use to receive media information from the source 106, or by a different channel.
The receiving devices include a set-top box 102. The set-top box 102 receives media information from the source 106, performs various processing on the received media information (such as decoding the media information and potentially decompressing it), and forwards the processed information to an output device. In the case of a media distribution environment, the output device can correspond to a television unit 110. In one case, the set-top box 102 can be implemented as a separate unit from the television unit 110, and it can couple to the set-top box 102 via any kind of coupling mechanism (e.g., physical wiring, wireless coupling, and so forth). In another case, the set-top box 102 can be implemented as an integral unit within the television unit 110. In still other cases, the output device that receives media information from the set-top box 102 can comprise another kind of display device besides a conventional television (such as a computer monitor), an audio output device (such as a stereo system), and so forth. The other receiving devices 104 can comprise any mechanism having processing and output functionality, such as any kind of wearable processing mechanism (e.g., a wristwatch, such as the Microsoft's SPOT watch), a mobile telephone, a personal digital assistant (PDA), a tablet-type device, and so forth. However, to facilitate discussion, the remainder of this description will assume that the receiving device corresponds to the set- top box 102 (which, as stated, can be separate from the television unit 110 or integrated with the television unit 110).
The set-top box 102 includes functionality (to be described) which can present user interface presentations 112 on a display surface 114 of the television unit 110. The display surface 114 is also referred to herein as the on-screen display (OSD). A user can interact with the user interface presentations 112 via a remote control device 116, or some other kind of input device. For example, the set-top box 102 may include input keys (not shown) directly integrated in its housing.
A.2. The Set-top Box
Fig. 2 shows the composition of the exemplary set-top box 102. The set-top box 102 can include a number of modules for performing its ascribed tasks, identified below. • To begin with, the set-top box can include an interface module 202. The interface module 202 can represent any functionality for receiving media information from the source 106 using any coupling mechanism. For example, the interface module 202 can include a DSL modem, a cable modem, a wireless network interface, an Ethernet NIC, or other kind of network interface equipment.
• The set-top box 102 can also include a tuner/decoder module 204 for performing any kind of initial processing on the received media information, such as decoding the media information, potentially decompressing the media information, and so forth. In the case of broadcast services, the tuning/decoding module 204 can select one or more channels of media information via any kind of tuning mechanism (such as by tuning to a prescribed physical frequency that provides a desired channel, and so forth). In the case of network delivery of media information, the tuning/decoding mechanism can rely on virtual tuning mechanisms to receive a channel (e.g., by "tuning" to a prescribed unicast or multicast source of media information).
• The set-top box 102 can include one or more processors 206 for executing instructions to implement the functionality of the set-top box 102.
• The set-top box 102 can include memory 208 (such as RAM memory, flash memory, etc.). A portion of the memory 208 may comprise a FIFO-type buffer (not shown) for storing media information prior to the information being decoded. Another portion of the memory may comprise a line control register (LCR) 210. The LCR 210 includes respective memory locations corresponding to each line on the display surface of the output device. The set-top box 102 can render information to the output device using the LCR 210. As will be described, the set top box 102 can also provide various graphics effects (such as transition effects) by manipulating the LCR 210.
• The set-top box 102 can include an I/O interface 212 for interacting with the user via one or more input devices (e.g., a remote controller 116, and so forth).
• The set-top box 102 can include an A/V interface module 214 for providing media information in an appropriate format to the television unit 110 (or other output device).
• The set-top box 102 can include an optional local store 216 for storing any kind of data and/or program information.
The set-top box 102 can include various other modules 218, not specifically enumerated in the figure. For instance, the set-top box 102 can include a graphics compositor for combining a video component of the media information from the tuning/decoding module 204 with graphics information. The graphics information may comprise various user interface presentations which are overlaid on the media information.
Finally, the set-top box 102 can include one or more buses 220 for coupling the above-identified components together. Additional information regarding a wide range of set-top boxes can be found in a number of sources, such as the online TV dictionary, in an online article entitled, "What are Set-top Boxes."
In any event, the system to be described below is particularly suited for set-top boxes having constrained processing resources (although it is not restricted to boxes having constrained resources). For example, the popular DCT 2000 box produced by Motorola has limited resources. The processor of this box operates at 27 MHz, and the memory comprises 1.5 MB of RAM and 1.25 MB of flash memory. The challenge met by the invention is to provide suitably diverse functionality for these kinds of resource-constrained environments in which to develop and run applications.
According to one exemplary implementation, the system can employ an interpreter- based common language runtime (CLR) that is adapted for use in the set-top box environment. This is in contrast to the above-summarized compact just-in-time-based (compact JIT-based) approach. In the JIT-based approach, the platform requires JIT- compilation of all of the managed code prior to start-up of an application. This has at least two disadvantages. First, the JIT-compilation produces a lag before the application is run. Second, the JIT-compilation requires a significant amount of memory to store the original assembly and the "jitted" native code. In contrast, the interpreter-based CLR provides interpretation and execution of code on a piecemeal basis, that is, by interpreting code on an as-needed basis. This reduces both the time required to start up an application and the memory requirements of an application; the latter of the advantages is particularly valuable for resource-constrained devices which have limited memory resources.
The interpreter-based CLR can be implemented using different technologies. In one exemplary and non-limiting case, the interpreter-based CLR can be implemented by Microsoft Corporation's Smart Personal Objects Technology (SPOT). SPOT technology is described in a number of sources, including an online article by Donald
Thomson entitled "Smart Personal Object Technology (SPOT): Part I: An introduction to hardware, network, and system software." Literature describing .NET embedded technology is relevant to SPOT technology. More specifically, netcpu™ Corporation of
3 Seattle Washington provides a netcpu™ product and associated SDK that is relevant to SPOT technology.
5 The above-described technology-specific implementations are merely illustrative.
6 Other interpreter-based functionality can rely on other programming frameworks besides
7 the .NET framework, such as the Java programming framework, and so forth. As defined above, the more general term "interpreter-based core runtime engine" encompasses the use
9 of an interpreter-based CLR (such as SPOT's TinyCLR), but is not limited to this
10 technology (and, indeed, is also not limited to .NET technology).
Il The interpreter-based CLR can be adapted for use in the set-top box environment in
12 ways that will be fully described in the ensuing sections of this disclosure. Generally, the
13 interpreter-based CLR can provide a reduced set of functionality compared to that provided
14 by the "full scale" .NET Framework. Yet the interpreter-based CLR preferably generally
15 conforms to the .NET paradigm, allowing developers to provide applications using the
16 .NET paradigm in very resource-constrained environments.
17 More specifically, a desktop environment receives input from a user via several
18 possible input devices, such as a keyboard and a mouse. Further, a desktop environment is
19 configured to provide a very complex user interface presentation, with multiple overlapping 0 Ulpanes, demanding an equally complex UIpane management strategy. A set-top box 1 environment, by contrast, receives input from the user typically via a limited number of 2 simple input mechanisms (e.g., a remote controller). Further, a set-top box environment is 3 typically expected to provide multiple applications, but typically does not present these 4 applications in a complex layered fashion (unlike the desktop environment). As such, 5 according to the invention, the interpreter-based CLR platform is adapted to optimally service the set-top box environment. As will be described in the next section, exemplary improvements include: a namespace specifically tailored for the set-top box environment; a unique application manager for pausing and resuming applications; a unique window manager; and various unique graphics and font-related provisions.
B. Exemplary System Software Functionality (Figs. 3-6) B.I. Overview of the Functionality
Fig. 3 provides an overview of the set-top box system's software stack 300, referred to herein as TV.Lite (because it provides relatively "lightweight" functionality for use in the television set-top box environment). As mentioned above, the stack 300 can include functionality provided by an interpreter-based CLR, adapted for use in a set-top box environment according to the unique provisions described herein. In conventional fashion, the layers in the stack 300 refer to the relative dependency of different functionality in the system, with the lowest level performing the most basic functions of the system, and the top level performing the most abstract or high-level functions in the system.
To begin with, the lowest set-top box layer 302 corresponds to the physical structure of the set-top box 102, including its various hardware capabilities. For example, this layer 302 includes the set top box components identified in Fig. 2, including the LCR
210.
The next highest layer, the set-top box OS layer 304, provides various base functions performed by the set-top box 102. For example, for the Motorola DCT 2000 set- top box, the set-top box OS layer 304 corresponds to a "GIOS" operating system provided by Motorola. This layer 304 can provide memory management, scheduling, hardware control, and so forth.
The next highest layer provides an interpreter-based CLR 306 (such as, but not limited to a SPOT-based CLR) and a GFX library 308. Generally, in an exemplary .NET implementation, the interpreter-based CLR 306 contains a subset of .NET common language runtime (CLR) functionality, specifically adapted for the demands of the set-top box environment. The interpreter-based CLR 306 is relatively low in the stack (compared to the "full scale" .NET Framework); this makes the distinction between application functionality and low-level OS functionality less distinct (compared to conventional systems).
The GFX library 308 provides various graphics functionality for use in the set-top box system, which is specifically adapted for use in the set-top box environment.
The next highest layer provides an application manager 310, UIpane manager 312, and forms and control 314. Among other tasks, the application manager 310 controls the loading, running, and shutting down of multiple applications.
The UIpane manager 312 and the forms and control 314 provide various functionality which controls the presentation of UIpanes (such as, but not limited to, display objects similar to those produced in a Windows™ operating system environment). The number of APIs has been condensed in this UIpane functionality (compared to a conventional desktop environment) in order to eliminate functionality that is not needed for the set-top box environment. Yet the APIs complement the full API set provided in the desktop environment, thereby allowing developers to start writing applications for the set- top box environment without learning an entirely new programming paradigm.
The topmost layer provides a number of applications (316, 318, 320, ... 322). These applications (316, 318, 320, ... 322) can include any code functionality designed to serve any purpose. For example, these applications (316, 318, 320, ... 322) can provide digital video recorder (DVR) applications, tuning-related applications, parental control- related applications, program guide and search applications, video on demand (VOD) applications, game applications, information (e.g., news) presentation applications, voting applications, instant messenger (IM) applications, and so forth. The applications (316, 318, 320, ... 322) also supports user applications written using the C# language (among other languages). The following subsections provide additional detail regarding the software stack 300 shown in Fig. 3.
B.2. ApplicationBase Functionality
The functionality in the stack 300 can be implemented, in part, by a unique namespace developed for the set-top box environment. At its base, the namespace provides a shell, ABC__Co.TV.Lite. Shell, from which additional functionality can be appended in hierarchical fashion. Child functionality in the hierarchy can rely on the tools provided by parent functionality through inheritance.
This subsection describes the functionality grouped into a namespace referred to as TVLiteApplicationBase (referred to below as ApplicationBase for brevity). The ApplicationBase class depends from the ABC_Co.TV.Lite. Shell. ApplicationBase represents a set-top box application. Namely, all applications should derive from the abstract TVLiteApplicationBase interface. Through this relationship, the applications can implement all the abstract methods specified in ApplicationBase. The Appendix, in Section D, provides a detailed description of the ApplicationBase functionality; this section provides exemplary salient features of this functionality.
The ApplicationBase class can provide the following exemplary and non-exhaustive list of features. (Below-reference to "message pumps" and other features will be clarified in the context of later discussion of the application manager 310.)
• A Run method begins running a standard application message loop on a current thread, and makes a specified UIpane visible. The Run method will automatically call RegisterUIpane (identified below) to register a main UIpane as a top level UIpane.
An Initialize method performs application-defined initialization. In this method, the URL of a HTTP request to launch the application along with the parameters that are appended to the URL can be passed to the application via a "url" parameter in a call to Initialize. The following provides an exemplary url parameter: http://appserver/monster.dat?paraml=valuel &param2=value2. • An Exit() method informs all message pumps that they should terminate, and then closes all application UIpanes after the messages have been processed. The Exit method is typically called from within a message loop, and forces the Run method to return. More generally, an application can call the Exit method to inform the application manager 310 that the application is exiting; this allows the application manager 310 to perform appropriate actions, such as cleaning up system resources, and so forth. • A RegisterUIpane method allows an application to register its top level UIpanes with the UIpane manager 312. The UIpane manager 312 will dispatch UIpane events to the top level UIpane. • A Pause method allows the application manager 310 to send a pause event to the application to request it to pause. The application manager 310 will suspend the thread after requesting the application to pause. • A Resume method allows the application manager 310 to send a resume event to the application to request it to resume. • A Terminate method allows the application manager 310 to send a terminate event to the application to request it to terminate. For example, the Terminate method can be invoked when an application is to be terminated, such as when the user enters an express quit instruction via appropriate UI commands, when the system is being shut down, when the system resources are running low, and so forth. In these circumstances, the application manager 310 calls the Terminate method to instruct the application to terminate. ' A ReleaseResource method allows the application manager 310 to send a release resource event to the application to request it to release any resource that can be freed. This includes removing references to objects for the garbage collector. B.3. UIpane Functionality
The shell also defines a base IUIpane interface that serves as a root base of all Ulpanes. This interface allows the UIpane manager to control all the UIpanes without "knowing" the specifics of the implementation of each UIpane.
An ABC_Co.TV.Lite.UIpanes namespace contains classes for creating "light TV applications" that are optimized for execution on low-end set-top boxes (STB). As explained in previous sections, the set-top boxes can run an interpreter-based CLR system.
The classes in this namespace can be grouped into the following categories:
• A UIpaneBase class category provides the base functionality for all UIpane controls that are displayed on a TV application. Most classes within the ABC_Co.TV.Lite.UIpanes namespace derive from the UIpaneBase class. The UIpaneBase class is also a container, meaning that it can contain child Ulpanes.
A UIpane Forms class category allows for the creation of top level container
Ulpanes.
• A UIpane Controls class category allow for the creation of user interfaces. For example, the Button class is a UIpane control.
There are a number of classes within the ABC__Co.TV.Lite.UIpanes namespace that provide support for the class categories mentioned in the preceding summary. By way of overview, as to classes:
• A Button class represents a TV button control.
• A Control class defines the base class for controls. A control object defines an object with visual representation that performs a specific function.
A Form class defines the base class for parentless, top level, container Ulpanes. Objects produced by this class (form objects) have some or no visual representation, and can contain child Ulpanes.
A Transition class defines methods to apply a transition to a form object. • A UIpaneBase class is an abstract class that defines the base class for a UIpane (which defines an object with visual representation or an object that contains other UIpaneBase objects).
As to delegates:
1 A UIpaneEventHandler class represents the methods that will handle any UIpane event.
• A KeyEventHandler class represents the methods that will handle key events.
• A TransitionEventHandler class represents the methods that will handle a transition event.
As to enumerations:
• A Keys class represents all possible keys codes used in a TV application.
• A ButtonStyle class represents all possible button styles.
Again, the Appendix, Section D, provides an exhaustive discussion of the UIpane functionality. Further, Fig. 4 shows an exemplary hierarchical organization of this functionality, which provides a summary of the functionality fully set forth in the Appendix.
B.4. Application Manager
The application manager 310 provides a mechanism to manage application loading, unloading, and initialization. The application manager 310 also governs the message pump, performs memory management, handles security-related aspects of the system, and so forth. The application manager 310 also manages application behavior by instructing an application to activate, deactivate, pause, resume, terminate, and so forth.
The follow subsections provide additional information regarding the above topics.
B.4.1. Initialization Behavior The application manager 310 can receive an application launch request to launch an application. For example, in one exemplary implementation, the launch request can request
3 the application manager 310 to launch an application in flash memory or to launch an
4 application via an HTTP request to download and launch the application.
S More specifically, the application shell can use a public Download class in the
6 ABC__Co.TV.Lite. Shell namespace to download and execute an application. Multiple
7 instances of the Download object can be created to download and execute multiple assemblies simultaneously. Each assembly runs in its own thread. (Note that, in certain
9 compact .NET JIT-based frameworks, applications run in different application domains.
10 By contrast, there is no concept of an application domain in the interpreter-based CLR π implementation, as applications run in different logical threads.) The Download object can
12 check for permission to launch an application.
13 An application can use the Download object to launch other applications. If the
14 launching application wants to be notified when the launched application exits, it can pass
15 an AutoResetEvent to the Download constructor and wait on the event. For example,
16 assume that entity X uses the Download object to launch a game application. Entity X can
17 create an AutoResetEvent called gameAppExitEvent and pass it to the Download object.
18 Entity X can create a separate thread and wait on the gameAppExitEvent in that thread.
19 When the game application exits, the Shell will signal the gameAppExitEvent. Entity X 0 should not wait for the gameAppExitEvent in the message pump thread (to be described
21 below) because entity X still needs to respond to system events (such, as pause events, 2 resume events, teπninate events, etc). 3 The Download class contains a public method called ExecuteAssembly to download 4 and execute an assembly. The ExecuteAssembly method will start a new application thread 5 to download, load, and execute an assembly. (Alternatively, or in addition, the Download object can support a method called GetFile that will return a byte array of the assembly.
Applications can use the GetFile method to read a block of bytes of the assembly data or file.) After the assembly is downloaded and loaded, the application manager can use Reflection to find the application class by looking for the class that is derived from TVLiteApplicationBase. Then, the application manager 310 instantiates an instance of TVLiteApplicationBase and calls the Initialize method with the command/URL that launches the application. Thus, the Initialize method constitutes the entry point for the managed application. The application creates its main UIpane when the Initialize method is called. The application can also use the RegisterUIpane functionality (discussed below) provided in the TVLiteApplicationBase to register additional top-level Ulpanes.
B.4.2. Execution and Memory Management Behavior The application calls the Run method when it is finished with all the initialization work. This will start a message pump, which allows the application to receive events (e.g. focus events, key events, pause events, resume events, terminate events, and so on). The Run method is a blocking call and will not return until the application calls Exit on itself. When the application is finished, it calls the Exit method provided in the base class TVLiteApplicationBase of the application. In other words, the Run method starts the message loop on the current thread and makes the specified UIpane visible. An application calls the Exit method to exit the message pump and return from the Run method. In the course of running the application, a garbage collector automatically releases the memory allocated to a managed object when that object is no longer used. However, it is unpredictable when garbage collection will occur. TVLiteApplicationBase can be implemented as a managed application that has no direct access to native memory handles, open files and streams. Therefore, the memory management of TVLiteApplicationBase can be handled properly by the garbage collector. The application manager 310 can call a Purge method to notify the application thread that the system is running low on memory. The application should free (by removing reference to objects) as many managed objects as possible when the Purge method is called. If the system is still running below the minimum memory threshold, the application manager 310 can terminate applications to bring the amount of available memory above the minimum memory threshold. Namely, the application manager 310 can terminate inactive applications based on a fϊrst-in-iϊrst out algorithm. The application manager 310 will not terminate applications listed in a KeepAlive section in a configuration file.
B.4.3. Pause and Resume Behavior
The application manager 310 calls an application's Pause method to indicate the application thread is about to be suspended. For example, the application manager 310 can automatically call the Pause method to pause a currently running application when another application is activated and that new application's UIpane overlaps the current application's UIpane. The Pause method will provide an opportunity for the application tα prepare for thread suspension. The application will not receive any messages until the thread is resumed. The application manager 310 can teπninate an application that does not pause within a pre-determined time period (e.g., 0.5 seconds).
The application manager can call the application's Resume method to indicate that the application thread has been resumed. This will provide an opportunity for the application to restore itself to the state existing prior to the thread suspension. The application manager 310 can then restart the message pump of the thread. The application manager 310 can terminate an application that does not resume within a pre-determined time period (e.g., 0.5 seconds).
B.4.4. Unloading/Termination Behavior The application manager 310 provides the implementation of the Exit method in its base implementation. Namely, the Exit method notifies the application manager 310 to terminate a current application. The application manager 310 will remove the terminated application and transfer control to a previous active application.
The application manager 310 can also call the application's Terminate method to indicate that the application thread should terminate. This will provide an opportunity for the application to exit gracefully. The application manager 310 will terminate an application that does not exit gracefully after a pre-determined period of time.
B.4.5. Miscellaneous Behavior
As to the topic of security, the application manager 310 validates an application's requests against rules specified in a configuration file. For instance, the application manager 310 can check whether an application has permission to launch another application, access network resources, and so on. An application will receive an exception when requesting functionality it does not have permission to use.
As to the topic of registration, an application can register its top level UIpanes with the application manager 310 to receive UIpane events. More specifically, the Run method automatically registers the UIpane specified in its UIpane parameter.
B.4.6. Summary (Fig. S)
Fig. 5 provides a summary of the above-identified concepts. In this figure, an application launcher 502 invokes the launch of an application by contacting download entity 504. The download entity 504 determines whether it has permission to download and execute the application by accessing the sandbox permission entity 506. If so, the download entity 504 adds a task to the task manager entity 508 to execute the application. Running the application creates an application thread 510 devoted to the application. The application manager 310 and the window manager 312 control the execution of the invoked application. Namely, these managers (310, 312) add queue items to a message queue entity 512, resulting in the execution of these items by the application entity 514.
B.5. UIpanes Manager
The UIpane manager 312 provides a fully managed UIpane management implementation. The UIpane manager 312 is responsible for UIpanes management, events routing, and focus management. This subsection provides details regarding the behavior of the winpage manager 312.
B.5.1. UIpane Management Behavior
UIpanes are displayed in a prescribed priority based on their type. The supported UIpane types comprise: Notification; Floating (Notification with AlwaysOnTop attribute set); and Normal. A Floating UIpane will always be the top-most UIpane. For example, assume that a display simultaneously presents plural UIpanes corresponding to different applications (or corresponding to the same application). The UIpane that has the highest priority level will receive focus, meaning that a user's input activity will be directed to this UIpane. According to one exemplary implementation, however, UIpanes are not allowed to overlap on the display.
The UIpane manager 312 works closely with the application manager 310 to pause, resume, and terminate applications. For example, the UIpane manager 312 asks the application manager 310 to send a pause event to a current application's message pump when the current application needs to be suspended (typically because another application's UIpane that is about to come up will interfere with the current UIpane). This will give the current application a chance to perfoπn required operations before it goes into a suspended state. More specifically, an application receives activate and deactivate events when it receives and loses focus respectively. For example, if a notification shows up on top of a running application, the application will receive a deactivate event (followed by a pause event). When the notification is dismissed, the application will receive an activate event (after it has been sent a resume event).
B.5.2. Event Routing Behavior
The UIpane manager dispatches all events to the message pump of the application thread. More specifically, user input events will "bubble up" the UIpanes containment hierarchy until the event is handled or the hierarchy ends (that is, when the event reaches a UIpane that does not consume the event and whose parent is null).
Paint events are dispatched to the top level UIpane of the containment hierarchy only if the UIpane has not been paused. The top level UIpane is responsible for dispatching paint events to its children. For example, if a UIpane has several buttons as its children, the UIpane will receive a paint event and it is responsible for invoking paint on the buttons.
B.5.3. UIpane Focus and Navigation Behavior
According to one exemplary implementation, navigation among child UIpanes is accomplished with the directional remote keys (e.g., provided by the remote controller 116). For example if the down key is pressed, the nearest child below the active child UIpane will receive focus. If a directional key event is not handled, the parent UIpane attempts to pass focus to one of its siblings.
More specifically, the navigation is determined by "hot points" created on various locations of a UIpane. The location of a hot point depends on which arrow key is selected. For example, in Fig. 6, assume that control A currently has focus. If the down key is selected, the hot point of the current focused control will correspond to the middle of control A's lower edge. This hot point is then projected onto the top edge of each of the surrounding controls. The distance between each hot point pair is then measured. The pair with shortest positive distance determines the next control to receive focus. In this case, the hot point distance between controls A and B (line AB) is shorter than the hot point distance between controls A and C (AC), so that control B will receive focus next. (D is not considered because it is located completely above A).
A special case occurs when two controls are overlapping. For example, if control D overlaps control A such that control D's top edge is over control A, then control D will be considered on a down key press. Therefore, in this case, control D will receive focus if line AD is shorter than both lines AB and AC.
B.6. Graphics Features
A principal objective of the graphics-related functionality is to provide an API set that meets a developer's requirements as economically and efficiently as possible (in view of the limitations of a resource-constrained environment).
According to one general feature, the above objective is achieved, in part, by using an API set that is simplified (compared to a "full" API set provided in the desktop environment). For example, simplified graphics APIs are provided, such as line and ellipse drawing algorithms. The API set is also be flexible, to allow future expansion.
According to another feature, the graphics functionality directly interacts with the set-top box hardware, utilizing the processing power of the hardware as much as possible. For example, in the current system, the drawing primitives can directly write to the hardware. In contrast, conventional graphics APIs are overly-abstracted behind "heavy" desktop APIs (and therefore would become sluggish when applied in a resource- constrained set-top box environment).
Figure imgf000033_0001
More specifically, the graphics functionality can preset the code path so that calls are made, if possible, to the set top box 102's hardware APIs. To provide one example, the 1 DCT 2000 set-top box hardware provides a block copy function which operates very
2 quickly. However, this function requires that the source and destination pointers be
3 WORD-aligned. The graphics functionality accommodates the requirements of this
4 function and then calls it. As another example, the M68000 chip has a special feature
5 referred to as DBRA. The graphics functionality can accommodate the requirements of this
6 chip (e.g., alignment) and then can call this chip directly to provide very fast memory
7 transfer. g As another example, the graphics functionality can also leverage the line control
9 register (LCR) 210 of the set top box 102 to provide various special effects in an efficient to manner. For example, suppose that the screen resolution is 480 lines. A developer can π allocate 480 storage locations in the LCR 210 that point to respective lines of the data on
12 the screen. Namely, this can be achieved by allocating a memory bitmap buffer for the
13 entire on-screen display. In a normal state, each LCR storage location points to the
14 beginning of each line of the bitmap. Special effects can be achieved by manipulating the is order of the lines using the LCR 210 according to various algorithms. To take a simple
16 case, if let LCR[IO] points to line 9 in the bitmap and LCR[9] points to line 10 in the
17 bitmap, then the set top box 102 will display these two lines in transposed order. is More specifically, exemplary unique graphics features of the set-top box system
19 described herein include transition effects, custom palette support, bit rending functionality, 0 true type font rendering, and so forth. These features are described in greater detail below. 1 The Appendix, Section D, provides more details on these features. 2 3 B.6.1. Transition Effects 4 The set-top box 102 provides a number of transition effects that take effect when 5 switching from one graphical presentation to another. The following functions provide exemplary transition effects. Again, these functions can be implemented by directly manipulating the LCR 210 in the manner described above. A Scroll method scrolls the screen up if the an "offset" parameter specified in the method is a positive number, or down if the "offset" is a negative number. This effect will be provided within the bounds defined by "upBound" and "lowBound" parameters specified in the method.
A Decimate method simulates a decimation effect. More specifically, this method takes a percentage number as input to indicate the effect level. The decimation effect is provided between the "upBound" and "lowBound" parameters specified in the method.
A RasterFade method simulates a raster fade effect. This method takes a percentage number as input to indicate the effect level. The decimation effect is provided between the "upBound" and "lowBound" parameters specified in the method.
An Expose method exposes a number of lines, specified by an "linesToExpose" parameter specified in the method, in the center of the Ulpane-specified "upBound" and "lowBound."
B.6.2. Palette and Resolution Effects
The set-top box system allows a developer to dynamically change resolution and color palette. This can provide a more varied, and therefore a more interesting, user experience. For example, a developer can configure the system such that switching from a first application to a second application will prompt the system to potentially change color palette and resolution (corresponding to the second application).
To achieve the above effects, the system provides a SetUserPalette method. This method lets the user specify a custom palette to be associated with a graphics object.
In addition, a RestoreDefaultPalette method restores the default on-screen color palette.
A SetOSDResolution method allows the caller to set the on-screen display resolution. A RestoreDefaultOSDResolution method restores the default on-screen display resolution.
B.6.3. Bit Effects
A BitBlt method bits contents from one graphics object to another graphics object. With this functionality, application developers, especially game programmers, can copy one part of the graphics context to another.
B.6.4. Font Rendering Functionality
As a general font processing feature, the set-top box system can strip unnecessary information from the font to provide more efficient processing of the fonts in the set-top box environment. Namely, a FontOptimizer tool optimizes font files by eliminating characters outside of the codeset file, remapping characters and stripping out glyph information to minimize file size. This feature therefore contributes to the general goal of running interesting applications in resource-constrained environments.
A SetAntiAliasBackgroundColor method sets a color to be used for anti-aliasing. More specifically, this call establishes a color used to build a table of intermediate colors for use in anti-aliasing.
A SetFont method sets a current font to be used for string draw operations.
A DrawString method draws a string in a specified color in a specific manner that is governed by its various parameters (e.g., note the Appendix for additional information).
A BreakString method, using a currently set font, attempts to break a string into words.
A GetFontMetrics method fetches the properties of a currently specified font used to provide accurate layout of text.
C. Exemplary Method of Operation Fig. 7 describes the operation of the set-top box system in flowchart form. To facilitate discussion, certain operations are described as constituting distinct steps performed in a certain order. Such implementations are exemplary and non-limiting. Certain steps described herein can be grouped together and performed in a single operation, and certain steps can be performed in an order that differs from the order employed in the example set forth in this disclosure. As the functions described in this flowchart have already been explained in prior sections, Section C will serve primarily as a brief review of those functions.
In set 702, the set-top box 102 launches and loads an application using the above- described Initialize method. This prompts the set-top box 102 to establish a message thread for the application.
In step 704, the set-top box 102 pauses and then resumes the application as necessary during the running of the application. For example, the set-top box 102 can pause a current application if another application produces a UIpane that takes precedence over the current application. The set-top box performs memory management during the running of the program in the manner described above by removing stale objects.
In step 706, the set-top box 102 exits/terminates the application.
D. Appendix
The following section provides a more exhaustive listing of the various functions identified in previous sections.
D.I. The IUIpane Interface
The shell defines a base IUIpane interface that serves as a root base for all Ulpanes.
This interface allows the UIpane manager 312 to control all of the Ulpanes without knowing the specifics of the implementation of each UIpane . The IUIpane interface can be expressed formally as: public interface IUIpane. A IUIpane interface can provide the following exemplary and non-exhaustive list of interface functions: • A Graphics CreateGraphics() method obtains a graphics object for the UIpane. • A void Hide() method makes the UIpane invisible. • A void NotifyOnCloseO method is invoked by the shell to notify a UIpane that it has been closed. • A void NotifyOnFocus(bool focus) is invoked by the shell to notify a UIpane that it has either gained or lost focus. The parameter "focus" is a value which indicates if the UIpane has gained or lost focus. • A void NotifyOnKey(int keyCode, ref bool handled) method is invoked by the shell to notify the currently active UIpane of a user input event. The UIpane will then appropriately route the event to its currently active child. • A void NotifyOnPaint(Rectangle rectangle) method is invoked by the shell to notify the currently active UIpane of a paint event. In this method, the parameter "rectangle" refers to the "dirty" region of the active UIpane. It is the responsibility of the active (parent) UIpane to send paint notifications to all of its children. • A void SetPaintThrottling(bool on) method turns paint throttling on or off. ' A void Show() method makes the UIpane visible.
D.2. ABC_Co.TV.Lite.UIpanes D.2.1. ABC Co.TV.Lite.UIpanes Namespace Overview By way of overview, the ABC_Co.TV.Lite.UIpanes namespace contains classes for creating "light TV applications" that are optimized for execution on low-end set-top boxes. As explained in previous sections, the set-top boxes run a provider's interpreter-based CLR system. The classes in this namespace can be grouped into the following categories: • A UIpaneBase class category provides the base functionality for all UIpane controls that are displayed on a TV application. Most classes within the ABC_Co.TV.Lite.UIpanes namespace derive from the UIpaneBase class. The UIpaneBase class is also a container, meaning that it can contain child Ulpanes. • A UIpane Forms class category allows for the creation of top level container Ulpanes. • A UIpane Controls class category allow for the creation of user interfaces. For example, the Button class is a UIpane control. There are a number of classes within the ABC_Co.TV.Lite.UIpanes namespace that provide support for the class categories mentioned in the preceding summary. Fig. 4 shows an exemplary hierarchical organization of these classes. By way of overview, as to classes: • A Button class represents a TV button control. • A Control class defines the base class for controls. A control object defines an object with visual representation that performs a specific function. • A Form class defines the base class for parentless, top level, container Ulpanes. Objects produced by this class (form objects) have some or no visual representation, and can contain child Ulpanes. A Transition class defines methods to apply a transition to a form object. A UIpaneBase class is an abstract class that defines the base class for a UIpane (which defines an object with visual representation or an object that contains other UIpaneBase objects). As to delegates:
A UIpaneEventHandler class represents the methods that will handle any UIpane event.
A KeyEventHandler class represents the methods that will handle key events. • A TransitionEventHandler class represents the methods that will handle a transition event. As to enumerations: • A Keys class represents all possible keys codes used in a TV application. • A ButtonStyle class represents all possible button styles. The following subsections provide additional details regarding each of the above- identified features of the ABC_Co.TV.Lite.UIpanes namespace.
D.2.2. ABC Co.TV.Lite.UIpanes.UIpaneBase As summarized above, the ABC_Co.TV.Lite.UIpanes.UIpaneBase class (UIpaneBase class) refers to an abstract base class for a UIpane (where a UIpane defines an object with visual representation or an object that contains other UIpaneBase objects). Namely, the UIpaneBase class implements very basic functionality required by classes that display information to the user. For instance, it defines the bounds of a UIpane, manages child UIpanes and handles user input through key events. It can be expressed formally as: public abstract class UIpaneBase : IUIpane. As to the topic of layout, the UIpaneBase class is a container, meaning that it can hold any non-top level UIpanes. UIpanes can be added and removed from the container by calling Add, Insert, Remove, and RemoveAt on its children collection. A Ulpane's top, left, width and height values are set during the creation of the UIpane. All children should be within the bounds of a parent UIpane. A user's input key events will first go to the focused UIpane. If the UIpane does not handle the key event, the event will be passed to its parent UIpane. The navigation behavior enabled by the UIpaneBase class was described above (e.g., in Subsection B.5.2).
As to the topic of painting, the UIpaneBase class does not implement painting. That is, in one exemplary implementation, the developer is responsible for all painting, including the background. The developer can override an OnPaint method to perform painting. However, UIpaneBase will paint any child control within its children collection.
The UIpaneBase class can provide the following exemplary and non-exhaustive list of public constructors:
• A public UIpaneBase(int left, int top, int width, int height, bool topLevel) constructor initializes a new instance of UIpaneBase class with specific location and size. Exception is thrown if the UIpane is outside the bounds of the screen. In this constructor, the parameter "left" refers to a distance, in pixels, between the left edge of the UIpane and the left edge of its container's client area. The minimum is 0 and the maximum corresponds to the OSD width. If the value is outside these bounds, an exception is thrown. The "top" parameter refers to the distance, in pixels, between the bottom edge of the UIpane and the top edge of its container's client area. The minimum is 0 and the maximum corresponds to the OSD height. If the value is outside these bounds, an exception is thrown. The "width" parameter refers to the width, in pixels, of the UIpane. The minimum is 1 and the maximum corresponds to the OSD width minus the left parameter. If the value is outside these bounds, an exception is thrown. The "height" parameter refers to the height, in pixels, of the UIpane. The minimum is 1 and the maximum corresponds to the OSD height minus the top parameter. If the value is outside these bounds, an exception is thrown. Finally, the "topLevel" parameter indicates whether the object is a top level
UIpane.
The UIpaneBase class can provide the following exemplary and non-exhaustive list of public properties:
• A public virtual byte BackColor property gets or sets the background color index for the UIpane. The exemplary default is 224.
A public virtual bool CanFocus property gets a value indicating whether a UIpane can receive focus. • A public ArrayList Children property gets the collection of UIpanes contained within a Ulpane.
• A public bool Enabled property gets or sets a value indicating whether the Ulpane can respond to user interaction. Default is true. This property returns false if the Ulpane is not the top level Ulpane and does not have a parent or grandparent that is a top level Ulpane.
• A public bool Floating property gets or sets a value indicating whether the top level Ulpane is a floating Ulpane. A floating Ulpane is a top level Ulpane that will pass keys onto other top level UIpanes. Non-top level UIpanes cannot be floating UIpanes. Attempts to set the Floating property for non-top level UIpanes will be ignored.
• A public bool Focused property gets a value indicating whether the Ulpane has the input focus.
• A public virtual byte ForeColor property gets or sets the foreground color index for the UIpaneBase. The exemplary default is 227.
• A public int Height property gets the height of the Ulpane.
• A public int Left property gets the distance, in pixels, between the left edge of the Ulpane and the left edge of its container's client area.
• A public virtual IUIpane Parent property gets or sets the parent container of the Ulpane. Exception is thrown if Ulpane is outside of the parent's bounds. Top level UIpanes cannot have parents.
• A public int Top gets the distance, in pixels, between the bottom edge of the Ulpane and the top edge of its container's client area.
• A public bool Visible property gets a value indicating whether the Ulpane is displayed. Default is false for top level UIpanes, and true for all other UIpanes. This property returns false if the Ulpane is not top level and does not have a parent or grandparent that is a top level Ulpane.
• A public int Width property gets the width of the Ulpane. The UIpaneBase class can provide the following exemplary and non-exhaustive list of public methods:
• A public Graphics CreateGraphics() method creates a graphics object for the Ulpane. It returns the graphics object for the Ulpane.
• A public bool Focus() method sets input focus to the Ulpane. By default, the control does not have focus. Setting focus to a Ulpane removes focus from any previously focused Ulpane. Setting focus is asynchronous, so the Ulpane will not actually obtain focus right away. This method returns "true" if the input focus request is successful; otherwise, "false." Note, returning true means that the Ulpane is able to notify the Ulpane manager 312 that it is interested in obtaining focus. It does not mean that the Ulpane has already obtained focus; it is up to the Ulpane manager 312 to provide focus.
• A public void Hide() method conceals the Ulpane from the user.
• A public void Invalidate(Rectangle region) method invalidates a specified region of the Ulpane (that is, this method adds the region to the Ulpane's update region, which is the area that will be repainted upon the next paint operation) and causes a paint message to be sent to the Ulpane. Also, this method invalidates the child UTpanes assigned to the Ulpane. In this method, the "region" parameter refers to the region to be invalidated. If the region parameter is null, the entire Ulpane is invalidated.
• A public void Refresh() method forces the Ulpane to invalidate its client area and immediately redraw itself and any child Ulpanes.
• A public void Show() method displays the Ulpane to the user.
• A public void SuspendLayout(bool suspend) method temporarily suspends or resumes the layout logic for the Ulpane. In this method, the "suspend" parameter indicates whether layout should be suspended.
The UIpaneBase class can provide the following exemplary and non-exhaustive list of public events: • A public event UIpaneEventHandler EnabledChanged occurs when the Enabled property value has changed.
• A public event UIpaneEventHandler FocusChanged occurs when the UIpane input focus changes.
• A public event KeyEventHandler KeyPress occurs when a key is pressed while UIpane has focus.
• A public event UIpaneEventHandler VisibilityChanged occurs when the UIpane 's visibility has changed.
The UIpaneBase class can provide the following exemplary and non-exhaustive list of protected methods:
A protected virtual void OnEnabledChanged() method raises an EnabledChanged event.
• A protected virtual void OnFocusChanged() method raises a FocusChanged event.
• A protected virtual void OnKeyPress(Keys keyCode, ref bool handled) method raises a KeyPress event. In this method, the "keyCode" parameter refers to a key code to be used by the key event. The "handle" parameter refers to a value indicating whether the key event has been handled.
• A protected virtual OnPaint(Graphics graphics, Rectangle clipRectangle) method provides a base paint method. Namely, this method paints children within the clipRectangle. That is, the "clipRectangle" parameter refers to a region to be painted. Everything is painted if clipRectange is null. The "graphics" parameter refers to the graphics used to perform the painting. An exception is thrown if graphics is null.
1 A protected virtual OnVisibilityChangedQ method raises a VisibilityChanged event.
D.2.3. ABC Co.TV.Lite.UIpanes.Form The ABC_Co.TV.Lite.UIpanes.Form class (Form class) derives from the above- described UIpaneBase class. The Forms class defines the base class for parentless, top level, container Ulpanes. These objects have some or no visual representation, and can contain child Ulpanes. More specifically, interpreter-based CLR applications can use forms for the main and other top level Ulpanes. An application may contain more than one form; however, each form must be registered with the application. The main UIpane is registered automatically when calling Run; however, subsequent top level Ulpanes (or forms) must be expressly registered in order to receive key and paint events. The Form class can be formally expressed as: public class Form : UIpaneBase The Form class can provide the following exemplary and non-exhaustive list of public constructors: • A public Form() constructor initializes new instances of the Form class with default settings. By default, a form is the same size as the OSD. • A public Form(int left, int top, int width, int height) constructor initializes a new instance of the Form class with a specific location and size. An exception is thrown if the UIpane is outside the bounds of the screen. The left, top, width and height parameters were described above (in the context of the UIpaneBase class). The Form class can provide the following exemplary and non-exhaustive list of public methods: ' A public void CloseQ method closes the form. When the form is closed, all resources created within this object are closed and the form is disposed of. A public bool DoTransition() method raises a transition event. If the form is overlapping any other form, then a transition event cannot be raised. Before an event is raised, the screen is locked at the horizontal region used by the form. While locked, no other forms can be created or moved to the locked region. This method returns "true" if the event was raised, and "false" otherwise. The Form class can provide the following exemplary and non-exhaustive list of public events:
• A public event UIpaneEventHandler Closed occurs when the form is closing.
A public event TransitionEventHandler Transition occurs when DoTransitionQ is invoked.
The Form class can provide the following exemplary and non-exhaustive list of protected methods:
• A protected virtual void OnClosed() method raises the Closed event.
D.2.4. ABC Co.TV.Lite.UIϋanes.Control
ABC_Co.TV.Lite.UIpanes.Control class (Control class) derives from UIpaneBase. This class defines the base class for controls. A control is an object with visual representation that performs a specific function. For example, interpreter-based CLR applications use controls for their user interface elements. An example of a control is an object derived from the Button class. The Control class can be formally expressed as: public class Control : UIpaneBase.
The Form class can provide the following exemplary and non-exhaustive list of public constructors:
• A public Control(int left, int top, int width, int height) constructor initializes a new instance of Control class with specific location and size. An exception is thrown if the control is outside the bounds of the screen. The left, top, width and height parameters were described above (in the context of the UIpaneBase class).
The Control class can provide the following exemplary and non-exhaustive list of public methods:
A public void BringToFront() method brings the UIpane to the front of the z- order. The z-order is determined by an index within the parent's children collection. The greater the index, the closer to the front; that is if the index is 0, then the child appears in the rear.
A public void SendToBackQ method sends the UIpane to the back of the z-order.
D.2.5. ABC Co.TV.Lite.UIpanes.Button
The ABC_Co.TV.Lite.UIpanes.Button class (Button class) derives from the Control class. The Button class represents a TV button control. That is, a button can be clicked by using the TV remote's OK key if the button has the input focus. A button can also contain children; however, these children will not be painted. The button's appearance can be set using the Style property (see ButtonStyle). For example, to produce a button with a left- rounded edge and text left-aligned, Style can be set equal to ButtonStyle.RoundedLeft | ButtonStyle.LeftAligned. The Button class can be formally expressed as: public class Button : Control
The Button class can provide the following exemplary and non-exhaustive list of public constructors:
• A public Button(int left, int top, int width, int height) constructor initializes a new instance of Button class with specific location, size or style. The left, top, width and height parameters were described above (in the context of the UIpaneBase class).
The Control class can provide the following exemplary and non-exhaustive list of public properties constructors:
• A public override byte BackColor property gets or sets the background color index for the UIpane. The exemplary default is 224.
A public byte BorderColor property gets or sets the border color index for the UIpane. The exemplary default is 227.
A public uint BorderWidth property gets or sets the border width, in pixels, for the button. The exemplary default is 4. • A public override byte ForeColor property gets or sets the foreground color index for the Ulpane. The exemplary default is 227.
• A public byte SelectedBorderColor property gets or sets the selected border color of the button. The exemplary default is 211.
• A public ButtonStyle Style property gets or sets the value representing the button style. The exemplary default value is 0x3, with all rounded edges and text center- aligned.
• A public String Text property gets or sets the value representing the text label of the button. If Text is set to null, Text is set to an empty string. The exemplary default is an empty string.
The Button class can provide the following exemplary and non-exhaustive list of public methods.
• A public virtual void GetFont(out string name, out int height, out int aspect) gets the font parameters of the button text. The "name" parameter refers to the font name of the button text. The exemplary default for name is "Tiresias" (although, of course, the default name can be set to any name). The "height" parameter refers to the font height of the button text. The exemplary default value height is 20. The "aspect" parameter refers to the font aspect ratio of the button text. The exemplary default value for aspect is 100.
• A public virtual void SetFont(string name, int height, int aspect) method sets the font parameters of the button text. The exemplary default values are as stated above.
The Button class can provide the following exemplary and non-exhaustive list of public events:
• A public event UIpaneEventHandler Click occurs when the button is clicked. The Button class can provide the following exemplary and non-exhaustive list of protected methods:
A protected virtual void OnClick() method raises the Click event.
A protected override void OnKeyPress(Keys keyCode, ref bool handled) method raises the KeyPress event. In this method, the "keyCode" parameter describes the key code to be used by the key event. The "handle" parameter provides a reference to a value which indicates whether the key event has been handled.
• A protected override void OnPaint(Graphics graphics, Rectangle clipRectangle) method paints the button and raises the paint event. In this method, the graphics parameter refers to the graphics used to paint. An exception is thrown if graphics is null. The "clipRectangle" parameter refers to the region to be painted. Everything is painted if clipRectange is null.
• A protected virtual void OnPaintBackground(Graphics graphics) method draws the background of the button. The developer may want to draw their own background (e.g., to draw a fancy bitmap). In these cases, the developer can override this method. In this method, the "graphics" parameter refers to the graphics used to paint. An exception is thrown if graphics is null.
1 A protected override OnVisibilityChangedQ method raises the VisibilityChanged event.
D.2.6. ABC Co.TV.Lite.UIpanes.UIpaneEventHandler
The UIpaneEventHandler class represents the methods that will handle UIpane events. This class can be formally expressed as: public delegate void UIpaneEventHandler(object sender). The declaration of the event handler should have the same parameters as the UIpaneEventHandler delegate declaration. In this class, the "sender" parameter refers to the source of the event.
D.2.7. ABC Co.TV.Lite.UIpanes.KevEventHandler
The KeyEventHandler class represents the methods that will handle key events. This class can be formally expressed as: public delegate void KeyEventHandler(object sender, Keys keyCode, ref bool handled). The declaration of the event handler should have the same parameters as the KeyEventHandler delegate declaration. The "sender" parameter refers to the source of the event. The "keyCode" parameter refers to the key code of the key event. The "handled" parameter indicates whether this key event has already been handled.
D.2.8. ABC Co.TV.Lite.UIpanes.Transition
The Transition class provides methods to apply a transition to the screen. More specifically, the Transition class can be use to provide visual transitions to a form object. To create a transition object, the developer can first raise a transition event by invoking Form.DoTransition(). This API will lock a specified horizontal screen area and raise a transition event. The developer can then create an event handler to handle the transition event. This event handler will then receive a valid transition object. The Transition class can be formally expressed as: public class Transition.
Example
public class MyForm : Form { public MyForm () : base() {
// Create a new event handler this. Transition += new
TransitionEventHanlder (this .OnTransition) ; } public void Start {)
{
// Raise transition event this .DoTransition ( ) ; } public void OnTransition (object sender, Transition transition)
{
// Perform transition effects.
}
The Transition class can provide the following exemplary and non-exhaustive list of public properties:
• A public int Height property gets the height of the Transition object.
The Transition class can provide the following exemplary and non-exhaustive list of public methods:
• A public void Decimate(int numerator, int denominator, int offset, int top, int bottom) method simulates a decimate effect on the transition object. The numerator and denominator represent the percentage of lines between top and bottom that will be affected. That is, percentage = (numerator / denominator) * 100. In this method, the parameter "numerator" represents the numerator of the percentage value. The parameter "denominator" represents the denominator of the percentage value. The parameter "offset" represents the number of lines (in pixels) from the top that will remain unaffected by the decimation. The parameter "top" refers to the top of the area to be considered when decimating. The upper bound is relative to the transition object. An exception is thrown if the argument is out of range. The "bottom" parameter refers to the bottom of the area to be considered when decimating. The lower bound is relative to the transition object. An exception is thrown if the argument is out of range.
A public void Expose(int linesToExpose, int top, int bottom) method exposes a number of lines, specified by linesToExpose, in the center of the area defined by top and bottom. That is, the parameter "linesToExpose" refers to a number of lines to expose from the center of the area defined by the specified top and bottom. The parameter "top" refers to the top of the area to be considered when exposing the lines. The upper bound is relative to the transition object. Exception is thrown if the argument is out of range. The parameter "bottom" refers to the bottom of the area to be considered when exposing the lines. The lower bound is relative to the transition object. An exception is thrown if the argument is out of range.
• A public void RasterFade(int numerator, int denominator, int top, int bottom) method simulates a raster fade effect on the transition object. The numerator and denominator represent the percentage of lines between top and bottom that will be affected. That is, percentage = (numerator / denominator) * 100. The parameter "numerator" represents the numerator of the percentage value. The parameter "denominator" represents the denominator of the percentage value. The parameter "top" refers to top of the area to be raster-faded. The upper bound is relative to the transition object. An exception is thrown if the argument is out of range. The parameter "bottom" refers to the bottom of the area to be raster-faded. The lower bound is relative to the transition object. An exception is thrown if the argument is out of range.
• A public void Scroll(int offset, int top, int bottom) method scrolls the area defined by top and bottom either up or down. The parameter "offset" refers to an offset indicating the number of lines to scroll. If value is greater than 0, then the area is scrolled up; otherwise, the area is scrolled down. The parameter "top" refers to the top of the area to be scrolled. The upper bound is relative to the transition object. An exception is thrown if the argument is out of range. The parameter "bottom" represents the bottom of the area to be scrolled. The lower bound is relative to the transition object. An exception is thrown if the argument is out of range.
D.2.9. ABC Co.TV.Lite.UIpanes.TransitionEventHandler The TransitionEventHandler class represents the methods that will handle transition events. The declaration of the event handler should have the same parameters as the TransitionEventHandler delegate declaration. This class can be formally expressed as: public delegate void TransitionEventHandler (object sender, Transition transition). The parameter "sender" refers to the source of the event. The parameter "transition" refers to the transition object.
D.2.10. ABC Co.TV.Lite.UIpanes.ButtonStyle
This enumeration specifies the available button styles. More specifically, ButtonStyle specifies the appearance of a Button object. If a button style is equal to 0x0, then the Button object has no curved edges and the text is aligned to the left. If neither LeftAligned nor RightAligned are set, then the text is center-aligned. If both LeftAligned and RightAligned are set, then LeftAligned takes precedence. If neither RoundedLeft nor RoundedRight are set, then the Button object has no curved edges. The ButtonStyle enumeration can be formally expressed as: public enum ButtonStyle
Other exemplary members in this enumeration are specified in the following table: Table 1: ButtonStyle Members
Figure imgf000053_0001
D.2.12. ABC Co.TV.Lite.UlOanes.Kevs This enumeration specifies the key codes. Each key is identified by a key value, which consists of a virtual key code. This enumeration can be formally expressed as: public enum Keys.
Exemplary members in this enumeration are specified in the following table:
Table 2: Keys Members
Figure imgf000054_0001
Figure imgf000055_0001
Figure imgf000056_0001
D.3. ABC_Co.TV.Lite.Shell.TVLiteApplicationBase
The ABC_Co.TV.Lite.Shell namespace contains, among other things, an abstract TVLiteApplicationBase class for creating light TV applications. That is, the ABC^Co.TV.Lite.Shell.TVLiteApplicationBase (ApplicationBase class) represents a TV application. All interpreter-based CLR applications should derive from the abstract TVLiteApplicationBase interface and provide the required implementation. The ApplicationBase class can be formally expressed as: public abstract class TVLiteApplicationBase.
The ApplicationBase class can provide the following exemplary and non-exhaustive list of protected methods:
• A protected void Run(IUIpane mainUIpane) method begins running a standard application message loop on a current thread, and makes the specified UIpane visible. In a compact .NET environment, the run method is a static method. However, static methods in an interpreter-based CLR environment are global to all running threads. Therefore, the Run method is implemented as a protected method in the abstract base class TVLiteApplicationBase to allow each application to have its own message pump.
The Run method will automatically call RegisterUIpane to register the main UIpane as a top level UIpane. Namely, the parameter mainUIpane refers to a UIpane that will be made visible.
The ApplicationBase class can provide the following exemplary and non-exhaustive list of public properties:
• A pubic bool EnhancedGraphicsMode property allows an application to enter into "Enhanced Graphics Mode (EGM)." The EGM mode allows an application to set user palette, change OSD resolution, and so forth. It is an exclusive mode, so that when an application requests to enter the EGM mode (setting the EnhancedGraphicsMode to true), all other managed application will be suspended. An application that enters the EGM mode should set EnhancedGraphicsMode to false when it wants to leave the EGM mode so that other suspended managed applications can run. The application manager 310 will force an application to leave the EGM mode when the application is exiting. The default value of this property is set to false. This property can only be set to true prior to a call to the Run method. An exception will be thrown if this property is set to true after the Run method is called to start the message loop.
The ApplicationBase class can provide the following exemplary and non-exhaustive list of public methods:
• A pubic abstract void Initialize(string url) method performs application-defined initialization. The URL of the HTTP request to launch the application along with the parameters that are appended to the URL will be passed to the application via the url parameter in the call to Initialize. The following provides an exemplary url parameter:
Figure imgf000057_0001
http ://appserver/monster. dat?param 1 =value 1 &param2=value2.
The application will be terminated if the application generates an unhandled exception. • A public void Exit() method informs all message pumps that they must terminate, and then closes all application UIpanes after the messages have been processed. The Exit
3 method is typically called from within a message loop, and forces the Run method to
4 return. The application manager 310 will not call the Terminate method because the
5 application has called the Exit method to exit the application.
6 • A public void RegisterUIpane(IUIpane topLevelUIpane) method allows an application to register its top level UIpanes with the UIpane manager 312. The UIpane manager 312 will dispatch UIpane events to the top level UIpane.
9 • A public abstract void Pause() method allow the application manager 310 to send
10 a pause event to the application to request it to pause. The application manager 310 will
11 suspend the thread after requesting the application to pause. The application thread will be
12 suspended even if the application generates an unhandled exception when handling a pause
13 event.
14 1 A pubic abstract void ResumeQ method allows the application manager 310 to
15 send a resume event to the application to request it to resume. The application manager
16 310 will un-suspend the application thread before calling the application to resume. The
17 application thread will be unsuspended even if the application generates an unhandled
18 exception when handling a resume event.
19 • A public abstract void TeπninateQ method allows the application manager 310 to
20 send a terminate event to the application to request it to terminate. The application 1 manager 310 will terminate the application thread if the application thread is still running 2 after returning from handling the terminate event. The application thread will be 3 terminated even if the application generates an unhandled exception when handling a 4 Terminate event. 5 A public abstract void ReleaseResource() method allows the application manager 310 to send a release resource event to the application to request it to release any resource that can be freed. This includes removing references to objects for the garbage collector. D.4. ABC_Co.TV.Lite.Drawing Namespace
D .4.1. Overview
The ABC_Co.TV.Lite.Drawing (Drawing) namespace provides an API set that can be easily used by developers writing graphics applications on the set-top box platform using the interpreter-based CLR.
D.4.2. ABC Co.TV.Lite.Drawing.Graphics Class
The Graphics class derives from the Drawing class. It can be expressed formally as: public class Graphics.
The Graphics class can provide the following exemplary and non-exhaustive list of public constructors:
• A public Graphics(int x, int y, int width, int height) constructor provides a method that lets the caller create a graphics object at any location on the screen. The graphics object cannot go beyond the TV display area. If this happens, this constructor automatically clips the graphics being created to the valid TV display area.
• A public Graphics(int width, int height) constructor provides a method that creates an off-screen graphics object in a memory buffer. In one exemplary implementation, the above two Graphics constructors can be provided as "internal" methods. This is because the programming model requires that all applications have a form object (derived from the Form class). The graphics object is controlled by the form object so that all drawings are in sync. For example, in the present application model, a button simply represents a rectangle inside the form, rather than a separate UIpane object in a conventional programming environment. The form object is responsible for painting the button. If the developer is allowed to create the graphics for this form, then it becomes difficult to sync the button and other contents which appear on the same form. (Recall that the form class will have a method CreateGraphics().) The Graphics class can provide the following exemplary and non-exhaustive list of public properties:
• A public Rectangle ClipBounds property is used for the clipping region that the current graphics object is working on.
The Graphics class can provide the following exemplary and non-exhaustive list of public methods:
• A public void DisposeQ method disposes of the graphics object.
• A public void SetClip(Rectangle clipRect) method sets a clipping region in current graphics object.
• A public void ResetCliρ() method resets the clipping region in the graphics object back to its default state
• A public void SetUserPalette(uint[] punPalette, byte startPos) method lets the user specify a custom palette to be associated with the current graphics object. In one exemplary implementation, the maximum number of palette entries that the user can specify is 253. The user can also specify where the custom palette should start in the whole color palette array. If the number of colors in the custom palette plus the starting position for the custom palette is larger than 253, then an INVALID_P ARAMETER exception will be thrown.
More specifically, in one exemplary implementation, a caller is not allowed to set the color index to 0 because this is reserved by the OS 304 to indicate transparent color. Also, the index 255 is used as an OSD transparent color index when the image format supported on this platform is encoded. The index 254 is used as the RLE escape key. Therefore, this index is prohibited as well. This explains, in this exemplary implementation, the reason why the number of colors in the custom palette cannot be larger than 253.
As a further note, in one exemplary implementation, this method can only be called when the graphics system is in an EGM mode. Otherwise, an "INVALID_EGM_STATE" exception will be thrown. Also, an "INVALID_INPUT_PARAMETER" will be thrown if the input parameter is not valid or the starting position is out of range.
• A public static void RestoreDefaultPalette() method restores the default OSD color palette.
• A public void SetOSDResolution(OSDResolution resolution) method lets the caller set the OSD display resolution.
In one exemplary implementation, the enum OSDResolution method is governed by the following definitions:
{
OSD_RES_704 = OxO, // 704x480 resolution
OSD_RES_576, // 576x480 resolution
OSD_RES_448, // 448x480 resolution
OSD_RES_352 // 352x480 resolution
};
In one exemplary implementation, this method can be only called when the graphics system is in the EGM mode; otherwise, an "INVALID_EGM_STATE" exception will be thrown.
• A public void RestoreDefaultOSDResolutionQ method restores the default OSD display resolution.
• A public void SetPixel(int x, int y, byte colorlndex) method lets a user set a color value at a specified location on the graphics context.
• A public byte GetPixel(int x, int y) method lets a user get the color index value at a specified location on the graphics context.
• A public void FillRectangle(byte colorlndex, int x, int y, int width, int height) method fills a rectangle in with a specified color.
A public void DrawRectangle(byte colorlndex, int penWidth, int x, int y, int width, int height) method draws a rectangle with a specified color and pen width. • A public void FillEllipse(byte colorlndex, int x, int y, int width, int height) method fills an ellipse in with a specified color. • A public void DrawEllipse(byte colorlndex, int penWidth, int x, int y, int width, int height) method draws an ellipse with a specified color and pen width. • A public void DrawLine(byte colorlndex, int penWidth, int startX, int startY, int endX, int endY) method draws a line with a specified color and pen width. • A public void FillRoundRectangle(byte colorlndex, int x, int y, int width, int height, int radius, RoundingStyle style ) method fills a rectangle with rounded edges with a specified color. In this method, the "radius" parameter must be less than or equal to one half of the minimum of the "height" and "width" parameters. If the radius exceeds this value, it will be truncated to that limit. The "style" parameter can comprise: RoundingStyle.All; RoundingStyle. UpperLeft; RoundingStyle .UpperRight; RoundingStyle.LowerLeft; RoundingStyle.LowerRight; or an OR'd combination. * A public void DrawRoundRectangle(byte colorlndex, int line Width, int x, int y, int width, int height, int radius, RoundingStyle style ) method draws a rounded rectangle outline of the specified thickness with the specified color. The "radius" parameter must be less than or equal to one half of the minimum of the "height" and "width" parameters. If the radius exceeds this value, it will be truncated to that limit. The "style" parameter can comprise: RoundingStyle.All; RoundingStyle.UpperLeft; RoundingStyle. UpperRight; RoundingStyle.LowerLeft; RoundingStyle.LowerRight; or an OR'd combination. A public void BitBlt(int destX, int destY, int destWidth, int destHeight, Graphics srcGraphics, int srcX, int srcY) method bits contents from one graphics object to another graphics object. * A public void Drawlmage(byte[] buffer, int x, int y) method draws a special format bitmap currently supported on the platfoπn. The user can use provided tools to convert a regular image into this special format bitmap. An INVALIDJMAGE JFORMAT exception will be thrown if the image is not one of the formats that this platform supports. The Graphics class can provide the following exemplary and non-exhaustive list of internal methods:
• An internal GraphicsQ method provides a constructor which creates a graphics object that covers the whole TV display Ulpane.
• An internal static void EnterEGM() method allows an application to enter "Enhanced Graphics Mode" (EGM). In one exemplary implementation, only one application is allowed to enter EGM mode at any particular time. An "INVALID_EGM_STATE" exception will be thrown if the caller attempts to enter EGM mode when the graphics system is already in EGM mode. An application is allowed to set user palette, change OSD resolution, etc. only in EGM mode.
• An internal static void LeaveEGM() method leaves EGM mode. Before calling this API, the caller is responsible for restoring the default color palette and default OSD resolution. An "INVALID_EGM_STATE" exception will be thrown from this API if: (1) the application is not in EGM mode; (2) the application has not restored the default color palette; or (3) the application has not restored the default OSD resolution.
• An internal static void Scroll(int offset, int upBound, int lowBound) method scrolls the screen up if the "offset" is a positive number, or down if the "offset" is a negative number. This effect will only happen within the up/low bound.
• An internal static void Decimate(int numerator, int denominator, int offset, int upBound, int lowBound) method simulates a decimation effect. It takes a percentage number as input to indicate the effect level.
• An internal static void RasterFade(int numerator, int denominator, int upBound, int lowBound) method simulates a raster fade effect. It takes a percentage number as input to indicate the effect level.
An internal static void Expose(int linesToExpose, int upBound, int lowBound) method exposes a number of lines, specified by "linesToExpose," in the center of the
Ulpane-specifϊed "upBound" and "lowBound". D.4.3. RLE Compressed Image Format Used in ABC Co.TV.Lite
The platform can use a variety of image formats. Two kinds of proprietary image formats include: an uncompressed bitmap format; and an RLE compressed bitmap format. These proprietary image formats can be generated using an image conversion tool which can be supplied to the customers.
A description of the RLE compressed format follows. typedef struct
{ unsigned char ucMagicl; // First file signature number: "V" unsigned char ucMagic2; // Second file signature number: "J" unsigned char fRLE; // 1 if the image is RLE compressed unsigned char ucPad; // Padding, unused unsigned short us Width; // Width of the image unsigned short usHeight; // Height of the image } SpotlmageHeader;
If less than two consecutive pixels have the same pixel value, this format encodes the current pixel "as is." If more than two consecutive pixels are encountered that have the same value, this format encodes these pixels as an RLE sequence, which is: RLE_ESCAPE, pixel (index) value and counter.
D.5. Font Methods
The following subsection sets forth functionality for handling the rendering of fonts.
D.5.1. Installing and Deinstalling Fonts Font lifetime management is handled in the TVLiteApplicationBase object. Functionality for installing and optionally deinstalling fonts comprise:
3 • A void TVLiteApplicationBase.InstallFont(string name , byte [] fontData) method
4 installs a new font. The font is stripped of unnecessary header information (compared to
5 the use of such a font in a desktop environment). Font names are case sensitive.
6 This method throws an exception: (1) if a font of the same name is already installed but with different data; (2) if the supplied bytes cannot be parsed as a valid stripped true type font; or (3) for other typical error conditions. If a second attempt is made to install a font with identical data, the call will not throw an exception. That is, if the application C installing the font is distinct from the application that originally installed the font, a 1 reference count will be incremented for the font. If the same application installs the same 2 font twice, the second installation attempt does not have effect. 3 The InstallFont method provides the following exemplary exception error returns: 4 0 - (MAX_FONTS-1) = slot number for this font; 5 FONTJDUP_NAME = font of same name already installed but data does not 6 match; 7 FONT_TABLE_FULL = font table full; and 8 FONT_DATA__VALIDATION_ERR = problem loading font data. 9 Note that other applications can use this same font while it is installed, but if they 0 have not installed the font themselves, the font could disappear when the installing 1 application exits. As such, it would be considered bad practice to "piggyback" on another 2 application's installation unless it can be assured that the "host" application will not exit 3 before the piggyback application. 4 A void TVLiteApplicationBase.DeinstallFont(string name) method deinstalls a 5 font. Or, if more than one application has installed the font, the DeinstallFont method releases the reference count for the calling application. More specifically, an installed font will persist for the life of the application and will automatically be removed when the application exits (if this exiting application is the last application using the font). It is usually not necessary to call DeinstallFont before exiting. However, if it is necessary to make only transient use of a font, a developer may consider explicitly deinstalling the font. The DeinstallFont call will throw an exception if the application did not install the font or has already deinstalled the font.
D.5.2, Graphics Object Font-Related Methods The graphics object provides a number of other font-related APIs (methods). Exemplary such methods include: • A void SetAntiAliasBackgroundCoIor(int backlndex) method sets the color to be used for anti-aliasing. More specifically, this call establishes a color used to build a table of intermediate colors to use for anti-aliasing purposes. This is very efficient when the default palette is being used and the foreground and background colors fall within a 6x6x6 color cube. An exhaustive walk of the color table will be performed when a custom palette is used or when colors are being used outside of the 6x6x6 space; the walk finds the best value for each position in the anti-aliasing table. If a "backlndex" of -1 is specified, no anti-aliasing will be performed. Setting a background color that is identical to a foreground color being used has the effect of disabling the anti-aliasing. Exemplary exception error returns include: FONT_PARAM_PUT_OF_RANGE = palette index out of range; and FONT_SYSTEM_ERR = error fetching system color palette info. • A void SetFont(string name, int height, int aspect) method sets the current font to be used for string draws. The "aspect" parameter defines a percent value between 30 and
250 inclusive, with 30 meaning 30% normal width and 25 meaning 250% normal width. The "height" parameter specifies the height in pixels of the font in the range 4-250 inclusive. The font name is case-sensitive. If the font is a glyph-only font (a font containing no cmap table), then the height and aspect are ignored.
Exemplary exception error returns include:
FONT_NOT_FOUND = no font at that slot; and
FONT_PARAM_OUT_OF_RANGE = param out of range.
• A void DrawString(byte colorlndex, string s, int x, int y) method draws a string in the specified color using the currently set font at location (x,y). This method performs no formatting; it just draws a single line of text.
Exemplary exception error returns include: FONT_NOT_FOUND = no font at that slot; and FONT_PARAM_OUT_OF_RANGE = size or aspect ratio out of range.
• A void DrawString(byte colorlndex, string s, int x, int y, int width, AlignStyle align, char truncation) method draws a string in the specified color using the currently set font, with left, right, or center alignment truncating if necessary so as not to exceed the specified width. If the string is truncated and a non-zero truncation character is supplied, this character is pre-pended or appended to the string. For a truncated centered string, the truncation character is both pre-pended and appended. In this method, the align parameter can be: AlignStyle.Left, AlignStyle.Right, or AlignStyle.Center.
Exemplary exception error returns include: FONT_NOT_FOUND = no font at that slot; and FONT_PARAM_OUT_OF_RANGE = size or aspect ratio out of range.
• A void DrawString(byte colorlndex, byte[] utfδBytes, int byteOffset, int characterCount, byteQ advances, int x, int y) method draws either a string or a run of glyphs depending on the currently selected font. If the selected font contains only glyphs (no cmap table), then the bytes starting at byteOffset from the head of the byte area are decoded and treated as glyph indices. Otherwise the bytes are treated as a UTF-8 encoded character run. The glyphs are drawn using the specified color index, and anti-aliased to the current anti-alias background color. An "advances array" contains the horizontal advances for each character/glyph to be drawn.
In order to support advances less than 0, advances are encoded in the following manner. Each character advance width is one or two bytes in length. Advance widths in the range 0 to 127 are stored without modification, using 1 byte. Outside this range, the most-significant bit (0x80) indicates the first byte of a two-byte sequence. The next bit (0x40) indicates whether the decoded value should be negated. Bits 4 and 5 (0x30) are ignored but should be set to 0. The lower 4 bits and the next byte represent the magnitude of the advance width. If bit 6 of the first byte is set, then the width is negated. This supports widths up to 12 bits in length. If an advance list is supplied, it must contain at least enough entries to support the number of characterCount characters.
Exemplary exception error returns include:
FONT_NOT_FOUND == no font is selected; and
FONT_PARAM_OUT_OF_RANGE = size or aspect ratio out of range.
• An int MeasureString(string s) method returns the width of the string in pixels using the currently set font.
Exemplary exception error returns include: FONT_PARAM_ERR = NULL inputs, etc.; FONTJSfOT_FOUND = no valid font selected;
FONTJPARAM_OUT_OFJRANGE = font size or aspect params out of range; and FONT_BAD_UTF8_CODE - invalid UTF8 sequence in string.
An int BreakString(string s, int startlndex, int width, string sep) method, using the currently set font, attempts to break the string into words using the characters in "sep" and will return the index of the separator character when the string can be broken to fit the specified width. This method returns "1" if the string cannot be broken to fit within the supplied width using "sep." For efficiency reasons, in one exemplary implementation, the "sep" string can only contain a maximum of 8 characters. This should be adequate for most practical purposes. If this string is the empty string, then the text will be broken on any character. For instance, assume that the string "How now brown cow" is passed with the separator string containing only a space character, startlndex of zero. If only the first three words will fit, BreakString() will return 13, the index of the space before "cow." If the entire string fits, this method will return the length of the string, 17.
Exemplary exception error returns include:
FONT_P ARAMJERR= NULL parameter, etc.;
FONT_NOT_FOUND = no valid font selected;
FONT_PARAM_OUT_OFJRANGE = font size or aspect parameters out of range, sep string too long; and
FONT_BAD_UTF8_CODE = invalid UTF8 sequence in "sep" string.
• A void GetFontMetrics(out int ascent, out int descent, out int lineSpacing) method fetches the properties of the currently specified font needed for accurate layout of text. The "ascent" parameter is a positive value describing how many pixels the font glyphs may draw above the baseline. The "descent" parameter is a positive value describing how many pixels the font glyphs may draw below the baseline. The "lineSpacing" parameter is the expected default spacing in pixels needed between lines of text in this font. This is the sum of the font's ascent, descent, and line gap.
Exemplary exception error returns include:
FONT_PARAM_ERR = NULL param, etc.; and
FONT_NOT_FOUND = not font at spec'd slot.
D.5.3. Font Error Codes Exemplary font error codes include: FONT_PARAM_ERR 0x85000002
FONT_DUP_NAME 0x85000003 FONT_TABLE_FULL 0x85000004
FONT_DATA_VALIDATION_ERR 0x85000005
FONT_NOT_FOUND 0x85000006
FONT_PARAM_OUT_OF_RANGE 0x85000007
FONT_BAD_UTF8_CODE 0x85000008
FONT_SYSTEM_ERR 0x85000009
D.6. Native Events and Managed Async CallBack An entity can call a NotifyOnEventCallback system method (internal only) to register for an event notification. NotifyOnEventCallback is a non-blocking call and the entity does not need to make this call on a separate thread, unless there is some explicit need to do so. There will be a single system thread that will perform the waiting and dispatching for all the callback-oriented events, such as HTTP, MpegFiltering, Tuning, eTV, and so forth. (Exceptions are Userlnput, AppLaunch and PingPong events, which are handled by dedicated system threads).
The types of events can be broadly classified into two: multiple instance events and single instance events. HTTP and GuideDB Search represent typical multiple instance models. In these models, a request typically has to be made explicitly (by the entity) to start operation, and multiple threads can be creating different requests. In this model, the caller (to NotifyOnEvent) will pass in the corresponding NSL handle which can be used to distinguish between multiple instances of the same event (for example, multiple HTTP requests from different threads on the same application or from different applications). With the single instance, the entity does not typically need to do anything explicit to initiate a request. The runtime gets these kinds of events automatically and it will dispatch them to the interested party (it is the responsibility of the entity to take that data, parse it appropriately and perform the further dispatching to the consumers of their APIs). According to one exemplary implementation, at any point in time, there can be only one outstanding request for an Event Type/Handle combination. For example, in one exemplary implementation, it is not possible to make a second HTTP request on the same handle until the first has successfully completed (e.g., the callback has been invoked). This is not a difficult requirement and can be relaxed to some extent if required and if certain conditions are met. A SpotHost layer will act as an intermediary between the NSL and SPOT environments. With the single instance model, the event will be broadcast to all subscribers. The SpotHost layer will take the event (such as HttpResponse or MpegFilter) from the NSL layer, wrap it into a HALJDISPATCHJEVENT struct and send it to the system queue using the Toba_EnqueueDispatchEvent function. The entity is responsible for implementing the appropriate function in the SpotHost layer. When the system takes an event off of the queue for processing, if it cannot find a matching request or if it cannot find any target to dispatch it to (e.g., because the application that made the request has exited), the system will discard the response (after doing appropriate cleanup). Hence, the APIs should register for notification first (by calling NotifyOnEvent) before they perform the initiation. Otherwise, there can be subtle race conditions that may cause the response to be discarded. If the system finds a matching request, it will invoke the corresponding delegate. The entity should not perform any non- trivial work in the delegate handler. A Dispose method should be called on the NativeResponse object (which invokes the function pointed to by NativeResponse.freeNativeDataFunctionPtr and passes in rawNativeDataPtr as the parameter). If it is desirable to hold onto the native data, it is possible to keep the NativeResponse object; alternatively, it is possible to set the freeNativeDataFunctionPtr field to 0 and then call Dispose. If an exception is thrown by the callback, then the system assumes the worst and calls Dispose on the NativeResponse object. There is no point in performing the cleanup using a Finalizer since both the system and the user will be able to provide guaranteed cleanup.
The system can also provide an explicit API to un-register too; for example, CancelNotificiation(HalDispatchEvents e, uint nativeHandle). Using this functionality, the system has only to be concerned with abnormal termination cases for automatic un- registration.
Usage Examples
Multiple Instance Model
_httpDataPtr = HttpWebResponse.CreateNativeHttpDataO ; //create the NSL handle
Multiple applications can create Http objects and each request needs to be uniquely- identifiable; hence the need to pass in the NSL handle as the token. */
SystemUtils.NotifyOnEvent(HalDispatchEvents.HTTP, _httpDataPtr, HttpCallback) ; StartRequest () ; //The initiation... //go do other stuff... void HttpCallback (NativeResponse nr) C uint rawNativeData = nr .rawNativeDataPtr; /* nr. Dispose must be called to dispose of the native resource. If it is desirable to hold onto the native data, the rawNativeDataPtr field can be set to 0 before invoking Dispose. Dispose does not have to be performed right here in the callback.*/
/ / perform trivial activities and return as soon as possible .
}
Single Instance Model
MpegFilterApi ( ) {
/*
0 => no associated native handle. Though the NSL MpegFilter APIs could have a handle, there is no need for it here because all instances of the MpegFilter events are the same. They simply pass on a blob of data to the interested party (in this case, the MpegFilter managed API) */
NotifyOnEventlHalDispatchEvents.MpegFilter, 0 /*no native handle*/, this.MpegFilterCallback) ; } void MpegFilterCallback(NativeResponse response) { byte U filterdata = new byte [response. rawnativedatasize] ,• Systemutils.CopyToByteArray(filterdata, response. rawnativedataptr) ; /*
Call Dispose to get rid of the associated native data. */ response . Dispose ( ) ; /*perform activity with the byte array but return as soon as possible because this call is made on a system thread*/
The goal here is to provide a very light-weight and "thin" layer for users to receive async callbacks and system events from the NSL/PAL layer (without spawning off a separate thread for each request). The API author can build an IAsyncResult/AsyncCallback based callback mechanism on top of this feature, if so desired.
Although the invention has been described in language specific to structural features and/or methodological acts, it is to be understood that the invention defined in the appended claims is not necessarily limited to the specific features or acts described. Rather, the specific features and acts are disclosed as exemplary forms of implementing the claimed invention.

Claims

CLAIMS:What is claimed is:
1. A set-top box system, comprising: a hardware layer representing hardware functionality provided by the set-top box system; an interpreter-based core runtime engine configured for use in a set-top box environment, wherein the set-top box system is configured to run an application that can perform a function using the hardware layer and the interpreter-based core runtime engine.
2. The set-top box system of claim 1, wherein the hardware functionality includes less than 5 MB of memory.
3. The set-top box system of claim 1, further including an application manager for managing applications, configured for use in the set-top box environment.
4. The set-top box system of claim 3, wherein the application manager is configured to pause a current application when another application is activated, and to resume the current application when the other application is deactivated.
5. The set-top box system of claim 1, further include a UI manager for managing user interface presentations, configured for use in the set-top box environment.
6. The set-top box system of claim 1, further comprising graphics functionality configured to provide a transition effect when switching from one graphical presentation to another.
7. The set-top box system of claim 6, wherein the transition effects include one or more of: decimation; fading; scrolling; and exposing.
8. The set-top box system of claim 1, further comprising graphics functionality configured to change a color palette of a graphical presentation.
9. The set-top box system of claim 1, further comprising graphics functionality configured to change a resolution of a graphical presentation.
10. The set-top box system of claim 1, further comprising graphics functionality configured to simplify font processing by stripping information from font files.
11. The set-top box system of claim 1, further comprising graphics functionality configured to provide anti-aliasing for fonts.
12. The set-top box system of claim 1, wherein the hardware functionality includes a line control register (LCR) which provides memory locations which correspond to respective lines on a display device, and wherein the set-top box system further comprises graphics functionality configured to provide a graphics effect by manipulating the LCR.
13. A set-top box system having a limited amount of resources, comprising: a hardware layer representing hardware functionality provided by the set-top box system; and an interpreter-based processing module configured for use in a set-top box environment, wherein the hardware functionality includes a line control register (LCR) which provides memory locations which correspond to respective lines on a display device, and wherein the set-top box system further comprises graphics functionality configured to provide a graphics effect by manipulating the LCR.
14. One or more machine-readable media containing instructions for implementing the set-top box system of claim 13.
15. A method for executing an application in a resource-constrained set-top box environment, comprising: loading and initializing a current application; executing the current application using an interpreter-based processing module configured for use in a set-top box environment; pausing the current application when another application is activated that interferes with the current application's user graphics presentation; resuming the current application when the other application is deactivated; and exiting the current application upon the occurrence of an exit event.
16. The method of claim 15, where the initializing comprises establishing a message thread for the application.
17. The method of claim 15, further comprising providing a transition effect when switching from one graphics presentation to another.
18. The method of claim 15, further comprising changing one or more of the palette and resolution upon switching from one graphics presentation to another.
19. One or more machine-readable media containing instructions for implementing the method of claim 15.
20. A set-top box system including logic configured to implement the method of claim 15.
6
7
10 11 12 13 14 15 16 17 18 19 2.0 21 22 23 24 25
PCT/US2006/011353 2005-04-01 2006-03-29 System for running applications in a resource-constrained set-top box environment WO2006107662A2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP06748835A EP1869883A4 (en) 2005-04-01 2006-03-29 System for running applications in a resource-constrained set-top box environment
JP2008504271A JP2008536384A (en) 2005-04-01 2006-03-29 A system that runs applications in a set-top box environment with limited resources

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US11/097,840 2005-04-01
US11/097,840 US20060225107A1 (en) 2005-04-01 2005-04-01 System for running applications in a resource-constrained set-top box environment

Publications (2)

Publication Number Publication Date
WO2006107662A2 true WO2006107662A2 (en) 2006-10-12
WO2006107662A3 WO2006107662A3 (en) 2007-09-27

Family

ID=37072173

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US2006/011353 WO2006107662A2 (en) 2005-04-01 2006-03-29 System for running applications in a resource-constrained set-top box environment

Country Status (6)

Country Link
US (1) US20060225107A1 (en)
EP (1) EP1869883A4 (en)
JP (1) JP2008536384A (en)
KR (1) KR20070121707A (en)
CN (1) CN101185328A (en)
WO (1) WO2006107662A2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009038548A (en) * 2007-08-01 2009-02-19 Panasonic Corp Cable broadcast receiver

Families Citing this family (70)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7193562B2 (en) 2004-11-22 2007-03-20 Ruckus Wireless, Inc. Circuit board having a peripheral antenna apparatus with selectable antenna elements
US7880683B2 (en) 2004-08-18 2011-02-01 Ruckus Wireless, Inc. Antennas with polarization diversity
US7652632B2 (en) 2004-08-18 2010-01-26 Ruckus Wireless, Inc. Multiband omnidirectional planar antenna apparatus with selectable elements
US7933628B2 (en) 2004-08-18 2011-04-26 Ruckus Wireless, Inc. Transmission and reception parameter control
US7696946B2 (en) 2004-08-18 2010-04-13 Ruckus Wireless, Inc. Reducing stray capacitance in antenna element switching
US7965252B2 (en) 2004-08-18 2011-06-21 Ruckus Wireless, Inc. Dual polarization antenna array with increased wireless coverage
US8031129B2 (en) 2004-08-18 2011-10-04 Ruckus Wireless, Inc. Dual band dual polarization antenna array
US7899497B2 (en) 2004-08-18 2011-03-01 Ruckus Wireless, Inc. System and method for transmission parameter control for an antenna apparatus with selectable elements
US7292198B2 (en) 2004-08-18 2007-11-06 Ruckus Wireless, Inc. System and method for an omnidirectional planar antenna apparatus with selectable elements
TWI391018B (en) 2004-11-05 2013-03-21 Ruckus Wireless Inc Throughput enhancement by acknowledgment suppression
US8638708B2 (en) 2004-11-05 2014-01-28 Ruckus Wireless, Inc. MAC based mapping in IP based communications
US7505447B2 (en) 2004-11-05 2009-03-17 Ruckus Wireless, Inc. Systems and methods for improved data throughput in communications networks
US8619662B2 (en) 2004-11-05 2013-12-31 Ruckus Wireless, Inc. Unicast to multicast conversion
US8792414B2 (en) 2005-07-26 2014-07-29 Ruckus Wireless, Inc. Coverage enhancement using dynamic antennas
US7358912B1 (en) 2005-06-24 2008-04-15 Ruckus Wireless, Inc. Coverage antenna apparatus with selectable horizontal and vertical polarization elements
US7646343B2 (en) 2005-06-24 2010-01-12 Ruckus Wireless, Inc. Multiple-input multiple-output wireless antennas
US7893882B2 (en) 2007-01-08 2011-02-22 Ruckus Wireless, Inc. Pattern shaping of RF emission patterns
US7789757B2 (en) * 2005-09-22 2010-09-07 At&T Intellectual Property I, L.P. Video games on demand with anti-piracy security
US8009644B2 (en) * 2005-12-01 2011-08-30 Ruckus Wireless, Inc. On-demand services by wireless base station virtualization
US20070275733A1 (en) * 2006-03-03 2007-11-29 David Vismons Method for providing certain information
US9071583B2 (en) 2006-04-24 2015-06-30 Ruckus Wireless, Inc. Provisioned configuration for automatic wireless connection
US9769655B2 (en) 2006-04-24 2017-09-19 Ruckus Wireless, Inc. Sharing security keys with headless devices
EP2013758B1 (en) 2006-04-24 2016-08-03 Ruckus Wireless, Inc. Dynamic authentication in secured wireless networks
US8670725B2 (en) 2006-08-18 2014-03-11 Ruckus Wireless, Inc. Closed-loop automatic channel selection
KR100781918B1 (en) * 2007-02-02 2007-12-04 가온미디어 주식회사 Mdu brodacasting signal distribution system
US8073882B2 (en) 2007-07-11 2011-12-06 Mats Stefan Persson Method, system and computer-readable media for managing software object handles in a dual threaded environment
US8547899B2 (en) 2007-07-28 2013-10-01 Ruckus Wireless, Inc. Wireless network throughput enhancement through channel aware scheduling
US8127233B2 (en) * 2007-09-24 2012-02-28 Microsoft Corporation Remote user interface updates using difference and motion encoding
KR100974908B1 (en) * 2007-12-15 2010-08-09 한국전자통신연구원 System and method for user customization type media service based on single-media multi-devices
US8355343B2 (en) 2008-01-11 2013-01-15 Ruckus Wireless, Inc. Determining associations in a mesh network
US8695056B2 (en) * 2008-01-26 2014-04-08 International Business Machines Corporation Method for information tracking in multiple interdependent dimensions
BRPI0803717A2 (en) * 2008-09-03 2010-06-15 Tqtvd Software Ltda digital television application execution system, digital television application execution apparatus and method for implementing such a system
US8217843B2 (en) 2009-03-13 2012-07-10 Ruckus Wireless, Inc. Adjustment of radiation patterns utilizing a position sensor
US8698675B2 (en) 2009-05-12 2014-04-15 Ruckus Wireless, Inc. Mountable antenna elements for dual band antenna
US9372711B2 (en) 2009-07-20 2016-06-21 Google Technology Holdings LLC System and method for initiating a multi-environment operating system
US9367331B2 (en) 2009-07-20 2016-06-14 Google Technology Holdings LLC Multi-environment operating system
US9348633B2 (en) 2009-07-20 2016-05-24 Google Technology Holdings LLC Multi-environment operating system
US9389877B2 (en) 2009-07-20 2016-07-12 Google Technology Holdings LLC Multi-environment operating system
US8528037B2 (en) 2009-08-28 2013-09-03 CSC Holdings, LLC Dynamic application loader for set top box
US9979626B2 (en) 2009-11-16 2018-05-22 Ruckus Wireless, Inc. Establishing a mesh network with wired and wireless links
CN102763378B (en) 2009-11-16 2015-09-23 鲁库斯无线公司 Set up and there is wired and mesh network that is wireless link
US8528005B2 (en) 2010-04-09 2013-09-03 Telefonaktiebolaget Lm Ericsson (Publ) Method and arrangement in an IPTV terminal
JP2013518733A (en) * 2010-04-23 2013-05-23 サムスン ヘビー インダストリーズ カンパニー リミテッド Robot system control method and apparatus
CN101859261B (en) * 2010-06-09 2015-05-13 中兴通讯股份有限公司 Control method and control equipment for releasing memory
CN102149017A (en) * 2010-07-20 2011-08-10 华为终端有限公司 Management method for set top box applications and set top box
US8898723B2 (en) * 2010-08-20 2014-11-25 Sony Corporation Virtual channel declarative script binding
US9407012B2 (en) 2010-09-21 2016-08-02 Ruckus Wireless, Inc. Antenna with dual polarization and mountable antenna elements
US9354900B2 (en) 2011-04-28 2016-05-31 Google Technology Holdings LLC Method and apparatus for presenting a window in a system having two operating system environments
US20120278747A1 (en) * 2011-04-28 2012-11-01 Motorola Mobility, Inc. Method and apparatus for user interface in a system having two operating system environments
US9792188B2 (en) 2011-05-01 2017-10-17 Ruckus Wireless, Inc. Remote cable access point reset
US8788863B2 (en) 2011-08-10 2014-07-22 Microsoft Corporation System and method for restoring and/or continuing execution functionality to various processes based on predefined power classifications while transitioning a computing environment from connected standby state to execution state
US9952897B2 (en) * 2011-09-12 2018-04-24 Microsoft Technology Licensing, Llc Managing processes within suspend states and execution states
US8751800B1 (en) 2011-12-12 2014-06-10 Google Inc. DRM provider interoperability
US8756668B2 (en) 2012-02-09 2014-06-17 Ruckus Wireless, Inc. Dynamic PSK for hotspots
US9634403B2 (en) 2012-02-14 2017-04-25 Ruckus Wireless, Inc. Radio frequency emission pattern shaping
US10186750B2 (en) 2012-02-14 2019-01-22 Arris Enterprises Llc Radio frequency antenna array with spacing element
US9092610B2 (en) 2012-04-04 2015-07-28 Ruckus Wireless, Inc. Key assignment for a brand
US9417753B2 (en) 2012-05-02 2016-08-16 Google Technology Holdings LLC Method and apparatus for providing contextual information between operating system environments
TWI594186B (en) * 2012-05-16 2017-08-01 緯創資通股份有限公司 Method for virtual channel management, method for obtaining digital content with virtual channel and web-based multimedia reproduction system with virtual channel
US9342325B2 (en) 2012-05-17 2016-05-17 Google Technology Holdings LLC Synchronizing launch-configuration information between first and second application environments that are operable on a multi-modal device
US9570799B2 (en) 2012-09-07 2017-02-14 Ruckus Wireless, Inc. Multiband monopole antenna apparatus with ground plane aperture
US9979960B2 (en) 2012-10-01 2018-05-22 Microsoft Technology Licensing, Llc Frame packing and unpacking between frames of chroma sampling formats with different chroma resolutions
EP2974045A4 (en) 2013-03-15 2016-11-09 Ruckus Wireless Inc Low-band reflector for dual band directional antenna
CN103888843B (en) * 2014-03-11 2017-12-12 惠州Tcl移动通信有限公司 The method and system that the programme channel of intelligent television is integrated with application program
US10540696B2 (en) 2014-09-30 2020-01-21 At&T Intellectual Property I, L.P. Enhanced shared media experiences
US10084984B2 (en) * 2016-08-15 2018-09-25 Hisense Usa Corp. System and methods for device control and multiple input handling
US10368080B2 (en) 2016-10-21 2019-07-30 Microsoft Technology Licensing, Llc Selective upsampling or refresh of chroma sample values
CN109150751B (en) 2017-06-16 2022-05-27 阿里巴巴集团控股有限公司 Network control method and device
US11036365B2 (en) * 2019-06-07 2021-06-15 Microsoft Technology Licensing, Llc Hang condition mitigation for browser applications
CN112231090A (en) * 2020-11-04 2021-01-15 Oppo广东移动通信有限公司 Application process management method and device and terminal equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001004743A2 (en) 1999-07-13 2001-01-18 Sun Microsystems, Inc. Methods and apparatus for managing an application according to an application lifecycle

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5563648A (en) * 1994-04-28 1996-10-08 Thomson Consumer Electronics, Inc. Method for controlling execution of an audio video interactive program
US5673401A (en) * 1995-07-31 1997-09-30 Microsoft Corporation Systems and methods for a customizable sprite-based graphical user interface
US5802284A (en) * 1995-12-13 1998-09-01 Silicon Graphics, Inc. System and method using cover bundles to provide immediate feedback to a user in an interactive television environment
JP3572473B2 (en) * 1997-01-30 2004-10-06 株式会社ルネサステクノロジ Liquid crystal display control device
US6029045A (en) * 1997-12-09 2000-02-22 Cogent Technology, Inc. System and method for inserting local content into programming content
US6792616B1 (en) * 1998-05-01 2004-09-14 Scientific-Atlanta, Inc. System and method for providing a plurality of programming services in a television system
US6874145B1 (en) * 1999-07-13 2005-03-29 Sun Microsystems, Inc. Methods and apparatus for implementing an application lifecycle design for applications
US7257812B1 (en) * 1999-12-16 2007-08-14 Sun Microsystems, Inc. Methods and apparatus for managing an application
US6819331B2 (en) * 2002-03-01 2004-11-16 Broadcom Corporation Method and apparatus for updating a color look-up table
US6995803B2 (en) * 2002-05-23 2006-02-07 Microsoft Corporation Anti-aliasing characters for improved display on an interlaced television monitor
WO2004047440A2 (en) * 2002-11-18 2004-06-03 United Video Properties, Inc. Systems and methods for providing real-time services in an interactive television program guide application
JP2007508612A (en) * 2003-10-10 2007-04-05 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ JAVA life cycle model for BD discs

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001004743A2 (en) 1999-07-13 2001-01-18 Sun Microsystems, Inc. Methods and apparatus for managing an application according to an application lifecycle

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009038548A (en) * 2007-08-01 2009-02-19 Panasonic Corp Cable broadcast receiver

Also Published As

Publication number Publication date
CN101185328A (en) 2008-05-21
WO2006107662A3 (en) 2007-09-27
JP2008536384A (en) 2008-09-04
US20060225107A1 (en) 2006-10-05
KR20070121707A (en) 2007-12-27
EP1869883A4 (en) 2009-01-21
EP1869883A2 (en) 2007-12-26

Similar Documents

Publication Publication Date Title
US20060225107A1 (en) System for running applications in a resource-constrained set-top box environment
US7665032B2 (en) Sidebar engine, object model and schema
CA2622900C (en) Self-contained mini-applications system and method for digital television
JP4694091B2 (en) Scaling and delivery of distributed applications
KR101366402B1 (en) Virtual execution system for resource-constrained devices
US20020007357A1 (en) Method and apparatus for providing plug-in media decoders
US20070044029A1 (en) Sidebar engine, object model and schema
KR20020035558A (en) Methods and apparatus for implementing individual class loaders
US20040075670A1 (en) Method and system for receiving interactive dynamic overlays through a data stream and displaying it over a video content
KR20010020250A (en) Hardware accelerator for an object-oriented programming language
KR20020022085A (en) Methods and apparatus for managing an application according to an application lifecycle
JP2003514273A (en) Data input in GUI
CA2518645A1 (en) Method and apparatus enabling multiple application sharing of classes
CN110297624B (en) Implementation method of Widget system based on electron framework and television adopting system
CN112612525A (en) Display device and display device starting method
CN103870316A (en) JAVA virtual machine implementation method for intelligent operating system
US7784041B2 (en) Mechanism for reducing detectable pauses in dynamic output caused by dynamic compilation
JP2009506467A (en) Event processing for concurrent tasks in virtual machines
CN116340680A (en) Display equipment and control method for managing life cycle of plug-in object
CN112616090B (en) Display equipment system upgrading method and display equipment
CN116261003A (en) Display equipment and streaming media playing control method based on browser
CN112637683A (en) Display equipment system optimization method and display equipment
Dorward et al. Programming in Limbo
Peng et al. Integration of applications into digital television environment
Jaeger Set-top box software architectures for digital video broadcast and interactive services

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 200680011173.7

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 2006748835

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2008504271

Country of ref document: JP

Kind code of ref document: A

WWE Wipo information: entry into national phase

Ref document number: 7543/DELNP/2007

Country of ref document: IN

Ref document number: 1020077022439

Country of ref document: KR

NENP Non-entry into the national phase

Ref country code: DE

NENP Non-entry into the national phase

Ref country code: RU