multimedia stack overview - khronos group · streams – the core of multimedia •streams are...
TRANSCRIPT
© Copyright Khronos Group, 2011 - Page 1
Multimedia Stack Overview Erik Noreke
Chair of OpenSL ES Working Group Chair of OpenMAX AL Working Group
Peruser of OpenMAX IL
© Copyright Khronos Group, 2011 - Page 2
Today’s Consumer Requirements • Rich media applications and UI
- Consumer decisions are driven by the multimedia experience
- Drives smart phone market • Enhanced user experience
- Games - Theater-like audio for video playback - Streaming media services - Mobile TV
• Availability of third party applications - Consumers expected to purchase $35 billion of
mobile applications by 2014
© Copyright Khronos Group, 2011 - Page 3
Application Developer Requirements • Use case driven design
- For ease of use • Comprehensive feature set
- Including advanced audio and streaming media • Consistent APIs
- Same APIs for both hardware and software implementations
• Full, predictable functionality - No need to guess what's available or how it is
going to work • Portable
- No need to port application for different platforms
© Copyright Khronos Group, 2011 - Page 4
System Integration Requirements • Function driven design
- For ease of integration • Comprehensive feature set
- Including advanced audio and streaming media • Consistent APIs
- Same APIs regardless if using a software implementation or hardware acceleration
• Full, predictable functionality - No need to guess about available functionality or
how it is going to work • Ease of Integration
- Expected set of components reduces integration time and costs
© Copyright Khronos Group, 2011 - Page 5
Multimedia Stack - Overview
Applications
Multimedia System Access
HW Integration / Implementation Layer
System Hardware
Multimedia Control Layer
Application Access Ease of use
Ease of integration
Choice of HW / SW
HW Acceleration
Abstraction level
Use case driven design
Use cases
Implementation of Multimedia functions in either software or hardware
Function driven design with access regardless of implementation
Creates abstraction layer for application developer
© Copyright Khronos Group, 2011 - Page 6
Multimedia Stack - Domains
Applications
Multimedia System Access
HW Integration / Implementation Layer
System Hardware
Multimedia Control Layer
Application Access Ease of use
Ease of integration
Choice of HW / SW
HW Acceleration
Abstraction level
Use cases Application developers
Operating Systems
Device Manufacturers
© Copyright Khronos Group, 2011 - Page 7
Multimedia Stack – Khronos APIs
Applications
Multimedia System Access
HW Integration / Implementation Layer
System Hardware
Multimedia Control Layer
Application Access Ease of use
Ease of integration
Choice of HW/SW
HW Acceleration
Abstraction level
Use cases
© Copyright Khronos Group, 2011 - Page 8
Why Create Khronos Multimedia APIs? Khronos APIs •Conformance Tests •Portable •IP Protection •Well defined layers of
implementation •Predictable set of functionality
Open Source Framework •Free to change •Every implementation unique •GPL license •Crosses implementation
layers •Functionality dependent on
implementation
© Copyright Khronos Group, 2011 - Page 9
Streams – The Core of Multimedia • Streams are content delivery
channels - Video, Audio, Text data flow - Additional metadata
• Controlling multimedia is about manipulating the streams
- Play rate, effects, source and destinations • The streams are sent through various
components - Readers, parsers and decoders (codecs) - Effects, schedulers and renderers - Splitters and mixers
• Combined with HW clock synch and system controls this forms the core of the multimedia stack
© Copyright Khronos Group, 2011 - Page 10
OpenMAX IL – Integration Layer
Applications
Multimedia System Access
Integration / Implementation Layer
System Hardware
Multimedia Control Layer
Application Access Ease of use
Ease of integration
Choice of HW/SW
HW Acceleration
Abstraction level
Use cases
© Copyright Khronos Group, 2011 - Page 11
OpenMAX IL – Managing Streams Component Networks • Enables arbitrary multimedia pipelines by plugging blocks together
- Componentized architecture abstracts multimedia functionality block interfaces • Wide variety of building blocks for imaging, video and audio functions
- Encode, decode, apply an effect, capture, render, split, mix, etc • Enables blocks from different sources to work together
- Blocks can be implemented in software or hardware Portable & Re-usable streaming media building blocks
© Copyright Khronos Group, 2011 - Page 12
...pBuffernOffset = 9nAllocLen = 96nFilledLen = 21nFlags inc 0x40...
4 bytes
nSize = 28
nVersion
nPortIndex
eType != OMX_ExtraDataNone
nDataSize = 6
OMX_OTHER_EXTRADATATYPE
padding
data
offset padding
extra data
nSize = 24
nVersion
nPortIndex
eType = OMX_ExtraDataNone
nDataSize = 0
data
OMX_OTHER_EXTRADATATYPE
OMX_BUFFERHEADERTYPE
padding
unused
padding
• Component abstracts a single actor – - Decoder, effect or renderer
• Standardized ports allows chaining of arbitrary components - Including port tunneling for compatible components
• Commands are sent to the component • Events are received from the component • Ports have calls and callbacks
OpenMAX IL Component
OMX IL Component
Input ports •Callbacks
Output ports •Calls •Callbacks
Commands Events
© Copyright Khronos Group, 2011 - Page 13
OpenMAX IL Example Graph • Standardized component interfaces enable flexible media graphs • Components are chained into pipelines as needed for each stream • Includes multi-stream synchronization
*.mp4 / *.3gp File Reader
Clock for AV Sync
Audio Decoder
Audio Renderer
Video Scheduler
Video Renderer
Speakers
Display
AAC Audio
MPEG4/ H.264 Video
Time Data
Video Decoder
Decompressed Video
OpenMAX IL Component Interfaces Enables components to be flexibly connected in any graph topology
Example: MPEG-4 video synchronized with AAC audio decode
Plug-in
E.g. send dance beats to 3D application for visualization
© Copyright Khronos Group, 2011 - Page 14
OpenSL ES and OpenMAX AL – Application Access
Applications
Multimedia System Access
Integration / Implementation Layer
System Hardware
Multimedia Control Layer
Application Access Ease of use
Ease of integration
Choice of HW/SW
HW Acceleration
Abstraction level
Use cases
© Copyright Khronos Group, 2011 - Page 15
OpenSL ES & OpenMAX AL – Controlling Streams • Hardware and low level access is powerful but complex
- More power than most application developers require • Most application developers just want to playback and record media
- Specifying where the content comes from - Specifying where the content should be rendered to - Manipulate a few playback controls - Have simple configurability
• OpenMAX AL and OpenSL ES provide… - Simple high-level multimedia APIs for playback and recording use cases
•…With Cross-platform portability - No need to rewrite an application for every platform
© Copyright Khronos Group, 2011 - Page 16
OpenMAX AL Focused on Streaming Media – Not Media Streams
• Media playback and recording - Playback and recording of everything from
video files to radio to camera input • Full range of video effects and controls –
including playback rate, post processing, and image manipulation - Apply advanced effects to captured images and
video before sending to friends • Complete metadata support
- Read, Edit, and Set the metadata for most types of content
© Copyright Khronos Group, 2011 - Page 17
OpenSL ES – Powerful 3D Audio • Full range of effects and controls,
including advanced 3D effects such as Doppler and virtualization
- Experience rich, enhanced sound from locations other than the handset, even moving, for the ultimate multimedia experience
• Full 3D audio functionality enhances any gaming experience
- Perfect companion to OpenGL ES • Designed to take full advantage of
system capabilities
© Copyright Khronos Group, 2011 - Page 18
OpenSL ES and OpenMAX AL • Working groups collaborated to define the common API functionality • Independent, Compatible, Consistent and Distinct
3D Audio
Audio Effects
Advanced MIDI
Audio Playback
Audio Recording
Basic MIDI
Video playback
Camera
Video recording
Image capture & display Buffer
queues
Radio and RDS
© Copyright Khronos Group, 2011 - Page 19
The OpenSL ES / OpenMAX AL Object • Object represents a logical grouping of functionality
- Acts on a stream or set of streams - Player, recorder, mixer
• Object has a source and a destination - Acts on a stream or set of streams as they flow through
• Objects have control interfaces - Grouped methods and callbacks - Play, Record, Seek
Object
Source
Destination
Interfaces
Dataflow
© Copyright Khronos Group, 2011 - Page 20
OpenMAX AL & OpenSL ES – Play Audio Shared Use Case
© Copyright Khronos Group, 2011 - Page 21
OpenMAX AL & OpenSL ES – Play Video Shared Use Case
© Copyright Khronos Group, 2011 - Page 22
Multimedia Stack – Khronos APIs
Applications
Multimedia System Access
HW Integration / Implementation Layer
System Hardware
Multimedia Control Layer
Application Access Ease of use
Ease of integration
Choice of HW/SW
HW Acceleration
Abstraction level
Use cases
© Copyright Khronos Group, 2011 - Page 23
Stream Control vs. Stream Management Audio playback
File Reader
Clock
Audio Decoder
Audio Sink
Audio Mixer
Audio Effect
OR
Player URI Data Source
Output Mix
© Copyright Khronos Group, 2011 - Page 24
Multimedia Stack – Khronos APIs
Applications
Multimedia System Access
HW Integration / Implementation Layer
System Hardware
Multimedia Control Layer
Application Access Ease of use
Ease of integration
Choice of HW/SW
HW Acceleration
Abstraction level
Use cases
© Copyright Khronos Group, 2011 - Page 25
Example: 3D Playback of two audio files
© Copyright Khronos Group, 2011 - Page 26
Example: Video Camera
© Copyright Khronos Group, 2011 - Page 27
Complete Multimedia Use-Case
Multimedia Processing
OpenGL ES GL_TEXURE_EXTERNAL_OES texture
3D Audio Rendering
Application on CPU
Video stream to GPU
EGLStream
Much more flexibility than just “show a video”
EGLSurface OpenGL ES
Audio stream to DSP
© Copyright Khronos Group, 2011 - Page 28
Multimedia – Managing Streams • OpenMAX IL manages the pipeline
- Controls where and how the stream flows • OpenMAX AL and OpenSL ES manage the flow
- Controls when and how fast the stream flows
• Together they separate the domains of the multimedia stack - A distinct integration layer - Use case driven application access layer
• To form the basis for a complete multimedia stack
- Without limiting implementation or innovation
© Copyright Khronos Group, 2011 - Page 29
...pBuffernOffset = 9nAllocLen = 96nFilledLen = 21nFlags inc 0x40...
4 bytes
nSize = 28
nVersion
nPortIndex
eType != OMX_ExtraDataNone
nDataSize = 6
OMX_OTHER_EXTRADATATYPE
padding
data
offset padding
extra data
nSize = 24
nVersion
nPortIndex
eType = OMX_ExtraDataNone
nDataSize = 0
data
OMX_OTHER_EXTRADATATYPE
OMX_BUFFERHEADERTYPE
padding
unused
padding
• Create a NULL OpenMAX IL Component - First with one input, one output port (1 stream) - Then with two input, two output ports (2 streams)
• Illustrates - Buffer handling and Latency - Stream synchronization and control - Command queue and event handling - Importance of industry standards conformance - Introduction to stream management
Suggested Student Assignment: OpenMAX IL NULL Component
OMX IL NULL Component
Input ports •Callbacks
Output ports •Calls •Callbacks
Commands Events
© Copyright Khronos Group, 2011 - Page 30
Thank You