1 // Common interface for low-level video codecs. Not to be confused
2 // with VideoEncoder (which is a higher-level orchestration class).
4 #ifndef _VIDEO_CODEC_INTERFACE_H
5 #define _VIDEO_CODEC_INTERFACE_H 1
10 #include <movit/image_format.h>
12 #include "print_latency.h"
16 class VideoCodecInterface {
18 // Called after the last frame. Will block; once this returns,
19 // the last data is flushed.
20 virtual ~VideoCodecInterface() {}
22 // Must be called before first frame. Does not take ownership.
23 virtual void add_mux(Mux *mux) = 0;
25 // <data> is taken to be raw NV12 data of WIDTHxHEIGHT resolution.
27 virtual void add_frame(int64_t pts, int64_t duration, movit::YCbCrLumaCoefficients ycbcr_coefficients, const uint8_t *data, const ReceivedTimestamps &received_ts) = 0;
29 virtual std::string get_global_headers() const = 0;
32 #endif // !defined(_VIDEO_CODEC_INTERFACE_H)