Lajos Molnar | c98f58e | 2015-04-22 19:28:53 -0700 | [diff] [blame] | 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 | |
| 17 | #ifndef _ANDROID_MEDIA_SYNC_SETTINGS_H_ |
| 18 | #define _ANDROID_MEDIA_SYNC_SETTINGS_H_ |
| 19 | |
| 20 | #include "jni.h" |
| 21 | |
| 22 | namespace android { |
| 23 | |
| 24 | struct SyncSettings { |
| 25 | // keep this here until it is implemented |
| 26 | int syncSource; |
| 27 | int audioAdjustMode; |
| 28 | float tolerance; |
| 29 | float frameRate; |
| 30 | |
| 31 | bool syncSourceSet; |
| 32 | bool audioAdjustModeSet; |
| 33 | bool toleranceSet; |
| 34 | bool frameRateSet; |
| 35 | |
| 36 | struct fields_t { |
| 37 | jclass clazz; |
| 38 | jmethodID constructID; |
| 39 | |
| 40 | jfieldID sync_source; |
| 41 | jfieldID audio_adjust_mode; |
| 42 | jfieldID tolerance; |
| 43 | jfieldID frame_rate; |
| 44 | jfieldID set; |
| 45 | jint set_sync_source; |
| 46 | jint set_audio_adjust_mode; |
| 47 | jint set_tolerance; |
| 48 | jint set_frame_rate; |
| 49 | |
| 50 | // initializes fields |
| 51 | void init(JNIEnv *env); |
| 52 | |
| 53 | // releases global references held |
| 54 | void exit(JNIEnv *env); |
| 55 | }; |
| 56 | |
| 57 | // fills this from an android.media.SyncSettings object |
| 58 | void fillFromJobject(JNIEnv *env, const fields_t& fields, jobject settings); |
| 59 | |
| 60 | // returns this as a android.media.SyncSettings object |
| 61 | jobject asJobject(JNIEnv *env, const fields_t& fields); |
| 62 | }; |
| 63 | |
| 64 | } // namespace android |
| 65 | |
| 66 | #endif // _ANDROID_MEDIA_SYNC_SETTINGS_H_ |