XBMC in IoT Application ( TH language )

36
How to adapt XBMC for IoT application Deaware System Co., LTD หมายเห : เนสไลประกอบการบรรยาย ในงาน cmm maker party 2015 ภายในเวลา 30 นา

Transcript of XBMC in IoT Application ( TH language )

Page 1: XBMC in IoT Application ( TH language )

How to adapt XBMC for IoT application

Deaware System Co., LTD

หมายเหตุ : เป็นสไลด์ประกอบการบรรยายในงาน cmm maker party 2015 ภายในเวลา 30 นาที

Page 2: XBMC in IoT Application ( TH language )

What XBMC/KODI ?

Page 3: XBMC in IoT Application ( TH language )

What is XBMC ?

XBMC ก็แค่โปรแกรมเอาไว้ดูหนังเล่นวีดีโอ ?

Page 4: XBMC in IoT Application ( TH language )

What is XBMC ?

XBMC ก็แค่โปรแกรมเอาไว้ดูหนังเล่นวีดีโอ ?

Page 5: XBMC in IoT Application ( TH language )

What XBMC/KODI ?

Originally developed for XBOX

XBMC = Xbox Media Center

Currently for All platform

Page 6: XBMC in IoT Application ( TH language )

What XBMC/KODI ?

Formally name XBMC but currently called “KODI”

Page 7: XBMC in IoT Application ( TH language )

What XBMC/KODI ?

Free OpenSource media player Available in multiple platform

Page 8: XBMC in IoT Application ( TH language )

Overview

XBMC/Kodi ซัพพอร์ตรูปแบบของไฟล์เสียง วีดีโอ ได้หลากหลายนอกจากนั้นยังสามารถเพิ่มความสามารถโดยการเขียน plugin จาก Third party ได้หลากหลายสำหรับ Plugin โดยหลักการเรียก API ของ XBMC จะใช้ภาษา Python

Page 9: XBMC in IoT Application ( TH language )

Overview

XBMC/Kodi เขียนด้วยภาษา C++ บน OpenGL เป็นหลักทำให้ประสิทธิภาพในการแสดงผลทำได้ดี โดยเฉพาะการแสดง ผล User interfaceโดยเฉพาะบน platform เช่น Embedded System ที่สามารถ รีดเร้นประสิทธิภาพออกมาได้สูง

Page 10: XBMC in IoT Application ( TH language )

Hardware requirement for XBMC/Kodi

เนื่องจาก XBMC/Kodi จำเป็นต้องการใช้ประสิทธิภาพทางด้าน 3D/Video ของระบบฮาร์ดแวร์ที่จะสามารถติดตั้งได้จำเป็นจะต้อง มีฮาร์ดแวร์กราฟิกที่รองรับ OpenGL

Page 11: XBMC in IoT Application ( TH language )

XBMC/Kodi ในมุมมองนักพัฒนา

จุดเด่นที่เราสามารถจับตาได้

Page 12: XBMC in IoT Application ( TH language )

XBMC/Kodi ในมุมมองนักพัฒนา

จุดเด่นที่เราสามารถจับตาได้

เนื่องจากเป็น XBMC เป็น platform ที่สามารถทำ cross-platform ได้และ core code เขียนด้วยภาษา C++ ( ANSI Standard ) ทำให้มีการนำไปปรับแต่ง พร้อมระบบปฏิบัติ เพื่อใช้งานเฉพาะด้านที่ต้องการ ความสามารถในการแสดงผลของ UI เช่นsmart tv box, digital signage, ตู้จำหน่ายสินค้าอัตโนมัติ

Page 13: XBMC in IoT Application ( TH language )

XBMC/Kodi ในมุมมองนักพัฒนา

Page 14: XBMC in IoT Application ( TH language )

XBMC/Kodi ในมุมมองนักพัฒนา

ไม่ใช่แค่ Graphic API, Video API แต่หมายถึง Networking, Database application

ที่สามารถใช้ประโยชน์จาก XBMC ได้

Page 15: XBMC in IoT Application ( TH language )

XBMC/Kodi ในมุมมองนักพัฒนา

ยกตัวอย่างเช่น Raspberry PI

Page 16: XBMC in IoT Application ( TH language )

XBMC/Kodi ในมุมมองนักพัฒนา

