susi media player api author: eric liang. outline introduction of susi player api gstreamer (open...

12
SUSI Media Player API Author: Eric Liang

Upload: claribel-houston

Post on 20-Jan-2016

235 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: SUSI Media Player API Author: Eric Liang. Outline Introduction of SUSI Player API GStreamer (Open Source Multimedia Framework) SUSI Player API Framework

SUSI Media Player API

Author: Eric Liang

Page 2: SUSI Media Player API Author: Eric Liang. Outline Introduction of SUSI Player API GStreamer (Open Source Multimedia Framework) SUSI Player API Framework

Outline

• Introduction of SUSI Player API

• GStreamer (Open Source Multimedia Framework)

• SUSI Player API Framework

• Function Specification & Limitation (on iMX6)• SUSI Player API

Page 3: SUSI Media Player API Author: Eric Liang. Outline Introduction of SUSI Player API GStreamer (Open Source Multimedia Framework) SUSI Player API Framework

Introduction of SUSI Player API• SUSI Player is an API for playing/controlling media file.

• Cross-platform – Freescale iMX6, TI OMAP, x86 Linux, x86 Windows …– You only need to develop your application once, and it works

for all supported platform.– You can make use of all the advantages each packaging

system can offer.

Page 4: SUSI Media Player API Author: Eric Liang. Outline Introduction of SUSI Player API GStreamer (Open Source Multimedia Framework) SUSI Player API Framework

GStreamer• GStreamer is a framework for creating streaming media

applications. (LGPL)

• The fundamental design comes from the video pipeline at Oregon Graduate Institute, as well as some ideas from DirectShow.

• Features:– an API for multimedia applications– a plugin architecture– a pipeline architecture– a mechanism for media type handling/negotiation– over 150 plug-ins– a set of tools

Page 5: SUSI Media Player API Author: Eric Liang. Outline Introduction of SUSI Player API GStreamer (Open Source Multimedia Framework) SUSI Player API Framework

GStreamer• GStreamer plug-ins could be classified into– protocols handling– sources: for audio and video– formats: parsers, formaters, muxers, demuxers,

metadata, subtitles– codecs: coders and decoders– filters: converters, mixers, effects, ...– sinks: for audio and video

Page 6: SUSI Media Player API Author: Eric Liang. Outline Introduction of SUSI Player API GStreamer (Open Source Multimedia Framework) SUSI Player API Framework

GStreamer

• GStreamer pipeline for a simple ogg player

Page 7: SUSI Media Player API Author: Eric Liang. Outline Introduction of SUSI Player API GStreamer (Open Source Multimedia Framework) SUSI Player API Framework

SUSI Player API Framework

SUSI Player API

Application

* Pure C Code

* Basic Function ( cross-platform)

iMX6 x86Linux

GStreamer

Windows

DirectShow

* INI File

INI Files (Customization

)

Page 8: SUSI Media Player API Author: Eric Liang. Outline Introduction of SUSI Player API GStreamer (Open Source Multimedia Framework) SUSI Player API Framework

SUSI Player API Framework

• SUSIPlayer API’s specification is depend on:– HW Limitation (ex: VPU, GPU, CPU, IPU, Performance … )

– Customer’s request ( ex: 2 Ch video + 1 audio )

• Linux base -> make file + script file + INI• Windows base -> bash file + INI

• INI example: FSL/iMX6_UBC-DS31_Tangale.ini Chip Vendor + Platform+ product + customer MAX_VIDEO_CH = 2, MAX_MUSIC_CH =1, MAX_WIN_RES = 1920x1080, PlayerType = IMX6_GST

Page 9: SUSI Media Player API Author: Eric Liang. Outline Introduction of SUSI Player API GStreamer (Open Source Multimedia Framework) SUSI Player API Framework

Function Specification & Limitation (Tangel)Item Function Our solution

1 可指定 video window 大小及位置 mfw_isink axis-top=0 axis-left=0 disp-width=1920 disp-height=1080

2支持硬解 , 支援 iMX6 支援的影片、聲音格式,不支援的格式 客戶會有軟體做轉壓

video decoder => MPEG4 ASP, H.264 HP, MPEG-2 MP, gst element: vpu audio decoder => MP3, AAC, WAV, gst element: decodebin

3 本地播放  

4 Audio decoder: MP3, AAC, WAV gst-launch filesrc location=/home/Signage/Content/Test/Love.mp3 ! decodebin name=demux demux. ! alsasink5 Audio type: .MP3, .AAC, .WAV

6 Video decoder: MPEG-4 ASP, H.264 HP, MPEG-2 MP gst-launch filesrc location=/home/Signage/Content/Test/Girl2_H264_MP3.avi typefind=true ! aiurdemux name=demux demux. ! queue max-size-buffers=0 max-size-time=0 ! vpudec ! mfw_isink axis-top=0 axis-left=0 disp-width=960 disp-height=1080 demux. ! queue max-size-buffers=0 max-size-time=0 ! beepdec ! alsasink

7 Video type: .MP4, .AVI, .MPG, .MPEG

8 Streaming 播放 Only support VLC streaming H.264+MP3 media file format and protocol is RTSP over UDP

9 H.264 視頻 ( 音訊為 MP3) ,最高 bitrate 為 2Mbps gst-launch rtspsrc location=rtsp://172.17.20.199:8554/Girl2.avi latency=200 name=r r. ! application/x-rtp,media="video" ! queue max-size-buffers=0 max-size-time=0 ! rtph264depay ! vpudec ! mfw_isink axis-top=0 axis-left=960 disp-width=960 disp-height=1080 sync=false async=false r. ! 'application/x-rtp, media=(string)audio' ! queue max-size-buffers=0 max-size-time=0 ! rtpmpadepay ! beepdec ! alsasink sync=false async=false -vvv

10 RTSP over UDP

11此版本提供與 VLC server 對連能力 , 透過 RTSP over UDP

protocol, 其他暫不提供

12 純音訊播放為 MP3 格式,僅有本地播放 gst-launch filesrc location=/home/Signage/Content/Test/Love.mp3 ! decodebin name=demux demux. ! alsasink

13 Stop 的行為模式 : 將 video 影片停止 , 關閉 video 視窗 Player_Stop ( int handl )

14

支持雙顯 :

提供 HDMI + VGA 雙輸出 , 同時輸出 HDMI + VGA 時 ,

會偵測 HDMI 輸出模式 , 複製到 VGA 輸出 ,

是以兩邊螢幕解析度必須一致 , 同時 , 因為是複製輸出 ,

所以兩邊的所播放的內容會完全一樣

general rootfs => HDMI & VGA copy

15 最多可同時輸出 2 Video 呼叫 Player_Play 兩次即可,最多兩個影片同時,第三次呼叫會回傳 over max handler

16同時播放兩組影片時 , 不確定 audio 輸出呈現模式經確認 , 目前 BSP 版本 , 會以 line out 輸出 (HDMI 無 audio 輸出 ), 可支援兩組影片雙聲道

ok, general rootfs default audio output: gts-5000 phone jack, mixer audio is fine

17 Video 在 Foreground 播放,客戶的 UI 和 Picture 會放在 background

 

18 API 需要提供錯誤處理及訊息 API 會做錯誤處理並提供錯誤訊息回報機制

19 IPU Warning Issue 客戶 Pannel max resolution: 1024*768, Mail: 5/30

Page 10: SUSI Media Player API Author: Eric Liang. Outline Introduction of SUSI Player API GStreamer (Open Source Multimedia Framework) SUSI Player API Framework

SUSI Player API • LIB Init

– BOOL SusiDllInit(void);– BOOL SusiDllUnInit(voiod);– char* SusiPlayerGetVersion(WORD *major, WORD *minor1, WORD

*minor2, WORD *build);– int SusiPlayerAvailable(void);

• Media Player API– int SusiPlayerPlay (const char *pURI, const PLAYER_MEDIA_TYPE mediaType,

const PLAYER_SOURCE_TYPE protocol, const WindowPois *pRect,

const BOOL Repeat, const PlayerMsgFunc func,

void* user_data, const char *pExtensionParam,

void* pRev1,void* pRev2, PLAYER_RET_CODE *out_ret);

Page 11: SUSI Media Player API Author: Eric Liang. Outline Introduction of SUSI Player API GStreamer (Open Source Multimedia Framework) SUSI Player API Framework

SUSI Player API

• int SusiPlayerStop(int hanlder )• int SusiPlayerStopAll(void)• int SusiUnInitHandle( int handle )• DWORD SusiPlayerGetDuration(int hanlder )• DWORD SusiPlayerGetPoistion(int hanlder )

• TYPE & Define– typedef void ( *PlayerMsgCbf ) ( int handle, int MsgCode *PLAYER_MSG*/, void* user_data, void* pReserve );– PLAYER_MSG: enum, Msg_Finished, Msg_Err_NoSuchFile …– PLAYER_RET_CODE: enum, Ret_OK, Ret_Err…– PLAYER_MEDIA_TYPE: VIDEO, MUSIC

Page 12: SUSI Media Player API Author: Eric Liang. Outline Introduction of SUSI Player API GStreamer (Open Source Multimedia Framework) SUSI Player API Framework

Q & A