日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

IPNC_RDK_McFW_UserGuide

發(fā)布時(shí)間:2024/3/26 编程问答 22 豆豆
生活随笔 收集整理的這篇文章主要介紹了 IPNC_RDK_McFW_UserGuide 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

?

?

?

?

IPNC RDK

文件版本 2.10

多通道框架(MCFW)

軟件用戶指南

?

?

?

?


TABLE OF CONTENTS

?

1? 介紹.. 3

1.1? 概述.. 3

1.2 關(guān)鍵首字母縮略詞和詞匯.. 3

2? 安裝和構(gòu)建.. 4

2.1 從屬包.. 4

2.2? 安裝 IPNC RDK. 5

2.3? 構(gòu)建 the IPNC RDK. 5

2.4? 運(yùn)行 the IPNC RDK. 5

3? 頂層設(shè)計(jì).. 5

3.1? 軟件層.. 5

3.2 ??? McFW API10

3.3 ??? Link API12

3.4? .. 21

4? 目錄結(jié)構(gòu).. 31

4.1? 接口文件.. 31

4.2? 模板示例代碼.. 33

4.3? 庫(kù).. 33

5? 額外細(xì)節(jié).. 34

5.1??? 內(nèi)部處理器通信詳細(xì)信息.. 34

5.2??? 內(nèi)存映射詳細(xì)信息.. 34

5.3?? 顯示控制器和顯示功能詳細(xì)信息.. 34

5.4? IPNC 應(yīng)用程序配置.. 35

5.5? 智能/視頻分析.. 43

5.6? 視頻幀緩沖接口.. 43

?

?

?

?

1? 介紹

1.1 ?概述

IPNC RDK是用于TIDM8127DM385 SOC平臺(tái)的多處理器軟件開(kāi)發(fā)框架,針對(duì)監(jiān)控IPNC,混合IPNC和視頻分析等應(yīng)用進(jìn)行了優(yōu)化。

IPNC RDK中的軟件框架允許用戶創(chuàng)建涉及傳感器視頻捕獲,ISP處理,分辨率縮放,視頻噪聲濾波器,視頻顯示(SC,噪聲濾波和編碼)和視頻流等的不同多通道數(shù)據(jù)流。?

1.2 關(guān)鍵首字母縮略詞和詞匯

術(shù)語(yǔ)

描述

IPNC

IP網(wǎng)絡(luò)攝像機(jī)-圖像傳感器輸入網(wǎng)絡(luò)流,ISP將它轉(zhuǎn)換為YUV其轉(zhuǎn)換為數(shù)字編碼的比特流和網(wǎng)絡(luò)流。

IPNC RDK

IPNC參考設(shè)計(jì)工具包- 包括多通道軟件框架,硬件平臺(tái)。

ISS

成像子系統(tǒng)-兩個(gè)硬件模塊的文件所涉及軟件驅(qū)動(dòng)包

HDVPSS

高清晰度視頻處理子系統(tǒng)- 簡(jiǎn)稱為硬件模塊文件中涉及軟件驅(qū)動(dòng)程序包

HDVICP

高清晰度視頻和圖像協(xié)處理器-文檔中涉到的主要為軟件編解碼器包和硬件IP區(qū)塊

Ducati

雙核M3處理器控制HDVPSSHDVICP硬件引擎

Video M3

ARM Cortex ?? M3(內(nèi)嵌Ducati

子系統(tǒng)) 控制HDVICP 編解碼器。

VPSS M3 / DSS M3 / ISS M3

ARM Cortex ?? M3(內(nèi)嵌Ducati

子系統(tǒng)) 控制 HDVPSSISS 驅(qū)動(dòng)

NF

噪聲濾波器 - 參考文檔中的硬件噪聲濾波器模塊以及支持它的軟件組件 ?

SC

標(biāo)量 - 參考文檔中的硬件標(biāo)量塊以及軟件

組件支持它

McFW

多通道架構(gòu)-多通道應(yīng)用IPNC開(kāi)發(fā)的軟件框架。

Links

最小的軟件組件控制功能單元(如捕獲,DEI,顯示器) -具有輸入隊(duì)列和輸出隊(duì)列

IPC

處理器間通信

ListMP

共享區(qū)域-具有跨處理器共享存儲(chǔ)SYSLINK組件

SR

共享區(qū)域-具有跨處理器共享存儲(chǔ)SYSLINK組件

VA

視頻分析

?

2? 安裝和構(gòu)建

2.1 從屬包

IPNC RDK依賴于以下附加軟件包。

Please referto the Release Notes for exact package version required for the current releaseof IPNC RDK有關(guān)當(dāng)前版本的IPNCRDK所需的精確軟件包版本,請(qǐng)參閱發(fā)行說(shuō)明

包名稱

軟件包版本

A8 Linux - Code Sorcery Code Generation tools

有關(guān)軟件包版本,請(qǐng)參閱發(fā)行說(shuō)明

ARM M3代碼生成工具

DSP c6x代碼生成工具*

Linux PSP

XDC

BIOS

Syslink

IPC

XDIAS

Framework components

IVAHD HDVICP2 API

H264 encoder

HDVPSS drivers

ISS drivers

2.2 ?安裝 IPNC RDK

有關(guān)安裝IPNC RDK的說(shuō)明,請(qǐng)參閱隨發(fā)行的軟件包提供的安裝指南。

2.3 ?構(gòu)建 the IPNC RDK

有關(guān)安裝IPNC RDK的說(shuō)明,請(qǐng)參閱隨發(fā)行的軟件包提供的安裝指南。

2.4 ?運(yùn)行 the IPNC RDK

有關(guān)執(zhí)行IPNC RDK提供的默認(rèn)應(yīng)用程序的說(shuō)明,請(qǐng)參閱隨發(fā)行的軟件包提供的安裝指南。

3? 頂層設(shè)計(jì)

3.1 ?軟件層

軟件使用不同的層實(shí)現(xiàn),如下所示。

分層的量基于模塊性(更多抽象/層)和易用性(更少層數(shù))之間的平衡來(lái)完成。

?

HOST A8

?

VPSS M3

?

Video M3

?

C64x DSP

?

下面描述軟件的不同層,

Processor?

Applicable

Description

TI SW Package

Linux

HOST A8

Linux操作系統(tǒng),包括文件系統(tǒng),SATA,以太網(wǎng),USBIO驅(qū)動(dòng)程序

Linux PSP

BIOS6

VPSS M3

Video M3

DSP

BIOS RTOS用作操作系統(tǒng)

Video-M3, VPSS-M3, DSP. 視頻-M3VPSS-M3DSP Provides features like threads, semaphores, interrupts. 提供線程,信號(hào)量,中斷等功能。

?

BIOS

XDC(用于BIOS和其他配置)

?

?

Layer

Processor?

Applicable

Description

TI SW Package

?

?

隊(duì)列和鏈路之間的消息傳遞使用BIOS信號(hào)量實(shí)現(xiàn)。

?

Syslink / IPC

HOST A8

VPSS M3

Video M3

DSP

用于處理器之間通信的軟件api。提供諸如處理器加載和引導(dǎo),多堆棧,多鏈表(ListMP)功能,消息隊(duì)列,通知等

Syslink

IPC

HDVPSS

Drivers

VPSS M3

HDVPSS驅(qū)動(dòng)器,如采集,顯示, 去隔行,縮放基于FVID2界面上控制和配置

HDVPSS硬件

?

HDVPSS

ISS Drivers

VPSS M3

ISS驅(qū)動(dòng)程序,如捕獲,傳感器配置,基于FVID2接口的縮放,以控制和配置ISS硬件

ISS

Video Encode

Video M3

基于XDM / XDIAS接口的視頻編碼APIUses framework components for用于框架組件

資源分配

XDIAS

Framework components

IVAHD HDVICP2 API

MJPEG encoder

H264 encoder

ALG

VPSS M3

用于視頻處理和高級(jí)功能的高級(jí)算法。例如-視頻穩(wěn)定,AWBAE,閃爍檢測(cè)等

ISS

Face Detect

VPSS M3

面部檢測(cè)引擎驅(qū)動(dòng)程序可以做到高達(dá)32張人臉的實(shí)時(shí)檢測(cè)

ISS

Links

HOST A8

VPSS M3

Video M3

DSP

實(shí)施單個(gè)鏈接。一些鏈路是特定于處理器的,而一些鏈路在處理器之間是公共的 ?

IPNC RDK

Link API

HOST A8

鏈接API允許用戶創(chuàng)建,連接和HOSTA8控制環(huán)節(jié),VPSS M3M3的視頻和DSP

McFW

?

Layer

Processor?

Applicable

Description

TI SW Package

?

?

Link API用于創(chuàng)建鏈接鏈,形成用戶定義的用例。

連接到彼此的鏈接是平臺(tái)相關(guān)的。

?

McFW API

HOST A8

多通道應(yīng)用程序特定API,允許用戶使用單個(gè)簡(jiǎn)化的API接口為IPNCNVR設(shè)置和控制預(yù)定義的應(yīng)用程序特定鏈。

這使得用戶可以直接使用的鏈接,而無(wú)需了解詳細(xì)的鏈路API

McFW API是平臺(tái)獨(dú)立的,相同的API將在DM812x工作,DM385

