2021-06-13 19:29:32 +00:00
|
|
|
#ifndef SUNSHINE_CBS_H
|
|
|
|
#define SUNSHINE_CBS_H
|
|
|
|
|
|
|
|
#include "utility.h"
|
|
|
|
|
|
|
|
struct AVPacket;
|
|
|
|
struct AVCodecContext;
|
2021-06-20 13:29:51 +00:00
|
|
|
|
2021-06-13 19:29:32 +00:00
|
|
|
namespace cbs {
|
|
|
|
|
2021-06-20 13:29:51 +00:00
|
|
|
struct nal_t {
|
|
|
|
util::buffer_t<std::uint8_t> _new;
|
|
|
|
util::buffer_t<std::uint8_t> old;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct hevc_t {
|
|
|
|
nal_t vps;
|
|
|
|
nal_t sps;
|
2021-06-18 15:27:56 +00:00
|
|
|
};
|
|
|
|
|
2021-06-20 13:29:51 +00:00
|
|
|
struct h264_t {
|
|
|
|
nal_t sps;
|
|
|
|
};
|
2021-06-18 15:27:56 +00:00
|
|
|
|
2021-06-20 13:29:51 +00:00
|
|
|
hevc_t make_sps_hevc(const AVCodecContext *ctx, const AVPacket *packet);
|
|
|
|
h264_t make_sps_h264(const AVCodecContext *ctx, const AVPacket *packet);
|
2021-06-13 19:29:32 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Check if SPS->VUI is present
|
|
|
|
*/
|
|
|
|
bool validate_sps(const AVPacket *packet, int codec_id);
|
|
|
|
} // namespace cbs
|
|
|
|
|
|
|
|
#endif
|