summaryrefslogtreecommitdiff
path: root/src/buffer/common_internal.h
blob: a9e6ece7fd0d59266079b62d500d0e8a8fe5b8e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#pragma once

#include <al/types.h>

#include "clock.h"

enum {
    // Flowing.
    FLOWING,
    // Got request to flush.
    FLUSHED,
    // Flushed because of an error.
    FLUSHED_ERROR,
    // Realized flush.
    SIGNALED,
    // Errored.
    ERRORED
};

static inline bool frame_is_late(struct camu_clock *clock, f64 base, f64 pts, f64 duration)
{
    return pts + duration < ((base == -1.0) ? camu_clock_get_base_pts(clock) : base);
}