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;
|
||||
guint8 payload_type_byte, payload_size_byte;
|
||||
#ifndef GST_DISABLE_GST_DEBUG
|
||||
guint remaining, payload_size;
|
||||
#endif
|
||||
GstH264ParserResult res;
|
||||
|
||||
GST_DEBUG ("parsing \"Sei message\"");
|
||||
|
@ -865,23 +863,24 @@ gst_h264_parser_parse_sei_message (GstH264NalParser * nalparser,
|
|||
}
|
||||
while (payload_size_byte == 0xff);
|
||||
|
||||
#ifndef GST_DISABLE_GST_DEBUG
|
||||
remaining = nal_reader_get_remaining (nr);
|
||||
payload_size = payloadSize * 8 < remaining ? payloadSize * 8 : remaining;
|
||||
|
||||
GST_DEBUG ("SEI message received: payloadType %u, payloadSize = %u bits",
|
||||
sei->payloadType, payload_size);
|
||||
#endif
|
||||
|
||||
if (sei->payloadType == GST_H264_SEI_BUF_PERIOD) {
|
||||
switch (sei->payloadType) {
|
||||
case GST_H264_SEI_BUF_PERIOD:
|
||||
/* size not set; might depend on emulation_prevention_three_byte */
|
||||
res = gst_h264_parser_parse_buffering_period (nalparser,
|
||||
&sei->payload.buffering_period, nr);
|
||||
} else if (sei->payloadType == GST_H264_SEI_PIC_TIMING) {
|
||||
break;
|
||||
case GST_H264_SEI_PIC_TIMING:
|
||||
/* size not set; might depend on emulation_prevention_three_byte */
|
||||
res = gst_h264_parser_parse_pic_timing (nalparser,
|
||||
&sei->payload.pic_timing, nr);
|
||||
} else {
|
||||
break;
|
||||
default:{
|
||||
/* Just consume payloadSize bytes, which does not account for
|
||||
emulation prevention bytes */
|
||||
guint nbits = payload_size % 8;
|
||||
|
@ -891,6 +890,8 @@ gst_h264_parser_parse_sei_message (GstH264NalParser * nalparser,
|
|||
nbits = 8;
|
||||
}
|
||||
res = GST_H264_PARSER_OK;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* When SEI message doesn't end at byte boundary,
|
||||
|
|
Loading…
Reference in a new issue