Chinaunix首页 | 论坛 | 博客
  • 博客访问: 322760
  • 博文数量: 145
  • 博客积分: 2500
  • 博客等级: 少校
  • 技术积分: 1510
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-19 11:12
文章分类

全部博文(145)

文章存档

2007年(75)

2006年(70)

我的朋友

分类:

2007-05-08 19:01:05

Helix DNA Client Overview


[27Mar2006 Revision]

Helix DNA Client has been deployed on Windows, UNIX®, and Mac® OSX systems, and provides the core media engine functionality for RealPlayer and Rhapsody. In the mobile space, it is the multimedia framework of media players on millions of handsets from a number of handset manufacturers. 

Helix DNA Client Architecture

Helix DNA Client is a part of the Helix DNA platform, the first open multi-format platform for digital media creation, delivery, and playback. The purpose of the Helix DNA Client is to play back audio and video streams. A stream is a flow of a single type of data, such as the sound track in a video. Helix DNA Client reads a stream from the network or a file, and plays the stream as it is being read. To make smooth playback possible, the Helix DNA Client buffers the network packets as they arrive.

Helix DNA Client is based on the Component Object Model (COM) binary standard, similar to the COM utilized extensively in Microsoft® Windows®-based applications. However, Helix DNA Client diverges from the COM standard to simplify cross-platform development. Client components implement interfaces to communicate with the client core, and the client core implements interfaces to provide services for the components.

In general, a Helix DNA Client consists of two basic parts: the client core and plug-ins. In addition, a top-level client can also be added to supply a user interface that communicates with the client core and plug-ins. The following figure shows the basic Helix DNA Client architecture.

Helix DNA Client Core

The client core is the part of the Helix DNA Client that handles data transport between the client and Helix Universal Server. The client core consists of specific client core components and client core services.

Client Core Components

The client core components include the client engine, the player object, and the source object. The client engine provides an entrance to the media engine and initializes cross-platform services (such as audio, video, and network services). The player object starts a presentation, controls the playback of the presentation, sends out presentation statistics, and manages the source object.

