#include "avcodec.h"
#include "dsputil.h"
#include "bytestream.h"
#include "libavutil/colorspace.h"
#include "libavutil/imgutils.h"
#include "libavutil/opt.h"
Go to the source code of this file.
Data Structures | |
struct | PGSSubPictureReference |
struct | PGSSubPresentation |
struct | PGSSubPicture |
struct | PGSSubContext |
Defines | |
#define | RGBA(r, g, b, a) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)) |
#define | OFFSET(x) offsetof(PGSSubContext, x) |
#define | SD AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_DECODING_PARAM |
Enumerations | |
enum | SegmentType { PALETTE_SEGMENT = 0x14, PICTURE_SEGMENT = 0x15, PRESENTATION_SEGMENT = 0x16, WINDOW_SEGMENT = 0x17, DISPLAY_SEGMENT = 0x80 } |
Functions | |
static av_cold int | init_decoder (AVCodecContext *avctx) |
static av_cold int | close_decoder (AVCodecContext *avctx) |
static int | decode_rle (AVCodecContext *avctx, AVSubtitle *sub, int rect, const uint8_t *buf, unsigned int buf_size) |
Decode the RLE data. | |
static int | parse_picture_segment (AVCodecContext *avctx, const uint8_t *buf, int buf_size) |
Parse the picture segment packet. | |
static void | parse_palette_segment (AVCodecContext *avctx, const uint8_t *buf, int buf_size) |
Parse the palette segment packet. | |
static void | parse_presentation_segment (AVCodecContext *avctx, const uint8_t *buf, int buf_size) |
Parse the presentation segment packet. | |
static int | display_end_segment (AVCodecContext *avctx, void *data, const uint8_t *buf, int buf_size) |
Parse the display segment packet. | |
static int | decode (AVCodecContext *avctx, void *data, int *data_size, AVPacket *avpkt) |
Variables | |
static const AVOption | options [] |
static const AVClass | pgsdec_class |
AVCodec | ff_pgssub_decoder |
Definition in file pgssubdec.c.
#define OFFSET | ( | x | ) | offsetof(PGSSubContext, x) |
Definition at line 511 of file pgssubdec.c.
Definition at line 34 of file pgssubdec.c.
#define SD AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_DECODING_PARAM |
Definition at line 512 of file pgssubdec.c.
enum SegmentType |
Definition at line 36 of file pgssubdec.c.
static av_cold int close_decoder | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 80 of file pgssubdec.c.
static int decode | ( | AVCodecContext * | avctx, | |
void * | data, | |||
int * | data_size, | |||
AVPacket * | avpkt | |||
) | [static] |
Definition at line 436 of file pgssubdec.c.
static int decode_rle | ( | AVCodecContext * | avctx, | |
AVSubtitle * | sub, | |||
int | rect, | |||
const uint8_t * | buf, | |||
unsigned int | buf_size | |||
) | [static] |
Decode the RLE data.
The subtitle is stored as an Run Length Encoded image.
avctx | contains the current codec context | |
sub | pointer to the processed subtitle data | |
buf | pointer to the RLE data to process | |
buf_size | size of the RLE data to process |
Definition at line 107 of file pgssubdec.c.
static int display_end_segment | ( | AVCodecContext * | avctx, | |
void * | data, | |||
const uint8_t * | buf, | |||
int | buf_size | |||
) | [static] |
Parse the display segment packet.
The display segment controls the updating of the display.
avctx | contains the current codec context | |
data | pointer to the data pertaining the subtitle to display | |
buf | pointer to the packet to process | |
buf_size | size of packet to process |
segment, which is currently ignored as it clears
the subtitle too early.
Definition at line 376 of file pgssubdec.c.
Referenced by decode().
static av_cold int init_decoder | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 73 of file pgssubdec.c.
static void parse_palette_segment | ( | AVCodecContext * | avctx, | |
const uint8_t * | buf, | |||
int | buf_size | |||
) | [static] |
Parse the palette segment packet.
The palette segment contains details of the palette, a maximum of 256 colors can be defined.
avctx | contains the current codec context | |
buf | pointer to the packet to process | |
buf_size | size of packet to process |
Definition at line 249 of file pgssubdec.c.
Referenced by decode().
static int parse_picture_segment | ( | AVCodecContext * | avctx, | |
const uint8_t * | buf, | |||
int | buf_size | |||
) | [static] |
Parse the picture segment packet.
The picture segment contains details on the sequence id, width, height and Run Length Encoded (RLE) bitmap data.
avctx | contains the current codec context | |
buf | pointer to the packet to process | |
buf_size | size of packet to process |
Definition at line 174 of file pgssubdec.c.
Referenced by decode().
static void parse_presentation_segment | ( | AVCodecContext * | avctx, | |
const uint8_t * | buf, | |||
int | buf_size | |||
) | [static] |
Parse the presentation segment packet.
The presentation segment contains details on the video width, video height, x & y subtitle position.
avctx | contains the current codec context | |
buf | pointer to the packet to process | |
buf_size | size of packet to process |
Definition at line 291 of file pgssubdec.c.
Referenced by decode().
Initial value:
{ .name = "pgssub", .type = AVMEDIA_TYPE_SUBTITLE, .id = CODEC_ID_HDMV_PGS_SUBTITLE, .priv_data_size = sizeof(PGSSubContext), .init = init_decoder, .close = close_decoder, .decode = decode, .long_name = NULL_IF_CONFIG_SMALL("HDMV Presentation Graphic Stream subtitles"), .priv_class = &pgsdec_class, }
Definition at line 525 of file pgssubdec.c.
Initial value:
{ {"forced_subs_only", "Only show forced subtitles", OFFSET(forced_subs_only), AV_OPT_TYPE_INT, {.dbl = 0}, 0, 1, SD}, { NULL }, }
Definition at line 513 of file pgssubdec.c.
const AVClass pgsdec_class [static] |
Initial value:
{ .class_name = "PGS subtitle decoder", .item_name = av_default_item_name, .option = options, .version = LIBAVUTIL_VERSION_INT, }
Definition at line 518 of file pgssubdec.c.