summaryrefslogtreecommitdiff
path: root/src/buffer/frame_queue.h
blob: ca4745739380227b285d760f8654b546f90f9f8c (plain)
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
#pragma once

#ifdef CAMU_HAVE_FFMPEG
#include <libavutil/frame.h>
#endif

#include "../codec/codec.h"
#include "../buffer/video.h"

enum {
    CAMU_QUEUE_OK = 0,
    CAMU_QUEUE_MORE,
    CAMU_QUEUE_EOF,
    CAMU_QUEUE_ERR
};

struct camu_frame_queue {
    struct camu_video_buffer *buf;
    bool (*configure_subtitles)(struct camu_frame_queue *, u32, u32, struct camu_codec_stream *);
    void (*push)(struct camu_frame_queue *, struct camu_codec_frame *, f64);
#ifdef CAMU_HAVE_FFMPEG
    void (*push_av_frame)(struct camu_frame_queue *, AVFrame *, f64);
#endif
    void (*push_subtitle)(struct camu_frame_queue *, struct camu_codec_packet *);
    void (*flush)(struct camu_frame_queue *);
    s32 (*count)(struct camu_frame_queue *);
    u8 (*read)(struct camu_frame_queue *, f64, void *);
    void (*reset)(struct camu_frame_queue *);
    void (*free)(struct camu_frame_queue **);
};