guint32 idr_num;
GstBuffer *sps_data;
+ GstBuffer *subset_sps_data;
GstBuffer *pps_data;
guint bitrate_bits; // bitrate (bits)
{
guint8 nal_type;
gsize ret;
+ gboolean has_subset_sps;
g_assert (size);
- if (encoder->sps_data && encoder->pps_data)
+ has_subset_sps = !encoder->is_mvc || (encoder->subset_sps_data != NULL);
+ if (encoder->sps_data && encoder->pps_data && has_subset_sps)
return;
nal_type = nal[0] & 0x1F;
ret = gst_buffer_fill (encoder->sps_data, 0, nal, size);
g_assert (ret == size);
break;
+ case GST_VAAPI_ENCODER_H264_NAL_SUBSET_SPS:
+ encoder->subset_sps_data = gst_buffer_new_allocate (NULL, size, NULL);
+ ret = gst_buffer_fill (encoder->subset_sps_data, 0, nal, size);
+ g_assert (ret == size);
+ break;
case GST_VAAPI_ENCODER_H264_NAL_PPS:
encoder->pps_data = gst_buffer_new_allocate (NULL, size, NULL);
ret = gst_buffer_fill (encoder->pps_data, 0, nal, size);
gst_vaapi_enc_picture_add_packed_header (picture, packed_seq);
gst_vaapi_mini_object_replace ((GstVaapiMiniObject **) & packed_seq, NULL);
+
+ /* store subset sps data */
+ _check_sps_pps_status (encoder, data + 4, data_bit_size / 8 - 4);
gst_bit_writer_clear (&bs, TRUE);
return TRUE;
guint32 i;
gst_buffer_replace (&encoder->sps_data, NULL);
+ gst_buffer_replace (&encoder->subset_sps_data, NULL);
gst_buffer_replace (&encoder->pps_data, NULL);
/* reference list info de-init */