blob: 543d79a8efa18dd738569645f8008f1a32c88b19 [file] [log] [blame]
Lajos Molnarc98f58e2015-04-22 19:28:53 -07001/*
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
Wei Jia2d61e2b2015-05-08 15:23:28 -070017#ifndef _ANDROID_MEDIA_SYNC_PARAMS_H_
18#define _ANDROID_MEDIA_SYNC_PARAMS_H_
Lajos Molnarc98f58e2015-04-22 19:28:53 -070019
20#include "jni.h"
21
Lajos Molnar05ebffe2015-04-29 20:41:19 -070022#include <media/stagefright/MediaSync.h>
23
Lajos Molnarc98f58e2015-04-22 19:28:53 -070024namespace android {
25
Wei Jia2d61e2b2015-05-08 15:23:28 -070026struct SyncParams {
Lajos Molnar05ebffe2015-04-29 20:41:19 -070027 AVSyncSettings sync;
Lajos Molnarc98f58e2015-04-22 19:28:53 -070028 float frameRate;
29
30 bool syncSourceSet;
31 bool audioAdjustModeSet;
32 bool toleranceSet;
33 bool frameRateSet;
34
35 struct fields_t {
36 jclass clazz;
37 jmethodID constructID;
38
39 jfieldID sync_source;
40 jfieldID audio_adjust_mode;
41 jfieldID tolerance;
42 jfieldID frame_rate;
43 jfieldID set;
44 jint set_sync_source;
45 jint set_audio_adjust_mode;
46 jint set_tolerance;
47 jint set_frame_rate;
48
49 // initializes fields
50 void init(JNIEnv *env);
51
52 // releases global references held
53 void exit(JNIEnv *env);
54 };
55
Wei Jia2d61e2b2015-05-08 15:23:28 -070056 // fills this from an android.media.SyncParams object
57 void fillFromJobject(JNIEnv *env, const fields_t& fields, jobject params);
Lajos Molnarc98f58e2015-04-22 19:28:53 -070058
Wei Jia2d61e2b2015-05-08 15:23:28 -070059 // returns this as a android.media.SyncParams object
Lajos Molnarc98f58e2015-04-22 19:28:53 -070060 jobject asJobject(JNIEnv *env, const fields_t& fields);
61};
62
63} // namespace android
64
Wei Jia2d61e2b2015-05-08 15:23:28 -070065#endif // _ANDROID_MEDIA_SYNC_PARAMS_H_