McFW

RTSP Stack

HOST A8

開(kāi)源的的C ++庫(kù),用于多媒體流,采用開(kāi)放的標(biāo)準(zhǔn)協(xié)議開(kāi)源包(RTP / RTCPRTSPSIP

Open source

User

Application

HOST A8

通常GUI和其他應(yīng)用程序特定組件,如文件讀/寫(xiě),網(wǎng)絡(luò)流。

User application can use the McFW API for pre-defined usecases 用戶應(yīng)用可以利用預(yù)先定義的用例的McFW API

OR 要么

User application can use the link API and create their own custom chains. 用戶應(yīng)用可以利用鏈接API,并創(chuàng)建自己的定制鏈。

NOTE: User application NEED NOT create “l(fā)inks” of their own for say file write. 注意:用戶應(yīng)用程序不需要?jiǎng)?chuàng)建自己的鏈接用于說(shuō)文件寫(xiě)入。 Users can write their own custom implementation of processing steps outside of the link API. 用戶可以在鏈接API之外編寫(xiě)自己的自定義實(shí)現(xiàn)的處理步驟。

IPNC RDK provides three kinds of demos

IPNC RDK提供了三種類型demos “chains” demo, this uses the“”demos,這里使用

?

Customer specific


Layer

Processor?

Applicable

Description

TI SW Package

?

?

link API

. “McFW” demo, this uses the

McFW API

??????????????????????????????????????????????????????? -???

?

3.2 ???? McFWAPI

McFW API基于以下原則

?多通道視頻系統(tǒng)由以下四個(gè)子系統(tǒng)組成

1.攝像/捕捉這個(gè)子系統(tǒng)實(shí)現(xiàn)了視頻拍攝。攝像機(jī)組件通過(guò)并行輸入視頻端口從bayer傳感器捕獲,并可選地提供兩個(gè)縮放輸出。 The capture link captures multi-channels from input video ports(VIP).捕獲鏈路從輸入視頻端口(VIP)捕獲多通道。

2.顯示 - 這將從捕獲和解碼子系統(tǒng)接收作為輸入,并通過(guò)不同的用戶定義的鑲嵌圖案組成并通過(guò)多個(gè)通道呈現(xiàn)在多個(gè)顯示設(shè)備上。?

3.編碼 - 這將由包括子碼流編碼的捕獲和編碼視頻作為輸入,并且給用戶提供編碼比特流 ?

4.視頻處理 - 這將由捕獲/攝像機(jī)和處理視頻作為輸入,取決于配置的引擎,如噪聲過(guò)濾器,mjpeg編碼。

視頻分析 - 這將輸入作為QVGA輸入從標(biāo)量和運(yùn)行DMVA算法

API隱藏平臺(tái)級(jí)別詳細(xì)信息,如YUV格式轉(zhuǎn)換,要使用的標(biāo)量,要使用的視頻噪聲過(guò)濾器,并允許用戶專注于廣泛級(jí)子系統(tǒng),而不是低級(jí)硬件資源和約束。

The hardware blocks (noise filter, scaler,isp) used inside a sub-system depend on the top level system configuration doneby the user depending on their use-case.在子系統(tǒng)內(nèi)部使用的硬件塊(噪聲濾波器,縮放器,isp)取決于用戶根據(jù)其使用情況完成的頂級(jí)系統(tǒng)配置。

User will see the same block diagram for alluse-cases on all platforms.用戶將在所有平臺(tái)上看到所有用例的相同框圖。 Thedetailed blocks inside the sub-system will depend on the system levelconfiguration selected by the user.子系統(tǒng)內(nèi)的詳細(xì)塊將取決于用戶選擇的系統(tǒng)級(jí)配置。 The blocks inside the subsystem will also depend on the platformlike DM812x or DM385.子系統(tǒng)內(nèi)部的塊也將取決于平臺(tái),如DM812xDM385

Thus McFW API allows user to use the same APIfor different products across different platforms, thus allowing user to keeptheir GUI and other applications portable to different product lines andplatforms. 因此,McFW API允許用戶針對(duì)不同平臺(tái)的不同產(chǎn)品使用相同的API,從而允許用戶保持其GUI和其他應(yīng)用程序可移植到不同的產(chǎn)品線和平臺(tái)。

3.2.1 ?McFW API 系統(tǒng)框架圖??????????????????????????????????????????????????????Primary stream, Secondary stream,

?

?

示例,三流IPNC用例的簡(jiǎn)單流程圖如下所示。

?

?

3.3 ???? LinkAPI

注:大多數(shù)用戶并不需要知道內(nèi)部軟件架構(gòu)的底層細(xì)節(jié),但有必要了解軟件如何才能最有效地運(yùn)行在系統(tǒng)內(nèi)部。

A link is the basic processing step in avideo data flow.鏈接是視頻數(shù)據(jù)流中的基本處理單元。 A link consists of aBIOS6/Linux thread coupled with a message box (implemented using OSsemaphores).鏈接由BIOS6 / Linux線程和消息框(使用OS信號(hào)量實(shí)現(xiàn))組成。 Since each link runs as aseparate thread, links can run in parallel to each other.由于每個(gè)鏈接作為單獨(dú)的線程運(yùn)行,鏈接可以彼此并行地運(yùn)行。 The message box associated with a link allows user application aswell as other links to talk to that link.與鏈接相關(guān)聯(lián)的消息框允許用戶應(yīng)用程序以及其他鏈接與該鏈接對(duì)話。 The link implements a specific interface which allows other linksto exchange video frames and/or bit streams with the link.鏈路實(shí)現(xiàn)特定接口,其允許其他鏈路與鏈路交換視頻幀和/或比特流。

Link API allows user to create,control and connect the links. Link API允許用戶創(chuàng)建,控制和連接鏈接。

McFW API uses Link API to make achain depending on the top level system configuration provided by the user.McFW API使用Link API根據(jù)用戶提供的頂級(jí)系統(tǒng)配置制作一個(gè)鏈。

Alternatively user's can use the link APIdirectly to make custom use-cases not supported by the McFW API.或者,用戶可以直接使用鏈接API來(lái)創(chuàng)建McFW API不支持的自定義用例。

?3.3.1 ?鏈接的內(nèi)部軟件體系結(jié)構(gòu)

McFW內(nèi)部使用的SW架構(gòu)基于以下原則,

視頻處理工作載在不同處理器之間劃分,如下所示

Processor

OS

Used for

HOST A8

Linux

系統(tǒng)設(shè)置和控制,GUIIO外設(shè)控制如SATA,以太網(wǎng),USB,音頻

VPSS M3

BIOS6?

HDVPSS控制視頻采集,視頻顯示,縮放,視頻噪聲濾波

Video M3

BIOS6

HDVICP2視頻壓縮(H264編碼,MJPEG編碼)

DSP

BIOS6

SW OSD,自定義視頻處理算法

?

在每個(gè)處理器中,每個(gè)處理步驟如捕獲或顯示將在其自己的獨(dú)立線程中運(yùn)行。這種獨(dú)立的執(zhí)行線程在這個(gè)框架中被稱為“l(fā)ink”

?Example links include, capture, display,DEI, Noise Filter, encode, decode示例鏈接包括,捕獲,顯示,DEI,噪聲濾波器,編碼,解碼

Eachthread or link is capable of handling processing of video frames from multiplechannels, each having different properties like width, height, data format etc.每個(gè)線程或link能夠處理來(lái)自多個(gè)通道的視頻幀,每個(gè)通道具有諸如寬度,高度,數(shù)據(jù)格式等不同的屬性。

A link will“connect” to other links to make a chain or a data flow.鏈接將連接到其他鏈接以形成鏈或數(shù)據(jù)流。This connection and control canbe done by the user from the HOST A8 side.這種連接和控制可以由用戶從HOST A8側(cè)完成。

Once a chain is setupand started, each link in the chain will exchange frames will its next link,using a well defined interface, to make the video processing data flow.一旦鏈建立和啟動(dòng),鏈中的每個(gè)link將交換幀,其下一個(gè)鏈路,使用良好定義的接口,使視頻處理數(shù)據(jù)流。

The frameworkallows links on different processors to exchange frames directly with eachother without any intervention of the HOST A8.該框架允許不同處理器上的鏈路直接彼此交換幀,而不需要HOST A8的任何干預(yù)。

Once a chain isrunning, user can send control commands to individual links to control theirrun-time behavior.一旦鏈運(yùn)行,用戶可以向單個(gè)link發(fā)送控制命令以控制其運(yùn)行時(shí)行為。Example, changing encode Qp, frame rate control etc.例如,改變編碼Qp,幀速率控制等。

An example chain is shown below, in thischain multiple channels of video are captured, encoded via HDVICP encode linkand then stream out on the network示例鏈如下所示,在該鏈中,多通道的視頻由捕獲,通過(guò)HDVICP編碼link編碼,然后在網(wǎng)絡(luò)上流出

?

3CH 1080p + D1 YUV420 + 1080p @ 60fps

?

?

?

Encode支持:

HDVICP H.264

H.264 1080p 60fps

H.264 D1 30fps

MJPEG 1080p 5fps

?

3.3.2 ?link接口

link接口包括