The source object is the base from which the file source and network source derive. A file source is created whenever the source of a presentation is a local file (file://) or originates from an HTTP URL (http://). The file source manages loading, initializing, and use of file format and file system plug-ins. In addition, it initializes a rendering plug-in for the media stream. A network source is created whenever the source of a presentation originates from an RTSP URL (rtsp://) or PNM URL (pnm://). The network source initializes the network protocols, controls network transport switching, and handles redirection and reconnnection functionality. In addition, it also initializes a rendering plug-in for the media stream.

Client Core Services

Client core services allow client components and plug-ins to use system hardware without concern for the specifics of the hardware. In this way, client components and plug-ins can access device- independent, cross-platform client core services rather than accessing the system hardware directly. In addition, client core services include miscellaneous services that manage client plug-ins, threads, and the client registry.

The client core provides the following services:

  • Audio services

    Provides device-independent, cross-platform features used by audio rendering plug-ins. The plug-in can use audio services without concern for the specifics of the audio hardware. Audio services provides play back synchronization, mixing and resampling functions, crossfading between audio streams, volume control, and so on.

  • Video services

    Provides device-independent, cross-platform features used by video rendering plug-ins. As with audio services, the plug-in need not concern itself with the specifics of the video hardware. Video services include window management (geometry, position, and z-order), alpha-blending, transition, and overlay, and access to keyboard and mouse events.

  • Network services

    Provides cross-platform support for managing network communications. Any Helix component can use network services to create the appropriate transport connections (either TCP or UDP) for reading and writing data. In addition, network services includes DNS lookup functionality.

  • Miscellaneous services

    Client core services also include some miscellaneous services for managing client components. The plug-in handler loads and unloads plug-ins, categorizes plug-ins, and returns handles (or instances) of plug-ins. The core also provides cross-platform thread abstraction, thread management (resume, suspend, and exit) and mutex/lock. In addition, the core handles the abstraction of storing or sharing non-persistent information, using the client registry to store information and statistics to share the information.

Helix DNA Client Plug-ins

A Helix DNA Client, like the other components of the Helix DNA platform, uses plug-ins to compartmentalize specific actions in the client. A plug-in is a dynamic link library (DLL) on Windows- based machines and a shared library on UNIX or Mac OSX. Each plug-in provides a specific service in the Helix DNA client. During the client's initialization, all plug-ins associated with the client are loaded and initialized. Once the plug-in is loaded and initialized, it is able to receive requests from the client core to perform specific operations. The type of operations performed depends entirely on the COM interfaces implemented by the plug-in.

The following types of plug-ins are available to a Helix DNA client:

  • File system plug-in

    Provides access to different types of data storage media, such as a computer's local disks or a database. A file system plug-in creates a file object that components such as file format plug-ins use to access the requested file's data. These system-standard file objects thereby create a virtual file system for accessing file data without regard to data location or storage format.

  • File format plug-in

    Converts a data type from its native format to a packet format that can be streamed. File format plug-ins can also include adaptive stream management (ASM) rules to change stream data, such as bandwidth, rating, and language.

  • Rendering plug-in

    Receives streamed packets and renders them for playback of a given data type on the Helix DNA Client computer. Every file format plug-in has a corresponding rendering plug-in. The rendering plug-in utilizes the audio and video services provided by client core.

  • Generic plug-in

    Any plug-in that is not a file system, file format, or rendering plug-in is referred to as a generic plug-in. Examples of a generic plug-in are a view source plug-in, which displays SMIL markup and clip information for the content it's playing, and a visualization plug-in, which displays audio information in various visual formats.

A Helix DNA Client generally contains at least one rendering plug-in to play back a media stream, at least one file format plug-in to convert data into a stream of packets, and a file system plug-in to read data from a local file.

A single data type (such as RealAudio or RealVideo) is handled by a matching file format plug-in and rendering plug-in. This pair of plug-ins is referred to generically as a data type plug-in.

Top-Level Client

A top-level client provides an optional user interface that communicates with the client core and the client's plug-ins. The top-level client can manipulate or get the status of a presentation , retrieve a username and password from the client's user, add and manage a window (which is called a site in the Helix DNA architecture), and so on.

Helix DNA Client Data Flow

A Helix DNA Client's basic function is to play back streams. A stream can either originate from a server on an external network, a server on an internal network, or from a local file.

Network Client Data Flow

The following figure shows the client data flow if the stream originates from a server on an external or internal network.

To play back a stream over an external or internal network:

  1. A top-level client or hosting application asks the client core to open the media URL.

  2. The client initiates a network connection. Using network services, it determines the proper path transport (UDP or TCP) to initiate communication with the server.

  3. The client requests the media clip from the server. The server begins by streaming the file's header data to the client.

  4. The client receives the header data, and uses this data to determine the types of plug-ins to load (in particular, the rendering plug-in for the data type).

  5. The server then begins streaming the presentation data. The client receives the data, and begins buffering.

  6. Once a sufficient amount of presentation data has been received, playback begins. Video and audio are sent to their proper rendering plug-ins and are played back.

  7. Once the presentation data stops, the client closes the network connection.

Local File Client Data Flow

The following figure shows the client data flow if the stream originates from a local file.

To play back a stream from a local file:

  1. The client receives a request to play back a local file.

  2. The client loads a file system plug-in and creates a file object.

  3. The client loads the file format plug-in and uses the plug-in to retrieve the file's header data.

  4. The client receives the header data, and uses this data to determine the types of plug-ins to load (in particular, the rendering plug-in for the data type).

  5. The client uses the file format plug-in to begin retrieving streaming packets from the local file. The client receives the data, and begins buffering.

  6. Once a sufficient amount of presentation data has been received, playback begins. Video and audio are sent to their proper rendering plug-ins and are played back.

  7. Once the presentation data stops, the client closes the local file.

For More Information

To learn more about Helix DNA Client components, see the following sections of the Helix Community client code:

  • Client engine

    • Provides an entrance to the media engine: CreateEngine and CloseEngine

    • Initializes cross-platform services (such as audio, video, and network)

    • Manages HXPlayer : HXClientEngine::CreatePlayer and HXClientEngine::ClosePlayer

    See client/core/pub/hxcleng.h for class and method definitions, and client/core/hxcleng.cpp for the client engine implementation.

  • Player object (HXPlayer )

    • Starts a presentation: HXPlayer::OpenRequest or HXPlayer::OpenURL

    • Controls the presentation: HXPlayer::Begin , HXPlayer::Pause , HXPlayer::Seek , and HXPlayer::Stop

    • Provides presentation status using IHXClientAdviseSink::OnBegin , IHXClientAdviseSink::OnPause , IHXClientAdviseSink::OnStop , and so on

    • Manages HXSource

    See client/core/pub/hxplay.h for class and method definitions, and client/core/hxplay.cpp for the player object implementation.

  • Source object (HXSource )

    • HXFileSource : local file or HTTP playback (file:// or http://)

      Instantiates file system and file format plug-ins

      Initializes rendering plug-ins

    • HXNetSource : network playback (rtsp://)

      Initializes protocols (RTSPProtocol)

      Initializes rendering plug-ins

    See client/core/hxbsrc.h for the source object class and method definitions, and client/core/hxflsrc.cpp for the file source (HXFileSource ) implementation for local playback, and client/core/hxntsrc.cpp for the network source (HXNetSource ) for streaming media.

  • Audio services

    • Audio device abstraction

    • Playback synchronization

    • Mixing and resampling

    • Crossfading between audio streams

    • Volume control

    See the files in client/audiosvc for definitions and audio services implementation.

  • Video services

    • Video device abstraction

    • Window management (geometry, position, and z-order)

    • Alpha blending, transition, and overlay

    • Keyboard and mouse events

    See the files in client/videosvc for definitions and video services implementation.

  • Network services

    • Network I/O abstraction

    • UDP/TCP data transmission

    • DNS lookup

    See the files in client/netwksvc for definitions and network services implementations.

阅读(1356) | 评论(0) | 转发(0) |
0

上一篇:MP3是什么?

下一篇:ctag

给主人留下些什么吧!~~