Home | History | Annotate | Download | only in android
      1 /*
      2  * Copyright (c) 2008, 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 ANDROID_AUDIO_OUTPUT_THREADSAFE_CALLBACK_H_INCLUDED
     18 #define ANDROID_AUDIO_OUTPUT_THREADSAFE_CALLBACK_H_INCLUDED
     19 
     20 #ifndef THREADSAFE_CALLBACK_AO_H_INCLUDED
     21 #include "threadsafe_callback_ao.h"
     22 #endif
     23 
     24 #ifndef THREADSAFE_MEMPOOL_H_INCLUDED
     25 #include "threadsafe_mempool.h"
     26 #endif
     27 
     28 #ifndef OSCL_MEM_MEMPOOL_H_INCLUDED
     29 #include "oscl_mem_mempool.h"
     30 #endif
     31 
     32 #define PROCESS_MULTIPLE_EVENTS_IN_CALLBACK 1
     33 
     34 const char AudioOutputCallbackAOName[] = "AndroidAudioOutputTSCAO_Name";
     35 
     36 class AndroidAudioOutputThreadSafeCallbackAO : public ThreadSafeCallbackAO
     37 {
     38 public:
     39     //Constructor
     40     AndroidAudioOutputThreadSafeCallbackAO(void* aObserver = NULL,
     41                                            uint32 aDepth=10,
     42                                            const char* aAOname = AudioOutputCallbackAOName,
     43                                            int32 aPriority = OsclActiveObject::EPriorityNominal
     44                                           );
     45     OsclReturnCode ProcessEvent(OsclAny* aEventData);
     46     // When the following two have been implemented, make them virtual
     47 #if PROCESS_MULTIPLE_EVENTS_IN_CALLBACK
     48     virtual void Run();
     49     virtual OsclAny* Dequeue(OsclReturnCode &status);
     50 #endif
     51     virtual ~AndroidAudioOutputThreadSafeCallbackAO();
     52     ThreadSafeMemPoolFixedChunkAllocator *iMemoryPool;
     53 };
     54 
     55 
     56 
     57 #endif //ANDROID_AUDIO_OUTPUT_THREADSAFE_CALLBACK_H_INCLUDED
     58 
     59 
     60