0% found this document useful (0 votes)
7 views16 pages

SmartAudioPlayer Implementation Guide

The document provides an overview of the SmartAudioPlayer developed by MediaTek, detailing its user interface and functionality for playing local and streaming audio. It outlines the valid and invalid states for various methods such as start, stop, and pause, as well as the overall architecture including source, decoder, and renderer components. Additionally, it emphasizes the proprietary nature of the content and the importance of adhering to the license agreement for usage.

Uploaded by

dvnprnv2nq
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views16 pages

SmartAudioPlayer Implementation Guide

The document provides an overview of the SmartAudioPlayer developed by MediaTek, detailing its user interface and functionality for playing local and streaming audio. It outlines the valid and invalid states for various methods such as start, stop, and pause, as well as the overall architecture including source, decoder, and renderer components. Additionally, it emphasizes the proprietary nature of the content and the importance of adhering to the license agreement for usage.

Uploaded by

dvnprnv2nq
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SmartAudioPlayer

© 2015 - 2017 MediaTek Inc.

This document contains information that is proprietary to MediaTek Inc. (“MediaTek”) and/or its licensor(s).
MediaTek cannot grant you permission for any material that is owned by third parties. You may only use or
reproduce this document if you have agreed to and been bound by the applicable license agreement with
MediaTek (“License Agreement”) and been granted explicit permission within the License Agreement
(“Permitted User”). If you are not a Permitted User, please cease any access or use of this document
immediately. Any unauthorized use, reproduction or disclosure of this document in whole or in part is strictly
prohibited. THIS DOCUMENT IS PROVIDED ON AN “AS-IS” BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY
AND ALL WARRANTIES OF ANY KIND AND SHALL IN NO EVENT BE LIABLE FOR ANY CLAIMS RELATING TO OR
ARISING OUT OF THIS DOCUMENT OR ANY USE OR INABILITY TO USE THEREOF. Specifications contained herein
are subject to change without notice.
Agenda

• overview
• user interface
• modules and flow

Copyright © MediaTek Inc. All rights reserved. 2


Overview

Implement an audio player


• Playing Local audio files
• Playing streaming content(http/tts)

Copyright © MediaTek Inc. All rights reserved. 3


User Interface
• State
– Idle, Initialized, Preparing,
Prepared, Started, Paused,
Stopped…
• interface
– setDataSource()
– prepare()
– start()
– stop()
– seekTo()
– pause_l()
– …

4
Copyright © MediaTek Inc. All rights reserved.
User Interface
Method Name Valid Sates Invalid States
start {Prepared, Started, Paused, {Idle, Initialized, Stopped,
PlaybackCompleted} Error}
stop {Prepared, Started, {Idle, Initialized, Error}
Stopped, Paused,
PlaybackCompleted}
pause_l {Started, Paused, {Idle, Initialized, Prepared,
PlaybackCompleted} Stopped, Error}
prepareAsync {Initialized, Stopped} {Idle, Prepared, Started,
Paused,
PlaybackCompleted, Error}
setDataSource {Idle} {Initialized, Prepared,
Started, Paused, Stopped,
PlaybackCompleted, Error}

Copyright © MediaTek Inc. All rights reserved. 5


User Interface
Method Name Valid Sates Invalid States
reset {Idle, Initialized, Prepared, {}
Started, Paused, Stopped,
PlaybackCompleted, Error}
setPlaybackSettings {Idle, Initialized, Stopped, {Error}
Prepared, Started, Paused,
PlaybackCompleted}
seekTo {Prepared, Started, Paused, {Idle, Initialized, Stopped,
PlaybackCompleted} Error}
getAvailableSize {Idle, Initialized, Stopped,
Prepared, Started, Paused,
PlaybackCompleted}
writeData {Idle, Initialized, Stopped,
Prepared, Started, Paused,
PlaybackCompleted}

Copyright © MediaTek Inc. All rights reserved. 6


User Interface
• path:src/multimedia/smartaudioplayer/include/Interface.h

Copyright © MediaTek Inc. All rights reserved. 7


Block Diagram

SmartAudioPlayer

Source Decoder Renderer

SmartAudioPlayer ::Source SmartAudioPlayer ::Decoder SmartAudioPlayer ::Renderer

GenericSource FFDecoder ALSARender

FFDemuxer

ffmpeg ALSA
FFStreamer
Copyright © MediaTek Inc. All rights reserved.
8
Implement
User

Function call
SmartAudioPlayer
Post to message thread

message queue

SmartAudioPlayer::Source SmartAudioPlayer::Decoder SmartAudioPlayer::Render

FFDemuxer FFDecoder MASRender

FFStreamer Copyright © MediaTek Inc. All rights reserved. 9


play flow

Copyright © MediaTek Inc. All rights reserved. 10


Data Flow

GenericSource SmartAudioPlayerRenderer

dequeueAccessUnit queueBuffer

SmartAudioPlayer

queueInputBuffer inputBufferAvailable queueOutputBuffer outputBufferAvailable

mInputBuffer MediaDecoder mOutputBuffer

AudioThread DecodeThread
(command processor) (decoding/buffer management)

Copyright © MediaTek Inc. All rights reserved. 11


setDataSource

Copyright © MediaTek Inc. All rights reserved. 12


prepare

Copyright © MediaTek Inc. All rights reserved. 13


start

14
pause

Copyright © MediaTek Inc. All rights reserved. 15


reset

Copyright © MediaTek Inc. All rights reserved. 16

You might also like