summaryrefslogtreecommitdiff
path: root/toxav/video.h
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2015-11-03 13:40:07 -0500
committerirungentoo <irungentoo@gmail.com>2015-11-03 13:40:07 -0500
commitf435e94397feb3121ef334de6873b93adaaf01dd (patch)
tree17e9c0b8cdda095e940803b34d7f95db325a981d /toxav/video.h
parenta25cc96b4f2aeaca169df834e39df796ac08f1bd (diff)
parentca4214bbcfe554c5754ebc4650cbab09f507567a (diff)
Merge branch 'new_api' of https://github.com/mannol/toxcore
Diffstat (limited to 'toxav/video.h')
-rw-r--r--toxav/video.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/toxav/video.h b/toxav/video.h
new file mode 100644
index 00000000..51f34318
--- /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
39struct RTPMessage;
40
41typedef 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
61VCSession *vc_new(ToxAV* av, uint32_t friend_number, toxav_video_receive_frame_cb* cb, void* cb_data);
62void vc_kill(VCSession *vc);
63void vc_iterate(VCSession *vc);
64int vc_queue_message(void *vcp, struct RTPMessage *msg);
65int vc_reconfigure_encoder(VCSession *vc, uint32_t bit_rate, uint16_t width, uint16_t height);
66
67#endif /* VIDEO_H */