SlideShare a Scribd company logo
1 of 19
Stagefright – how it works

            Alexy Mathew Joseph
Who am I?
   Works at Pathpartner(pathpartnertech.com) as a
    Technical Architect.
   Working on multimedia frameworks and systems
    optimization for 8 years.
   Contact: galahad@gmail.com
Flow
   Overview
   Architecture
   File playback
   Recording
   Streaming
   Hardware accelerated rendering
   Tweaking and optimizing
   Questions?
Overview




   Multimedia frameworks - the weight lifters
Stagefright
   The primary multimedia framework available on
    Android
   Feature set
       Supports playback of multiple file formats
       Integrates with OpenMax codecs
       Recording
       RTSP streaming
       HTTP streaming
The scary block diagram
                +mSource

 MP3Decoder
                                                                               FileSource          MPEG4Source
                  MediaSource         +mAudioSource
                                                      DataSource
                                      +mVideoSource                          HTTPDataSour
  AVCDecoder
                                                                                  ce
                           +mSource                                                                  MP3Source
                                                                    MediaExtractor

                   OMXCodec                  AwesomePlayer
    IOMX                                                                                    MPEG4Extractor
                                                                      MP3Extractor


                                                                                                   TimedEventQueue
    OMX            OMXClient                AwesomeRenderer

                                                                                AudioPlayer                     AudioTrack
                                      AwesomeRem      AwesomeLocalR                                                 (media
 OMXMaster        IOMXRender                                                                                     framework)
                                       oteRenderer       enderer
       0...n                                                                         TimeSource
                                                                                                     MediaPlayerBase:AudioSink
                                                         SoftwareRen                                    (media framework)
OMXPluginBase      OMXRender          VideoRender
                                                             der
                                                                               SystemTimeSource

                                                                                                       MediaPlayerInterface
OMXPVCodecs                           HardwareRe                                                        (media framework)
                                                           iSurface
                   OMXPlugin                                                   StageFrightPlayer
  Plugin                                 nder           (surfaceflinger)
Components
   DataSource
   Media Extractor
   Media Source
   Media Buffer
   Meta Data
   OMXCodec
   Camera Source
   Media Writer
File playback
   Awesome Player
       File playback
       HTTP
       RTSP
   Components
       Timed queue
       AV sync
Caveats
   AV synch tweaks.
   Fast forward/rewind
   Codec configuration
Recording
   Consists of CameraSource, OMXCodec,
    MPEG4Writer.
Caveats
   Exchanging buffers with the camera
   Hardware codec integration and the troubles
Streaming support
   RTSP streaming – the basics
Thread




  Alooper:Looper
      Thread                  ALooper
                                                       HandlerI                                              AMessage
                                                                          ALooperRoster
                                                         nfo    0..n
                           registerHandler()                                                             mTarget

                                                                                                         post()
                                                                         registerHandler()
                                                                         unregisterHandler()
                                                                         postMessage()
                                               AHandler                  deliverMessage()
                                         onMessageReceived()
MediaExtra                               looper()
  ctor


                                                                                                                         ARTPAssembler          +mNotifyMsg
ARTSPCont          AHandlerR                              ARTSPCon        ARTPConne
                                                                                                   ARTPSource
  roller           eflector<T>          MyHan              nection          ction
                                         dler                                                                           assembleMore()        AMPEG4Audio
                                                                                                                                               Assembler
                                                0..n
                                                                                                                                                     +mNotifyMsg


                                                                        ARTPSe                 AAMRAss            AAVCAssem       AH263Asse   AMPEG4Element
MediaSource          APacketSource               TrackInfo                                                                                     aryAssembler
                                                                         ssion                  embler               bler           mbler




                                                          MediaWriter           ARTPWriter
Components
   ARTSPController
   ARTSPConnection
   ARTPConnection
   ARTPSource
   ARTPAssembler
       AAMRAssembler is an example
Gaps and further work
   Jitter buffer
   Error correction and feedback
   RTCP handling
Hardware rendering
   VideoRenderer class
   Instantiating Hardware overlay
Tweaking and optimizing
   Copies
   Latency
   Slice mode
   Signaling errors from decoder
