Дмитрий Рыжков_widi android intel

43
Использование Presentation API и Intel ® Wireless Display в приложения для Android Дмитрий Рыжков Инженер по программному обеспечению Intel Corporation

Upload: apps4all

Post on 14-Nov-2014

1.739 views

Category:

Technology


6 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Дмитрий Рыжков_WiDi Android Intel

Использование Presentation APIи Intel® Wireless Display

в приложения для Android

Дмитрий РыжковИнженер по программному обеспечению

Intel Corporation

Page 2: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

Содержание

• Miracast* и Intel® Wireless Display• Совместимые устройства• Режимы работы и модели использования• Демонстрация• Android* Presentation API• Резюме

Page 3: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

Содержание

• Miracast* и Intel® Wireless Display• Совместимые устройства• Режимы работы и модели использования• Демонстрация• Android* Presentation API• Резюме

Page 4: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

Что такое Miracast*?

• Miracast* стандарт беспроводной передачи мультимедийного сигнала, принятый и утверждённый объединением Wi-Fi Alliance

• Беспроводная альтернатива HDMI*/MHL*• Построен на базе существующих стандартов

– H.264 (кодирование) и WiFi Direct (транспорт)

• Основан на спецификации Intel® Wi-Fi Display• Является открытым стандартом• Имеет поддержку в Android* 4.2

Это не DLNA или ChromeCast

Page 5: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

Что такое Intel® Wireless Display (WiDi)

• Два режима работы– Редим клонирования (с помощью Android*

media framework)– Расширенный режим (отдельные

представления для каждого экрана)

• Доступен на большинстве устройств с Intel® Atom™ SOCs

Intel® WiDi совместим WFA Miracast*

• Сертифицирован WFA Miracast*– Совместим с сертифицированными Miracast* устройствами.

• Поддерживает HD видео (1080p/60 + 5.1 аудио)• Защита передаваемого контента (HDCP2.1)

Page 6: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

Как работает Miracast*

Wi-Fi Direct*

Audio/Video Payload

Control

Content

Composition of Audio/Video

frames, graphics and

text

Device capability negotiation and

session maintenance

Device capability negotiation and

session maintenance

Decoding RenderingEncoding

Page 7: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

Содержание

• Miracast* и Intel® Wireless Display• Совместимые устройства• Режимы работы и модели использования• Демонстрация• Android* Presentation API• Резюме

Page 8: Дмитрий Рыжков_WiDi Android Intel

Полный список устройств доступен на http://www.wi-fi.org/wi-fi-certified-miracast

Адаптеры• Actiontec* ScreenBeam Pro• Netgear* (ex: PTV3000)• Viewsonic (WPG-370)• Acer*

• Best Buy* Rocketfish*

• Lenovo*

• …

Проекторы• Dell*

• Seiko Epson *• Ricoh*• LG*• …

Телевизоры• Samsung*• Toshiba*• LG*• TCL*• Sharp*• Philips*• …

Сертифицированные устройства

Intel® WiDi Certified

Page 9: Дмитрий Рыжков_WiDi Android Intel

Intel® WiDi на Intel® Atom™ SoCs

Низкая задержка

Совместим с WFA Miracast*

Простое подключение

Поддержка 1080p видео

Индикаторы состояния

Автоматический выбор канала ABG

Page 10: Дмитрий Рыжков_WiDi Android Intel

Совместимые устройства на Android* 4.2.x с поддержкой Presentation API

Устройство Сертифицировано Miracast*

HDMI*, MHL* или SlimPort*

Samsung* Galaxy S4 Да Да

Samsung Galaxy Tab3 10.1 Нет Да

Sony* Xperia Z Да Да

LG* Optimus G Да Да

Nexus* 4 Да Да

HTC* One Да Да

Lenovo* K900 Да Нет

Asus* MeMO Pad FHD10 Да Да

Page 11: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

Подключение Wireless Display в Android*

Sony* Xperia Z Stock/Intel® Samsung* Galaxy S4

Page 12: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

Содержание

