android_media_SyncParams.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. * Copyright 2015, 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_MEDIA_SYNC_PARAMS_H_
  17. #define _ANDROID_MEDIA_SYNC_PARAMS_H_
  18. #include "jni.h"
  19. #include <media/stagefright/MediaSync.h>
  20. namespace android {
  21. struct SyncParams {
  22. AVSyncSettings sync;
  23. float frameRate;
  24. bool syncSourceSet;
  25. bool audioAdjustModeSet;
  26. bool toleranceSet;
  27. bool frameRateSet;
  28. struct fields_t {
  29. jclass clazz;
  30. jmethodID constructID;
  31. jfieldID sync_source;
  32. jfieldID audio_adjust_mode;
  33. jfieldID tolerance;
  34. jfieldID frame_rate;
  35. jfieldID set;
  36. jint set_sync_source;
  37. jint set_audio_adjust_mode;
  38. jint set_tolerance;
  39. jint set_frame_rate;
  40. // initializes fields
  41. void init(JNIEnv *env);
  42. // releases global references held
  43. void exit(JNIEnv *env);
  44. };
  45. // fills this from an android.media.SyncParams object
  46. void fillFromJobject(JNIEnv *env, const fields_t& fields, jobject params);
  47. // returns this as a android.media.SyncParams object
  48. jobject asJobject(JNIEnv *env, const fields_t& fields);
  49. };
  50. } // namespace android
  51. #endif // _ANDROID_MEDIA_SYNC_PARAMS_H_