AudioEffectShared.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. #ifndef ANDROID_EFFECTCBASESHARED_H
  17. #define ANDROID_EFFECTCBASESHARED_H
  18. #include <stdint.h>
  19. #include <sys/types.h>
  20. #include <utils/threads.h>
  21. namespace android {
  22. // ----------------------------------------------------------------------------
  23. // Size of buffer used to exchange parameters between application and mediaserver processes.
  24. #define EFFECT_PARAM_BUFFER_SIZE 1024
  25. // Shared memory area used to exchange parameters between application and mediaserver
  26. // process.
  27. struct effect_param_cblk_t
  28. {
  29. Mutex lock;
  30. volatile uint32_t clientIndex; // Current read/write index for application
  31. volatile uint32_t serverIndex; // Current read/write index for mediaserver
  32. uint8_t* buffer; // start of parameter buffer
  33. effect_param_cblk_t()
  34. : lock(Mutex::SHARED), clientIndex(0), serverIndex(0) {}
  35. };
  36. // ----------------------------------------------------------------------------
  37. }; // namespace android
  38. #endif // ANDROID_EFFECTCBASESHARED_H