References
   http://freepine.blogspot.com/2010/01/overview-of-
    stagefrighter-player.html
   http://freepine.blogspot.com/2010/09/rtsp-in-
    stagefright-1.html
   http://freepine.blogspot.com/2010/09/rtsp-in-
    stagefright-2.html
   http://iamkcspa.pixnet.net/blog/category/1793816
Questions?

More Related Content

What's hot

Java 7 - short intro to NIO.2
Java 7 - short intro to NIO.2Java 7 - short intro to NIO.2
Java 7 - short intro to NIO.2Martijn Verburg
 
NIO.2, the I/O API for the future
NIO.2, the I/O API for the futureNIO.2, the I/O API for the future
NIO.2, the I/O API for the futureMasoud Kalali
 
Php and threads ZTS
Php and threads ZTSPhp and threads ZTS
Php and threads ZTSjulien pauli
 
PyCon Taiwan 2013 Tutorial
PyCon Taiwan 2013 TutorialPyCon Taiwan 2013 Tutorial
PyCon Taiwan 2013 TutorialJustin Lin
 
PE Packers Used in Malicious Software - Part 1
PE Packers Used in Malicious Software - Part 1PE Packers Used in Malicious Software - Part 1
PE Packers Used in Malicious Software - Part 1amiable_indian
 
Symbian OS - Descriptors
Symbian OS - DescriptorsSymbian OS - Descriptors
Symbian OS - DescriptorsAndreas Jakl
 
Erlang Message Passing Concurrency, For The Win
Erlang  Message  Passing  Concurrency,  For  The  WinErlang  Message  Passing  Concurrency,  For  The  Win
Erlang Message Passing Concurrency, For The Winl xf
 
OlinData Puppet Presentation for MOSC 2012
OlinData Puppet Presentation for MOSC 2012OlinData Puppet Presentation for MOSC 2012
OlinData Puppet Presentation for MOSC 2012Walter Heck
 
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)Sam Kim
 
Make container without_docker_6-overlay-network_1
Make container without_docker_6-overlay-network_1 Make container without_docker_6-overlay-network_1
Make container without_docker_6-overlay-network_1 Sam Kim
 
Tiny ML for spark Fun Edge
Tiny ML for spark Fun EdgeTiny ML for spark Fun Edge
Tiny ML for spark Fun Edge艾鍗科技
 
Additional resources repositories_rpm_forge - centos wiki
Additional resources repositories_rpm_forge - centos wikiAdditional resources repositories_rpm_forge - centos wiki
Additional resources repositories_rpm_forge - centos wikiCarlos Eduardo
 
Comandos routing switching
Comandos routing switchingComandos routing switching
Comandos routing switching1 2d
 
ofxTonic und Sound
ofxTonic und SoundofxTonic und Sound
ofxTonic und SoundJeongHo Park
 

What's hot (18)

Read doc
Read docRead doc
Read doc
 
Java 7 - short intro to NIO.2
Java 7 - short intro to NIO.2Java 7 - short intro to NIO.2
Java 7 - short intro to NIO.2
 
NIO.2, the I/O API for the future
NIO.2, the I/O API for the futureNIO.2, the I/O API for the future
NIO.2, the I/O API for the future
 
Linux System
Linux SystemLinux System
Linux System
 
Php and threads ZTS
Php and threads ZTSPhp and threads ZTS
Php and threads ZTS
 
PyCon Taiwan 2013 Tutorial
PyCon Taiwan 2013 TutorialPyCon Taiwan 2013 Tutorial
PyCon Taiwan 2013 Tutorial
 
PE Packers Used in Malicious Software - Part 1
PE Packers Used in Malicious Software - Part 1PE Packers Used in Malicious Software - Part 1
PE Packers Used in Malicious Software - Part 1
 
Symbian OS - Descriptors
Symbian OS - DescriptorsSymbian OS - Descriptors
Symbian OS - Descriptors
 
Pycon Sec
Pycon SecPycon Sec
Pycon Sec
 
Erlang Message Passing Concurrency, For The Win
Erlang  Message  Passing  Concurrency,  For  The  WinErlang  Message  Passing  Concurrency,  For  The  Win
Erlang Message Passing Concurrency, For The Win
 
