Adds a new private option to enable them (off by default).
int fixed_qp_p;
int fixed_qp_b;
int fixed_qp_p;
int fixed_qp_b;
H264RawSPS sps;
H264RawPPS pps;
H264RawSEI sei;
H264RawSPS sps;
H264RawPPS pps;
H264RawSEI sei;
CodedBitstreamContext cbc;
CodedBitstreamFragment current_access_unit;
CodedBitstreamContext cbc;
CodedBitstreamFragment current_access_unit;
int sei_needed;
} VAAPIEncodeH264Context;
int sei_needed;
} VAAPIEncodeH264Context;
int qp;
int quality;
int low_power;
int qp;
int quality;
int low_power;
int sei;
} VAAPIEncodeH264Options;
int sei;
} VAAPIEncodeH264Options;
CodedBitstreamFragment *au = &priv->current_access_unit;
int err;
CodedBitstreamFragment *au = &priv->current_access_unit;
int err;
+ if (priv->aud_needed) {
+ err = vaapi_encode_h264_add_nal(avctx, au, &priv->aud);
+ if (err < 0)
+ goto fail;
+ priv->aud_needed = 0;
+ }
+
err = vaapi_encode_h264_add_nal(avctx, au, &priv->sps);
if (err < 0)
goto fail;
err = vaapi_encode_h264_add_nal(avctx, au, &priv->sps);
if (err < 0)
goto fail;
CodedBitstreamFragment *au = &priv->current_access_unit;
int err;
CodedBitstreamFragment *au = &priv->current_access_unit;
int err;
+ if (priv->aud_needed) {
+ err = vaapi_encode_h264_add_nal(avctx, au, &priv->aud);
+ if (err < 0)
+ goto fail;
+ priv->aud_needed = 0;
+ }
+
err = vaapi_encode_h264_add_nal(avctx, au, &priv->slice);
if (err < 0)
goto fail;
err = vaapi_encode_h264_add_nal(avctx, au, &priv->slice);
if (err < 0)
goto fail;
int err, i;
if (priv->sei_needed) {
int err, i;
if (priv->sei_needed) {
+ if (priv->aud_needed) {
+ vaapi_encode_h264_add_nal(avctx, au, &priv->aud);
+ priv->aud_needed = 0;
+ }
+
memset(&priv->sei, 0, sizeof(priv->sei));
priv->sei.nal_unit_header.nal_unit_type = H264_NAL_SEI;
memset(&priv->sei, 0, sizeof(priv->sei));
priv->sei.nal_unit_header.nal_unit_type = H264_NAL_SEI;
priv->pic_order_cnt = pic->display_order - priv->last_idr_frame;
priv->dpb_delay = pic->display_order - pic->encode_order + 1;
priv->pic_order_cnt = pic->display_order - priv->last_idr_frame;
priv->dpb_delay = pic->display_order - pic->encode_order + 1;
+ if (opt->aud) {
+ priv->aud_needed = 1;
+ priv->aud.nal_unit_header.nal_unit_type = H264_NAL_AUD;
+ priv->aud.primary_pic_type = priv->primary_pic_type;
+ } else {
+ priv->aud_needed = 0;
+ }
+
if (opt->sei & SEI_IDENTIFIER && pic->encode_order == 0)
priv->sei_needed = 1;
if (opt->sei & SEI_IDENTIFIER && pic->encode_order == 0)
priv->sei_needed = 1;
"on some platforms, does not support all features)",
OFFSET(low_power), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS },
"on some platforms, does not support all features)",
OFFSET(low_power), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS },
+ { "aud", "Include AUD",
+ OFFSET(aud), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS },
+
{ "sei", "Set SEI to include",
OFFSET(sei), AV_OPT_TYPE_FLAGS,
{ .i64 = SEI_IDENTIFIER | SEI_TIMING },
{ "sei", "Set SEI to include",
OFFSET(sei), AV_OPT_TYPE_FLAGS,
{ .i64 = SEI_IDENTIFIER | SEI_TIMING },