FFmpeg
|
#include "avcodec.h"
#include "bytestream.h"
#include "codec_internal.h"
#include "decode.h"
#include "mathops.h"
#include "libavutil/colorspace.h"
#include "libavutil/mem.h"
#include "libavutil/opt.h"
Go to the source code of this file.
Data Structures | |
struct | PGSSubObjectRef |
struct | PGSSubPresentation |
struct | PGSSubObject |
struct | PGSSubObjects |
struct | PGSSubPalette |
struct | PGSSubPalettes |
struct | PGSSubContext |
Macros | |
#define | RGBA(r, g, b, a) (((unsigned)(a) << 24) | ((r) << 16) | ((g) << 8) | (b)) |
#define | MAX_EPOCH_PALETTES 8 |
#define | MAX_EPOCH_OBJECTS 64 |
#define | MAX_OBJECT_REFS 2 |
#define | OFFSET(x) offsetof(PGSSubContext, x) |
#define | SD AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_DECODING_PARAM |
Enumerations | |
enum | SegmentType { PALETTE_SEGMENT = 0x14, OBJECT_SEGMENT = 0x15, PRESENTATION_SEGMENT = 0x16, WINDOW_SEGMENT = 0x17, DISPLAY_SEGMENT = 0x80, SEGMENT_TYPE_AUTO = 0, SEGMENT_TYPE_MP4, SEGMENT_TYPE_WEBM, SEGMENT_TYPE_NB, SEGMENT_TYPE_MPEGTS, SEGMENT_TYPE_FMP4 } |
Functions | |
static void | flush_cache (AVCodecContext *avctx) |
static PGSSubObject * | find_object (int id, PGSSubObjects *objects) |
static PGSSubPalette * | find_palette (int id, PGSSubPalettes *palettes) |
static av_cold int | init_decoder (AVCodecContext *avctx) |
static av_cold int | close_decoder (AVCodecContext *avctx) |
static int | decode_rle (AVCodecContext *avctx, AVSubtitleRect *rect, const uint8_t *buf, unsigned int buf_size) |
Decode the RLE data. More... | |
static int | parse_object_segment (AVCodecContext *avctx, const uint8_t *buf, int buf_size) |
Parse the picture segment packet. More... | |
static int | parse_palette_segment (AVCodecContext *avctx, const uint8_t *buf, int buf_size) |
Parse the palette segment packet. More... | |
static int | parse_presentation_segment (AVCodecContext *avctx, const uint8_t *buf, int buf_size, int64_t pts) |
Parse the presentation segment packet. More... | |
static int | display_end_segment (AVCodecContext *avctx, AVSubtitle *sub, const uint8_t *buf, int buf_size) |
Parse the display segment packet. More... | |
static int | decode (AVCodecContext *avctx, AVSubtitle *sub, int *got_sub_ptr, const AVPacket *avpkt) |
Variables | |
static const AVOption | options [] |
static const AVClass | pgsdec_class |
const FFCodec | ff_pgssub_decoder |
PGS subtitle decoder
Definition in file pgssubdec.c.
Definition at line 37 of file pgssubdec.c.
#define MAX_EPOCH_PALETTES 8 |
Definition at line 38 of file pgssubdec.c.
#define MAX_EPOCH_OBJECTS 64 |
Definition at line 39 of file pgssubdec.c.
#define MAX_OBJECT_REFS 2 |
Definition at line 40 of file pgssubdec.c.
#define OFFSET | ( | x | ) | offsetof(PGSSubContext, x) |
Definition at line 679 of file pgssubdec.c.
#define SD AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_DECODING_PARAM |
Definition at line 680 of file pgssubdec.c.
enum SegmentType |
Enumerator | |
---|---|
PALETTE_SEGMENT | |
OBJECT_SEGMENT | |
PRESENTATION_SEGMENT | |
WINDOW_SEGMENT | |
DISPLAY_SEGMENT | |
SEGMENT_TYPE_AUTO | |
SEGMENT_TYPE_MP4 | |
SEGMENT_TYPE_WEBM | |
SEGMENT_TYPE_NB | |
SEGMENT_TYPE_MPEGTS | |
SEGMENT_TYPE_FMP4 |
Definition at line 42 of file pgssubdec.c.
|
static |
Definition at line 102 of file pgssubdec.c.
Referenced by close_decoder(), and parse_presentation_segment().
|
static |
Definition at line 116 of file pgssubdec.c.
Referenced by display_end_segment(), and parse_object_segment().
|
static |
Definition at line 127 of file pgssubdec.c.
Referenced by display_end_segment(), and parse_palette_segment().
|
static |
Definition at line 138 of file pgssubdec.c.
|
static |
Definition at line 145 of file pgssubdec.c.
|
static |
Decode the RLE data.
The subtitle is stored as a 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 162 of file pgssubdec.c.
Referenced by display_end_segment().
|
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 232 of file pgssubdec.c.
Referenced by decode().
|
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 327 of file pgssubdec.c.
Referenced by decode().
|
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 389 of file pgssubdec.c.
Referenced by decode().
|
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 |
Definition at line 497 of file pgssubdec.c.
Referenced by decode().
|
static |
Definition at line 592 of file pgssubdec.c.
Definition at line 681 of file pgssubdec.c.
|
static |
Definition at line 686 of file pgssubdec.c.
const FFCodec ff_pgssub_decoder |
Definition at line 693 of file pgssubdec.c.