OlinData Puppet Presentation for MOSC 2012
OlinData Puppet Presentation for MOSC 2012OlinData Puppet Presentation for MOSC 2012
OlinData Puppet Presentation for MOSC 2012
 
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
도커 없이 컨테이너 만들기 4편 네트워크네임스페이스 (2)
 
Make container without_docker_6-overlay-network_1
Make container without_docker_6-overlay-network_1 Make container without_docker_6-overlay-network_1
Make container without_docker_6-overlay-network_1
 
Tiny ML for spark Fun Edge
Tiny ML for spark Fun EdgeTiny ML for spark Fun Edge
Tiny ML for spark Fun Edge
 
Linux
LinuxLinux
Linux
 
Additional resources repositories_rpm_forge - centos wiki
Additional resources repositories_rpm_forge - centos wikiAdditional resources repositories_rpm_forge - centos wiki
Additional resources repositories_rpm_forge - centos wiki
 
Comandos routing switching
Comandos routing switchingComandos routing switching
Comandos routing switching
 
ofxTonic und Sound
ofxTonic und SoundofxTonic und Sound
ofxTonic und Sound
 

Viewers also liked

MediaPlayer Playing Flow
MediaPlayer Playing FlowMediaPlayer Playing Flow
MediaPlayer Playing FlowJavid Hsu
 
08 android multimedia_framework_overview
08 android multimedia_framework_overview08 android multimedia_framework_overview
08 android multimedia_framework_overviewArjun Reddy
 
Android media framework overview
Android media framework overviewAndroid media framework overview
Android media framework overviewJerrin George
 
Building an Android Scale Incident Response Process
Building an Android Scale Incident Response ProcessBuilding an Android Scale Incident Response Process
Building an Android Scale Incident Response ProcessPriyanka Aash
 
OpenMAX Overview
OpenMAX OverviewOpenMAX Overview
OpenMAX OverviewYoss Cohen
 
Farewell, Stagefright bugs!
Farewell, Stagefright bugs!Farewell, Stagefright bugs!
Farewell, Stagefright bugs!Tsukasa Oi
 
Stagefright入門
Stagefright入門Stagefright入門
Stagefright入門l_b__
 
Fuzzing the Media Framework in Android
Fuzzing the Media Framework in AndroidFuzzing the Media Framework in Android
Fuzzing the Media Framework in AndroidE Hacking
 
Media Files : Android's New Nightmare
Media Files :  Android's New NightmareMedia Files :  Android's New Nightmare
Media Files : Android's New NightmareOguzhan Topgul
 
20分で理解するdisplaysystem
20分で理解するdisplaysystem20分で理解するdisplaysystem
20分で理解するdisplaysystemmagoroku Yamamoto
 
Surface flingerservice(서피스플링거서비스초기화 jb)
Surface flingerservice(서피스플링거서비스초기화 jb)Surface flingerservice(서피스플링거서비스초기화 jb)
Surface flingerservice(서피스플링거서비스초기화 jb)fefe7270
 
Android's Multimedia Framework
Android's Multimedia FrameworkAndroid's Multimedia Framework
Android's Multimedia FrameworkOpersys inc.
 
Media Source Extensions
Media Source ExtensionsMedia Source Extensions
Media Source ExtensionsFITC
 

Viewers also liked (20)

MediaPlayer Playing Flow
MediaPlayer Playing FlowMediaPlayer Playing Flow
MediaPlayer Playing Flow
 
08 android multimedia_framework_overview
08 android multimedia_framework_overview08 android multimedia_framework_overview
08 android multimedia_framework_overview
 
Android media framework overview
Android media framework overviewAndroid media framework overview
Android media framework overview
 
Building an Android Scale Incident Response Process
Building an Android Scale Incident Response ProcessBuilding an Android Scale Incident Response Process
Building an Android Scale Incident Response Process
 
OpenMAX Overview
OpenMAX OverviewOpenMAX Overview
OpenMAX Overview
 
Farewell, Stagefright bugs!
Farewell, Stagefright bugs!Farewell, Stagefright bugs!
Farewell, Stagefright bugs!
 
Stagefright (1)
Stagefright (1)Stagefright (1)
Stagefright (1)
 
Stagefright入門
Stagefright入門Stagefright入門
Stagefright入門
 
