2013年8月7日 星期三

ONVIF -- 如何產生正確的 TopicSet

針對 ONVIF 13.06 test tool 的測試案例 ACCESSCONTROL-12-1-1,進行測試時,
在 Step 4 Validate topics XML representation. 會發生錯誤。

問題是 Test tool 認為 GetEventPropertiesResponse 的 xml 不合法,
錯誤訊息為 "tns1:Configuration/tns1:VideoEncoderConfiguration must be respresennted by a non-qualified element"

查詢event.wsdl內的GetEventPropertiesResponse,可得知問題與 TopicSet 的設定有關,
以下便針對 GetEventPropertiesResponse 內如何產生 TopicSet 作一討論

2013年8月4日 星期日

[xcode] 清除 recent memu

打開 xcode,裡面常常出現許多已經沒有使用的 Project,下面的操作可以將 Project list 整個清空。
  1. Launch Xcode
  2. Select File->Open Recent->Clear Menu
  3. Right-click the Xcode icon and select "Show All Windows". You should now see only your current document in the recents list at the bottom
  4. Quit Xcode. The recents list should now only be populated with your single current project.

FFMPEG -- RTSP and RTP over HTTP

QuickTime 4.1 在 Transport Capability 上,增加了 RTSP
RTSP 可以透過 application/x-rtsp-tunneled,使用 HTTP tunnel 的方式來進行溝通


若要在ffmpeg下使用 RTSP over HTTP,其用法如下:
AVDictionary *opts = 0; if (usesTcp) { int ret = av_dict_set(&opts, "rtsp_transport", "tcp", 0); } err = avformat_open_input(&avfContext, filename, NULL, &opts); av_dict_free(&opts);


參考資料
1. RTSP_Over_HTTP.pdf
2. QuickTime Streaming Server Modules Programming Guide
3. http://stackoverflow.com/questions/14459513/rtsp-tunneled-http-ffmpeg
ttps://developer.apple.com/quicktime/icefloe/dispatch028.html
4. State Machine http://docs.lscube.org/rtsp.xhtml


2013年8月2日 星期五

gSOAP -- Empty Element Tag 的產生規則整理

若一個 xml elemnt 為空,一般有兩種表示方式。
<tag></tag>
<tag />

那麼當使用 gSoap 建議的 onvif schema 產生程式碼後,如何確認哪些函數會生成 <tag />的形式呢?
gSOAP 的 stdsoap2.c中會透過soap_element_start_end_out()函數產生 "/>" 的標籤,而透過 onvif schema 所產生的程式碼,主要會透過呼叫 stdsoap2.c其中的三個函數 soap_element_href(), soap_element_null(), soap_element_nil()來產生 "/>" 的標籤。 
由於 gSoap 會自動根據 wsdl 產生 header file, 接著自動產生程式碼。
因此若我們想要強制其產生</>,則不應該手動呼叫上述的三個函數,
而應該了解其生成原理。藉著修改wsdl, 或是 header file, 來達成此功能。

2013年8月1日 星期四

[Embedded] TFTP 使用舉例

今天因為手殘,結果更新ipcam韌體失敗,一開機就出現了 kernal panic。只好複習一下使用 uboot 更新韌體的方法。以下將今天的作法作一記錄。

TFTP Server (使用 ubuntu v12.04)

1. 用apt-get直接裝TFTP server套件。
sudo apt-get install tftpd-hpa

2. 視需要修改設定值
視需要修改/etc/init/tftpd-hpa.conf, /etc/init.d/tftpd-hpa, /etc/default/tftpd-hpa
可使用 "ps -A|grep tftp" 檢視是否服務有正確啟動
若沒有正確啟動,執行下列命令 sudo service tftpd-hpa restart
3. 將要傳輸的檔案放置到 /var/lib/tftpboot
例如: cp uImage_ipnc_DM365 /var/lib/tftpboot
註:若在Windows環境,可使用這個 tftp server http://tftpd32.jounin.net/

2013年6月29日 星期六

Linux 下 IPC 的運作方式


IPC溝通的有許多方式,例如:Shared Memory, Message Queue, PIPE, FIFO, Unix Socket 等等。
下面將會整理 Linux 下常見的 IPC 的運作方式舉例。

ONVIF -- Event by RTSP Stream 實作探討

ONVIF 針對 Event 的傳送定義了三種方式,Basic Notification Interface,Real-time Pull-Point Notification Interface與 RTSP metadata stream 的方式。

由於實作 ONVIF 與 RTSP 的開發人員可能並不相同,因此在實作RTSP metadata stream時溝通可能會有誤解。以下對這種情況提出一種簡單的合作開發方式。

ONVIF:
當使用者想要建立一個 RTSP Stream 時,會先透過 GetStreamUri 詢問對應的 RTSP URI。
如果 GetStreamUri 的 Profile 內有定義 MetadataConfiguration,便表示後續使用者使用此 URI 建立 RTSP 時,RTSP 所回應的 SDP 內需要加入 metadata 的描述。 
可以使用 IPC 的方式來通知 RTSP 加入 metadata。此處假設使用 shared memory,設定 gIsMetadata = TRUE。