SlideShare ist ein Scribd-Unternehmen logo
1 von 29
Getting the most out of
QtMultimediaKit on mobile

      Gareth Stockwell
Accenture
• It‟s not just a management consultancy ...
• I work for a division called Accenture Mobility
   – Provides Mobility aspects of end-to-end solutions
   – Work on many mobile/embedded platforms
       • Android, iOS, MeeGo, Symbian, Windows Phone ...
   – In a wide range of industry sectors
       • Healthcare, automotive, retail, consumer electronics ...
   – Some of us even get to hack on Qt 
About me
• Based in London, UK
• 6 years in embedded software
   – Mostly on Symbian
   – Mostly developing multimedia adaptations, lately some graphics
• 2 years developing Symbian port of Qt
   – Phonon MMF backend
   – QAudio backend
   – QtMultimediaKit, mostly around video rendering
Conventions

• Source code for the demos shown is available at
  https://gitorious.org/garethstockwell-qtdevdays-2011/mainline


• Path within the repository is shown as
   $DD11/examples/foo


• Logos show which platform(s) a topic or example applies
  to
Overview
• QtMultimediaKit provides cross-platform abstractions
   – So why do you need to care whether you are targeting a mobile
     device?
   – Where are the limitations and leaks in those abstractions?
• How can you tune your code so that it works well in the
  constrained mobile environment?
Mobile considerations

         Less processing power
                                      Low latency processing
     Reliance on co-processors




    Multiple connectivity options     Access point control




                                      Memory management
                Limited memory
                                        and monitoring
         Latency

Portable – always in your pocket          Cool demos
Achieving low latency
Sources of latency


                                                 time


Resource
                     Buffering        Playback
allocation



    Media playback use case



                Real-time use cases
Media playback: startup latency

                          Resource
                                                   Buffering           Playback
                          allocation


MediaStatus     NoMedia     Loading      Loaded     Buffering   Buffered




     QML      audio.source = “foo.mp3”      audio.play()


    Native    m_audio->setMedia(...);       m_audio->play()


 • Startup latency can be minimised by pre-loading media
   sources where possible
 • Buffering latency is not controllable via QtMultimediaKit
   high-level APIs
Media playback: startup latency

Demo                            $DD11/audioplayer




                                         Pure QML app
Low level audio APIs

                                    QAudioInput            QIODevice


                QIODevice            QAudioOutput



Push       QIODevice *QAudioOutput::start();

       +    Easy to use – no need to implement QIODevice
       -    Requires an extra buffer copy from client data into the audio stack


Pull       void QAudioOutput::start(QIODevice *device);

        Best choice for low-latency processing
Real time audio latency
                                                               time


                  Buffering                 Playback


         Real-time data generation


   Impulse
                    • Keep buffer size to a minimum
e.g. User input          – But beware of underflow
                    • This is controllable via an API
                              void QAudioOutput::setBufferSize(int value);


                         – But this isn‟t supported on Symbian
                         – Here, you can control the buffering instead via the
                           source QIODevice
                              qint64 QIODevice::bytesAvailable() const;
Real time audio latency

Demo                                $DD11/qpiano




                                 Hybrid QML / C++ app

                                 Guess what it does ...
Network streaming
Access point selection
• By default, the access point will be chosen by the
  platform
   – May involve popping up a dialog for the user
• Apps may want programmatic control
   – For application-specific reasons (e.g. video chat protocol won‟t
     work well over laggy cellular networks)
   – To simplify the UX

  QList<QNetworkConfiguration>
      QNetworkConfigurationManager::allConfigurations(...) const;

  void QMediaPlayer::setNetworkConfigurations(
      const QList<QNetworkConfiguration> &configurations);

  QNetworkConfiguration QMediaPlayer::currentNetworkConfiguration() const;
Access point selection

Demo                                      $DD11/networkplayer

 Hybrid QML / C++ app

No access point selection
 QML bindings provided                 Network configuration state
    in QtMultimediaKit                       Undefined
                                             Defined
                                             Discovered
                                             Active
Memory management
and monitoring
GPU memory constraints
• Current S^3 devices have only 32MB graphics memory
   – This is shared by the graphics subsystem (GLES and VG
     engines) and the multimedia subsystem (video and camera)
   – Combination of heavy graphics use cases (e.g. storing large
     QPixmaps or textures on the GPU) with MM (e.g. playback of
     high-resolution video clips; starting camera viewfinder) can
     quickly exhaust the memory
