Nexus分为三层结构:Application, Nexus, Magnum。
(1)Application and Middleware
应用和中间件
(2)Nexus
上层模块,为应用开发提供各种接口。
Nexus中包括:各个模块,驱动,回调函数,消息,计时器等系统信息。
• Interfaces: From the application’s perspective, Nexus is a high-level API for DTVs and set-top boxes. This
is represented as a collection of interconnected Nexus Interfaces. An Interface is a set of function
signatures (that is, prototypes), along with their structures and enums, that present a feature.
• Modules: A collection of code with a common state and synchronization. It provides the implementation
for one or more Nexus Interfaces.
• Base: Provides OS abstraction required for Nexus architecture rules, including creating tasks, requesting
task callbacks for timers and events, and queuing callbacks to applications. A Nexus Base is analogous to
Magnum’s Base Modules, except at a higher level.
• Platforms: Collects all the Nexus Interfaces available on a system into a cohesive whole. It also provides
OS driver code, board configuration, along with a build system. A Platform can be customized to meet a
user’s configuration and integration needs.
(3)Magnum
底层核心模块,提供硬件的接口。
Nexus的组件很多,比较重要的有:
(1)playback(解码核心)
(2)playpump(playback的engine)
(3)record(重新编码核心)
(4)recpump(record的engine)
(5)videoDecoder videoEncoder
(6)audioDecoder audioEncoder
(7)stream Mux
(8)A/V Muxer
(9)display (物理设备??)
(10)window(虚拟设备??)
(11)audioMix(混音器)
(12)pidChannel
(13)stcChannel
code:
main() { // open Interfaces videoDecoder = NEXUS_VideoDecoder_Open(0, NULL); display = NEXUS_Display_Open(0, NULL); window = NEXUS_VideoWindow_Open(display, 0); component = NEXUS_ComponentOutput_Open(0, NULL); // make connections NEXUS_Display_AddOutput(display, NEXUS_ComponentOutput_GetConnector(component)); NEXUS_VideoWindow_AddInput(window,NEXUS_VideoDecoder_GetConnector(videoDecoder)); startSettings.pidChannel = NEXUS_PidChannel_Open(NEXUS_ParserBand_e0, 0x21, NULL); // start video decode NEXUS_VideoDecoder_Start(videoDecoder, &startSettings); }