android_AudioToCbRenderer.h revision bb832e853d4afb11b0a3287b2eb0cad87696d631
1/* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17#ifndef AUDIO_TO_CB_RENDERER_H_ 18#define AUDIO_TO_CB_RENDERER_H_ 19 20#include "android/android_AudioSfDecoder.h" 21 22//-------------------------------------------------------------------------------------------------- 23namespace android { 24 25class AudioToCbRenderer : public AudioSfDecoder 26{ 27public: 28 29 AudioToCbRenderer(AudioPlayback_Parameters* params); 30 virtual ~AudioToCbRenderer(); 31 32 void setDataPushListener(const data_push_cbf_t pushCbf, void* pushUser); 33 34protected: 35 36 // Async event handlers (called from GenericPlayer's event loop) 37 virtual void onPrepare(); 38 virtual void onRender(); 39 40 // overridden from AudioSfDecoder 41 virtual void createAudioSink(); 42 virtual void updateAudioSink(); 43 virtual void startAudioSink(); 44 virtual void pauseAudioSink(); 45 46private: 47 48 data_push_cbf_t mDecodeCbf; 49 void* mDecodeUser; 50 51private: 52 DISALLOW_EVIL_CONSTRUCTORS(AudioToCbRenderer); 53 54}; 55 56} // namespace android 57 58#endif //AUDIO_TO_CB_RENDERER_H_ 59