HACK: store dvd palette info for user-app use
This commit is contained in:
parent
0c36516659
commit
637a926e74
|
@ -2224,6 +2224,12 @@ typedef struct AVSubtitleRect {
|
||||||
char *ass;
|
char *ass;
|
||||||
} AVSubtitleRect;
|
} AVSubtitleRect;
|
||||||
|
|
||||||
|
typedef struct AVSubtitleDVDPalette {
|
||||||
|
uint32_t start_display_time;
|
||||||
|
uint8_t colormap[4];
|
||||||
|
uint8_t alpha[4];
|
||||||
|
} AVSubtitleDVDPalette;
|
||||||
|
|
||||||
typedef struct AVSubtitle {
|
typedef struct AVSubtitle {
|
||||||
uint16_t format; /* 0 = graphics */
|
uint16_t format; /* 0 = graphics */
|
||||||
uint32_t start_display_time; /* relative to packet pts, in ms */
|
uint32_t start_display_time; /* relative to packet pts, in ms */
|
||||||
|
@ -2231,6 +2237,9 @@ typedef struct AVSubtitle {
|
||||||
unsigned num_rects;
|
unsigned num_rects;
|
||||||
AVSubtitleRect **rects;
|
AVSubtitleRect **rects;
|
||||||
int64_t pts; ///< Same as packet pts, in AV_TIME_BASE
|
int64_t pts; ///< Same as packet pts, in AV_TIME_BASE
|
||||||
|
|
||||||
|
unsigned num_dvd_palette;
|
||||||
|
AVSubtitleDVDPalette **dvd_palette;
|
||||||
} AVSubtitle;
|
} AVSubtitle;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -324,7 +324,7 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
|
||||||
case 0xff:
|
case 0xff:
|
||||||
goto the_end;
|
goto the_end;
|
||||||
default:
|
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;
|
goto the_end;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -332,6 +332,14 @@ static int decode_dvd_subtitles(DVDSubContext *ctx, AVSubtitle *sub_header,
|
||||||
if (offset1 >= buf_size || offset2 >= buf_size)
|
if (offset1 >= buf_size || offset2 >= buf_size)
|
||||||
goto fail;
|
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) {
|
if (offset1 >= 0 && offset2 >= 0) {
|
||||||
int w, h;
|
int w, h;
|
||||||
uint8_t *bitmap;
|
uint8_t *bitmap;
|
||||||
|
|
Loading…
Reference in New Issue