Home | History | Annotate | Download | only in media
      1 /*
      2  * Copyright (C) 2007 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 IAUDIORECORD_H_
     18 #define IAUDIORECORD_H_
     19 
     20 #include <stdint.h>
     21 #include <sys/types.h>
     22 
     23 #include <utils/RefBase.h>
     24 #include <utils/Errors.h>
     25 #include <binder/IInterface.h>
     26 #include <binder/IMemory.h>
     27 
     28 namespace android {
     29 
     30 // ----------------------------------------------------------------------------
     31 
     32 class IAudioRecord : public IInterface
     33 {
     34 public:
     35     DECLARE_META_INTERFACE(AudioRecord);
     36 
     37     /* get this tracks control block */
     38     virtual sp<IMemory> getCblk() const = 0;
     39 
     40     /* After it's created the track is not active. Call start() to
     41      * make it active.
     42      */
     43     virtual status_t    start(int /*AudioSystem::sync_event_t*/ event, int triggerSession) = 0;
     44 
     45     /* Stop a track. If set, the callback will cease being called and
     46      * obtainBuffer will return an error. Buffers that are already released
     47      * will be processed, unless flush() is called.
     48      */
     49     virtual void        stop() = 0;
     50 };
     51 
     52 // ----------------------------------------------------------------------------
     53 
     54 class BnAudioRecord : public BnInterface<IAudioRecord>
     55 {
     56 public:
     57     virtual status_t    onTransact( uint32_t code,
     58                                     const Parcel& data,
     59                                     Parcel* reply,
     60                                     uint32_t flags = 0);
     61 };
     62 
     63 // ----------------------------------------------------------------------------
     64 
     65 }; // namespace android
     66 
     67 #endif /*IAUDIORECORD_H_*/
     68