ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
codecs.h File Reference

Video and audio codec definitions and capability bitmasks. More...

Go to the source code of this file.

Macros

Video Codec Bitmask Constants

Bitmasks for video codec capabilities

Each codec is represented by a single bit, allowing multiple codecs to be advertised simultaneously in the codec_capabilities_video field.

#define VIDEO_CODEC_CAP_RGBA   ((uint32_t)(1 << VIDEO_CODEC_RGBA))
 Bit 0: RGBA support.
 
#define VIDEO_CODEC_CAP_H265   ((uint32_t)(1 << VIDEO_CODEC_H265))
 Bit 1: H.265 support.
 
#define VIDEO_CODEC_CAP_JPEG   ((uint32_t)(1 << VIDEO_CODEC_JPEG))
 Bit 2: JPEG support.
 
#define VIDEO_CODEC_CAP_ALL   (VIDEO_CODEC_CAP_RGBA | VIDEO_CODEC_CAP_H265 | VIDEO_CODEC_CAP_JPEG)
 Default video codec capabilities (all codecs supported)
 
Audio Codec Bitmask Constants

Bitmasks for audio codec capabilities

Each codec is represented by a single bit, allowing multiple codecs to be advertised simultaneously in the codec_capabilities_audio field.

#define AUDIO_CODEC_CAP_RAW   ((uint32_t)(1 << AUDIO_CODEC_RAW))
 Bit 0: Raw PCM support.
 
#define AUDIO_CODEC_CAP_OPUS   ((uint32_t)(1 << AUDIO_CODEC_OPUS))
 Bit 1: Opus support.
 
#define AUDIO_CODEC_CAP_ALL   (AUDIO_CODEC_CAP_RAW | AUDIO_CODEC_CAP_OPUS)
 Default audio codec capabilities (all codecs supported)
 
#define VIDEO_CODEC_SUPPORTED(cap, codec)   (((cap) & (1 << (codec))) != 0)
 Check if a video codec is supported in capabilities bitmask.
 
#define AUDIO_CODEC_SUPPORTED(cap, codec)   (((cap) & (1 << (codec))) != 0)
 Check if an audio codec is supported in capabilities bitmask.
 

Enumerations

Video Codec Types

Enumeration of supported video codecs

enum  video_codec_t { VIDEO_CODEC_RGBA = 0 , VIDEO_CODEC_H265 = 1 , VIDEO_CODEC_JPEG = 2 }
 
Audio Codec Types

Enumeration of supported audio codecs

enum  audio_codec_t { AUDIO_CODEC_RAW = 0 , AUDIO_CODEC_OPUS = 1 }
 

Detailed Description

Video and audio codec definitions and capability bitmasks.

Defines codec types and capability bitmasks for video and audio streams. Used in CLIENT_CAPABILITIES packet to negotiate supported codecs between client and server.

Author
Zachary Fogg me@zf.nosp@m.o.gg
Date
March 2026
Version
1.0

Definition in file codecs.h.

Macro Definition Documentation

◆ AUDIO_CODEC_CAP_OPUS

#define AUDIO_CODEC_CAP_OPUS   ((uint32_t)(1 << AUDIO_CODEC_OPUS))

Bit 1: Opus support.

Definition at line 71 of file codecs.h.

◆ AUDIO_CODEC_CAP_RAW

#define AUDIO_CODEC_CAP_RAW   ((uint32_t)(1 << AUDIO_CODEC_RAW))

Bit 0: Raw PCM support.

Definition at line 70 of file codecs.h.

◆ VIDEO_CODEC_CAP_H265

#define VIDEO_CODEC_CAP_H265   ((uint32_t)(1 << VIDEO_CODEC_H265))

Bit 1: H.265 support.

Definition at line 43 of file codecs.h.

◆ VIDEO_CODEC_CAP_JPEG

#define VIDEO_CODEC_CAP_JPEG   ((uint32_t)(1 << VIDEO_CODEC_JPEG))

Bit 2: JPEG support.

Definition at line 44 of file codecs.h.

◆ VIDEO_CODEC_CAP_RGBA

#define VIDEO_CODEC_CAP_RGBA   ((uint32_t)(1 << VIDEO_CODEC_RGBA))

Bit 0: RGBA support.

Definition at line 42 of file codecs.h.

Enumeration Type Documentation

◆ audio_codec_t

Enumerator
AUDIO_CODEC_RAW 

Raw PCM audio (uncompressed)

AUDIO_CODEC_OPUS 

Opus audio codec.

Definition at line 57 of file codecs.h.

57 {
58 AUDIO_CODEC_RAW = 0,
audio_codec_t
Definition codecs.h:57
@ AUDIO_CODEC_RAW
Raw PCM audio (uncompressed)
Definition codecs.h:58
@ AUDIO_CODEC_OPUS
Opus audio codec.
Definition codecs.h:59

◆ video_codec_t

Enumerator
VIDEO_CODEC_RGBA 

Raw RGBA (4 bytes per pixel, uncompressed)

VIDEO_CODEC_H265 

H.265 (HEVC) video codec.

VIDEO_CODEC_JPEG 

JPEG still frame codec.

Definition at line 28 of file codecs.h.

28 {
video_codec_t
Definition codecs.h:28
@ VIDEO_CODEC_RGBA
Raw RGBA (4 bytes per pixel, uncompressed)
Definition codecs.h:29
@ VIDEO_CODEC_JPEG
JPEG still frame codec.
Definition codecs.h:31
@ VIDEO_CODEC_H265
H.265 (HEVC) video codec.
Definition codecs.h:30