• It can be difficult to understand whether a given bug is
  due to GOOM
   – There is an API via which GPU memory usage can be queried
   – There are some strategies which can be used to minimise GPU
     memory usage
• The good news: the next generation of S^3
  devices, starting with the C7-01, have 128MB
Memory usage monitoring
• EGL_NOK_resource_profiling
  – Provides total memory, total used memory, and per-process
    usage
  – API is not very friendly (particularly when compared to Qt APIs)
  – So I wrote a Qt wrapper
 class GraphicsMemoryMonitor : public QObject
 {
     Q_PROPERTY(qint64 totalMemory READ totalMemory
                NOTIFY totalMemoryChanged)
     Q_PROPERTY(qint64 usedMemory READ usedMemory
                NOTIFY usedMemoryChanged)
     Q_PROPERTY(qint64 currentProcessUsage READ currentProcessUsage
                NOTIFY currentProcessUsageChanged)
     ...
 };
                            $DD11/snippets/graphicsmemorymonitor
Memory usage monitoring


                                               Total usage


                                               Current process usage *


                                               Total memory




• Not all memory allocations are correctly tagged
   – Here, the 3.84MB is the EGL window surface
   – Memory consumed by the video decoder is not represented
   – So the only reliable measurement is the total usage


                                        Demo     $DD11/videoplayer
Mimimising camera memory usage

Demo    $DD11/viewfinder



• The image capture ISP firmware module
  consumes several MB
    – So if you only need a viewfinder, switch to
      video capture mode

  m_camera->setCaptureMode(QCamera::CaptureModeVideo);


    – You may also need to lower the viewfinder
      resolution
  QMediaRecorder *mediaRecorder = new QMediaRecorder(m_camera);
  QVideoEncoderSettings videoSettings = mediaRecorder->videoSettings();
  videoSettings->setResolution(QSize(320, 240));
  mediaRecorder->setEncodingSettings(audioSettings, videoSettings);
Cool stuff alert


Advanced video rendering
Video post-processing with GLSL
    • If QAbstractVideoSurface returns texture handles, we
      can use QGLShaderProgram to apply effects
    • From Qt 4.7.4, this becomes much easier, as we can
      embed GLSL directly in QML via ShaderEffectItem
ShaderEffectItem {
    property variant source: ShaderEffectSource { sourceItem: anItem; hideSource: true }
    property real granularity: 10
    property int targetSize: 256

     fragmentShader: "
         uniform highp float granularity;
         uniform sampler2D source;
         uniform highp float targetSize;
         uniform lowp float qt_Opacity;
         varying highp vec2 qt_TexCoord0;
         void main() {
             vec2 uv = qt_TexCoord0.xy;
             float dx = granularity / targetSize;
             float dy = granularity / targetSize;
             vec2 tc = vec2(dx*(floor(uv.x/dx) + 0.5),
                            dy*(floor(uv.y/dy) + 0.5));
             gl_FragColor = qt_Opacity * texture2D(source, tc);
         }"
}
Video post-processing with GLSL

Demo     $DD11/qmlvideofx




                                                             Pure QML app (!)


 • Possible use cases
       – Video playback transition effects (e.g. pixellated fade-in)
       – Camera „ageing‟, applied both to viewfinder and captured images
Video and Qt3D
• Qt3D provides the Material               import   QtQuick 1.0
                                           import   QtQuick3D 1.0
  abstraction, which can be a wrapper      import   VideoTexture 1.0
                                           import   TextureStream 1.0
  around a texture
   – But at present, it doesn‟t abstract   Rectangle {
                                               width: 600
     texture streams                           height: 600

• With a bit of C++, we can provide            VideoTexture {
                                                   id: video
  the glue which pipes                             source: "test.mp4”
  QAbstractVideoSurface output into            }

  a Qt3D material                              Viewport {
                                                   Cube { id: cube }
   – Requires definition of some new QML       }
     elements
                                               TextureStream {
                                                   source: video
                                                   target: cube
                                               }
                                           }
Video and Qt3D

Demo   Source not available yet, sorry...




                                            Hybrid QML / C++ app

                                            C++ provides the glue
                                                 which sticks
                                            QtMultimediaKit to Qt3D
Summary

• Low latency
   – Startup
   – Steady state


• Network access point control

