Hermes 0.7.0
Linux game streaming host
Loading...
Searching...
No Matches
cbs.cpp File Reference

Definitions for FFmpeg Coded Bitstream API. More...

#include <libavcodec/avcodec.h>
#include <libavcodec/cbs_h264.h>
#include <libavcodec/cbs_h265.h>
#include <libavcodec/h264_levels.h>
#include <libavutil/pixdesc.h>
#include "cbs.h"
#include "logging.h"
#include "utility.h"
Include dependency graph for cbs.cpp:

Go to the source code of this file.

Classes

class  cbs::frag_t

Typedefs

using cbs::ctx_t = util::safe_ptr<CodedBitstreamContext, close>

Functions

void cbs::close (CodedBitstreamContext *c)
util::buffer_t< std::uint8_t > cbs::write (cbs::ctx_t &cbs_ctx, std::uint8_t nal, void *uh, AVCodecID codec_id)
util::buffer_t< std::uint8_t > cbs::write (std::uint8_t nal, void *uh, AVCodecID codec_id)
h264_t cbs::make_sps_h264 (const AVCodecContext *avctx, const AVPacket *packet)
hevc_t cbs::make_sps_hevc (const AVCodecContext *avctx, const AVPacket *packet)
bool cbs::validate_sps (const AVPacket *packet, int codec_id)
 Validates the Sequence Parameter Set (SPS) of a given packet.

Detailed Description

Definitions for FFmpeg Coded Bitstream API.

Definition in file cbs.cpp.

Typedef Documentation

◆ ctx_t

using cbs::ctx_t = util::safe_ptr<CodedBitstreamContext, close>

Definition at line 26 of file cbs.cpp.

Function Documentation

◆ close()

void cbs::close ( CodedBitstreamContext * c)

Definition at line 22 of file cbs.cpp.

◆ make_sps_h264()

h264_t cbs::make_sps_h264 ( const AVCodecContext * avctx,
const AVPacket * packet )

Definition at line 89 of file cbs.cpp.

◆ make_sps_hevc()

hevc_t cbs::make_sps_hevc ( const AVCodecContext * avctx,
const AVPacket * packet )

Definition at line 145 of file cbs.cpp.

◆ validate_sps()

bool cbs::validate_sps ( const AVPacket * packet,
int codec_id )

Validates the Sequence Parameter Set (SPS) of a given packet.

This function initializes a Coded Bitstream Context and reads the packet into a Coded Bitstream Fragment. It then checks if the SPS->VUI (Video Usability Information) is present in the active SPS of the packet. This is done for both H264 and H265 codecs.

Parameters
packetThe packet to validate.
codec_idThe ID of the codec used (either AV_CODEC_ID_H264 or AV_CODEC_ID_H265).
Returns
True if the SPS->VUI is present in the active SPS of the packet, false otherwise.

Definition at line 222 of file cbs.cpp.

◆ write() [1/2]

util::buffer_t< std::uint8_t > cbs::write ( cbs::ctx_t & cbs_ctx,
std::uint8_t nal,
void * uh,
AVCodecID codec_id )

Definition at line 57 of file cbs.cpp.

◆ write() [2/2]

util::buffer_t< std::uint8_t > cbs::write ( std::uint8_t nal,
void * uh,
AVCodecID codec_id )

Definition at line 82 of file cbs.cpp.