• Miracast* и Intel® Wireless Display• Совместимые устройства• Режимы работы и модели использования• Демонстрация• Android* Presentation API• Резюме

Page 13: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

Режим клонирования (по умолчанию)

• После подключения пользователь видит экран мобильного устроства на телевизоре

• Используется разрешение мобильного устройства• От разработчика не требуется никаких изменений

Page 14: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

• Внешний экран отображает контент• Экран мобильного устройства

используется для управления• Достигается использованием Android*

Presentation API

Режим презентации

Page 15: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

• Активируется атвоматически, если приложение использует Android* Media Player API (VideoView)

• Контен отображается в оригинальном разрешении• Опции управления доступны на мобильном устройстве• С целью экономии заряда батареи контент не отображается

на мобильном устройстве

Расширенный режим (Доступен только для Intel® WiDi)

Page 16: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

Модели использования

• Видео– Отображение видео на внешнем экране, мобильное

устройство используется как пульт ДУ

• Игры– Использование мобильного устройства как игрового

контроллера

• Продуктивность– Отображение презентации на внешнем экране, мобильное

устройство используется как кликер

• IVI– Отображение навигационного приложения на экране IVI

Page 17: Дмитрий Рыжков_WiDi Android Intel

Идеи приложений

Enter search term

Режим Touch-Pad

Браузер

Page 18: Дмитрий Рыжков_WiDi Android Intel

Идеи приложений

And

Браузер

Режим клавиатуры

wq e r t y u i o p

sa d f g h j k l

z x c v b n m&12

3/ space · searc

h

And

Page 19: Дмитрий Рыжков_WiDi Android Intel

Идеи приложений

Игры

Режим Game Pad

Page 20: Дмитрий Рыжков_WiDi Android Intel

Идеи приложений

Продуктивность

Page 21: Дмитрий Рыжков_WiDi Android Intel

Идеи приложений

Current matches

X vs. Y

A vs. B

X vs. Z

Add Score

11

Player X vs. Player Z

7

Интерфейс для ввода данных

Page 22: Дмитрий Рыжков_WiDi Android Intel

Демонстрация

Page 23: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

Содержание

• Miracast* и Intel® Wireless Display• Совместимые устройства• Режимы работы и модели использования• Демонстрация• Android* Presentation API• Резюме

Page 24: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

Android* Presentation API

Класс Presentation в Android* 4.2 (API Level 17), позволяет:

• Использовать второй экран не заботясь о способе подключения

• Использовать MHL*, HDMI*, SlimPort* & Miracast* совместимые устройства

• Контролировать контент, отображаемый на внешнем экране

Page 25: Дмитрий Рыжков_WiDi Android Intel

Объект Presentation

Dialog

Presentation

Activity должно контролировать представление (Presentation) в моменты изменения текущего статуса (onPause, onStop, onResume)

• Представление должно наследовать Presentation

• Presentation наследуется от Dialog, так же как для Dialog жизненный цикл зависит от Activity