• Graphics memory usage
   – Monitoring
   – Reduction


• Advanced video rendering
   – Shader effects
   – 3D
Feedback

      Remember to send your session feedback
      via the Qt Developer Days app

       Get the app by
       • Tapping one of the NFC tags on the event floor
       • Downloading the “Qt Developer Days” app from Nokia
       Store
       • Downloading from qt.nokia.com/qtdevdays2011
       • Visiting m.qtdevdays2011.qt.nokia.com to use web
       version
Thanks for listening

Questions?

Weitere ähnliche Inhalte

Was ist angesagt?

Introduction to parallel computing using CUDA
Introduction to parallel computing using CUDAIntroduction to parallel computing using CUDA
Introduction to parallel computing using CUDAMartin Peniak
 
An Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware Webinar
An Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware WebinarAn Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware Webinar
An Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware WebinarAMD Developer Central
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
 
Monte Carlo G P U Jan2010
Monte  Carlo  G P U  Jan2010Monte  Carlo  G P U  Jan2010
Monte Carlo G P U Jan2010John Holden
 
Nvidia cuda tutorial_no_nda_apr08
Nvidia cuda tutorial_no_nda_apr08Nvidia cuda tutorial_no_nda_apr08
Nvidia cuda tutorial_no_nda_apr08Angela Mendoza M.
 
Introduction to CUDA
Introduction to CUDAIntroduction to CUDA
Introduction to CUDARaymond Tay
 
Shader model 5 0 and compute shader
Shader model 5 0 and compute shaderShader model 5 0 and compute shader
Shader model 5 0 and compute shaderzaywalker
 
Direct3D12 and the Future of Graphics APIs by Dave Oldcorn
Direct3D12 and the Future of Graphics APIs by Dave OldcornDirect3D12 and the Future of Graphics APIs by Dave Oldcorn
Direct3D12 and the Future of Graphics APIs by Dave OldcornAMD Developer Central
 
Cuda introduction
Cuda introductionCuda introduction
Cuda introductionHanibei
 
A beginner’s guide to programming GPUs with CUDA
A beginner’s guide to programming GPUs with CUDAA beginner’s guide to programming GPUs with CUDA
A beginner’s guide to programming GPUs with CUDAPiyush Mittal
 
Gpu with cuda architecture
Gpu with cuda architectureGpu with cuda architecture
Gpu with cuda architectureDhaval Kaneria
 
Can we boost more HPC performance? Integrate IBM POWER servers with GPUs to O...
Can we boost more HPC performance? Integrate IBM POWER servers with GPUs to O...Can we boost more HPC performance? Integrate IBM POWER servers with GPUs to O...
Can we boost more HPC performance? Integrate IBM POWER servers with GPUs to O...NTT Communications Technology Development
 
Computing using GPUs
Computing using GPUsComputing using GPUs
Computing using GPUsShree Kumar
 

Was ist angesagt? (18)

Introduction to parallel computing using CUDA
Introduction to parallel computing using CUDAIntroduction to parallel computing using CUDA
Introduction to parallel computing using CUDA
 
An Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware Webinar
An Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware WebinarAn Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware Webinar
An Introduction to OpenCL™ Programming with AMD GPUs - AMD & Acceleware Webinar
 
GPU: Understanding CUDA
GPU: Understanding CUDAGPU: Understanding CUDA
GPU: Understanding CUDA
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
 
Monte Carlo G P U Jan2010
Monte  Carlo  G P U  Jan2010Monte  Carlo  G P U  Jan2010
Monte Carlo G P U Jan2010
 
Nvidia cuda tutorial_no_nda_apr08
Nvidia cuda tutorial_no_nda_apr08Nvidia cuda tutorial_no_nda_apr08
Nvidia cuda tutorial_no_nda_apr08
 
Introduction to CUDA
Introduction to CUDAIntroduction to CUDA
Introduction to CUDA
 
Parallel Vision by GPGPU/CUDA
Parallel Vision by GPGPU/CUDAParallel Vision by GPGPU/CUDA
Parallel Vision by GPGPU/CUDA
 
Cuda tutorial
Cuda tutorialCuda tutorial
Cuda tutorial
 
Shader model 5 0 and compute shader
Shader model 5 0 and compute shaderShader model 5 0 and compute shader
Shader model 5 0 and compute shader
 
Cuda
CudaCuda
Cuda
 