IOMX in Android
IOMX in AndroidIOMX in Android
IOMX in Android
 
Fuzzing the Media Framework in Android
Fuzzing the Media Framework in AndroidFuzzing the Media Framework in Android
Fuzzing the Media Framework in Android
 
Art of public speaking
Art of public speakingArt of public speaking
Art of public speaking
 
Media Files : Android's New Nightmare
Media Files :  Android's New NightmareMedia Files :  Android's New Nightmare
Media Files : Android's New Nightmare
 
Stagefright
StagefrightStagefright
Stagefright
 
20分で理解するdisplaysystem
20分で理解するdisplaysystem20分で理解するdisplaysystem
20分で理解するdisplaysystem
 
Understanding open max il
Understanding open max ilUnderstanding open max il
Understanding open max il
 
Surface flingerservice(서피스플링거서비스초기화 jb)
Surface flingerservice(서피스플링거서비스초기화 jb)Surface flingerservice(서피스플링거서비스초기화 jb)
Surface flingerservice(서피스플링거서비스초기화 jb)
 
Video Streaming
Video StreamingVideo Streaming
Video Streaming
 
Android's Multimedia Framework
Android's Multimedia FrameworkAndroid's Multimedia Framework
Android's Multimedia Framework
 
Media Source Extensions
Media Source ExtensionsMedia Source Extensions
Media Source Extensions
 
Design and Concepts of Android Graphics
Design and Concepts of Android GraphicsDesign and Concepts of Android Graphics
Design and Concepts of Android Graphics
 

Similar to A slightly deeper dive into Stagefright

Stagefright recorder part1
Stagefright recorder part1Stagefright recorder part1
Stagefright recorder part1fefe7270
 
TinyML - 4 speech recognition
TinyML - 4 speech recognition TinyML - 4 speech recognition
TinyML - 4 speech recognition 艾鍗科技
 
เทคโนโลยีสารสนเทศสำหรับครู
เทคโนโลยีสารสนเทศสำหรับครูเทคโนโลยีสารสนเทศสำหรับครู
เทคโนโลยีสารสนเทศสำหรับครูBeauso English
 
Statistical Machine Learning for Text Classification with scikit-learn and NLTK
Statistical Machine Learning for Text Classification with scikit-learn and NLTKStatistical Machine Learning for Text Classification with scikit-learn and NLTK
Statistical Machine Learning for Text Classification with scikit-learn and NLTKOlivier Grisel
 
Introduction GStreamer
Introduction GStreamerIntroduction GStreamer
Introduction GStreamerShih-Yuan Lee
 
JIT compilation for CPython
JIT compilation for CPythonJIT compilation for CPython
JIT compilation for CPythondelimitry
 
12 Monkeys Inside JS Engine
12 Monkeys Inside JS Engine12 Monkeys Inside JS Engine
12 Monkeys Inside JS EngineChengHui Weng
 
Domain-Specific Profiling - TOOLS 2011
Domain-Specific Profiling - TOOLS 2011Domain-Specific Profiling - TOOLS 2011
Domain-Specific Profiling - TOOLS 2011Jorge Ressia
 
Game development
Game developmentGame development
Game developmentAsido_
 
Kamaelia Protocol Walkthrough
Kamaelia Protocol WalkthroughKamaelia Protocol Walkthrough
Kamaelia Protocol Walkthroughkamaelian
 
Porting a Streaming Pipeline from Scala to Rust
Porting a Streaming Pipeline from Scala to RustPorting a Streaming Pipeline from Scala to Rust
Porting a Streaming Pipeline from Scala to RustEvan Chan
 
Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)Itzik Kotler
 
IronSmalltalk
IronSmalltalkIronSmalltalk
IronSmalltalkESUG
 
presentation
presentationpresentation
presentationVideoguy
 

Similar to A slightly deeper dive into Stagefright (20)

No Heap Remote Objects for Distributed real-time Java
No Heap Remote Objects for Distributed real-time JavaNo Heap Remote Objects for Distributed real-time Java
No Heap Remote Objects for Distributed real-time Java
 
Qemu JIT Code Generator and System Emulation
Qemu JIT Code Generator and System EmulationQemu JIT Code Generator and System Emulation
Qemu JIT Code Generator and System Emulation
 
