Skip to content
Snippets Groups Projects
Commit 3143fe34 authored by Mark Thompson's avatar Mark Thompson
Browse files

cbs_h264: Actually decompose end-of-sequence NAL units

64c50c0e declared support for decomposing
them but omitted to implement it; this adds an implementation.

Also do the same for end-of-stream NAL units, since they are equivalent.
parent b737317a
No related branches found
No related tags found
No related merge requests found
...@@ -872,7 +872,21 @@ static int cbs_h264_read_nal_unit(CodedBitstreamContext *ctx, ...@@ -872,7 +872,21 @@ static int cbs_h264_read_nal_unit(CodedBitstreamContext *ctx,
break; break;
case H264_NAL_END_SEQUENCE: case H264_NAL_END_SEQUENCE:
return 0; case H264_NAL_END_STREAM:
{
err = ff_cbs_alloc_unit_content(ctx, unit,
sizeof(H264RawNALUnitHeader),
NULL);
if (err < 0)
return err;
err = (unit->type == H264_NAL_END_SEQUENCE ?
cbs_h264_read_end_of_sequence :
cbs_h264_read_end_of_stream)(ctx, &gbc, unit->content);
if (err < 0)
return err;
}
break;
default: default:
return AVERROR(ENOSYS); return AVERROR(ENOSYS);
...@@ -1147,6 +1161,22 @@ static int cbs_h264_write_nal_unit(CodedBitstreamContext *ctx, ...@@ -1147,6 +1161,22 @@ static int cbs_h264_write_nal_unit(CodedBitstreamContext *ctx,
} }
break; break;
case H264_NAL_END_SEQUENCE:
{
err = cbs_h264_write_end_of_sequence(ctx, pbc, unit->content);
if (err < 0)
return err;
}
break;
case H264_NAL_END_STREAM:
{
err = cbs_h264_write_end_of_stream(ctx, pbc, unit->content);
if (err < 0)
return err;
}
break;
default: default:
av_log(ctx->log_ctx, AV_LOG_ERROR, "Write unimplemented for " av_log(ctx->log_ctx, AV_LOG_ERROR, "Write unimplemented for "
"NAL unit type %"PRIu32".\n", unit->type); "NAL unit type %"PRIu32".\n", unit->type);
......
...@@ -1375,3 +1375,21 @@ static int FUNC(filler)(CodedBitstreamContext *ctx, RWContext *rw, ...@@ -1375,3 +1375,21 @@ static int FUNC(filler)(CodedBitstreamContext *ctx, RWContext *rw,
return 0; return 0;
} }
static int FUNC(end_of_sequence)(CodedBitstreamContext *ctx, RWContext *rw,
H264RawNALUnitHeader *current)
{
HEADER("End of Sequence");
return FUNC(nal_unit_header)(ctx, rw, current,
1 << H264_NAL_END_SEQUENCE);
}
static int FUNC(end_of_stream)(CodedBitstreamContext *ctx, RWContext *rw,
H264RawNALUnitHeader *current)
{
HEADER("End of Stream");
return FUNC(nal_unit_header)(ctx, rw, current,
1 << H264_NAL_END_STREAM);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment