mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
codecparsers: h264: clean-up gst_h264_parser_parse_sei_message().
Fix build when GST_DISABLE_GST_DEBUG is not defined. Use a switch statement to dispatch to the various SEI payload handlers. Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
This commit is contained in:
parent
1b42180817
commit
afff27651b
1 changed files with 22 additions and 21 deletions
|
@ -845,9 +845,7 @@ gst_h264_parser_parse_sei_message (GstH264NalParser * nalparser,
|
||||||
{
|
{
|
||||||
guint32 payloadSize;
|
guint32 payloadSize;
|
||||||
guint8 payload_type_byte, payload_size_byte;
|
guint8 payload_type_byte, payload_size_byte;
|
||||||
#ifndef GST_DISABLE_GST_DEBUG
|
|
||||||
guint remaining, payload_size;
|
guint remaining, payload_size;
|
||||||
#endif
|
|
||||||
GstH264ParserResult res;
|
GstH264ParserResult res;
|
||||||
|
|
||||||
GST_DEBUG ("parsing \"Sei message\"");
|
GST_DEBUG ("parsing \"Sei message\"");
|
||||||
|
@ -865,32 +863,35 @@ gst_h264_parser_parse_sei_message (GstH264NalParser * nalparser,
|
||||||
}
|
}
|
||||||
while (payload_size_byte == 0xff);
|
while (payload_size_byte == 0xff);
|
||||||
|
|
||||||
#ifndef GST_DISABLE_GST_DEBUG
|
|
||||||
remaining = nal_reader_get_remaining (nr);
|
remaining = nal_reader_get_remaining (nr);
|
||||||
payload_size = payloadSize * 8 < remaining ? payloadSize * 8 : remaining;
|
payload_size = payloadSize * 8 < remaining ? payloadSize * 8 : remaining;
|
||||||
|
|
||||||
GST_DEBUG ("SEI message received: payloadType %u, payloadSize = %u bits",
|
GST_DEBUG ("SEI message received: payloadType %u, payloadSize = %u bits",
|
||||||
sei->payloadType, payload_size);
|
sei->payloadType, payload_size);
|
||||||
#endif
|
|
||||||
|
|
||||||
if (sei->payloadType == GST_H264_SEI_BUF_PERIOD) {
|
switch (sei->payloadType) {
|
||||||
/* size not set; might depend on emulation_prevention_three_byte */
|
case GST_H264_SEI_BUF_PERIOD:
|
||||||
res = gst_h264_parser_parse_buffering_period (nalparser,
|
/* size not set; might depend on emulation_prevention_three_byte */
|
||||||
&sei->payload.buffering_period, nr);
|
res = gst_h264_parser_parse_buffering_period (nalparser,
|
||||||
} else if (sei->payloadType == GST_H264_SEI_PIC_TIMING) {
|
&sei->payload.buffering_period, nr);
|
||||||
/* size not set; might depend on emulation_prevention_three_byte */
|
break;
|
||||||
res = gst_h264_parser_parse_pic_timing (nalparser,
|
case GST_H264_SEI_PIC_TIMING:
|
||||||
&sei->payload.pic_timing, nr);
|
/* size not set; might depend on emulation_prevention_three_byte */
|
||||||
} else {
|
res = gst_h264_parser_parse_pic_timing (nalparser,
|
||||||
/* Just consume payloadSize bytes, which does not account for
|
&sei->payload.pic_timing, nr);
|
||||||
emulation prevention bytes */
|
break;
|
||||||
guint nbits = payload_size % 8;
|
default:{
|
||||||
while (payload_size > 0) {
|
/* Just consume payloadSize bytes, which does not account for
|
||||||
nal_reader_skip (nr, nbits);
|
emulation prevention bytes */
|
||||||
payload_size -= nbits;
|
guint nbits = payload_size % 8;
|
||||||
nbits = 8;
|
while (payload_size > 0) {
|
||||||
|
nal_reader_skip (nr, nbits);
|
||||||
|
payload_size -= nbits;
|
||||||
|
nbits = 8;
|
||||||
|
}
|
||||||
|
res = GST_H264_PARSER_OK;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
res = GST_H264_PARSER_OK;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* When SEI message doesn't end at byte boundary,
|
/* When SEI message doesn't end at byte boundary,
|
||||||
|
|
Loading…
Reference in a new issue