Direct3D12 and the Future of Graphics APIs by Dave Oldcorn
Direct3D12 and the Future of Graphics APIs by Dave OldcornDirect3D12 and the Future of Graphics APIs by Dave Oldcorn
Direct3D12 and the Future of Graphics APIs by Dave Oldcorn
 
Cuda introduction
Cuda introductionCuda introduction
Cuda introduction
 
CUDA
CUDACUDA
CUDA
 
A beginner’s guide to programming GPUs with CUDA
A beginner’s guide to programming GPUs with CUDAA beginner’s guide to programming GPUs with CUDA
A beginner’s guide to programming GPUs with CUDA
 
Gpu with cuda architecture
Gpu with cuda architectureGpu with cuda architecture
Gpu with cuda architecture
 
Can we boost more HPC performance? Integrate IBM POWER servers with GPUs to O...
Can we boost more HPC performance? Integrate IBM POWER servers with GPUs to O...Can we boost more HPC performance? Integrate IBM POWER servers with GPUs to O...
Can we boost more HPC performance? Integrate IBM POWER servers with GPUs to O...
 
Computing using GPUs
Computing using GPUsComputing using GPUs
Computing using GPUs
 

Andere mochten auch

Assignment03 luciddreams(1)
Assignment03 luciddreams(1)Assignment03 luciddreams(1)
Assignment03 luciddreams(1)Per Lingvall
 
Andrea borden powerpoint project
Andrea borden powerpoint projectAndrea borden powerpoint project
Andrea borden powerpoint projectAndreaBorden
 
Bai3cautrucdieukhien 130622085309-phpapp02
Bai3cautrucdieukhien 130622085309-phpapp02Bai3cautrucdieukhien 130622085309-phpapp02
Bai3cautrucdieukhien 130622085309-phpapp02Tiểu Sương Lãnh
 
Andrea borden powerpoint project
Andrea borden powerpoint projectAndrea borden powerpoint project
Andrea borden powerpoint projectAndreaBorden
 
Vivant - INNOVATION EXPERTS
Vivant - INNOVATION EXPERTSVivant - INNOVATION EXPERTS
Vivant - INNOVATION EXPERTSRob Collins
 
2013 Digital Marketing Vietnam-5 Paradigms
2013 Digital Marketing Vietnam-5 Paradigms2013 Digital Marketing Vietnam-5 Paradigms
2013 Digital Marketing Vietnam-5 ParadigmsClaire Gruslin
 
Vivant - INNOVATION EXPERTS
Vivant - INNOVATION EXPERTSVivant - INNOVATION EXPERTS
Vivant - INNOVATION EXPERTSRob Collins
 
Creation of LSE Digital Library
Creation of LSE Digital LibraryCreation of LSE Digital Library
Creation of LSE Digital LibraryEd Fay
 
Soft x3000 operation manual configuration guide
Soft x3000 operation manual configuration guideSoft x3000 operation manual configuration guide
Soft x3000 operation manual configuration guideTuhin Narayan
 

Andere mochten auch (16)

Linguas indoeuropeas
Linguas indoeuropeasLinguas indoeuropeas
Linguas indoeuropeas
 
Assignment03 luciddreams(1)
Assignment03 luciddreams(1)Assignment03 luciddreams(1)
Assignment03 luciddreams(1)
 
Luminare, inc
Luminare, incLuminare, inc
Luminare, inc
 
Andrea borden powerpoint project
Andrea borden powerpoint projectAndrea borden powerpoint project
Andrea borden powerpoint project
 
Luminare, inc
Luminare, incLuminare, inc
Luminare, inc
 
Bai3cautrucdieukhien 130622085309-phpapp02
Bai3cautrucdieukhien 130622085309-phpapp02Bai3cautrucdieukhien 130622085309-phpapp02
Bai3cautrucdieukhien 130622085309-phpapp02
 
Luminare, inc
Luminare, incLuminare, inc
Luminare, inc
 
Luminare, inc
Luminare, incLuminare, inc
Luminare, inc
 
Portraits
PortraitsPortraits
Portraits
 
Feinberg
FeinbergFeinberg
Feinberg
 
Andrea borden powerpoint project
Andrea borden powerpoint projectAndrea borden powerpoint project
Andrea borden powerpoint project
 
Vivant - INNOVATION EXPERTS
Vivant - INNOVATION EXPERTSVivant - INNOVATION EXPERTS
Vivant - INNOVATION EXPERTS
 