Link API – whichis used by chains or user applications for configuring and controlling the link Link API - 鏈或用戶應(yīng)用程序用于配置和控制link

Inter Link API –which is used by other links for exchanging frames between two links Inter Link API - 由其他鏈路用于在兩個(gè)link之間交換幀

Link OutputQueue – is the queue which is used by another link (via the inter link API) toexchange frames with that linklink輸出隊(duì)列 - 是另一個(gè)link(通過(guò)linklink API)用來(lái)與該link交換幀的隊(duì)列

3.3.3 ?將消息傳遞到鏈接?

每個(gè)鏈接由系統(tǒng)級(jí)唯一的32位鏈接ID(如“system_linkId.h”中定義)標(biāo)識(shí)。

The link ID determines on which processor the link runs as shownbelow.鏈路ID確定鏈路在哪個(gè)處理器上運(yùn)行,如下所示。

?

描述

0..27

鏈接ID

28..31

此鏈接運(yùn)行的處理器ID

0: DSP (C64x)

1: Video M3

2: VPSS M3

3: HOST A8

每個(gè)link API在向link發(fā)送消息時(shí)需要鏈接ID作為參數(shù)。

When amessage is sent to a link by the user, based on the link ID the functioninternally knows whether this is a local link, in which case it sends themessage using normal BIOS/Linux APIs, else it will use Syslink MessageQ to sendthe message to the appropriate processor.當(dāng)用戶發(fā)送消息到鏈接時(shí),基于鏈接ID,函數(shù)內(nèi)部知道這是否是本地鏈接,在這種情況下,它使用正常的BIOS / LinuxAPI發(fā)送消息,否則它將使用Syslink MessageQ發(fā)送消息發(fā)送到適當(dāng)?shù)奶幚砥鳌?/span>Once the MessageQ message reachesthe target processor, it invokes the local BIOS APIs to forward the message tothe intended link.一旦MessageQ消息到達(dá)目標(biāo)處理器,它調(diào)用本地BIOS API將消息轉(zhuǎn)發(fā)到目標(biāo)鏈路。This allows user to control the links on VPSS M3, Video M3 and DSPfrom HOST A8.這允許用戶控制來(lái)自HOSTA8VPSS M3,視頻M3DSP上的鏈路。The user need not directly know about the processor and mechanism(Syslink message Q) that is used for this message passing.用戶不需要直接了解用于該消息傳遞的處理器和機(jī)制(Syslink消息Q)。

3.3.4 ??? link API

API允許link由用戶或鏈控制。

The followingAPIs are part of the link API.以下API linkAPI的一部分。

The API arguments are typically specific to the link implementation. API參數(shù)通常特定于鏈接實(shí)現(xiàn)。

?

API

Description

System_linkCreate

創(chuàng)建鏈接 - 分配驅(qū)動(dòng)程序,編解碼器,內(nèi)存資源。

System_linkGetInfo

獲取有關(guān)通道數(shù)量,每個(gè)通道的屬性等link的信息。MUST be called after System_linkCreate() for a link System_linkCreate()中的鏈接后,必須調(diào)用

System_linkStart

啟動(dòng)link - 啟動(dòng)驅(qū)動(dòng)程序或編解碼器

System_linkControl

發(fā)送帶有可選參數(shù)的link特定控制命令

System_linkStop

停止鏈接 - 停止驅(qū)動(dòng)程序或編解碼器

System_linkDelete

刪除一個(gè)link- 釋放驅(qū)動(dòng)程序,編解碼器,內(nèi)存資源

?

3.3.5 ??? Inter Link API

APIlink用于相互交換幀。Users of a link typically neednot be aware of this API.link的用戶通常不需要知道這個(gè)API

Each link needs to implement a few functions and register thefunction pointers with the system frame work along with its link ID.每個(gè)link需要實(shí)現(xiàn)一些功能,并注冊(cè)與系統(tǒng)框架一起工作的函數(shù)指針及link IDThis registration is done once during system init.此注冊(cè)在系統(tǒng)初始化期間執(zhí)行一次。

?

API

Description

System_GetLinkInfoCb

返回關(guān)于link的信息的功能,如通道數(shù),每個(gè)通道的屬性

System_LinkGetOutputFramesCb

將捕獲或生成或輸出幀返回給調(diào)用者的函數(shù)(另一個(gè)鏈接)

System_LinkPutEmptyFramesCb

將消費(fèi)的幀釋放回原始鏈接以便重用的功能

System_LinkGetOutputBitBufsCb

返回生成的函數(shù)或輸出比特流幀到調(diào)用者(另一鏈接) -

僅對(duì)Encode Link有效

System_LinkPutEmptyBitBufsCb

函數(shù)來(lái)釋放所消耗的位流的幀回原始鏈路重用-有效僅用于編碼鏈接

任何想從另一個(gè)link獲取幀的link將使用系統(tǒng)API“System_getLinksFullFrames()從上一個(gè)link獲取幀。This internally will index into thesystem wide link information table and invoke the link specificSystem_LinkGetOutputFramesCb() function callback.這將在內(nèi)部索引到系統(tǒng)范圍的kink信息表,并調(diào)用特定于鏈接的System_LinkGetOutputFramesCb()函數(shù)回調(diào)。

Similarlywhen a link wants to release the frames back to the original link after theframes have been consumed, it will call the API “System_putLinksEmptyFrames()”.類似地,當(dāng)鏈路想要在幀被消耗之后將幀釋放回原始鏈路時(shí),它將調(diào)用API“System_putLinksEmptyFrames()Thisinternally will index into the system wide link information table and invokethe link specific System_ LinkPutEmptyFramesCb () function callback.這在內(nèi)部將索引到系統(tǒng)范圍的鏈接信息表,并調(diào)用鏈接特定的System_LinkPutEmptyFramesCb()函數(shù)回調(diào)。

This way alink need not exactly know which link it is exchanging frames with.這樣,鏈路不需要精確地知道它正在與哪個(gè)鏈路交換幀。All it needs is a link ID of theprevious link in the data flow.它所需要的是數(shù)據(jù)流中上一個(gè)鏈接的鏈接IDThisallows user to user the same link in many different data flows withoutmodifying the link implementation.這允許用戶在許多不同的數(shù)據(jù)流中使用相同的鏈路,而不修改link的實(shí)現(xiàn)。

3.3.6 ?鏈路輸出隊(duì)列

鏈接將具有一個(gè)或多個(gè)輸出隊(duì)列,其將把捕獲或生成的幀放入其中。 A link owns it output queue and takescare of memory allocation for the frames that will go into its output queue.鏈接擁有它的輸出隊(duì)列,并負(fù)責(zé)處理將進(jìn)入其輸出隊(duì)列的幀的內(nèi)存分配。

Most linkshave only one output queue, but some links have multiple output queue's.大多數(shù)鏈接只有一個(gè)輸出隊(duì)列,但有些鏈接有多個(gè)輸出隊(duì)列。These multiple output queue's allowthat link to be used in different data flows without changing the linkimplementation.這些多個(gè)輸出隊(duì)列允許該鏈路在不改變鏈路實(shí)現(xiàn)的情況下在不同的數(shù)據(jù)流中使用。

Example,Noise filter link can be configured to output its channel frames over twooutput queues, such that 8CH of 16CH goto one output queue and other 8CH go toother output queue.示例,噪聲濾波器鏈路可以被配置為在兩個(gè)輸出隊(duì)列上輸出其信道幀,使得16CH8個(gè)輸出隊(duì)列中的8CH和其他8CH到另一個(gè)輸出隊(duì)列。This allows noise filter to feed to two different DEI links in somedata flows.這允許噪聲濾波器饋送到一些數(shù)據(jù)流中的兩個(gè)不同的DEI鏈路。

An outputqueue can hold frames from multiple channels of multiples sizes and differentdata formats.輸出隊(duì)列可以保存來(lái)自多個(gè)大小和不同數(shù)據(jù)格式的多個(gè)通道的幀。ie it's a hetrogeous queue.即它是一個(gè)hetrogeous隊(duì)列。

Theinformation of the content in the queue can be known by using the System_linkGetInfo()API.通過(guò)使用System_linkGetInfo()API可以知道隊(duì)列中的內(nèi)容的信息。This internally will call the link specific System_GetLinkInfoCb()function callback.這在內(nèi)部將調(diào)用特定于鏈接的System_GetLinkInfoCb()函數(shù)回調(diào)。

The datastructure FIVD2_Frame, used by VPSS driver, is used for exchanging frameinformation between links. VPSS驅(qū)動(dòng)程序使用的數(shù)據(jù)結(jié)構(gòu)FIVD2_Frame用于在鏈路之間交換幀信息。This allows frame information toflow between links without any additional translation.這允許幀信息在鏈路之間流動(dòng)而不需要任何額外的翻譯。Among other information it has a“channelNum” field which allows a link to indentify the channel with the framedata.在其他信息中,它具有“channelNum”字段,其允許鏈路用幀數(shù)據(jù)來(lái)標(biāo)識(shí)信道。

A link willtypically call the System_getLinksFullFrames() with the link ID and que ID ofthe previous link when it wants to process the input frames.當(dāng)鏈接想要處理輸入幀時(shí),鏈接通常會(huì)調(diào)用具有前一鏈接的鏈接ID和隊(duì)列IDSystem_getLinksFullFrames()。

