Signal disposable sample in the h.264 importer.
This commit is contained in:
1 file changed
+5
-4
@@ -954,9 +954,8 @@ extern "C" uint32_t h264_get_frame_dependency (h264_decode_t *dec)
|
|||||||
else
|
else
|
||||||
dflags |= MP4_SDT_HAS_NO_DEPENDENTS; /* disposable */
|
dflags |= MP4_SDT_HAS_NO_DEPENDENTS; /* disposable */
|
||||||
|
|
||||||
if (dec->nal_unit_type != H264_NAL_TYPE_IDR_SLICE) {
|
if (dec->nal_unit_type == H264_NAL_TYPE_IDR_SLICE) {
|
||||||
if (H264_TYPE_IS_P(dec->slice_type)) dflags |= MP4_SDT_EARLIER_DISPLAY_TIMES_ALLOWED;
|
dflags |= MP4_SDT_IS_INDEPENDENT;
|
||||||
if (H264_TYPE_IS_I(dec->slice_type)) dflags |= MP4_SDT_EARLIER_DISPLAY_TIMES_ALLOWED;;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return dflags;
|
return dflags;
|
||||||
@@ -1532,6 +1531,7 @@ NSData* H264Info(const char *filePath, uint32_t *pic_width, uint32_t *pic_height
|
|||||||
sample->size = nal_buffer_size;
|
sample->size = nal_buffer_size;
|
||||||
sample->duration = mp4FrameDuration;
|
sample->duration = mp4FrameDuration;
|
||||||
sample->flags = nal_is_sync ? MP42SampleBufferFlagIsSync : 0;
|
sample->flags = nal_is_sync ? MP42SampleBufferFlagIsSync : 0;
|
||||||
|
sample->dependecyFlags = dflags;
|
||||||
sample->trackId = trackId;
|
sample->trackId = trackId;
|
||||||
|
|
||||||
[self enqueue:sample];
|
[self enqueue:sample];
|
||||||
@@ -1551,7 +1551,6 @@ NSData* H264Info(const char *filePath, uint32_t *pic_width, uint32_t *pic_height
|
|||||||
h264_dec.nal_unit_type, nal.buffer_on);
|
h264_dec.nal_unit_type, nal.buffer_on);
|
||||||
}
|
}
|
||||||
if (h264_nal_unit_type_is_slice(h264_dec.nal_unit_type)) {
|
if (h264_nal_unit_type_is_slice(h264_dec.nal_unit_type)) {
|
||||||
dflags = h264_get_frame_dependency(&h264_dec);
|
|
||||||
// copy all seis, etc before indicating first
|
// copy all seis, etc before indicating first
|
||||||
first = false;
|
first = false;
|
||||||
copy_nal_to_buffer = true;
|
copy_nal_to_buffer = true;
|
||||||
@@ -1559,6 +1558,7 @@ NSData* H264Info(const char *filePath, uint32_t *pic_width, uint32_t *pic_height
|
|||||||
poc = h264_dec.pic_order_cnt;
|
poc = h264_dec.pic_order_cnt;
|
||||||
|
|
||||||
nal_is_sync = h264_slice_is_idr(&h264_dec);
|
nal_is_sync = h264_slice_is_idr(&h264_dec);
|
||||||
|
dflags = h264_get_frame_dependency(&h264_dec);
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
switch (h264_dec.nal_unit_type) {
|
switch (h264_dec.nal_unit_type) {
|
||||||
@@ -1618,6 +1618,7 @@ NSData* H264Info(const char *filePath, uint32_t *pic_width, uint32_t *pic_height
|
|||||||
sample->size = nal_buffer_size;
|
sample->size = nal_buffer_size;
|
||||||
sample->duration = mp4FrameDuration;
|
sample->duration = mp4FrameDuration;
|
||||||
sample->flags = nal_is_sync ? MP42SampleBufferFlagIsSync : 0;
|
sample->flags = nal_is_sync ? MP42SampleBufferFlagIsSync : 0;
|
||||||
|
sample->dependecyFlags = dflags;
|
||||||
sample->trackId = trackId;
|
sample->trackId = trackId;
|
||||||
|
|
||||||
[self enqueue:sample];
|
[self enqueue:sample];
|
||||||
|
|||||||
Reference in new issue
Block a user