droidcon2013 miracast final2

25

Upload: droidcon-berlin

Post on 28-Nov-2014

5.057 views

Category:

Business


0 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Droidcon2013 miracast final2
Page 2: Droidcon2013 miracast final2

A new application paradigm: Using the 2nd

screen API with Miracast

• Who we are: short recap of LG's Android highlights

• What is Miracast and how can I use it?

• Android API Level 17: The 2nd Screen API hands-on

• Usage Scenarios – what can I do with it?

Page 3: Droidcon2013 miracast final2

LIFE’S GOOD

WHEN YOU MAKE

THE MOST OF IT!

Page 4: Droidcon2013 miracast final2

Nexus 4 is the new smartphone from Google. Developed by LG. With cutting edge hardware, your favorite Google Apps, and the latest version of Android, Nexus 4 puts the best of Google in the palm of your hand.

NEXUS 4

Page 5: Droidcon2013 miracast final2
Page 6: Droidcon2013 miracast final2

LG TECHNOLOGY LEADERSHIP

True HD IPSPlus display and cutting-edge Zerogap Touch

Thinner camera & advanced touch screen

Superior mobile experience

in speed, performance, battery usage and graphics Innovation in energy

density & efficiency

Page 7: Droidcon2013 miracast final2

Wi-Fi Miracast

Page 8: Droidcon2013 miracast final2

What is Miracast?

• Wireless Replacement for HDMI

• Based on existing standards

• Using existing device capabilities

• Open for the industry

• Compliance-tested by Wi-Fi Alliance

Page 9: Droidcon2013 miracast final2

Miracast Concept

SINK SOURCE

Link content encryption (Optional)

AV mux

Transport

LLC

Wi-Fi MAC (direct link)

Wi-Fi PHY

Video encode

Packetize

Audio encode

Packetize

Link content decrypt (Optional)

AV Demux

Transport

LLC

Wi-Fi MAC (direct link)

Wi-Fi PHY

Video decode

Depacketize

Audio decode

Depacketize

Display frames Audio samples Render Render Synchronized

Page 10: Droidcon2013 miracast final2

Miracast Logical Block diagram

Game content

UI content

Video content

Composition Composited

display surface

Display

controller

Display

capture

Encode Encoded video

bit-stream

PCM audio MPEG-2

packeting

MPEG-2 TS

Audio/Video

mux

RTP

Transport

LCD

Wi-Fi

Page 11: Droidcon2013 miracast final2

Sounds Great! Can I Use It Now?

Miracast Source (e.g. Nexus4, LG Optimus G)

Miracast Display (e.g. LG BlueRay Player, HomeCinema, SmartTV, Monitor)

Yes! It is commercially available!

Page 12: Droidcon2013 miracast final2

Android 4.2

Secondary Displays

Page 13: Droidcon2013 miracast final2

What's the secondary display API?

From 4.2 (API Level 17), Android supports output to multiple displays in a hardware-agnostic way, which means: You can implement support for multiple displays in your applications without having to worry about the way those displays are connected! You can control the output on this displays independently of the phones screen!

Page 14: Droidcon2013 miracast final2

Presentation Class

associated with android.view.Display

Before showing a Presentation it's important to choose the Display on which it will appear. There are two main ways to choose a Display: 1. Using the MediaRouter – System will decide 2. Using the DisplayManager – Enumeration of Displays

Page 15: Droidcon2013 miracast final2

Code Example - How to get a display

protected Display getDisplay() {

if(mUseMediaRouter){

//Use the MediaRouter that supports live video

MediaRouter.RouteInfo route =

mMediaRouter.getSelectedRoute(MediaRouter.ROUTE_TYPE_LIVE_VIDEO);

mCurrentDisplay = route.getPresentationDisplay();

}

else {

// Get all available displays using the DisplayManager

Display[] displays =

mDisplayManager.getDisplays(

DisplayManager.DISPLAY_CATEGORY_PRESENTATION);

// Keep an object to the first available external display

mCurrentDisplay = displays[0];

}

return mCurrentDisplay;

}

Page 16: Droidcon2013 miracast final2

Getting the displays metrics

You can obtain the metrics with getMetrics() of the external Display in order to use the proper resources for the external display

Keep in mind that screens connected to the users device often have a larger screen size and likely a different screen density. Because the screen characteristics may differ, you should provide resources that are optimized specifically for such larger displays.

Page 17: Droidcon2013 miracast final2

Simple Example: Presentation

Hello droidcon!

public class TextDemoPresentation extends Presentation {

private TextView mText;

public TextDemoPresentation(Context context, Display

display) {

super(context, display);

}

@Override

protected void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);

// Inflate the layout.

setContentView(

R.layout.presentation_text);

// Find the TextView field

mText = (TextView)

findViewById(R.id.demoText);

}

}

Page 18: Droidcon2013 miracast final2

Lifecycle

A presentation is canceled when the display to which it is attached is removed. An activity should take care of pausing and resuming whatever content is playing within the presentation whenever the activity itself is paused or resumed. If you use OpenGL in the Presentation the OpenGL context will get lost on pausing. The only way to keep the context during pause/resume is to call onPause() and onResume() manually on the GLSurfaceView in the pause and resume callbacks of your activity. public void onPause() {

mGLSurfaceView.onPause();

}

public void onResume() {

mGLSurfaceView.onResume();

}

Page 19: Droidcon2013 miracast final2

Developer Options

Android provides an easy on-device method to test your app using the secondary display API in the developer option. You can select several resolutions and once activated you get an overlay emulating the secondary screen(s)

Page 20: Droidcon2013 miracast final2

Secondary Displays A new application paradigm

Page 21: Droidcon2013 miracast final2

Use cases - Ideas

Add external Display support to your existing app in order to utilize other (bigger) displays when available, e.g. a browser could render content with the external displays resolution

Page 22: Droidcon2013 miracast final2

Use cases - Ideas

Add a special mode to your existing application to show the content on the external display when available and provide special input mode on the phone, e.g. just browser input fields and moving controls

Page 23: Droidcon2013 miracast final2

Use cases - Ideas

Dedicated apps which work ONLY with external displays, e.g. a Home Office App to utilize your phone as PC replacement together with mouse and keyboard

Page 24: Droidcon2013 miracast final2

Summary

Miracast is • a method to transmit audio/video from a mobile

device to external display(s) • OPEN, STANDARDIZED and COMMERCIALLY

AVAILABLE Secondary Display API is • introduced with Android API Level 17 • adds methods to control the content on multiple

displays

Exciting new use cases for applications!!!

Page 25: Droidcon2013 miracast final2

http://developer.lge.com

www.lgworld.com

Thank you.

Don’t miss the

demo at our

booth!