A link whenit has generated output frames for consumption by the next link will send amessage “SYSTEM_CMD_NEW_DATA” to the next link.當(dāng)鏈路生成輸出幀供下一鏈路使用時(shí),鏈路將向下一鏈路發(fā)送消息“SYSTEM_CMD_NEW_DATA”

When a link receives “SYSTEM_CMD_NEW_DATA” it will call當(dāng)鏈接接收到“SYSTEM_CMD_NEW_DATA”時(shí),它將調(diào)用

System_getLinksFullFrames(). System_getLinksFullFrames()。After processing the input frames itwill release the input frames using System_putLinksEmptyFrames()在處理輸入幀之后,它將使用System_putLinksEmptyFrames()釋放輸入幀,

Thus a linkneeds to know因此鏈路需要知道

?Previous link ID and Previous Link QueID to get input frames上一個(gè)鏈接ID和上一個(gè)鏈接Que ID以獲取輸入幀

?And Next Link ID, in order to informthe next link when new frames are generated.和下一鏈路ID,以便在生成新幀時(shí)通知下一鏈路。

Thisinformation of previous link ID and next link ID is passed to a link using theSystem_linkCreate() API.使用System_linkCreate()API將上一個(gè)鏈接ID和下一個(gè)鏈接ID的信息傳遞到鏈接。

Thus previouslink ID and next link ID is what “connects” one link to another link.因此,先前鏈路ID和下一鏈路ID是將一個(gè)鏈路連接到另一鏈路。

3.3.7 ??? IPC Link

稱為IPC(處理器間通信)鏈路的特殊鏈路用于跨越處理器交換幀。

Example, A local processor link likecapture will exchange frames with the IPC Link and the IPC Link will turn makeuse of use of appropriate Syslink/IPC APIs to send the received frames acrossprocessors.例如,像捕獲的本地處理器鏈路將與IPC鏈路交換幀,并且IPC鏈路將利用適當(dāng)?shù)?/span>Syslink / IPC API來(lái)發(fā)送在處理器之間接收的幀。

Thus a capture link can be implemented asif it will only talk to a link on the same processor.因此,捕獲鏈路可以被實(shí)現(xiàn)為好像它將僅與相同處理器上的鏈路通話。 This will keep the implementation of the capture link simple andefficient.這將保持捕獲鏈路的實(shí)現(xiàn)簡(jiǎn)單和有效。

The special IPC link will handle thecomplexity of sending frames between processors and it will take care of anycache operations or other such inter processor synchronization functions.特殊的IPC鏈接將處理在處理器之間發(fā)送幀的復(fù)雜性,并且它將負(fù)責(zé)任何高速緩存操作或其它這樣的處理器間同步功能。

The inter link frame exchange mechanismsthat are used, depend on where the links are located in order to reduce interlink frame exchange overheads.所使用的鏈路幀交換機(jī)制取決于鏈路所在的位置,以便減少鏈路幀間交換開(kāi)銷。

The following three inter link frameexchange mechanisms are used使用以下三個(gè)鏈路幀交換機(jī)制

Intra-processor links 幀內(nèi)處理器links

o Example, from capture to noise filterwhich run on the same processor.實(shí)例,從捕捉到噪聲濾波器在相同的處理器上運(yùn)行。

Simple and efficient array based queue'sare used for frame exchange.簡(jiǎn)單和高效的基于陣列的隊(duì)列用于幀交換。

Inter M3 (Video / VPSS) links 內(nèi)部M3(視頻/ VPSSlink

o Example from NF to encode (via IPC M3OUT/IN Link) which run on VPSS M3 and Video M3 (sharing a uni-cache).例如從NF到編碼(通過(guò)IPC M3 OUT / IN連接),這對(duì)VPSS M3M3視頻(共用一個(gè)單緩存)上運(yùn)行。

IPC ListMP with Notify is used with frameinformation pointer (FVID2_Frame) being passed directly without any cacheoperations and address translation since both M3 share the same uni-cache.具有NotifyIPC ListMP與幀信息指針(FVID2_Frame)一起被直接傳遞而沒(méi)有任何高速緩存操作和地址轉(zhuǎn)換,因?yàn)閮蓚€(gè)M3共享相同的單一高速緩存。

Inter processor (M3 to A8 or DSP) 內(nèi)部處理器(M3A8DSP

o Example from encode to Bitstream IN (viaIPC OUT/IN Link) which run on Video M3 and Host A8. 例如,從編碼到比特流(通過(guò)IPC OUT / IN連接),這對(duì)視頻M3和主機(jī)A8運(yùn)行。

IPC ListMP with Notify is used with frameinformation being passed with address and information translation includingcache operations, if applicable帶有通知的IPC ListMP用于通過(guò)地址和信息轉(zhuǎn)換傳遞的幀信息,包括高速緩存操作(如果適用)

3.3.8 ?框架結(jié)構(gòu)

?

Linksexchange frames.鏈接交換幀。 The frame buffers (video data) can be sent across processors forprocessing using these frames.可以在處理器之間發(fā)送幀緩沖器(視頻數(shù)據(jù))以便使用這些幀進(jìn)行處理。

TheFVID2 header has sufficient information that can be used to in transportationof frame buffers. FVID2頭具有足夠的信息,可用于幀緩沖區(qū)的傳輸。

FVID2header has many parameters but as an application writer its important to understandfollowing ones FVID2頭有許多參數(shù),但作為應(yīng)用程序編寫(xiě)者,了解以下的重要

channelNum- Identifies channel channelNum - 標(biāo)識(shí)通道

Addr[][]- Pointer to the frame buffer Addr [] [] - 指向幀緩沖區(qū)的指針

perFrameCfg- Information about frame configuration perFrameCfg - 有關(guān)幀配置的信息

AppData -Application data can be plugged in here, currently it has systemInformation AppData - 應(yīng)用程序數(shù)據(jù)可以在這里插入,目前它有systemInformation

?

3.4 ?

NOTE:Most users don’t need to know lowlevel details of how to make chains since McFW API hides this detail from theuser, but its useful to know how the software operates internally in order toget the most out of the system.

注:大多數(shù)用戶并不需要知道如何自McFW API隱藏從用戶這一細(xì)節(jié)做出鏈底層的細(xì)節(jié),但其有用知道軟件如何才能最有效地系統(tǒng)的內(nèi)部操作。

A chain is connection of links in alogical order to make a video processing data flow.鏈?zhǔn)且赃壿嬳樞蜻B接鏈路以產(chǎn)生視頻處理數(shù)據(jù)流。A chain is constructed using Link APIs.鏈?zhǔn)褂?/span>Link API構(gòu)建。

Differentchains can be constructed for different applications.可以為不同的應(yīng)用構(gòu)建不同的鏈。Chains can be “destroyed” and then reconstructed in a different wayswithout needing a reboot.鏈可以銷毀,然后以不同的方式重建,而不需要重新啟動(dòng)。

McFW API根據(jù)用戶傳遞的頂層系統(tǒng)配置構(gòu)造一些預(yù)定義的鏈。

3.4.1 ?鏈執(zhí)行順序

鏈執(zhí)行按以下順序執(zhí)行。

A chain createsthe links using System_linkCreate() API.鏈?zhǔn)褂?/span>System_linkCreate()API創(chuàng)建鏈接。Links MUST be created in the order ofsource link to sink link.鏈路必須按源鏈路到宿鏈路的順序創(chuàng)建。

A source is a link which has no previous link.源是沒(méi)有先前鏈接的鏈接。Example, Capture示例,捕獲

A sink is a link which has no next link.宿是沒(méi)有下一個(gè)鏈路的鏈路。Example, Display示例,顯示

The order ofcreating a link is important since when a link is created it queries itsprevious link to get information about the expected number of channels andchannel properties, based on a which a link will configure itself.創(chuàng)建鏈接的順序很重要,因?yàn)楫?dāng)鏈接被創(chuàng)建時(shí),它基于鏈接將對(duì)其自身進(jìn)行配置來(lái)查詢其先前的鏈接以獲得關(guān)于預(yù)期的信道數(shù)量和信道屬性的信息。Hence a “previous” link needs tocreated before the “next” link因此,需要在下一個(gè)鏈接之前創(chuàng)建先前鏈接

Next the chainis started by calling System_linkStart() for each link in the chain.接下來(lái),通過(guò)為鏈中的每個(gè)鏈接調(diào)用System_linkStart()來(lái)啟動(dòng)鏈。The links are started in theorder of sink link to source link.鏈路按照宿鏈路到源鏈路的順序開(kāi)始。This is not a hard requirementbut is usually desired in the application, since this allows all links to getready to receive input before the source link itself is started.這不是硬要求,但通常在應(yīng)用程序中是需要的,因?yàn)檫@允許所有鏈路在源鏈路本身啟動(dòng)之前準(zhǔn)備好接收輸入。

Once a chain isrunning control commands can be sent to individual links to control the dataflow.一旦鏈運(yùn)行,控制命令可以發(fā)送到各個(gè)鏈路以控制數(shù)據(jù)流。System_linkControl() API is used tosend control commands.System_linkControl()API用于發(fā)送控制命令。Example, command to SW Mosaic Link tochang Mosaic layout at run-time.示例,SW圖案鑲嵌的命令鏈接到運(yùn)行時(shí)的圖案鑲嵌布局。

