HACK: store dvd palette info for user-app use
This commit is contained in:
parent
d454a7ba15
commit
18f6b3cb0a
@ -2225,6 +2225,12 @@ typedef struct AVSubtitleRect {
|
||||
char *ass;
|
||||
} AVSubtitleRect;
|
||||
|
||||
typedef struct AVSubtitleDVDPalette {
|
||||
uint32_t start_display_time;
|
||||
uint8_t colormap[4];
|
||||
uint8_t alpha[4];
|
||||
} AVSubtitleDVDPalette;
|
||||
|
||||
typedef struct AVSubtitle {
|
||||
uint16_t format; /* 0 = graphics */
|
||||
uint32_t start_display_time; /* relative to packet pts, in ms */
|
||||
@ -2232,6 +2238,9 @@ typedef struct AVSubtitle {
|
||||
unsigned num_rects;
|
||||
AVSubtitleRect **rects;
|
||||
int64_t pts; ///< Same as packet pts, in AV_TIME_BASE
|
||||
|
||||
unsigned num_dvd_palette;
|
||||
AVSubtitleDVDPalette **dvd_palette;
|
||||
} AVSubtitle;
|
||||
|
||||
/**
|
||||
|
@ -325,7 +325,7 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
|
||||
case 0xff:
|
||||
goto the_end;
|
||||
default:
|
||||
ff_dlog(NULL, "unrecognised subpicture command 0x%x\n", cmd);
|
||||
av_log(ctx, AV_LOG_WARNING, "unrecognised subpicture command 0x%x\n", cmd);
|
||||
goto the_end;
|
||||
}
|
||||
}
|
||||
@ -333,6 +333,14 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
|
||||
if (offset1 >= buf_size || offset2 >= buf_size)
|
||||
goto fail;
|
||||
|
||||
/* store dvd palette info in subtitle struct for use by caller */
|
||||
i = sub_header->num_dvd_palette++;
|
||||
sub_header->dvd_palette = av_realloc(sub_header->dvd_palette, sizeof(AVSubtitleDVDPalette *) * (i+1));
|
||||
sub_header->dvd_palette[i] = av_mallocz(sizeof(AVSubtitleDVDPalette));
|
||||
sub_header->dvd_palette[i]->start_display_time = (date << 10) / 90;
|
||||
memcpy(sub_header->dvd_palette[i]->colormap, colormap, 4);
|
||||
memcpy(sub_header->dvd_palette[i]->alpha, alpha, 4);
|
||||
/* parse rle subtitles */
|
||||
if (offset1 >= 0 && offset2 >= 0) {
|
||||
int w, h;
|
||||
uint8_t *bitmap;
|
||||
|
Loading…
Reference in New Issue
Block a user