gint32 prev_frame_num; // prevFrameNum
guint is_constructed : 1;
guint is_opened : 1;
+ guint is_avc : 1;
};
static gboolean
buf_size = GST_BUFFER_SIZE(buffer);
ofs = 0;
do {
- result = gst_h264_parser_identify_nalu(
- priv->parser,
- buf, ofs, buf_size,
- &nalu
- );
+ if (priv->is_avc) {
+ result = gst_h264_parser_identify_nalu_avc(
+ priv->parser,
+ buf, ofs, buf_size, priv->nal_length_size,
+ &nalu
+ );
+ }
+ else {
+ result = gst_h264_parser_identify_nalu(
+ priv->parser,
+ buf, ofs, buf_size,
+ &nalu
+ );
+ }
status = get_status(result);
if (status == GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA) {
status = GST_VAAPI_DECODER_STATUS_ERROR_BITSTREAM_PARSER;
break;
}
- } while (status == GST_VAAPI_DECODER_STATUS_SUCCESS);
+ } while (status == GST_VAAPI_DECODER_STATUS_SUCCESS && ofs < buf_size);
return status;
}
return status;
ofs = nalu.offset + nalu.size;
}
+
+ priv->is_avc = TRUE;
return status;
}
priv->prev_frame_num = 0;
priv->is_constructed = FALSE;
priv->is_opened = FALSE;
+ priv->is_avc = FALSE;
memset(priv->dpb, 0, sizeof(priv->dpb));
memset(priv->short_ref, 0, sizeof(priv->short_ref));