2013 Digital Marketing Vietnam-5 Paradigms
2013 Digital Marketing Vietnam-5 Paradigms2013 Digital Marketing Vietnam-5 Paradigms
2013 Digital Marketing Vietnam-5 Paradigms
 
Vivant - INNOVATION EXPERTS
Vivant - INNOVATION EXPERTSVivant - INNOVATION EXPERTS
Vivant - INNOVATION EXPERTS
 
Creation of LSE Digital Library
Creation of LSE Digital LibraryCreation of LSE Digital Library
Creation of LSE Digital Library
 
Soft x3000 operation manual configuration guide
Soft x3000 operation manual configuration guideSoft x3000 operation manual configuration guide
Soft x3000 operation manual configuration guide
 

Ähnlich wie qtdd11_qtmultimediakitonmobile

Let's make it flow ... one way
Let's make it flow ... one wayLet's make it flow ... one way
Let's make it flow ... one wayRoberto Ciatti
 
Java and Containers - Make it Awesome !
Java and Containers - Make it Awesome !Java and Containers - Make it Awesome !
Java and Containers - Make it Awesome !Dinakar Guniguntala
 
Newbie’s guide to_the_gpgpu_universe
Newbie’s guide to_the_gpgpu_universeNewbie’s guide to_the_gpgpu_universe
Newbie’s guide to_the_gpgpu_universeOfer Rosenberg
 
AIST Super Green Cloud: lessons learned from the operation and the performanc...
AIST Super Green Cloud: lessons learned from the operation and the performanc...AIST Super Green Cloud: lessons learned from the operation and the performanc...
AIST Super Green Cloud: lessons learned from the operation and the performanc...Ryousei Takano
 
Method of NUMA-Aware Resource Management for Kubernetes 5G NFV Cluster
Method of NUMA-Aware Resource Management for Kubernetes 5G NFV ClusterMethod of NUMA-Aware Resource Management for Kubernetes 5G NFV Cluster
Method of NUMA-Aware Resource Management for Kubernetes 5G NFV Clusterbyonggon chun
 
Porting Tizen-IVI 3.0 to an ARM based SoC Platform
Porting Tizen-IVI 3.0 to an ARM based SoC PlatformPorting Tizen-IVI 3.0 to an ARM based SoC Platform
Porting Tizen-IVI 3.0 to an ARM based SoC PlatformRyo Jin
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
 
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...Amazon Web Services
 
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...Amazon Web Services
 
Introducing Container Technology to TSUBAME3.0 Supercomputer
Introducing Container Technology to TSUBAME3.0 SupercomputerIntroducing Container Technology to TSUBAME3.0 Supercomputer
Introducing Container Technology to TSUBAME3.0 SupercomputerAkihiro Nomura
 
”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016Kuniyasu Suzaki
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computingArka Ghosh
 
Achieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVMAchieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVMDevOps.com
 
Improving MeeGo boot-up time
Improving MeeGo boot-up timeImproving MeeGo boot-up time
Improving MeeGo boot-up timeHiroshi Doyu
 
JITServerTalk.pdf
JITServerTalk.pdfJITServerTalk.pdf
JITServerTalk.pdfRichHagarty
 
Droidcon2013 triangles gangolells_imagination
Droidcon2013 triangles gangolells_imaginationDroidcon2013 triangles gangolells_imagination
Droidcon2013 triangles gangolells_imaginationDroidcon Berlin
 
How to Puppetize Google Cloud Platform - PuppetConf 2014
How to Puppetize Google Cloud Platform - PuppetConf 2014How to Puppetize Google Cloud Platform - PuppetConf 2014
How to Puppetize Google Cloud Platform - PuppetConf 2014Puppet
 
Achieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVMAchieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVMdata://disrupted®
 
Include os @ flossuk 2018
Include os @ flossuk 2018Include os @ flossuk 2018
Include os @ flossuk 2018Per Buer
 

Ähnlich wie qtdd11_qtmultimediakitonmobile (20)

Let's make it flow ... one way
Let's make it flow ... one wayLet's make it flow ... one way
Let's make it flow ... one way
 
Java and Containers - Make it Awesome !
Java and Containers - Make it Awesome !Java and Containers - Make it Awesome !
Java and Containers - Make it Awesome !
 
