]> git.sesse.net Git - nageru/blob - nageru/video_codec_interface.h
Fix a dangling reference (found by GCC 14).
[nageru] / nageru / video_codec_interface.h
1 // Common interface for low-level video codecs. Not to be confused
2 // with VideoEncoder (which is a higher-level orchestration class).
3
4 #ifndef _VIDEO_CODEC_INTERFACE_H
5 #define _VIDEO_CODEC_INTERFACE_H 1
6
7 #include <stdint.h>
8 #include <string>
9
10 #include <movit/image_format.h>
11
12 #include "print_latency.h"
13
14 class Mux;
15
16 class VideoCodecInterface {
17 public:
18         // Called after the last frame. Will block; once this returns,
19         // the last data is flushed.
20         virtual ~VideoCodecInterface() {}
21
22         // Must be called before first frame. Does not take ownership.
23         virtual void add_mux(Mux *mux) = 0;
24
25         // <data> is taken to be raw NV12 data of WIDTHxHEIGHT resolution.
26         // Does not block.
27         virtual void add_frame(int64_t pts, int64_t duration, movit::YCbCrLumaCoefficients ycbcr_coefficients, const uint8_t *data, const ReceivedTimestamps &received_ts) = 0;
28
29         virtual std::string get_global_headers() const = 0;
30 };
31
32 #endif  // !defined(_VIDEO_CODEC_INTERFACE_H)