Stagefright recorder part1
Stagefright recorder part1Stagefright recorder part1
Stagefright recorder part1
 
TinyML - 4 speech recognition
TinyML - 4 speech recognition TinyML - 4 speech recognition
TinyML - 4 speech recognition
 
เทคโนโลยีสารสนเทศสำหรับครู
เทคโนโลยีสารสนเทศสำหรับครูเทคโนโลยีสารสนเทศสำหรับครู
เทคโนโลยีสารสนเทศสำหรับครู
 
TinyOS 2.1 Tutorial: TOSSIM
TinyOS 2.1 Tutorial: TOSSIMTinyOS 2.1 Tutorial: TOSSIM
TinyOS 2.1 Tutorial: TOSSIM
 
Songbird
SongbirdSongbird
Songbird
 
Statistical Machine Learning for Text Classification with scikit-learn and NLTK
Statistical Machine Learning for Text Classification with scikit-learn and NLTKStatistical Machine Learning for Text Classification with scikit-learn and NLTK
Statistical Machine Learning for Text Classification with scikit-learn and NLTK
 
Introduction GStreamer
Introduction GStreamerIntroduction GStreamer
Introduction GStreamer
 
JIT compilation for CPython
JIT compilation for CPythonJIT compilation for CPython
JIT compilation for CPython
 
Assembler (2)
Assembler (2)Assembler (2)
Assembler (2)
 
12 Monkeys Inside JS Engine
12 Monkeys Inside JS Engine12 Monkeys Inside JS Engine
12 Monkeys Inside JS Engine
 
Domain-Specific Profiling - TOOLS 2011
Domain-Specific Profiling - TOOLS 2011Domain-Specific Profiling - TOOLS 2011
Domain-Specific Profiling - TOOLS 2011
 
The MPEG Extensible Middleware API
The MPEG Extensible Middleware APIThe MPEG Extensible Middleware API
The MPEG Extensible Middleware API
 
Game development
Game developmentGame development
Game development
 
Kamaelia Protocol Walkthrough
Kamaelia Protocol WalkthroughKamaelia Protocol Walkthrough
Kamaelia Protocol Walkthrough
 
Porting a Streaming Pipeline from Scala to Rust
Porting a Streaming Pipeline from Scala to RustPorting a Streaming Pipeline from Scala to Rust
Porting a Streaming Pipeline from Scala to Rust
 
Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)Hack Like It's 2013 (The Workshop)
Hack Like It's 2013 (The Workshop)
 
IronSmalltalk
IronSmalltalkIronSmalltalk
IronSmalltalk
 
presentation
presentationpresentation
presentation
 

Recently uploaded

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 

Recently uploaded (20)

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 