Newbie’s guide to_the_gpgpu_universe
Newbie’s guide to_the_gpgpu_universeNewbie’s guide to_the_gpgpu_universe
Newbie’s guide to_the_gpgpu_universe
 
AIST Super Green Cloud: lessons learned from the operation and the performanc...
AIST Super Green Cloud: lessons learned from the operation and the performanc...AIST Super Green Cloud: lessons learned from the operation and the performanc...
AIST Super Green Cloud: lessons learned from the operation and the performanc...
 
Method of NUMA-Aware Resource Management for Kubernetes 5G NFV Cluster
Method of NUMA-Aware Resource Management for Kubernetes 5G NFV ClusterMethod of NUMA-Aware Resource Management for Kubernetes 5G NFV Cluster
Method of NUMA-Aware Resource Management for Kubernetes 5G NFV Cluster
 
Porting Tizen-IVI 3.0 to an ARM based SoC Platform
Porting Tizen-IVI 3.0 to an ARM based SoC PlatformPorting Tizen-IVI 3.0 to an ARM based SoC Platform
Porting Tizen-IVI 3.0 to an ARM based SoC Platform
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
 
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
 
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
SRV402 Deep Dive on Amazon EC2 Instances, Featuring Performance Optimization ...
 
Introducing Container Technology to TSUBAME3.0 Supercomputer
Introducing Container Technology to TSUBAME3.0 SupercomputerIntroducing Container Technology to TSUBAME3.0 Supercomputer
Introducing Container Technology to TSUBAME3.0 Supercomputer
 
”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016”Bare-Metal Container" presented at HPCC2016
”Bare-Metal Container" presented at HPCC2016
 
Vpu technology &gpgpu computing
Vpu technology &gpgpu computingVpu technology &gpgpu computing
Vpu technology &gpgpu computing
 
Achieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVMAchieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVM
 
Improving MeeGo boot-up time
Improving MeeGo boot-up timeImproving MeeGo boot-up time
Improving MeeGo boot-up time
 
JITServerTalk.pdf
JITServerTalk.pdfJITServerTalk.pdf
JITServerTalk.pdf
 
Droidcon2013 triangles gangolells_imagination
Droidcon2013 triangles gangolells_imaginationDroidcon2013 triangles gangolells_imagination
Droidcon2013 triangles gangolells_imagination
 
How to Puppetize Google Cloud Platform - PuppetConf 2014
How to Puppetize Google Cloud Platform - PuppetConf 2014How to Puppetize Google Cloud Platform - PuppetConf 2014
How to Puppetize Google Cloud Platform - PuppetConf 2014
 
Achieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVMAchieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVM
 
Include os @ flossuk 2018
Include os @ flossuk 2018Include os @ flossuk 2018
Include os @ flossuk 2018
 

Kürzlich hochgeladen

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
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
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 
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
 
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
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
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!
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 
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
 
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
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 

