天天看點

OpenCores學習(4)--接口與NODE

第四章和第五章就是些介紹,隻是把關鍵的語句翻譯出來,見諒。

從第六章開始很關鍵,我也會盡量全部翻譯過來。

4.接口

4.1預設接口

      PVPlayer的接口是标準的OSCL-based 接口,引擎的API都是通過這些接口來調用相對應的操作,但是像一些OSCL類型的元件和PVMF類型的元件裡需要注意有些不同.

 4.2 适配層

       the interface to PVPlayer SDK needs to be different than the OSCL-based interface, another interface layer needs to be created to “wrap” around the OSCL-based interface. This “wrapper” is referred to as an

 adaptation layer for OSCL-based PVPlayer engine interface.One possible reason to create an adaptation layer would be to encapsulate the OSCL interface with types and components of a particular platform or operating system (e.g. ANSI C interface, Symbian interface).Another reason would be that the adaptation layer modifies the interface and behavior of PVPlayer SDK to match the expectation of the application (e.g. legacy interface). The adaptation layer could also combine PVPlayer SDK with another SDK or component to provide a unified interface to the application.The block diagrams below illustrate how the adaptation layer relates to PVPlayer Engine and its OSCL-based interface. The diagram on the right shows the adaptation layer adding more functionality by including another engine.

OpenCores學習(4)--接口與NODE

                                   圖四    适配層

4.3 多線程支援

        預設的OSCL-based 接口不支援多線程,是以在使用多線程的時候,适配層需要提供一個功能來實作.一種方法是使用OSCL proxy 接口元件來提供多線程的支援.另一種方法是添加一個另外的Platform Threading Support.兩種方法的框圖如下.

4.4  媒體資料輸出到資料池

 PVPlayer引擎利用PVMF節點指定資料輸出的資料池,但大部份使用的時候,同步資料通過适合的渲染後再送到媒體輸出裝置.在輸出視訊流的時候,需 要一個顯示裝置,音頻流需要一個PCM 音頻輸出裝置.媒體輸出裝置是一個具體的特定平台.輸出裝置的建立有兩個方法可以實作:

 (1)在PVMF節點裡封裝一個media device,引擎可以直接調用,這種方法可以最大限度的減少PVPlayer和接口層的代碼,但是需要建立一個新的PVMF節點.

  (2)直接調用PV media I/O接口,在I/O接口中調用輸出裝置.這種方法相對于第一種來說并不需要建立新的PVMF節點,複雜性也小.但增加了代碼的層次和和代碼量.下圖是兩 種方法的引擎.更多PV I/O接口的資訊,參考PV MEDIA I/O datasheet.

OpenCores學習(4)--接口與NODE

                          圖 6 媒體輸出的兩種方法

5. PVMF Node

       本節給出PVMF簡短的描述節點,由PVPlayer引擎使用。隻有PVMF節點OSCL和PVMF 基于元件都包括在内。沒有特定于平台PVMF節點覆寫。欲了解更多有關特定節點(1,低于或平台特定一)的詳細資訊,請參閱該節點檔案。

5.1 資料池節點(Data Sink Nodes)

       資料池節點是PVPlayer的引擎中輸出資料前最後的資料終點.

5.1.1 PVMFMediaOutputNode

       PVMFMediaOutputNode is a wrapper node around the PV media I/O interface to output data. The node translates node commands and incoming media data to appropriate media I/O actions and handles media I/O events. Using PVMFMediaOutputNode allows encapsulation of platform and device specific output interface with PV media I/O interface.

5.1.2 PVMFFileOutputNode

       PVMFFileOutputNode accesses the file directly using OSCL file I/O to write media data coming in via the port. The node has some capability to understand format type and to write out data appropriately for the specified format type (AMR file header for AMR IETF format).

繼續閱讀