Line | Count | Source |
1 | | /* SPDX-License-Identifier: GPL-3.0-or-later |
2 | | * Copyright © 2016-2026 The TokTok team. |
3 | | * Copyright © 2013-2015 Tox project. |
4 | | */ |
5 | | #ifndef C_TOXCORE_TOXAV_VIDEO_H |
6 | | #define C_TOXCORE_TOXAV_VIDEO_H |
7 | | |
8 | | #include <pthread.h> |
9 | | #include <stdint.h> |
10 | | |
11 | | #include "../toxcore/logger.h" |
12 | | #include "../toxcore/mono_time.h" |
13 | | |
14 | | #ifdef __cplusplus |
15 | | extern "C" { |
16 | | #endif |
17 | | |
18 | | typedef void vc_video_receive_frame_cb(uint32_t friend_number, uint16_t width, uint16_t height, |
19 | | const uint8_t *_Nonnull y, const uint8_t *_Nonnull u, const uint8_t *_Nonnull v, |
20 | | int32_t ystride, int32_t ustride, int32_t vstride, |
21 | | void *_Nullable user_data); |
22 | | |
23 | | typedef struct VCSession VCSession; |
24 | | |
25 | 3 | #define VC_EFLAG_NONE 0 |
26 | 142 | #define VC_EFLAG_FORCE_KF (1 << 0) |
27 | | |
28 | | struct RTPMessage; |
29 | | |
30 | | VCSession *_Nullable vc_new(const Memory *_Nonnull mem, const Logger *_Nonnull log, const Mono_Time *_Nonnull mono_time, uint32_t friend_number, |
31 | | vc_video_receive_frame_cb *_Nullable cb, void *_Nullable user_data); |
32 | | void vc_kill(VCSession *_Nullable vc); |
33 | | void vc_iterate(VCSession *_Nullable vc); |
34 | | |
35 | | int vc_queue_message(const Mono_Time *_Nonnull mono_time, void *_Nullable cs, struct RTPMessage *_Nullable msg); |
36 | | int vc_reconfigure_encoder(VCSession *_Nullable vc, uint32_t bit_rate, uint16_t width, uint16_t height, int16_t kf_max_dist); |
37 | | |
38 | | int vc_encode(VCSession *_Nonnull vc, uint16_t width, uint16_t height, const uint8_t *_Nonnull y, |
39 | | const uint8_t *_Nonnull u, const uint8_t *_Nonnull v, int encode_flags); |
40 | | |
41 | | int vc_get_cx_data(VCSession *_Nonnull vc, uint8_t *_Nonnull *_Nonnull data, uint32_t *_Nonnull size, bool *_Nonnull is_keyframe); |
42 | | uint32_t vc_get_lcfd(const VCSession *_Nonnull vc); |
43 | | pthread_mutex_t *_Nonnull vc_get_queue_mutex(VCSession *_Nonnull vc); |
44 | | void vc_increment_frame_counter(VCSession *_Nonnull vc); |
45 | | |
46 | | #ifdef __cplusplus |
47 | | } /* extern "C" */ |
48 | | #endif |
49 | | |
50 | | #endif /* C_TOXCORE_TOXAV_VIDEO_H */ |