Home | History | Annotate | Download | only in media
      1 /*
      2  * Copyright (C) 2010 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_EFFECTCBASESHARED_H
     18 #define ANDROID_EFFECTCBASESHARED_H
     19 
     20 #include <stdint.h>
     21 #include <sys/types.h>
     22 
     23 #include <utils/threads.h>
     24 
     25 namespace android {
     26 
     27 // ----------------------------------------------------------------------------
     28 
     29 // Size of buffer used to exchange parameters between application and mediaserver processes.
     30 #define EFFECT_PARAM_BUFFER_SIZE 1024
     31 
     32 
     33 // Shared memory area used to exchange parameters between application and mediaserver
     34 // process.
     35 struct effect_param_cblk_t
     36 {
     37                 Mutex       lock;
     38     volatile    uint32_t    clientIndex;    // Current read/write index for application
     39     volatile    uint32_t    serverIndex;    // Current read/write index for mediaserver
     40                 uint8_t*    buffer;         // start of parameter buffer
     41 
     42                 effect_param_cblk_t()
     43                     : lock(Mutex::SHARED), clientIndex(0), serverIndex(0) {}
     44 };
     45 
     46 
     47 // ----------------------------------------------------------------------------
     48 
     49 }; // namespace android
     50 
     51 #endif // ANDROID_EFFECTCBASESHARED_H
     52