?The control commands that aresupported depend on the type of link.支持的控制命令取決于鏈路的類型。

NOTE,depending on the link System_linkControl() can be called even before callingSystem_linkCreate().注意,根據(jù)鏈接,System_linkControl()甚至可以在調(diào)用System_linkCreate()之前調(diào)用。

After the useris done with a chain he can stop it by calling System_linkStop() API for eachlink of the chain.在用戶完成鏈后,他可以通過(guò)為鏈的每個(gè)鏈接調(diào)用System_linkStop()API來(lái)停止它。A chains MUST be stopped in the orderof source to sink.一個(gè)鏈必須按源到sink的順序停止。

A link can wait on a output buffer which could be held by the nextlink.鏈路可以等待可以由下一鏈路保持的輸出緩沖器。If the next link is stopped before aprevious link is stopped, then the previous could wait for ever on a bufferwhich never arrives since the next link is no longer active.如果下一鏈接在前一鏈接停止之前停止,則先前可以在從未到達(dá)的緩沖器上等待,因?yàn)橄乱绘溄硬辉倩顒?dòng)。Hence a previous link MUST be stoppedbefore stopping the next link.因此,在停止下一鏈路之前必須停止先前的鏈路。

Finally after achain is stopped, it can be destroyed by calling最后一個(gè)鏈停止后,它可以通過(guò)調(diào)用銷毀

System_linkDelete()API on each link in the chain.在鏈中的每個(gè)鏈接上的System_linkDelete()APILink delete can be called in any orderon the links.鏈接刪除可以在鏈接上以任何順序調(diào)用。

刪除鏈后,可以使用相同的序列創(chuàng)建和啟動(dòng)新鏈。

?

3.4.2 ?鏈?zhǔn)纠a

多通道捕獲到SW嵌合體到顯示鏈的示例代碼如下所示。Some details are left out for clarity.為了清楚起見(jiàn),省略了一些細(xì)節(jié)。?

數(shù)據(jù)流

16CH 720x240 YUV422I 60fps

1CH 1920x1080 YUV422I 60fps (1080p60)

4x4 Mosaic Layout

?

鏈接包含文件

#include <ti/vsi/interfaces/system.h>

#include <ti/vsi/interfaces/captureLink.h>

#include <ti/vsi/interfaces/displayLink.h>

#include <ti/vsi/interfaces/swMsLink.h>

#include <ti/vsi/interfaces/systemLink_m3vpss.h>

鏈接創(chuàng)建參數(shù)結(jié)構(gòu)

CaptureLink_CreateParams??? capturePrm;

SwMsLink_CreateParams?????? swMsPrm;

DisplayLink_CreateParams??? displayPrm;

Setup Capture link parameters

capturePrm.tilerEnable = FALSE; // 不使用 tiler內(nèi)存輸出

capturePrm.numVipInst = 4; // 使用4個(gè)視頻端口

?

// 捕獲鏈接后的下一個(gè)鏈接是SW Mosaic DEI 鏈接

capturePrm.outQueParams[0].nextLink = SYSTEM_LINK_ID_SW_MS_DEI_0;

?

?

// 為每個(gè)視頻捕獲端口配置

for(vipInstId=0; vipInstId<capturePrm.numVipInst; vipInstId++) {??? // 設(shè)置捕獲端口 ID?

capturePrm.vipInst[vipInstId].vipInstId =??????????

????????????? SYSTEM_CAPTURE_INST_VIP0_PORTA+vipInstId;

?

?? // 設(shè)置捕獲外部設(shè)備 ID???

capturePrm.vipInst[vipInstId].videoDecoderId???? =????

????????????? SYSTEM_DEVICE_VID_DEC_TVP5158_DRV;

?

?? //設(shè)置輸入數(shù)據(jù)格式為16-bit YUV422??? capturePrm.vipInst[vipInstId].inDataFormat =?

????????????? SYSTEM_DF_YUV422P;

?

?? // 設(shè)置捕獲視頻標(biāo)準(zhǔn)為4D1 multiplxed 捕獲 (每端口)???? capturePrm.vipInst[vipInstId].standard =?

????? ????????SYSTEM_STD_MUX_4CH_D1;

?

// 每通道輸出端口數(shù)量為一

???? capturePrm.vipInst[vipInstId].numOutput =? 1

?

???? //輸出數(shù)據(jù)格式是YUV422I????? capturePrm.vipInst[vipInstId].outParams[0].dataFormat =?????????????????? SYSTEM_DF_YUV422I_YUYV

?

????? // inline scaling disabled since this is multi-channel capture?????? capturePrm.vipInst[vipInstId].outParams[0].scEnable = FALSE;

?

????? // 所有通道映射到輸出隊(duì)列 ID = 0

????? capturePrm.vipInst[vipInstId].outParams[0].outQueId = 0; }

?

設(shè)置 SW Mosaic 鏈接參數(shù)

// 一個(gè)鏈接是捕捉, 一個(gè)鏈接 que ID = 0

swMsPrm.inQueParams.prevLinkId = SYSTEM_LINK_ID_CAPTURE; swMsPrm.inQueParams.prevLinkQueId = 0;

?

?

// 下一個(gè)鏈接是顯示

swMsPrm.outQueParams.nextLink???? = SYSTEM_LINK_ID_DISPLAY_1;

?

// SW Mosaic 調(diào)用周期是 16ms or 60fps

swMsPrm.timerPeriod?????????????? = 16;

?

// 初始布局是,顯示貞大小為 1080p60

swMsPrm.layoutPrm.outLayoutMode = SYSTEM_LAYOUT_MODE_16CH; swMsPrm.layoutPrm.outRes = SYSTEM_DISPLAY_RES_1080P60;

?

// CHx mapped to WINx. 最大 16 windows possible in 4x4 layout.

for(winId=0; winId<16; winId++)

??? swMsPrm.layoutPrm.win2ChMap[winId] = winId;

?

設(shè)置顯示鏈接參數(shù)

// 一個(gè)鏈接是 SW Mosaic 鏈接, 一個(gè)鏈接 que ID = 0

displayPrm.inQueParams.prevLinkId??? = SYSTEM_LINK_ID_SW_MS_DEI_0; displayPrm.inQueParams.prevLinkQueId = 0;

?

// display resolution is same as SW Mosaic link output frame size, 1080p60 displayPrm.displayRes??????????????? = swMsPrm.layoutPrm.outRes;

初始化顯示控制器這是必需的,以便使顯示。There is no separate display controller link. 沒(méi)有單獨(dú)的顯示控制器鏈接。Instead a command is sent to the generic VPSS Link which in turn calls the display controller API on the VPSS M3 processor. 相反,命令被發(fā)送到通用VPSS鏈路,其又調(diào)用VPSS M3處理器上的顯示控制器API。

SystemVpss_DisplayCtrlInitParam prm;

?

// 顯示控制器分辨率和顯示器鏈接一樣

prm.hdDisplayRes = displayPrm.displayRes;

?

//發(fā)送命令到VPSS M3 link 來(lái)初始化顯示控制器

System_linkControl(

??????? SYSTEM_LINK_ID_M3VPSS,

??????? SYSTEM_M3VPSS_CMD_GET_DISPLAYCTRL_INIT,

&prm,??????????? sizeof(prm),

??????? TRUE

?

??????? );

創(chuàng)建鏈接

// 按照源的順序創(chuàng)建sink

System_linkCreate (SYSTEM_LINK_ID_CAPTURE, &capturePrm, sizeof(capturePrm));

System_linkCreate(SYSTEM_LINK_ID_SW_MS_DEI_0, &swMsPrm, sizeof(swMsPrm));

System_linkCreate(SYSTEM_LINK_ID_DISPLAY_1, &displayPrm, sizeof(displayPrm));

啟動(dòng)鏈接

// start in the order of sink to source

System_linkStart(SYSTEM_LINK_ID_DISPLAY_1);

System_linkStart(SYSTEM_LINK_ID_SW_MS_DEI_0);

System_linkStart(SYSTEM_LINK_ID_CAPTURE);

運(yùn)行時(shí)控制鏈接

while(1)

{

??? //?? sleep few seconds???? sleep(10);

?

?? //? 改變mosaic 布局, 保持其他布局參數(shù)和初始化時(shí)刻的一樣

?? swMsPrm.layoutPrm.outLayoutMode = SYSTEM_LAYOUT_MODE_7CH_PLUS_1CH;??? System_linkControl(

???????????? SYSTEM_LINK_ID_SW_MS_DEI_0,?

???????????? SYSTEM_SW_MS_LINK_CMD_SWITCH_LAYOUT,?

&swMsPrm.layoutPrm,?????????????? sizeof(swMsPrm.layoutPrm),?

??? ??????????TRUE

????????????? );

?

?? // 檢查鏈?zhǔn)欠癜凑沼脩糨斎氲淖?/span>

??? if(userIsDone())??????? break;

}

停止鏈接

// 按源到sink的順序停止

System_linkStop(SYSTEM_LINK_ID_CAPTURE);

System_linkStop(SYSTEM_LINK_ID_SW_MS_DEI_0);