public class DemoPresentation extends Presentation {

• В момент создания ассоциируется с объектом Display

Page 26: Дмитрий Рыжков_WiDi Android Intel

Использование Presentation API

Сначала необходимо получить объект Display, на котором будет отображаться представление:

1. MediaRouter API (в API 16): автоматический выбор наиболее подходящего

2. Display Manager API (в API 17): Перечисление доступных

// Get the media router service. MediaRouter mMediaRouter = (MediaRouter)getSystemService(Context.MEDIA_ROUTER_SERVICE); // Use the MediaRouter that supports live videoMediaRouter.RouteInfo mRouteInfo = mMediaRouter.getSelectedRoute(MediaRouter.ROUTE_TYPE_LIVE_VIDEO);Display presentationDisplay = mRouteInfo.getPresentationDisplay();

// Get the display manger service. DisplayManager mDisplayManager = (DisplayManger)getSystemService(Context.DISPLAY_SERVICE); // enumerate the displaysDisplay[] displays = mDisplayManager.getDisplays(DisplayManger.DISPLAY_CATEGORY_PRESENTATION);

Page 27: Дмитрий Рыжков_WiDi Android Intel

Presentation API

MediaRouter.getSelectedRoute

(ROUTE_TYPE_LIVE_VIDEO)

MediaRouter.routeInfo

getPresentationDisplay()new Presentation

(activityContext, display)

.show()

Используя MediaRouter.addCallback, необходимо отслеживать и обрабатывать:• onRouteUnselected• onRouteSelected• onRoutePresentationDisplayChanged

Внутри Activity, создавшей представление:• onResume• onPause

How to get a Presentation displayed:

Page 28: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

Тестирование приложений

Варианты:• На устройствах с наличием возможности подключения (Miracast, HDMI, и т.д.)• В режиме эмуляции – новая возможность в Android* 4.2 (Инструменты

разработчика). Позволяет выбрать разрешение и DPI, после активации отображается поверх экрана.

Page 29: Дмитрий Рыжков_WiDi Android Intel

Добавление MediaRouteButton

res/menu/default.xml:

<item android:title="Media Route Settings" android:actionProviderClass="android.app.MediaRouteActionProvider" android:showAsAction="always" />

//Sets Media Route Button to second screen modemediaRouteActionProvider.setRouteTypes

(MediaRouter.ROUTE_TYPE_LIVE_VIDEO); //Launches the Wireless display setting intent startActivity(new Intent ("android.settings.WIFI_DISPLAY_SETTINGS"));

Page 30: Дмитрий Рыжков_WiDi Android Intel

Реализация интерфейса Presentation

Используется тот же стиль, что и для Dialog.Разрешение и DPI:

Density телевизора и смартфона сопоставимы, больший размер экрана компенсируется расстоянием.

Тема по умолчанию Holo Dark: светлый текст на темном фоне легче читается на телевизоре.

Всегда ландшафтный режим ориентации

TV setting Разрешение Density Screen Density Display Resolution Screen size identifier

720p 1280 x 720 px tvdpi 213 dp 960 x 540 dp large

1080p 1920 x 1080 px xhdpi 320 dp 960 x 540 dp large

source: https://developers.google.com/tv/android/docs/gtv_android_patterns

Page 31: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

Wireless Display APIs в Android* 4.2

• Диалог настроек беспроводного дисплея можно вызвать используя android.settings.WIFI_DISPLAY_SETTINGS, так же возможны варианты– Samsung*:

com.samsung.wfd.LAUNCH_WFD_PICKER_DLG

– HTC*:com.htc.wifidisplay.CONFIGURE_MODE_NORMAL

Page 32: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

Содержание

• Miracast* и Intel® Wireless Display• Совместимые устройства• Режимы работы и модели использования• Демонстрация• Android* Presentation API• Резюме

Page 33: Дмитрий Рыжков_WiDi Android Intel

Резюме

Miracast* и Intel® WiDi : • Позволяют отображать контент на внешнем устройстве

используя беспроводную передачу• Intel® WiDi является полностью совместимым с Miracast* и

предоставляет дополнительные функции, такие как Dolby 5.1, защита контента (HDCP 2.1), низкая задержка

Android* Presentation API• Добавлены в Android* API Level 17, позволяют использовать

внешние устройства для отображения контента, вне зависимости от способа подключения

Page 35: Дмитрий Рыжков_WiDi Android Intel

Q&A

Page 36: Дмитрий Рыжков_WiDi Android Intel

Legal DisclaimerINFORMATION IN THIS DOCUMENT IS PROVIDED IN CONNECTION WITH INTEL PRODUCTS. NO LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, TO ANY INTELLECTUAL PROPERTY RIGHTS IS GRANTED BY THIS DOCUMENT. EXCEPT AS PROVIDED IN INTEL'S TERMS AND CONDITIONS OF SALE FOR SUCH PRODUCTS, INTEL ASSUMES NO LIABILITY WHATSOEVER AND INTEL DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY, RELATING TO SALE AND/OR USE OF INTEL PRODUCTS INCLUDING LIABILITY OR WARRANTIES RELATING TO FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, OR INFRINGEMENT OF ANY PATENT, COPYRIGHT OR OTHER INTELLECTUAL PROPERTY RIGHT.A "Mission Critical Application" is any application in which failure of the Intel Product could result, directly or indirectly, in personal injury or death. SHOULD YOU PURCHASE OR USE INTEL'S PRODUCTS FOR ANY SUCH MISSION CRITICAL APPLICATION, YOU SHALL INDEMNIFY AND HOLD INTEL AND ITS SUBSIDIARIES, SUBCONTRACTORS AND AFFILIATES, AND THE DIRECTORS, OFFICERS, AND EMPLOYEES OF EACH, HARMLESS AGAINST ALL CLAIMS COSTS, DAMAGES, AND EXPENSES AND REASONABLE ATTORNEYS' FEES ARISING OUT OF, DIRECTLY OR INDIRECTLY, ANY CLAIM OF PRODUCT LIABILITY, PERSONAL INJURY, OR DEATH ARISING IN ANY WAY OUT OF SUCH MISSION CRITICAL APPLICATION, WHETHER OR NOT INTEL OR ITS SUBCONTRACTOR WAS NEGLIGENT IN THE DESIGN, MANUFACTURE, OR WARNING OF THE INTEL PRODUCT OR ANY OF ITS PARTS.Intel may make changes to specifications and product descriptions at any time, without notice. Designers must not rely on the absence or characteristics of any features or instructions marked "reserved" or "undefined". Intel reserves these for future definition and shall have no responsibility whatsoever for conflicts or incompatibilities arising from future changes to them. The information here is subject to change without notice. Do not finalize a design with this information.The products described in this document may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request.Contact your local Intel sales office or your distributor to obtain the latest specifications and before placing your product order.Copies of documents which have an order number and are referenced in this document, or other Intel literature, may be obtained by calling 1-800-548-4725, or go to: http://www.intel.com/design/literature.htm

Intel® WiDi Technology requires an Intel® Wireless Display enabled system, compatible adapter and TV. 1080p and Blu-Ray* or other protected content playback only available on select Intel® Core™ processor-based systems with built-in visuals enabled, a compatible adapter and media player, and supporting Intel WiDi software and graphics driver installed. Consult your PC manufacturer. For more information, see www.intel.com/go/widi.

Intel, Look Inside and the Intel logo are trademarks of Intel Corporation in the United States and other countries.

*Other names and brands may be claimed as the property of others.Copyright ©2013 Intel Corporation.

Page 37: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

Legal DisclaimerSoftware Source Code Disclaimer: Any software source code reprinted in this document is furnished under a software license and may only be used or copied in accordance with the terms of that license. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Page 38: Дмитрий Рыжков_WiDi Android Intel

Risk FactorsThe above statements and any others in this document that refer to plans and expectations for the third quarter, the year and the future are forward-looking statements that involve a number of risks and uncertainties. Words such as “anticipates,” “expects,” “intends,” “plans,” “believes,” “seeks,” “estimates,” “may,” “will,” “should” and their variations identify forward-looking statements. Statements that refer to or are based on projections, uncertain events or assumptions also identify forward-looking statements. Many factors could affect Intel’s actual results, and variances from Intel’s current expectations regarding such factors could cause actual results to differ materially from those expressed in these forward-looking statements. Intel presently considers the following to be the important factors that could cause actual results to differ materially from the company’s expectations. Demand could be different from Intel's expectations due to factors including changes in business and economic conditions; customer acceptance of Intel’s and competitors’ products; supply constraints and other disruptions affecting customers; changes in customer order patterns including order cancellations; and changes in the level of inventory at customers. Uncertainty in global economic and financial conditions poses a risk that consumers and businesses may defer purchases in response to negative financial events, which could negatively affect product demand and other related matters. Intel operates in intensely competitive industries that are characterized by a high percentage of costs that are fixed or difficult to reduce in the short term and product demand that is highly variable and difficult to forecast. Revenue and the gross margin percentage are affected by the timing of Intel product introductions and the demand for and market acceptance of Intel's products; actions taken by Intel's competitors, including product offerings and introductions, marketing programs and pricing pressures and Intel’s response to such actions; and Intel’s ability to respond quickly to technological developments and to incorporate new features into its products. The gross margin percentage could vary significantly from expectations based on capacity utilization; variations in inventory valuation, including variations related to the timing of qualifying products for sale; changes in revenue levels; segment product mix; the timing and execution of the manufacturing ramp and associated costs; start-up costs; excess or obsolete inventory; changes in unit costs; defects or disruptions in the supply of materials or resources; product manufacturing quality/yields; and impairments of long-lived assets, including manufacturing, assembly/test and intangible assets. Intel's results could be affected by adverse economic, social, political and physical/infrastructure conditions in countries where Intel, its customers or its suppliers operate, including military conflict and other security risks, natural disasters, infrastructure disruptions, health concerns and fluctuations in currency exchange rates. Expenses, particularly certain marketing and compensation expenses, as well as restructuring and asset impairment charges, vary depending on the level of demand for Intel's products and the level of revenue and profits. Intel’s results could be affected by the timing of closing of acquisitions and divestitures. Intel's results could be affected by adverse effects associated with product defects and errata (deviations from published specifications), and by litigation or regulatory matters involving intellectual property, stockholder, consumer, antitrust, disclosure and other issues, such as the litigation and regulatory matters described in Intel's SEC reports. An unfavorable ruling could include monetary damages or an injunction prohibiting Intel from manufacturing or selling one or more products, precluding particular business practices, impacting Intel’s ability to design its products, or requiring other remedies such as compulsory licensing of intellectual property. A detailed discussion of these and other factors that could affect Intel’s results is included in Intel’s SEC filings, including the company’s most recent reports on Form 10-Q, Form 10-K and earnings release.

Rev. 7/17/13

Page 39: Дмитрий Рыжков_WiDi Android Intel

Backup

Page 40: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

Miracast* Concept

Sink device

Source device

Wi-Fi Direct*

Audio/Video Payload

Control

Content

Composition of Audio/Video

frames, graphics and

text

Device capability negotiation and

session maintenance

Device capability negotiation and

session maintenance

Decoding RenderingEncoding

Page 41: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

Miracast* Architecture (Source side)

TCP (socket)

RTSP

Capa

bilit

y N

egoti

ation

Sess

ion

Esta

blis

hmen

tSe

ssio

n M

anag

emen

t

L2 S

etup

& D

isco

very

Ass

ist

RTP

UDP (socket)

Wi-Fi Direct* (P2P) / TDLS & Wi-Fi Protected Setup

HD

CP C

ontr

olMPEG2-TS / AV MUX

Audio Encode Video Encode

HDCP 2.0/2.1 (opt)

Miracast Control

WLAN Device

PES

Display Application & Manager

PES

UIBC(opt)

Use

r Inp

ut D

ata

Page 42: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

Как работает Miracast*

Video Decode Audio Decode

De-Packetize De-Packetize

Link Content Protection Decrypt (Optional)

AV DeMux

Transport

LLC

WI-Fi MAC (Direct Link)

Wi-Fi PHY

Приемник

Video Encode Audio Encode

Packetize Packetize

Link Content Protection Encrypt (Optional)

AV Mux

Transport

LLC

WI-Fi MAC (Direct Link)

Wi-Fi PHY

Видео Аудио

ИсточникВидео Аудио

Page 43: Дмитрий Рыжков_WiDi Android Intel

Software and Services Group

Miracast vs Intel® WiDi Receiver Spec

Features Miracast Intel® WiDi (4th Gen)

Resolution 480p/30fps720p Optional

1080p/30fps1080p/60fps Optional

HDCP Optional 2.1

Audio Stereo Sound Stereo Sound & 5.1 Surround Sound

S3D Optional Yes

Speed Mode Optional Low Latency

Fast Cursor No Yes