1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
|
#pragma once
#include <al/atomic.h>
#include "../codec/codec.h"
#include "clock.h"
struct camu_video_buffer {
struct camu_codec_stream *stream;
f64 seek_pts;
bool single_frame;
f64 avg_frame_duration;
#ifdef CAMU_SCREEN_THREADED
atomic(bool) ref;
#endif
void (*callback)(void *, u8);
void *userdata;
};
struct camu_renderer {
void (*add_font)(struct camu_renderer *, struct camu_codec_stream *);
u32 (*get_latency)(struct camu_renderer *);
};
AL_IGNORE_WARNING("-Wunused-function")
static bool camu_video_buffer_init(struct camu_video_buffer *buf, struct camu_clock *clock)
{
(void)clock;
buf->single_frame = true;
buf->avg_frame_duration = 0.0;
#ifdef CAMU_SCREEN_THREADED
al_atomic_store(bool)(&buf->ref, false, AL_ATOMIC_RELAXED);
#endif
return true;
}
static bool camu_video_buffer_configure(struct camu_video_buffer *buf, struct camu_codec_stream *stream,
struct camu_renderer *renderer)
{
(void)renderer;
buf->stream = stream;
return true;
}
static bool camu_video_buffer_configure_subtitles(struct camu_video_buffer *buf, struct camu_codec_stream *stream)
{
(void)buf;
(void)stream;
return false;
}
static void camu_video_buffer_set_latency(struct camu_video_buffer *buf, s32 frames)
{
(void)buf;
(void)frames;
}
static void camu_video_buffer_push(struct camu_video_buffer *buf, struct camu_codec_frame *frame)
{
(void)buf;
camu_codec_frame_discard(frame);
}
static void camu_video_buffer_push_subtitle(struct camu_video_buffer *buf, struct camu_codec_packet *packet)
{
// This packet gets freed in the client.
(void)buf;
(void)packet;
}
static void camu_video_buffer_flush(struct camu_video_buffer *buf, bool error)
{
(void)buf;
(void)error;
}
static void camu_video_buffer_reset(struct camu_video_buffer *buf, f64 pts)
{
(void)buf;
(void)pts;
}
static bool camu_video_buffer_read(struct camu_video_buffer *buf, void *out, bool *weighted)
{
(void)buf;
(void)out;
(void)weighted;
al_assert_and_return(false);
}
static void camu_video_buffer_free(struct camu_video_buffer *buf)
{
(void)buf;
}
AL_IGNORE_WARNING_END
|