XBMC ก็แค่โปรแกรมเอาไว้ดูหนังเล่นวีดีโอ ?

Page 17: XBMC in IoT Application ( TH language )

XBMC/Kodi ในมุมมองนักพัฒนา

XBMC ก็แค่โปรแกรมเอาไว้ดูหนังเล่นวีดีโอ ?

ตัวอย่างโอกาสทางธุรกิจของโปรแกรมที่เกิดขึ้นจริง

Page 18: XBMC in IoT Application ( TH language )

XBMC/Kodi ในมุมมองนักพัฒนา

Digital signage made on raspberry pi with XBMC

Page 19: XBMC in IoT Application ( TH language )

XBMC/Kodi ในมุมมองนักพัฒนา

Page 20: XBMC in IoT Application ( TH language )

XBMC/Kodi ในมุมมองนักพัฒนา

Web management

Broadcast content

Broadcast content

Page 21: XBMC in IoT Application ( TH language )

XBMC/Kodi ในมุมมองนักพัฒนา

Web management

Broadcast content

Broadcast content

สื่อประชาสัมพันธ์เป็นตลาด ที่ใหญ่มาก

Page 22: XBMC in IoT Application ( TH language )

XBMC/Kodi ในมุมมองนักพัฒนา

- ประสิทธิภาพดี - ต้นทุนฮาร์ดแวร์ถูก - ขายได้ราคา- ไม่มีใครสนใจระบบด้านหลัง ว่าใช้คอมหรือ Embedded สำคัญที่สุดคือราคาและคุณภาพ

Page 23: XBMC in IoT Application ( TH language )

XBMC and IoT Application Example ( FreeScale SoC )

Page 24: XBMC in IoT Application ( TH language )

XBMC and IoT Application Example ( Home media Gateway )

- Check Out IoT - Integration with Zigbee and Low level hardware interface- Security Camera, Smart Bulb, Smart phone, Smart Plugin Including

Page 25: XBMC in IoT Application ( TH language )

Home media gateway architecture

Page 26: XBMC in IoT Application ( TH language )

XBMC IoT Gateway

Page 27: XBMC in IoT Application ( TH language )

Home media gateway Demo

Page 28: XBMC in IoT Application ( TH language )

Home media gateway Demo

IP Camera monitoring

Page 29: XBMC in IoT Application ( TH language )

XBMC Plugin for developer ( Python )

ข้อเสียของ XBMC ด้านการพัฒนาคือเอกสารตัวอย่างในการพัฒนาน้อยมาก

อาจจะต้องศึกษาจาก plugin ตัวอย่างแทนและใช้วิธี การอ่าน API ของ Python

Page 30: XBMC in IoT Application ( TH language )

XBMC Plugin for developer ( Python )

XBMC มีความสามารถในการให้นักพัฒนาเขียน Plugin ผ่านภาษา Python ได้โดยเป็นการเรียก API ของ XBMC

Page 31: XBMC in IoT Application ( TH language )

XBMC Plugin for developer ( Python )

Python binding Class in XBMC core

Page 32: XBMC in IoT Application ( TH language )

Hello world plugin example

Add your metadata

Page 33: XBMC in IoT Application ( TH language )

Writing the code ( HelloWorld )

Will popup Helloworld

Page 34: XBMC in IoT Application ( TH language )

XBMC have ability to create GUI

import xbmc, xbmcgui ACTION_PREVIOUS_MENU = 10ACTION_SELECT_ITEM = 7 class MyClass(xbmcgui.Window): def onAction(self, action): if action == ACTION_PREVIOUS_MENU: self.close() if action == ACTION_SELECT_ITEM: self.strAction = xbmcgui.ControlLabel(300, 200, 200, 200, '', 'font14', '0xFF00FF00') self.addControl(self.strAction) self.strAction.setLabel('Hello world') mydisplay = MyClass()mydisplay .doModal()del mydisplay

Page 35: XBMC in IoT Application ( TH language )

Hacking XBMC from C++

Interesting Library - Rendering GUI with OpenGL - Overlay on small embedded system - Video player OMXPlayer and other platform support

Page 36: XBMC in IoT Application ( TH language )

Happy Coding !!!

เดียแวร์ ซิสเต็ม[email protected] facebook.com/deaware