System_linkStop(SYSTEM_LINK_ID_DISPLAY_1);

刪除鏈接

// 任何順序都可以

System_linkDelete(SYSTEM_LINK_ID_CAPTURE);

System_linkDelete(SYSTEM_LINK_ID_SW_MS_DEI_0);

System_linkDelete(SYSTEM_LINK_ID_DISPLAY_1);

銷毀顯示器控制

//發(fā)送命令到VPSS M3鏈接以初始化顯示控制器。No parameters are passed for de-init沒(méi)有傳遞參數(shù)用于de-init

System_linkControl(

??????? SYSTEM_LINK_ID_M3VPSS,

SYSTEM_M3VPSS_CMD_GET_DISPLAYCTRL_DEINIT,

??????? NULL,

??????? 0,

??????? TRUE

??????? );

?

?

4? 目錄結(jié)構(gòu)

4.1 ?接口文件

McFW的接口文件可以在以下位置找到。所有的接口API都可以從Host A8端調(diào)用

Interface files base path

?

ipnc_rdk\mcfw\interfaces

?

McFW API - Interface files ipnc_rdk\mcfw\interfaces

?

ti_vcap.h

視頻捕捉子系統(tǒng)接口

ti_vcam.h

攝像機(jī) (ISP) 子系統(tǒng)接口

ti_vdec.h

視頻解碼子系統(tǒng)接口

ti_vdis.h

視頻顯示子系統(tǒng)接口

ti_vdis_timings.h

視頻顯示子系統(tǒng)接口

(timings)

ti_venc.h

視頻編碼子系統(tǒng)接口

ti_mjpeg.h

基于SIMCOP的視頻編碼(MJPEG

?

?

子系統(tǒng)接口

ti_vsys.h

系統(tǒng)配置接口

ti_media_common_def.h

公共數(shù)據(jù)結(jié)構(gòu)定義

ti_media_error_def.h

錯(cuò)誤定義

ti_media_std.h

數(shù)據(jù)類型

Link API - Interface files

ipnc_rdk\mcfw\interfaces\link_api

system.h

Common Link APIs and 數(shù)據(jù)結(jié)構(gòu)

system_common.h

系統(tǒng)級(jí)const,數(shù)據(jù)結(jié)構(gòu),所有處理器共用的函數(shù)。 User does not use the const 's, function's, data structure defined in this file directly用戶不使用常量的,函數(shù),數(shù)據(jù)結(jié)構(gòu),在這個(gè)文件中定義的直接

system_const.h

常見(jiàn)的全系統(tǒng)的常量和枚舉的。用戶可以使用const,在鏈接API中的此文件中定義

system_debug.h

定義的控制調(diào)試信息的打印。如果修改這需要重建BIOSlinux端代碼以使更改生效。 ?

system_linkId.h

32位鏈接IDproc ID和其他實(shí)用程序宏來(lái)操作鏈接ID

system_tiler.h

APIs to allocate memory from Tiler region

systemLink_common.h

系統(tǒng)鏈接API,它在所有從處理器的常見(jiàn)

(VPSS M4, Video M3, DSP) VPSS M4Video M3DSP

?

systemLink_m3video.h

System Link API specific to Video M3 processor

systemLink_m3vpss.h

System Link API specific to VPSS M3 processor

systemLink_c6xdsp.h

System Link API specific to C64x processor

captureLink.h

視頻捕獲 Link API

sclrLink.h

HDVPSS Scalar Link API

ispLink.h

ISP Memory to memory Link API

glbceLink.h

GLBCE Link API

avsync.h

音頻視頻同步 Link API

algLink.h

算法 Link API

cameraLink.h

圖像捕獲 (ISS) API Link

decLink.h

視頻解碼 (H264) Link API

deiLink.h

Deinterlacer Link API

displayLink.h

顯示 Link API

dupLink.h

幀復(fù)制器 Link API

encLink.h

視頻編碼 (H264) Link API?

grpxLink.h

圖形 Link API

ipcLink.h

IPC (內(nèi)部處理器間的通信) Link API

mergeLink.h

框架合并 Link API

vaLink.h

視頻分析 (C64x) Link API

swosdLink.h

軟件 OSD Link API

swMsLink.h

軟件 mosaic Link API

mjpegLink.h

MJPEG 編碼 (SIMCOP) API Link

nsfLink.h

噪聲濾波器 Link API

vnfLink.h

視頻噪聲濾波器 (SIMCOP) API Link

fdLink.h

面部檢測(cè)引擎 Link

osdLink.h

OSD link

nullLink.h

Dummy / Null sink Link API

nullSrcLink.h

Dummy / Null source Link API

swMsLink.h

Software Mosaic Link API

vidbitstream.h

視頻比特流的數(shù)據(jù)結(jié)構(gòu).不被用戶直接使用.

?

4.2 ?模板示例代碼

McFW API Examples

?

ipnc_rdk\ipnc_mcfw\demos\mcfw_api_demos

demos展示McFW APIs的用法

ipnc_rdk\ipnc_mcfw\demos\ mcfw_api_demos\stream

連接到RTSP流棧和音頻/視頻流服務(wù)器的鏈路

ipnc_rdk\ipnc_mcfw\demos\ mcfw_api_demos\itt

圖像調(diào)整工具服務(wù)器線程. 此線程偵聽(tīng)TCP端口上的ITT連接,并協(xié)調(diào)客戶端CMD/DATA發(fā)送和接收

ipnc_rdk\ipnc_mcfw\demos\audio_sample

視頻捕捉 / 回放示例代碼

?

4.3 ?庫(kù)

McFW API Examples

?

ipnc_rdk\demos\mcfw_api_demos

demos展示McFW APIs的用法

?

5? 額外細(xì)節(jié)

5.1 ???內(nèi)部處理器通信詳細(xì)信息

5.2 ???內(nèi)存映射詳細(xì)信息

請(qǐng)參閱隨發(fā)行版提供的IPNC_RDK_MemoryMapAnalysis.pdf

The memorymap of the complete IPNC RDK software is controlled in the following files:完整的IPNC RDK軟件的存儲(chǔ)器映射在以下文件中進(jìn)行控制:

ipnc_rdk\ipnc_mcfw\mcfw\src_bios6\cfg\config_512M.bld ipnc_rdk \ ipnc_mcfw \ mcfw \ src_bios6 \cfg \ config_512M.bld

To modify thememory map, user needs to modify the above mentioned files, but the followingkey considerations are required:要修改內(nèi)存映射,用戶需要修改上述文件,但需要以下關(guān)鍵注意事項(xiàng):

§? Code section of Video and VPSS M3 has to lie in the top256MB of the available memory map視頻和VPSS M3的代碼段必須位于可用內(nèi)存映射的頂部256MB

§? A section of minimum 2MB need to be reserved forSyslink-Notify support in linux kernel.在Linux內(nèi)核中,需要為Syslink-Notify支持保留一個(gè)最小2MB的段。 Linux kernel uses this memory to communicate with VPSS M3 in IPNCRDK. Linux內(nèi)核使用此內(nèi)存與IPNC RDK中的VPSS M3通信。 Any change in address for this section requires an update ofbootargs for “ notifyk.vpssm3_sva ” boot parameter在地址段中的任何改變都需要bootargs的更新“notifyk.vpssm3_sva”啟動(dòng)參數(shù)

§? A section of minimum 2MB is required to be reserved forFBDev buffer for IPNC RDK.對(duì)于IPNC RDK,需要為FBDev緩沖區(qū)保留最小2MB的段。 Any change in the buffer base address need to be updated in thefollowing line in ipnc_rdk \ ipnc_mcfw \bin\ load.sh o insmod./kermod/vpss.ko omx=1 sbufaddr= 0xbfb00000在緩沖區(qū)基址需要的任何變化在以下行ipnc_rdk\ ipnc_mcfw\ BIN \ load.sh

§? Insmod./kermod/vpss.ko OMX = 1 sbufaddr = 0xbfb00000更新

§? A section of 1MB is required for remote debug prints tobe shared across all cores.要在所有內(nèi)核之間共享遠(yuǎn)程調(diào)試打印,需要1MB的部分。 In current system, A8 utility continuously reads the shared memoryand dumps the debug messages on A8.在當(dāng)前系統(tǒng)中,A8實(shí)用程序連續(xù)讀取共享內(nèi)存,并在A8上轉(zhuǎn)儲(chǔ)調(diào)試消息。 Any change to this address need a change in the following line in對(duì)此地址的任何更改都需要更改以下行

ipnc_rdk\ipnc_mcfw\bin\scripts\wait_cmd.sh,ipnc_rdk\ipnc_mcfw\bin\scripts\send_cmd.sh and ipnc_rdk\ipnc_mcfw\bin\scripts\send_str.sh

o../bin/remote_debug_client.out0xbff00000 --waitch $1 $2

5.3 ??顯示控制器和顯示功能詳細(xì)信息

5.3.1 ?靜態(tài)改變顯示分辨率

MCFW支持在靜態(tài)時(shí)改變VGA顯示的顯示分辨率。Following VESA resolutions aretested on display VGA, ON-chip HDMI, OFF-chip HDMI.以下VESA分辨率在顯示VGA,片上HDMI,關(guān)閉芯片HDMI上測(cè)試。

?1080P60 (1920 * 1080) 1080P601920 * 1080

?720P (1280 * 720) 720P1280* 720

?XGA (1024 * 768) XGA1024* 768

?SXGA (1280 * 1024) SXGA1280* 1024

By default, for ti812x HDMIand DVO2 are tied together .默認(rèn)情況下,ti812x HDMI和DVO2捆綁在一起Itmeans when these VENCs are configured same resolution must be passed to DVO2and HDCOMP.這意味著當(dāng)這些VENC配置相同時(shí),必須將分辨率傳遞給DVO2HDCOMPAlso, same content will be displayed onboth outputs.此外,相同的內(nèi)容將顯示在兩個(gè)輸出上。Regarding clocks, VENC 'D' clock drivesHDMI (on chip HDMI) and VENC 'A' clock drives DVO2 and HDCOMP.關(guān)于時(shí)鐘,VENC'D'時(shí)鐘驅(qū)動(dòng)HDMI(片上HDMI),VENC'A'時(shí)鐘驅(qū)動(dòng)DVO2HDCOMPThereis no change regarding SD VENC and SD VENC clock.關(guān)于SD VENCSD VENC時(shí)鐘沒(méi)有變化。

If DisplayController configuration needs to be changed it can be done by modifying defaultconfiguration set for gSystem_dctrlTriDisplayConfig in system_dctrl_ti814x.c Tounderstand the mesh of components in display controller please referHDVPSS_UserGuide.pdf in hdvpss package, UserGuideHdvpssDisplayDriver section.如果顯示控制器配置需要改變它可以通過(guò)在system_dctrl_ti814x.c修改默認(rèn)配置集為gSystem_dctrlTriDisplayConfig要理解部件的網(wǎng)眼中顯示控制器請(qǐng)參照hdvpss,UserGuideHdvpssDisplayDriver部 HDVPSS_UserGuide.pdf來(lái)完成

?5.4 ?IPNC 應(yīng)用程序配置

IPNC RDK適用于DM8127DM385 soc平臺(tái)。主要有四種用例配置可供用戶選擇,如下所示:

1.???Tri-stream 低功耗模式

2.???Tri-stream 全功能模式

3.???捕獲顯示模式

除了上述四個(gè)選項(xiàng)之外,還向用戶提供了用于選擇諸如TILER模式的一些高級(jí)選項(xiàng)的靈活性。In this section we discussdetails of the above configurability options and the steps for configuration.在本節(jié)中,我們將討論上述可配置性選項(xiàng)的詳細(xì)信息和配置步驟。

還請(qǐng)注意,DM38x不支持C64x,并且具有比DM812x更低的DDR帶寬。From usecaseperspective the VA and C64x related data flows will not apply to DM38x versionof RDK.從使用者角度來(lái)看,VAC64x相關(guān)數(shù)據(jù)流將不適用于DM38x版本的RDK

5.4.1 ?平臺(tái)選擇

用戶需要在編譯IPNC RDK之前定義目標(biāo)平臺(tái)。 Currently supported options are:當(dāng)前支持的選項(xiàng)有:

IPNC_DEVICE:= DM385, DM388 or DMVA3 IPNC_DEVICE= DM385DM388DMVA3

IPNC_DEVICE:= DM812x IPNC_DEVICE= DM812x

Pleasecomment off the platform which is not targeted. 請(qǐng)注釋掉沒(méi)有定位的平臺(tái)。

5.4.2 ?三流低功率

IPNC三流低功耗應(yīng)用程序已配置為演示具有最低功耗配置的三流配置(1080p 60fps + D1 30fps + MJPEG 5fps)。實(shí)現(xiàn)低功耗DSSDSP已關(guān)閉。這意味著功能,如額外的標(biāo)量; dsp框架,hd-vpss視頻噪聲過(guò)濾器,hdmi視頻輸出等將不可用。

For selecting low power configurationfollow the following steps:對(duì)于選擇低功耗配置,請(qǐng)按照以下步驟操作:

OpenRules.makefile and make the following changeRules.make打開(kāi)文件,并進(jìn)行以下更改

IPNC_CONFIG := LOW_POWERIPNC_CONFIG= LOW_POWER

Run'make all'command to regenerate the binaries運(yùn)行make all”命令來(lái)重新生成二進(jìn)制文件

5.4.3 ?三流全功能

IPNC三流全功能應(yīng)用在標(biāo)準(zhǔn)低功耗配置中增加了視頻噪聲濾波器和面部檢測(cè)功能。 HDMI & SD Display are also available in full featureconfiguration mode. HDMISD顯示也可在全功能配置模式下使用。

To enable full-feature configuration usermust follow the following procedure:要啟用全功能配置,用戶必須遵循以下過(guò)程:

OpenRules.makefile and make IPNC_CONFIG := FULL_FEATURERules.make打開(kāi)文件并進(jìn)行IPNC_CONFIG=FULL_FEATURE

Run'make all'command to regenerate the binaries運(yùn)行make all命令來(lái)重新生成二進(jìn)制文件

5.4.4 ??全功能NF 選擇

IPNC三流全功能應(yīng)用程序?qū)崿F(xiàn)兩個(gè)噪聲濾波器路徑。 First path uses the 3D noise filter from the DSS subsystem and thesecond path uses the ISS NSF2+TNF implementation in the SIMCOP.第一路徑使用來(lái)自DSS子系統(tǒng)的3D噪聲濾波器,第二路徑使用SIMCOP中的ISS NSF2 + TNF實(shí)現(xiàn)。 The user can do the noise filter selection using the followingcompile time switch:用戶可以使用以下編譯時(shí)開(kāi)關(guān)進(jìn)行噪聲濾波器選擇:

