Song Zhao | ea5a041 | 2021-01-18 16:40:08 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 13 | #ifndef MSYNC_UTIL_H |
| 14 | #define MSYNC_UTIL_H |
| 15 | |
| 16 | #include <stdbool.h> |
| 17 | #include <stdint.h> |
| 18 | #include "aml_avsync.h" |
Song Zhao | d62bb39 | 2021-04-23 12:25:49 -0700 | [diff] [blame] | 19 | #include "msync.h" |
Song Zhao | ea5a041 | 2021-01-18 16:40:08 -0800 | [diff] [blame] | 20 | |
| 21 | int msync_create_session(); |
| 22 | void msync_destory_session(int id); |
| 23 | |
| 24 | int msync_session_set_mode(int fd, enum sync_mode mode); |
| 25 | int msync_session_get_mode(int fd, enum sync_mode *mode); |
bo.xiao | 5821fc7 | 2021-07-11 22:47:00 -0400 | [diff] [blame^] | 26 | int msync_session_get_start_policy(int fd, uint32_t *policy, int *timeout); |
| 27 | int msync_session_set_start_policy(int fd, uint32_t policy, int timeout); |
Song Zhao | ea5a041 | 2021-01-18 16:40:08 -0800 | [diff] [blame] | 28 | int msync_session_set_pause(int fd, bool pause); |
| 29 | int msync_session_set_video_start(int fd, pts90K pts); |
| 30 | int msync_session_get_wall(int fd, uint32_t *wall, uint32_t *interval); |
| 31 | int msync_session_set_video_start(int fd, pts90K pts); |
| 32 | int msync_session_set_audio_start(int fd, pts90K pts, pts90K delay, uint32_t *mode); |
| 33 | int msync_session_set_video_dis(int fd, pts90K pts); |
| 34 | int msync_session_set_audio_dis(int fd, pts90K pts); |
| 35 | int msync_session_set_rate(int fd, float speed); |
| 36 | int msync_session_get_rate(int fd, float *speed); |
| 37 | int msync_session_set_name(int fd, const char* name); |
| 38 | int msync_session_update_vpts(int fd, uint32_t system, uint32_t pts, uint32_t delay); |
| 39 | int msync_session_update_apts(int fd, uint32_t system, uint32_t pts, uint32_t delay); |
| 40 | int msync_session_set_audio_stop(int fd); |
| 41 | int msync_session_set_video_stop(int fd); |
Song Zhao | e208d69 | 2021-04-19 15:38:52 -0700 | [diff] [blame] | 42 | int msync_session_get_stat (int fd, enum sync_mode *mode, |
yongchun.li | 107a616 | 2021-05-05 02:38:57 -0700 | [diff] [blame] | 43 | bool *v_active, bool *a_active, bool *v_timeout, bool *a_switch); |
Song Zhao | ea5a041 | 2021-01-18 16:40:08 -0800 | [diff] [blame] | 44 | bool msync_clock_started(int fd); |
Song Zhao | d62bb39 | 2021-04-23 12:25:49 -0700 | [diff] [blame] | 45 | int msync_session_set_pcr(int fd, pts90K pts, uint64_t mono_clock); |
| 46 | int msync_session_get_pcr(int fd, pts90K *pts, uint64_t *mono_clock); |
| 47 | int msync_session_get_debug_mode(int fd, struct session_debug *debug); |
yongchun.li | 107a616 | 2021-05-05 02:38:57 -0700 | [diff] [blame] | 48 | int msync_session_set_audio_switch(int fd, bool start); |
Song Zhao | 8039f56 | 2021-05-18 18:11:25 -0700 | [diff] [blame] | 49 | int msync_session_get_clock_dev(int fd, int32_t *ppm); |
| 50 | int msync_session_set_clock_dev(int fd, int32_t ppm); |
Song Zhao | f46932e | 2021-05-21 01:51:45 -0700 | [diff] [blame] | 51 | int msync_session_get_disc_thres(int session_id, uint32_t *min, uint32_t *max); |
Song Zhao | ea5a041 | 2021-01-18 16:40:08 -0800 | [diff] [blame] | 52 | #endif |