qtdd11_qtmultimediakitonmobile

  • 1. Getting the most out of QtMultimediaKit on mobile Gareth Stockwell
  • 2. Accenture • It‟s not just a management consultancy ... • I work for a division called Accenture Mobility – Provides Mobility aspects of end-to-end solutions – Work on many mobile/embedded platforms • Android, iOS, MeeGo, Symbian, Windows Phone ... – In a wide range of industry sectors • Healthcare, automotive, retail, consumer electronics ... – Some of us even get to hack on Qt 
  • 3. About me • Based in London, UK • 6 years in embedded software – Mostly on Symbian – Mostly developing multimedia adaptations, lately some graphics • 2 years developing Symbian port of Qt – Phonon MMF backend – QAudio backend – QtMultimediaKit, mostly around video rendering
  • 4. Conventions • Source code for the demos shown is available at https://gitorious.org/garethstockwell-qtdevdays-2011/mainline • Path within the repository is shown as $DD11/examples/foo • Logos show which platform(s) a topic or example applies to
  • 5. Overview • QtMultimediaKit provides cross-platform abstractions – So why do you need to care whether you are targeting a mobile device? – Where are the limitations and leaks in those abstractions? • How can you tune your code so that it works well in the constrained mobile environment?
  • 6. Mobile considerations Less processing power Low latency processing Reliance on co-processors Multiple connectivity options Access point control Memory management Limited memory and monitoring Latency Portable – always in your pocket Cool demos
  • 8. Sources of latency time Resource Buffering Playback allocation Media playback use case Real-time use cases
  • 9. Media playback: startup latency Resource Buffering Playback allocation MediaStatus NoMedia Loading Loaded Buffering Buffered QML audio.source = “foo.mp3” audio.play() Native m_audio->setMedia(...); m_audio->play() • Startup latency can be minimised by pre-loading media sources where possible • Buffering latency is not controllable via QtMultimediaKit high-level APIs
  • 10. Media playback: startup latency Demo $DD11/audioplayer Pure QML app
  • 11. Low level audio APIs QAudioInput QIODevice QIODevice QAudioOutput Push QIODevice *QAudioOutput::start(); + Easy to use – no need to implement QIODevice - Requires an extra buffer copy from client data into the audio stack Pull void QAudioOutput::start(QIODevice *device);  Best choice for low-latency processing
  • 12. Real time audio latency time Buffering Playback Real-time data generation Impulse • Keep buffer size to a minimum e.g. User input – But beware of underflow • This is controllable via an API void QAudioOutput::setBufferSize(int value); – But this isn‟t supported on Symbian – Here, you can control the buffering instead via the source QIODevice qint64 QIODevice::bytesAvailable() const;
  • 13. Real time audio latency Demo $DD11/qpiano Hybrid QML / C++ app Guess what it does ...
  • 15. Access point selection • By default, the access point will be chosen by the platform – May involve popping up a dialog for the user • Apps may want programmatic control – For application-specific reasons (e.g. video chat protocol won‟t work well over laggy cellular networks) – To simplify the UX QList<QNetworkConfiguration> QNetworkConfigurationManager::allConfigurations(...) const; void QMediaPlayer::setNetworkConfigurations( const QList<QNetworkConfiguration> &configurations); QNetworkConfiguration QMediaPlayer::currentNetworkConfiguration() const;
  • 16. Access point selection Demo $DD11/networkplayer Hybrid QML / C++ app No access point selection QML bindings provided Network configuration state in QtMultimediaKit Undefined Defined Discovered Active
  • 18. GPU memory constraints • Current S^3 devices have only 32MB graphics memory – This is shared by the graphics subsystem (GLES and VG engines) and the multimedia subsystem (video and camera) – Combination of heavy graphics use cases (e.g. storing large QPixmaps or textures on the GPU) with MM (e.g. playback of high-resolution video clips; starting camera viewfinder) can quickly exhaust the memory • It can be difficult to understand whether a given bug is due to GOOM – There is an API via which GPU memory usage can be queried – There are some strategies which can be used to minimise GPU memory usage • The good news: the next generation of S^3 devices, starting with the C7-01, have 128MB
  • 19. Memory usage monitoring • EGL_NOK_resource_profiling – Provides total memory, total used memory, and per-process usage – API is not very friendly (particularly when compared to Qt APIs) – So I wrote a Qt wrapper class GraphicsMemoryMonitor : public QObject { Q_PROPERTY(qint64 totalMemory READ totalMemory NOTIFY totalMemoryChanged) Q_PROPERTY(qint64 usedMemory READ usedMemory NOTIFY usedMemoryChanged) Q_PROPERTY(qint64 currentProcessUsage READ currentProcessUsage NOTIFY currentProcessUsageChanged) ... }; $DD11/snippets/graphicsmemorymonitor
  • 20. Memory usage monitoring Total usage Current process usage * Total memory • Not all memory allocations are correctly tagged – Here, the 3.84MB is the EGL window surface – Memory consumed by the video decoder is not represented – So the only reliable measurement is the total usage Demo $DD11/videoplayer
  • 21. Mimimising camera memory usage Demo $DD11/viewfinder • The image capture ISP firmware module consumes several MB – So if you only need a viewfinder, switch to video capture mode m_camera->setCaptureMode(QCamera::CaptureModeVideo); – You may also need to lower the viewfinder resolution QMediaRecorder *mediaRecorder = new QMediaRecorder(m_camera); QVideoEncoderSettings videoSettings = mediaRecorder->videoSettings(); videoSettings->setResolution(QSize(320, 240)); mediaRecorder->setEncodingSettings(audioSettings, videoSettings);
  • 22. Cool stuff alert Advanced video rendering
  • 23. Video post-processing with GLSL • If QAbstractVideoSurface returns texture handles, we can use QGLShaderProgram to apply effects • From Qt 4.7.4, this becomes much easier, as we can embed GLSL directly in QML via ShaderEffectItem ShaderEffectItem { property variant source: ShaderEffectSource { sourceItem: anItem; hideSource: true } property real granularity: 10 property int targetSize: 256 fragmentShader: " uniform highp float granularity; uniform sampler2D source; uniform highp float targetSize; uniform lowp float qt_Opacity; varying highp vec2 qt_TexCoord0; void main() { vec2 uv = qt_TexCoord0.xy; float dx = granularity / targetSize; float dy = granularity / targetSize; vec2 tc = vec2(dx*(floor(uv.x/dx) + 0.5), dy*(floor(uv.y/dy) + 0.5)); gl_FragColor = qt_Opacity * texture2D(source, tc); }" }
  • 24. Video post-processing with GLSL Demo $DD11/qmlvideofx Pure QML app (!) • Possible use cases – Video playback transition effects (e.g. pixellated fade-in) – Camera „ageing‟, applied both to viewfinder and captured images
  • 25. Video and Qt3D • Qt3D provides the Material import QtQuick 1.0 import QtQuick3D 1.0 abstraction, which can be a wrapper import VideoTexture 1.0 import TextureStream 1.0 around a texture – But at present, it doesn‟t abstract Rectangle { width: 600 texture streams height: 600 • With a bit of C++, we can provide VideoTexture { id: video the glue which pipes source: "test.mp4” QAbstractVideoSurface output into } a Qt3D material Viewport { Cube { id: cube } – Requires definition of some new QML } elements TextureStream { source: video target: cube } }
  • 26. Video and Qt3D Demo Source not available yet, sorry... Hybrid QML / C++ app C++ provides the glue which sticks QtMultimediaKit to Qt3D
  • 27. Summary • Low latency – Startup – Steady state • Network access point control • Graphics memory usage – Monitoring – Reduction • Advanced video rendering – Shader effects – 3D
  • 28. Feedback Remember to send your session feedback via the Qt Developer Days app Get the app by • Tapping one of the NFC tags on the event floor • Downloading the “Qt Developer Days” app from Nokia Store • Downloading from qt.nokia.com/qtdevdays2011 • Visiting m.qtdevdays2011.qt.nokia.com to use web version

Hinweis der Redaktion

  1. QtMultimediaKit provides cross-platform abstractions, so the same code should work on both desktop and mobile platforms But in practice, it often has to be tweaked or tuned to work well in the constrained context of a mobile device This presentation will look at which aspects of mobile devices are relevant to app developers using QtMultimediaKit It will provide some tips on how those constraints can be managed The demos shown have been tested on Symbian and Harmattan
  2. Demonstrate that pre-loading an audio clip noticeably reduces the startup latency Show that a second clip can be loaded while the first is still playing – this allows for gapless playlist playback
  3. On Symbian, buffer size can be managed in pull mode by throttling the amount of data via QIODevice::bytesAvailable
  4. Show that pull mode with a buffer size of ~12-25ms gives the best user experience Show that further reducing the buffer size causes underflow, leading to nasty audio jittering
  5. QtMultimediaKit provides various APIs for getting multimedia data from a network stream into the native MM stack The most high-level is passing a QUrl to QMediaPlayer::setSource Where a custom networking protocol and/or DRM scheme is required, the app can manage the network interaction via QTcpSocket, and pass a QIODevice to QMediaPlayer This is not supported on Symbian due to limitations of the native MM stack For playback of audio streams which are not encapsulated in containers, QIODevice can be provided to QAudioOutput Support for playback of encoded audio streams via QAudioOutput varies by platform On platforms which support only PCM, the app will need to manage the decoding of the audio stream
  6. Set up the device beforehand so that it has multiple access points (e.g. cellular and wi-fi) Show that not selecting an access point causes a dialog to pop up when Play is pressed Show that choosing an AP in this dialog causes the relevant network configuration to go green when playback starts Reset Show that selecting an NC from the list causes this to be used without the dialog being shown
  7. Show this app running, and point out how the memory consumed by the video playback can be calculated
  8. Show that checking video capture mode leads to a reduction in memory consumption Show that changing the encoder resolution makes no difference (at least on the C7-01 running qtm-multimedia/master)
  9. Show the demo Point out that, in Qt4, processing video via ShaderEffectItem is not optimally efficient: it uses an FBO, despite the fact that the video frames are already available as texture handles This will be resolved in Qt5, in which the texture stream will be directly available to shader effects