Select'VNF MODE'menu item from Camera Page.選擇攝像機(jī)Page“VNF MODE”菜單項(xiàng)。

HIGH SPEED will choose DSS VNF and HIGHQUALITY will choose ISS VNF.HIGH SPEED將選擇DSS VNFHIGH QUALITY將選擇ISS VNFIf DM388, HIGH QUALITY willchoose MCTNF如果DM388HIGH QUALITY將選擇MCTNF

5.4.5 ?智能分析或視頻分析模式

IPNC三流完整功能usecase實(shí)現(xiàn)Smart Analytics示例。 To enable Smart Analyticsexample user must follow the following procedure:要啟用SmartAnalytics示例用戶,必須遵循以下過(guò)程:

1.Select'SMART ANALYTICS'menu item from Example drop down menus.從實(shí)例智能分析菜單項(xiàng)下拉菜單。

2.Once the application is restartedSmart Analytics links appears on left side panel.應(yīng)用程序重新啟動(dòng)后,Smart Analytics鏈接將顯示在左側(cè)面板上。

?

5.4.6 ?捕獲顯示模式

IPNC用戶程序集實(shí)現(xiàn)一個(gè)例子,只做傳感器捕獲,YUV轉(zhuǎn)換和顯示。 This is an important examplebecause it allows users to use a simple application for testing image qualitybefore encode and also helps during sensor bringups.這是一個(gè)重要的例子,因?yàn)樗试S用戶使用一個(gè)簡(jiǎn)單的應(yīng)用程序在編碼之前測(cè)試圖像質(zhì)量,也有助于在傳感器提出。

To switch on capture-display example chain,user must follow the following steps:要打開(kāi)capture-display示例鏈,用戶必須按照以下步驟操作:

1.OpenRules.makefile and make CAPTURE_DISPLAY_MODE_ON := YESRules.make打開(kāi)文件并進(jìn)行CAPTURE_DISPLAY_MODE_ON= YES

2.Run'make all'command to regenerate the binaries運(yùn)行make all”命令來(lái)重新生成二進(jìn)制文件

5.4.7 ?RAWYUV發(fā)送到A8

在捕獲顯示模式下,用戶還可以選擇將在ISS中捕獲的RAWYUV幀發(fā)送到A8,這允許在A8上運(yùn)行的應(yīng)用程序?qū)D像幀保存在文件系統(tǒng)中或通過(guò)網(wǎng)絡(luò)發(fā)送它們,以進(jìn)行任何調(diào)試和調(diào)整目的。 It also shows an example of IPCcommunications between M3 and A8 for sharing frame buffers.它還示出了用于共享幀緩沖器的M3A8之間的IPC通信的示例。

Toconfigure this option in Rules.make:要在Rules.make中配置此選項(xiàng):

1.SetFRAMES_TO_A8 to YUV, YUV frames of the secondary stream will do a round tripM3-A8-M3 to reach the SD display.FRAMES_TO_A8設(shè)置為YUV,輔助流的YUV幀將進(jìn)行往返M3-A8-M3以到達(dá)SD顯示。

2.SetFRAMES_TO_A8 to RAW, RAW frames will be sent to A8 and then back to M3 beforegetting converted to YUV.FRAMES_TO_A8設(shè)置為RAWRAW幀將發(fā)送到A8,然后返回到M3,然后再轉(zhuǎn)換為YUV

3.SetFRAMES_TO_A8 to NO, which is the default option, will disable the above IPCframe exchange.FRAMES_TO_A8設(shè)置為NO(默認(rèn)選項(xiàng))將禁用上述IPC幀交換。

