Android多媒体开发技术浅析
2012.10.14
Android Multimedia Framework
Media Applications
Video Codecs Audio Codecs Image Codecs
Media API Libraries
Hardware: processors and accelerators
Operating System Multimedia framework
Silicon vendors provide high performance media primitive implementations optimized for their silicon architecture
Media API library
implementations re-use optimized primitives across diverse silicon and platforms Portable integration of
Media API libraries into host operating system - if needed
Available across a wide variety of processor
architectures and operating systems and tool chains
Physics Engines
Focused on key „hotspot‟
functions and algorithms
Multimedia Software Stack
”Application Level”
Media Application Portability
Applications programmed using cross-vendor
interfaces
“Integration Level”
Media Graph Portability Integrate media networks using standard interconnect protocols
“Development Level”
Media Component Portability Develop portable media components using low-level media APIs
More media applications available on more
platforms
for more end-user value!
Component vendors can ship more advanced
functionality across more processors. Media silicon vendors reduce costs and time to market
Portable and powerful media processing graphs can flexibly leverage
available platform media components
Streaming Media Infrastructure Portability
Open, royalty-free standard
IL
DL AL
OpenMAX defines three holistically designed media open standards to provide complete streaming media infrastructure portability
OpenMAX - Three Layer Solution
Media Multimedia File Path
• Stagefright的头文件路径如下:
frameworks/include/media/stagefright/
• 实现Stagefright 功能的文件路径如下:
frameworks/base/media/libstagefright/
• 实现Stagefright 播放和录音功能的文件路径如下:
frameworks/base/media/libmediaplayerservice/
• 实现录音和音频的文件路径如下:
frameworks/base/media/libmedia/
Media recorder state mechine
Idle
Initialezed
Preparing
Prepared Recording
Released Error
setAudoSource()/
setVideoSource()
setAudoSource()/
setVideoSource()
setAudioEncoder() setVideoEncoder() setOutputFile() setVideoSize() setVideoFrameRate()
setPreviewDisplay() setOutputFormat()
reset()
reset()
Prepare() reset()
Start() reset()/
stop() release()
reset()
Error occurs or an invalid call
Application
• 照相机系统:
android.hardware.Camera
• 实现录音:
android.media.MediaRecorder
• 实现播放:
android.media.MediaPlayer
Graphics
Skia 是 Google 一个底层的图形、图像、动画、 SVG 、文本等 多方面的图形库,是 Android 中图形系统的引擎。
• 图形包的文件路径如下:
frameworks/base/graphics/java/android/graphics/
• 实现图形库:
android.graphics.*;
Media Scanner
DLNA
DLNA(DIGITAL LIVING NETWORK ALLIANCE,数字家庭网络联盟)
• DMS(数字媒体服务器)
• DMP(数字媒体播放器)
• DMC(数字媒体控制器)
• DMD(数字媒体下载)
• DMU(数字媒体上传)
DLNA 结构图
The More
• 视频电话
• 家庭控制系统
• 基于多媒体分享社交平台
09/17/12 20