mov: Use defines for sample flags in fragments
Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
3eec23f3cd
commit
5be805d38c
@ -171,6 +171,16 @@ void ff_mp4_parse_es_descr(AVIOContext *pb, int *es_id);
|
|||||||
#define MOV_TRUN_SAMPLE_FLAGS 0x400
|
#define MOV_TRUN_SAMPLE_FLAGS 0x400
|
||||||
#define MOV_TRUN_SAMPLE_CTS 0x800
|
#define MOV_TRUN_SAMPLE_CTS 0x800
|
||||||
|
|
||||||
|
#define MOV_FRAG_SAMPLE_FLAG_DEGRADATION_PRIORITY_MASK 0x0000ffff
|
||||||
|
#define MOV_FRAG_SAMPLE_FLAG_IS_NON_SYNC 0x00010000
|
||||||
|
#define MOV_FRAG_SAMPLE_FLAG_PADDING_MASK 0x000e0000
|
||||||
|
#define MOV_FRAG_SAMPLE_FLAG_REDUNDANCY_MASK 0x00300000
|
||||||
|
#define MOV_FRAG_SAMPLE_FLAG_DEPENDED_MASK 0x00c00000
|
||||||
|
#define MOV_FRAG_SAMPLE_FLAG_DEPENDS_MASK 0x03000000
|
||||||
|
|
||||||
|
#define MOV_FRAG_SAMPLE_FLAG_DEPENDS_NO 0x02000000
|
||||||
|
#define MOV_FRAG_SAMPLE_FLAG_DEPENDS_YES 0x01000000
|
||||||
|
|
||||||
int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb, MOVAtom atom);
|
int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb, MOVAtom atom);
|
||||||
enum CodecID ff_mov_get_lpcm_codec_id(int bps, int flags);
|
enum CodecID ff_mov_get_lpcm_codec_id(int bps, int flags);
|
||||||
|
|
||||||
|
@ -2282,7 +2282,7 @@ static int mov_read_trun(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
avio_rb32(pb) : 0;
|
avio_rb32(pb) : 0;
|
||||||
sc->ctts_count++;
|
sc->ctts_count++;
|
||||||
if ((keyframe = st->codec->codec_type == AVMEDIA_TYPE_AUDIO ||
|
if ((keyframe = st->codec->codec_type == AVMEDIA_TYPE_AUDIO ||
|
||||||
(flags & MOV_TRUN_FIRST_SAMPLE_FLAGS && !i && !(sample_flags & 0xffff0000)) || sample_flags & 0x2000000))
|
(flags & MOV_TRUN_FIRST_SAMPLE_FLAGS && !i && !(sample_flags & ~MOV_FRAG_SAMPLE_FLAG_DEGRADATION_PRIORITY_MASK)) || sample_flags & MOV_FRAG_SAMPLE_FLAG_DEPENDS_NO))
|
||||||
distance = 0;
|
distance = 0;
|
||||||
av_add_index_entry(st, offset, dts, sample_size, distance,
|
av_add_index_entry(st, offset, dts, sample_size, distance,
|
||||||
keyframe ? AVINDEX_KEYFRAME : 0);
|
keyframe ? AVINDEX_KEYFRAME : 0);
|
||||||
|
@ -2214,7 +2214,8 @@ static int mov_write_tfhd_tag(AVIOContext *pb, MOVTrack *track,
|
|||||||
if (flags & MOV_TFHD_DEFAULT_FLAGS) {
|
if (flags & MOV_TFHD_DEFAULT_FLAGS) {
|
||||||
track->default_sample_flags =
|
track->default_sample_flags =
|
||||||
track->enc->codec_type == AVMEDIA_TYPE_VIDEO ?
|
track->enc->codec_type == AVMEDIA_TYPE_VIDEO ?
|
||||||
0x01010000 : 0x02000000;
|
(MOV_FRAG_SAMPLE_FLAG_DEPENDS_YES | MOV_FRAG_SAMPLE_FLAG_IS_NON_SYNC) :
|
||||||
|
MOV_FRAG_SAMPLE_FLAG_DEPENDS_NO;
|
||||||
avio_wb32(pb, track->default_sample_flags);
|
avio_wb32(pb, track->default_sample_flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2223,7 +2224,8 @@ static int mov_write_tfhd_tag(AVIOContext *pb, MOVTrack *track,
|
|||||||
|
|
||||||
static uint32_t get_sample_flags(MOVTrack *track, MOVIentry *entry)
|
static uint32_t get_sample_flags(MOVTrack *track, MOVIentry *entry)
|
||||||
{
|
{
|
||||||
return entry->flags & MOV_SYNC_SAMPLE ? 0x02000000 : 0x01010000;
|
return entry->flags & MOV_SYNC_SAMPLE ? MOV_FRAG_SAMPLE_FLAG_DEPENDS_NO :
|
||||||
|
(MOV_FRAG_SAMPLE_FLAG_DEPENDS_YES | MOV_FRAG_SAMPLE_FLAG_IS_NON_SYNC);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mov_write_trun_tag(AVIOContext *pb, MOVTrack *track)
|
static int mov_write_trun_tag(AVIOContext *pb, MOVTrack *track)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user