A slightly deeper dive into Stagefright

  • 1. Stagefright – how it works Alexy Mathew Joseph
  • 2. Who am I?  Works at Pathpartner(pathpartnertech.com) as a Technical Architect.  Working on multimedia frameworks and systems optimization for 8 years.  Contact: galahad@gmail.com
  • 3. Flow  Overview  Architecture  File playback  Recording  Streaming  Hardware accelerated rendering  Tweaking and optimizing  Questions?
  • 4. Overview  Multimedia frameworks - the weight lifters
  • 5. Stagefright  The primary multimedia framework available on Android  Feature set  Supports playback of multiple file formats  Integrates with OpenMax codecs  Recording  RTSP streaming  HTTP streaming
  • 6. The scary block diagram +mSource MP3Decoder FileSource MPEG4Source MediaSource +mAudioSource DataSource +mVideoSource HTTPDataSour AVCDecoder ce +mSource MP3Source MediaExtractor OMXCodec AwesomePlayer IOMX MPEG4Extractor MP3Extractor TimedEventQueue OMX OMXClient AwesomeRenderer AudioPlayer AudioTrack AwesomeRem AwesomeLocalR (media OMXMaster IOMXRender framework) oteRenderer enderer 0...n TimeSource MediaPlayerBase:AudioSink SoftwareRen (media framework) OMXPluginBase OMXRender VideoRender der SystemTimeSource MediaPlayerInterface OMXPVCodecs HardwareRe (media framework) iSurface OMXPlugin StageFrightPlayer Plugin nder (surfaceflinger)
  • 7. Components  DataSource  Media Extractor  Media Source  Media Buffer  Meta Data  OMXCodec  Camera Source  Media Writer
  • 8. File playback  Awesome Player  File playback  HTTP  RTSP  Components  Timed queue  AV sync
  • 9. Caveats  AV synch tweaks.  Fast forward/rewind  Codec configuration
  • 10. Recording  Consists of CameraSource, OMXCodec, MPEG4Writer.
  • 11. Caveats  Exchanging buffers with the camera  Hardware codec integration and the troubles
  • 12. Streaming support  RTSP streaming – the basics
  • 13. Thread Alooper:Looper Thread ALooper HandlerI AMessage ALooperRoster nfo 0..n registerHandler() mTarget post() registerHandler() unregisterHandler() postMessage() AHandler deliverMessage() onMessageReceived() MediaExtra looper() ctor ARTPAssembler +mNotifyMsg ARTSPCont AHandlerR ARTSPCon ARTPConne ARTPSource roller eflector<T> MyHan nection ction dler assembleMore() AMPEG4Audio Assembler 0..n +mNotifyMsg ARTPSe AAMRAss AAVCAssem AH263Asse AMPEG4Element MediaSource APacketSource TrackInfo aryAssembler ssion embler bler mbler MediaWriter ARTPWriter
  • 14. Components  ARTSPController  ARTSPConnection  ARTPConnection  ARTPSource  ARTPAssembler  AAMRAssembler is an example
  • 15. Gaps and further work  Jitter buffer  Error correction and feedback  RTCP handling
  • 16. Hardware rendering  VideoRenderer class  Instantiating Hardware overlay
  • 17. Tweaking and optimizing  Copies  Latency  Slice mode  Signaling errors from decoder
  • 18. References  http://freepine.blogspot.com/2010/01/overview-of- stagefrighter-player.html  http://freepine.blogspot.com/2010/09/rtsp-in- stagefright-1.html  http://freepine.blogspot.com/2010/09/rtsp-in- stagefright-2.html  http://iamkcspa.pixnet.net/blog/category/1793816

Editor's Notes

  1. Give overview of multimedia frameworks and its use.
  2. Mention about opencore and the transition from opencore to stagefright in froyo.Mention about move to OpenMax AL as an alternative in Ice cream sandwich.
  3. DataSource – Baseclass for all data source. Sniffers are registered from here. This is what is used to find file/mime types. For e.g., FileExtractor, MPEG4DataSource etc.MediaExtractor – Talks to Data sources and parses data to extract media content. MPEG4Extractor is an example of this.MediaSource – The source of media data flowing through stagefright. Every component which needs to exchange media data have to be of this type. MPEG4Source is an example.MediaBuffer – object to pass data around. Supports reference counting, MIME types, timestamps etc. Also of interest is the MediaBufferGroup.MetaData – the ambassador. The structure used to exchange info b.w two components. Config info, Mime type, etcOMXCodec – the wrapper over the encoder and decoder components. Controls the whole life cycle of the OpenMax Codec (mention the life stages)CameraSource – Is the source node which feeds data for video recording. MediaWriter – sink node and the base class for all writers
  4. Give overview of the flow from the top level media APIs to the bottom File playback is a sequence of initializing input nodes, finding data types, instantiating necessary decoders and using this info to instantiate renderers. A decode sequence involves extractors extracting the buffers and this gets is passed onto the OMXCodec. After decoding is complete, awesome renderer renders it using the renderer.TimedQueue is what is used to sleep on and achieve AV Sync. The clock gets updated from audio player depending on the amount of data played back.
  5. What is important here is the passing around of config dataGive example of SKYPE
  6. Will be describing the basics behind RTSP streaming here. The blocks involved.Has support for AMR, H.263, H.264, MPEG4.
  7. ARTSP Controller is the media extractor, and the RTP stuff is taken care by ARTPConnection or ARTPSource. RTSP stuff is handled ARTSPConnection. Mention about looper and message posting.ARTSPConnection takes care of sending requests and receiving responses, ARTPConnection receives the packet, but the parsing is delegated to ARTPAssembler which assembles it using the codec specific assembler, through the ARTPSource.ARTPSession has a track info and the data is queued