Thisoption only applies in the capture display mode.此選項(xiàng)僅適用于捕獲顯示模式。 When YUV or RAW frames exchange isswitched on, the sensor output frame rate is configured to 30fps.當(dāng)YUVRAW幀交換打開(kāi)時(shí),傳感器輸出幀速率配置為30fps

5.4.8 ?????? 256MB 內(nèi)存映射

IPNC RDK還支持256MB內(nèi)存映射作為縮減內(nèi)存示例:

Open Rules.make file andmake MEMORY_CONFIG := 256MB 1.Rules.make打開(kāi)文件并進(jìn)行MEMORY_CONFIG=256MB

Run ' make all 'command to regenerate the binaries 2.運(yùn)行make all命令來(lái)重新生成二進(jìn)制文件

5.4.9 ??? TILER 模式

IPNC RDK支持TILER模式,用戶可以評(píng)估TILER模式功能以及DDR使用效率的相關(guān)改進(jìn)。 Currently TILER mode is limited to Low Power configuration only.當(dāng)前TILER模式僅限于低功率配置。 For selecting the TILERmode:選擇TILER模式:

1.OpenRules.makefile and make IPNC_TILER_ENABLE := YESRules.make打開(kāi)文件并進(jìn)行IPNC_TILER_ENABLE= YES

CAMERA_TILER_ENABLE := YESCAMERA_TILER_ENABLE= YES

BTE_ENABLE := YESBTE_ENABLE= YES

2.Run'make all'command to regenerate the binaries Note: 運(yùn)行make all命令來(lái)重新生成二進(jìn)制文件注意:

In this release TILER mode is enabled onlyfor low power mode.在此版本中,TILER模式僅在低功耗模式下使能。


?

IPNC LowPower Demo Tristream1080p60fps + D1@30fps +MJPEG@5fps

IPNC FullFeature Demo 1080p60fps + D1@30fps + MJPEG@5fps +ISS/DSSVNF + FD(face-detect) +VA

IPNC FullFeature Demo 1080p60fps+ D1@30fps + MJPEG@5fps +

MCTNF + FD(face-detect) +VA

?

IPNC CaptureDisplay Demo

5.5 ?智能/視頻分析

智能/視頻分析(VA)算法檢測(cè)和跟蹤視頻流中的對(duì)象。支持的基本VA算法是Trip Zone,攝像機(jī)篡改檢測(cè)和對(duì)象計(jì)數(shù)。VA算法在C647 DSP上運(yùn)行。當(dāng)VA事件發(fā)生時(shí),事件是SWOS顯示的,并且還由Web GUI指示。

5.6 ?視頻幀緩沖接口

IPNC RDK還提供訪問(wèn)視頻幀緩沖區(qū)的接口,可以是RAWYUV幀。

McFWprovides the following APIs for interacting with video frame buffers McFW提供以下API用于與視頻幀緩沖區(qū)交互

Receivingframe buffers:接收幀緩沖區(qū):

Vcam_getFullVideoFrames Vcam_getFullVideoFrames API to get captured RAW/YUV frames from the front end (camera) - API來(lái)獲得拍攝的RAW / YUV從前端幀(相機(jī))

Vcam_putEmptyVideoFrames Vcam_putEmptyVideoFrames- - API to free RAW/YUV frame buffers consumed bythe application API來(lái)釋放應(yīng)用程序所消耗的RAW / YUV幀緩沖區(qū)

Sendingframe buffers:發(fā)送幀緩沖區(qū):

Vdis_putFullVideoFrames Vdis_putFullVideoFrames API to send RAW/YUV frames to the back end -API發(fā)送RAW / YUV幀發(fā)送到后端

(display) (顯示)

Vdis_getEmptyVideoFrames Vdis_getEmptyVideoFrames- - API to take back RAW/YUV frame buffersconsumed by McFW API以收回McFW使用的RAW / YUV幀緩沖區(qū)

The keydata structure having the frame buffer info is:具有幀緩沖區(qū)信息的關(guān)鍵數(shù)據(jù)結(jié)構(gòu)是:

VIDEO_FRAMEBUF_LIST_S . VIDEO_FRAMEBUF_LIST_S

Definedin ipnc_rdk/mcfw/interfaces/ti_media_common_def.h as typedef struct {ipnc_rdk / mcfw / interfaces / ti_media_common_def.h中定義為typedef struct {

UInt32 numFrames; UInt32 numFrames;

VIDEO_FRAMEBUF_S frames[VIDEO_FRAMEBUF_MAX]; VIDEO_FRAMEBUF_S frames[VIDEO_FRAMEBUF_MAX];

} VIDEO_ FRAMEBUF_LIST_S; } VIDEO_ FRAMEBUF_LIST_S;

TheVIDEO_ FRAMEBUF_LIST_S structure has the following members: VIDEO_ FRAMEBUF_LIST_S結(jié)構(gòu)具有以下成員:

numBufs :Indicates the number of valid entries in the frames array (details follow) numBufs:表示frames數(shù)組中的有效條目數(shù)(詳細(xì)信息如下)

Thisnumber should be <= VIDEO_FRAMEBUF_MAX此數(shù)字應(yīng)為<=VIDEO_FRAMEBUF_MAX

frames:Array of VIDEO_FRAMEBUF_S structures framesVIDEO_FRAMEBUF_S結(jié)構(gòu)的數(shù)組

Eachelement in this array represents _one_ RAW/YUV frame from aparticular channel此數(shù)組中的每個(gè)元素都代表一個(gè)特定的頻道_one_ RAW / YUV框架

TheVIDEO_FRAMEBUF_S has the following members:VIDEO_FRAMEBUF_S具有以下成員:

addr:Buffer start address for each field/plan of the frame buffer. addr:幀緩沖區(qū)的每個(gè)字段/計(jì)劃的緩沖區(qū)起始地址。This is the user space virtual address.這是用戶空間虛擬地址。The application should use this address if it wants to access theframe buffer via CPU (eg: memcpy)如果應(yīng)用程序想要通過(guò)CPU訪問(wèn)幀緩沖區(qū)(例如:memcpy),則應(yīng)使用此地址。

phyAddr:Physical address of start for each field/plan of the frame buffer. phyAddr:幀緩沖區(qū)的每個(gè)字段/計(jì)劃的開(kāi)始的物理地址。Can be used for EDMA APIs可用于EDMA API

channelNum:Channel ID. channelNum:通道IDShould be from 0 to VCAM_STRM_MAX-1應(yīng)該從0VCAM_STRM_MAX-1

timestamp:Timestamp associated with the frame. timestamp:與幀相關(guān)聯(lián)的時(shí)間戳。

fid:Indentifies whether this is a top field/bottom field/frame. fid:標(biāo)識(shí)這是頂場(chǎng)還是底場(chǎng)/幀。

0: Evenfield or Frame based, 1: Odd Field – frameWidth: Width of the frame in pixels. 0:偶場(chǎng)或基于幀,1:奇數(shù)場(chǎng)- frameWidth:以像素為單位幀的寬度。

frameHeight:Height of the frame in lines. frameHeight:行的高度。

framePitch:Stride for each plan of the frame. framePitch:幀的每個(gè)計(jì)劃的步幅。

Frame Receive Operation幀接收操作

In orderto receive notifications about available RAW/YUV frames on the Linux side, theuser application needs to call the below function:為了在Linux端接收關(guān)于可用RAW / YUV幀的通知,用戶應(yīng)用程序需要調(diào)用以下函數(shù):

Int32 Vcam_ registerCallback(VCAM_CALLBACK_S * callback, Ptr arg) Create time API toregister application callback. INT32 Vcam_ registerCallbackVCAM_CALLBACK_S *回調(diào),PTR ARG-創(chuàng)建時(shí)間API來(lái)注冊(cè)應(yīng)用程序的回調(diào)。

The callback will be invoked each time whennew frame buffers are available.每當(dāng)新的幀緩沖區(qū)可用時(shí),將調(diào)用回調(diào)。

The application can use the callback tosynchronize invocation of the Vcam_getFullVideoFrames應(yīng)用程序可以使用回調(diào)同步Vcam_getFullVideoFrames的調(diào)用API. API

The usageof above functions is demonstrated in the capture display use case withFRAMES_TO_A8 option enabled.在啟用FRAMES_TO_A8選項(xiàng)的捕獲顯示用例中演示了上述函數(shù)的用法。 One taskis created and waits for the notification from VCAM of the available RAW/YUVframes, then it takes these buffers from VCAM and eventually send them to VDISfor consummation.創(chuàng)建一個(gè)任務(wù),并等待來(lái)自VCAM的可用RAW / YUV幀的通知,然后從VCAM獲取這些緩沖區(qū),并最終將它們發(fā)送到VDIS以完成。 At the same time it takes consumedframes from VDIS and releases them back to VCAM.同時(shí),它從VDIS消耗幀并將其釋放回VCAM

Pleaserefer to the source code in ti_mcfw_ipcframes.c for more implementationdetails.有關(guān)更多實(shí)現(xiàn)詳細(xì)信息,請(qǐng)參閱ti_mcfw_ipcframes.c中的源代碼。

?

?

?

總結(jié)

以上是生活随笔為你收集整理的IPNC_RDK_McFW_UserGuide的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。