OpenTV
Encyclopedia : O : OP : OPE : OpenTV
OpenTV (NASDAQ: [OPTV]
Development
OpenTV applications are written in the ANSI standard of the C language. OpenTV provides a development kit compiler similar to the standard C compiler, gcc, called gcco. This allows developers to write their applications and compile them to o-code, a portable form much like the .exe under Windows which is then run on many set-top-boxes. In this way, OpenTV encourages developers to write applications for their hardware by facilitating the process and ensures development of software for the platform. The OpenTV operating system itself is compact and micro-kernel based, ported to the host operating system in real time using OpenTV's Hardware Porting Kit (HPK). This allows it to be run on different set-top-boxes with minimal recompiling.
API functions
The OpenTV API provides a large library of functions that can display graphics on the television screen, control audio/video services, accept and respond to user input - even communicate with the outside world. This is done through a medium-independent method of communication that involves the API handling the transmission, and passing the data received onto the application, thus concealing the actual method of data transfer. The communication protocols support one-way satellite broadcasts, full bi-directional links (such as a modem or hard-wired serial port) and high-speed broadband networks.
Programming model
The OpenTV programming model is an asynchronous message-based environment. OpenTV applications make o-code function calls to the OpenTV library. The library routines initiate operations or requests. They do not block until the operation has completed; they return immediately. When an operation or request completes, a message is sent to the application indicating completion. Applications consist primarily of a message loop, which retrieves messages from the single message queue. Messages are used for notification of external events, such as key presses on the remote control or completion of function call requests.
Modules
OpenTV applications consist of two or more modules:
- The directory module, containing data about the application and its modules. This is required as the data must be transmitted before that of any other module.
- One or more modules containing the code and data. These modules must contain either application o-code or application data. The main module is automatically loaded by the set-top-box (much like C's 'main' function) while other modules are loaded on request.
OpenTV application code is edited on the development platform and is compiled and linked to create .otv files. C code is created using a standard text editor or C IDE and compiled into o-code using gcco. The resulting .o file, which contains o-code, is run through several stages of linking to produce objects which are processed with a postlinker to reduce the size. This part of the process is similar to application development in other environments. However, the .otv file must be combined with control information that synchronizes its transmission to the set-top box with the regular TV audio and video signals. This stream of application data is known as a flow. The flow is ready to be multiplexed with audio and video stream to create a complete OpenTV broadcast stream. During the debugging cycle, the flow is used as is to download and test the interactive application over a blank screen, assuming that the TV signals are not essential to the functional behavior of the application.
Source Code Example
/** Displays Hello World on the TV screen, then * waits for Quit message, and exits. */int main (void) ; texter *hellotxt;
- include "opentv.h"
- include "classes.h"
- include "texter.h"
O_debug ("Starting.\n");
// Initialize ALL the gadget classes we use in this program init_texter_class (texter_ID);
// Now create the text (string, color, x, y) hellotxt = (texter *) O_gadget_new( texter_ID, hello_world_ID, &hellodata );// set UIMS tree O_ui_set_root( hellotxt ); // Activate gadget O_gadget_activate( hellotxt );
for (;;) break; } } }
See also
External links
From Wikipedia, the Free Encyclopedia. Original article here. Support Wikipedia by contributing or donating.
All text is available under the terms of the GNU Free Documentation License See Wikipedia Copyrights for details.
