blob: ab8a13aa9b97ad3c86333855bd3beac891bd2e49 [file] [log] [blame]
Song Zhaoc03ba122020-12-23 21:54:02 -08001/*
2 * Copyright (c) 2020 Amlogic, Inc. All rights reserved.
3 *
4 * This source code is subject to the terms and conditions defined in the
5 * file 'LICENSE' which is part of this source code package.
6 *
7 * Description:
8 * User space AV sync module.
9 *
10 * Author: song.zhao@amlogic.com
11 */
12#ifndef AML_AVSYNC_PATTERN_H__
13#define AML_AVSYNC_PATTERN_H__
14
15enum frame_pattern {
16 AV_SYNC_FRAME_P32 = 0,
17 AV_SYNC_FRAME_P22 = 1,
18 AV_SYNC_FRAME_P41 = 2,
Song Zhao35a82df2021-04-15 10:58:49 -070019 AV_SYNC_FRAME_P11 = 3,
Song Zhaoc03ba122020-12-23 21:54:02 -080020 AV_SYNC_FRAME_PMAX,
21};
22
23void* create_pattern_detector();
24void destroy_pattern_detector(void *handle);
25void reset_pattern(void *handle);
Song Zhao35a82df2021-04-15 10:58:49 -070026bool detect_pattern(void* handle, enum frame_pattern pattern, int cur_peroid, int last_peroid);
Song Zhaoc03ba122020-12-23 21:54:02 -080027void correct_pattern(void* handle, struct vframe *frame, struct vframe *nextframe,
28 int cur_peroid, int last_peroid, pts90K systime, pts90K vsync_interval, bool *expire);
29#endif