diff options
Diffstat (limited to 'toxav/video.h')
-rw-r--r-- | toxav/video.h | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/toxav/video.h b/toxav/video.h new file mode 100644 index 00000000..fb836a35 --- /dev/null +++ b/toxav/video.h | |||
@@ -0,0 +1,67 @@ | |||
1 | /** video.h | ||
2 | * | ||
3 | * Copyright (C) 2013-2015 Tox project All Rights Reserved. | ||
4 | * | ||
5 | * This file is part of Tox. | ||
6 | * | ||
7 | * Tox is free software: you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation, either version 3 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * Tox is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with Tox. If not, see <http://www.gnu.org/licenses/>. | ||
19 | * | ||
20 | */ | ||
21 | |||
22 | #ifndef VIDEO_H | ||
23 | #define VIDEO_H | ||
24 | |||
25 | #include <vpx/vpx_decoder.h> | ||
26 | #include <vpx/vpx_encoder.h> | ||
27 | #include <vpx/vp8dx.h> | ||
28 | #include <vpx/vp8cx.h> | ||
29 | #include <vpx/vpx_image.h> | ||
30 | #define VIDEO_CODEC_DECODER_INTERFACE (vpx_codec_vp8_dx()) | ||
31 | #define VIDEO_CODEC_ENCODER_INTERFACE (vpx_codec_vp8_cx()) | ||
32 | |||
33 | #include <pthread.h> | ||
34 | |||
35 | #include "toxav.h" | ||
36 | |||
37 | #include "../toxcore/util.h" | ||
38 | |||
39 | struct RTPMessage; | ||
40 | |||
41 | typedef struct VCSession_s { | ||
42 | /* encoding */ | ||
43 | vpx_codec_ctx_t encoder[1]; | ||
44 | uint32_t frame_counter; | ||
45 | |||
46 | /* decoding */ | ||
47 | vpx_codec_ctx_t decoder[1]; | ||
48 | void *vbuf_raw; /* Un-decoded data */ | ||
49 | |||
50 | uint64_t linfts; /* Last received frame time stamp */ | ||
51 | uint32_t lcfd; /* Last calculated frame duration for incoming video payload */ | ||
52 | |||
53 | ToxAV *av; | ||
54 | uint32_t friend_number; | ||
55 | |||
56 | PAIR(toxav_video_receive_frame_cb *, void *) vcb; /* Video frame receive callback */ | ||
57 | |||
58 | pthread_mutex_t queue_mutex[1]; | ||
59 | } VCSession; | ||
60 | |||
61 | VCSession *vc_new(ToxAV *av, uint32_t friend_number, toxav_video_receive_frame_cb *cb, void *cb_data); | ||
62 | void vc_kill(VCSession *vc); | ||
63 | void vc_iterate(VCSession *vc); | ||
64 | int vc_queue_message(void *vcp, struct RTPMessage *msg); | ||
65 | int vc_reconfigure_encoder(VCSession *vc, uint32_t bit_rate, uint16_t width, uint16_t height); | ||
66 | |||
67 | #endif /* VIDEO_H */ | ||