mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 11:19:55 +00:00
commit
73a5eb9dc5
5
BUILD.gn
5
BUILD.gn
@ -1544,8 +1544,9 @@ ohos_source_set("ffmpeg_dynamic") {
|
||||
# "//third_party/ffmpeg/libavformat/webm_chunk.c",
|
||||
# "//third_party/ffmpeg/libavformat/webmdashenc.c",
|
||||
# "//third_party/ffmpeg/libavformat/webpenc.c",
|
||||
# "//third_party/ffmpeg/libavformat/webvttdec.c",
|
||||
# "//third_party/ffmpeg/libavformat/webvttenc.c",
|
||||
"//third_party/ffmpeg/libavformat/webvttdec.c",
|
||||
"//third_party/ffmpeg/libavformat/webvttenc.c",
|
||||
|
||||
# "//third_party/ffmpeg/libavformat/westwood_aud.c",
|
||||
# "//third_party/ffmpeg/libavformat/westwood_vqa.c",
|
||||
# "//third_party/ffmpeg/libavformat/wsddec.c",
|
||||
|
@ -79,6 +79,7 @@ const AVCodecTag ff_codec_movsubtitle_tags[] = {
|
||||
{ AV_CODEC_ID_MOV_TEXT, MKTAG('t', 'e', 'x', 't') },
|
||||
{ AV_CODEC_ID_MOV_TEXT, MKTAG('t', 'x', '3', 'g') },
|
||||
{ AV_CODEC_ID_EIA_608, MKTAG('c', '6', '0', '8') },
|
||||
{ AV_CODEC_ID_WEBVTT, MKTAG('w', 'v', 't', 't') },
|
||||
{ AV_CODEC_ID_NONE, 0 },
|
||||
};
|
||||
|
||||
@ -451,4 +452,4 @@ static const struct MP4TrackKindValueMapping dash_role_map[] = {
|
||||
const struct MP4TrackKindMapping ff_mov_track_kind_table[] = {
|
||||
{ "urn:mpeg:dash:role:2011", dash_role_map },
|
||||
{ 0, NULL }
|
||||
};
|
||||
};
|
@ -801,7 +801,7 @@ static int mov_read_hdlr(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||
else if (type == MKTAG('m','1','a',' '))
|
||||
st->codecpar->codec_id = AV_CODEC_ID_MP2;
|
||||
else if ((type == MKTAG('s','u','b','p')) || (type == MKTAG('c','l','c','p')))
|
||||
else if ((type == MKTAG('s','u','b','p')) || (type == MKTAG('c','l','c','p')) || (type == MKTAG('t','e','x','t')))
|
||||
st->codecpar->codec_type = AVMEDIA_TYPE_SUBTITLE;
|
||||
#ifdef OHOS_TIMED_META_TRACK
|
||||
else if (type == MKTAG('m', 'e', 't', 'a'))
|
||||
@ -9021,6 +9021,38 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
if (st->codecpar->codec_id == AV_CODEC_ID_WEBVTT) {
|
||||
if (pkt->size >= 8) {
|
||||
uint32_t type = AV_RL32(pkt->data + 4);
|
||||
int payload_size = pkt->size - 8;
|
||||
if (type == MKTAG('v', 't', 't', 'e')) {
|
||||
pkt->size = 0;
|
||||
} else if (type == MKTAG('v', 't', 't', 'c')) {
|
||||
uint8_t *payload_data = pkt->data + 8;
|
||||
while (payload_size >= 8) {
|
||||
int64_t temp_size = AV_RB32(payload_data);
|
||||
uint32_t temp_type = AV_RL32(payload_data + 4);
|
||||
if (temp_type == MKTAG('p', 'a', 'y', 'l')) {
|
||||
payload_data += 8;
|
||||
payload_size -= 8;
|
||||
int move_size = payload_size;
|
||||
if (pkt->size < move_size) {
|
||||
move_size = pkt->size;
|
||||
}
|
||||
memmove(pkt->data, payload_data, move_size);
|
||||
pkt->size = payload_size;
|
||||
break;
|
||||
} else {
|
||||
if (temp_size > payload_size) {
|
||||
break;
|
||||
}
|
||||
payload_data += temp_size;
|
||||
payload_size -= temp_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#if CONFIG_DV_DEMUXER
|
||||
if (mov->dv_demux && sc->dv_audio_container) {
|
||||
ret = avpriv_dv_produce_packet(mov->dv_demux, pkt, pkt->data, pkt->size, pkt->pos);
|
||||
@ -9382,4 +9414,4 @@ const AVInputFormat ff_mov_demuxer = {
|
||||
.read_close = mov_read_close,
|
||||
.read_seek = mov_read_seek,
|
||||
.flags = AVFMT_NO_BYTE_SEEK | AVFMT_SEEK_TO_PTS | AVFMT_SHOW_IDS,
|
||||
};
|
||||
};
|
@ -50,7 +50,7 @@ FF_CONFIG_OPTIONS="
|
||||
--disable-bzlib
|
||||
--disable-lzma
|
||||
--disable-vulkan
|
||||
--enable-demuxer=mp3,aac,ape,flac,ogg,wav,mov,mpegts,amr,amrnb,amrwb,matroska,flv,mpegps,asf,asf_o,srt,h264
|
||||
--enable-demuxer=mp3,aac,ape,flac,ogg,wav,mov,mpegts,amr,amrnb,amrwb,matroska,flv,mpegps,asf,asf_o,srt,h264,webvtt
|
||||
--enable-muxer=mp4,h264,ipod,amr,mpegts,mp3,wav
|
||||
--enable-parser=h263,h264,mpeg4video,vp8,vp9,mpegvideo
|
||||
--enable-parser=mpegaudio,aac,aac_latm,av3a,amr,opus
|
||||
@ -144,7 +144,7 @@ FF_CONFIG_OPTIONS="
|
||||
--disable-sdl2
|
||||
--disable-bzlib
|
||||
--disable-lzma
|
||||
--enable-demuxer=mp3,aac,ape,flac,ogg,wav,mov,mpegts,amr,amrnb,amrwb,matroska,flv,mpegps,asf,asf_o,srt,h264
|
||||
--enable-demuxer=mp3,aac,ape,flac,ogg,wav,mov,mpegts,amr,amrnb,amrwb,matroska,flv,mpegps,asf,asf_o,srt,h264,webvtt
|
||||
--enable-muxer=mp4,h264,ipod,amr,mpegts,mp3,wav
|
||||
--enable-parser=h263,h264,mpeg4video,vp8,vp9,mpegvideo
|
||||
--enable-parser=mpegaudio,aac,aac_latm,av3a,amr,opus
|
||||
|
Loading…
Reference in New Issue
Block a user