priv->max_width, priv->max_height, seq_header.max_frame_width_minus_1 + 1,
seq_header.max_frame_height_minus_1 + 1);
- ret = klass->new_sequence (self, &seq_header);
+ /* TODO: Implement render delay */
+ ret = klass->new_sequence (self, &seq_header, GST_AV1_TOTAL_REFS_PER_FRAME);
if (ret != GST_FLOW_OK) {
GST_ERROR_OBJECT (self, "subclass does not want accept new sequence");
return ret;
* GstAV1DecoderClass::new_sequence:
* @decoder: a #GstAV1Decoder
* @seq_hdr: a #GstAV1SequenceHeaderOBU
+ * @max_dpb_size: the size of dpb including preferred output delay
+ * by subclass reported via get_preferred_output_delay method.
*
* Notifies subclass of SPS update
*
* Since: 1.20
*/
GstFlowReturn (*new_sequence) (GstAV1Decoder * decoder,
- const GstAV1SequenceHeaderOBU * seq_hdr);
+ const GstAV1SequenceHeaderOBU * seq_hdr,
+ gint max_dpb_size);
/**
* GstAV1DecoderClass::new_picture:
* @decoder: a #GstAV1Decoder
GstMpegVideoPictureHdr pic_hdr = { 0, };
GstMpeg2DecoderClass *klass = GST_MPEG2_DECODER_GET_CLASS (decoder);
+ g_assert (klass->new_sequence);
+
if (!_is_valid_state (decoder, GST_MPEG2_DECODER_STATE_VALID_SEQ_HEADERS)) {
GST_ERROR_OBJECT (decoder, "no sequence before parsing picture header");
return GST_FLOW_ERROR;
priv->need_to_drain = FALSE;
}
- if (klass->get_preferred_output_delay)
+ if (klass->get_preferred_output_delay) {
priv->preferred_output_delay =
klass->get_preferred_output_delay (decoder, priv->is_live);
+ } else {
+ priv->preferred_output_delay = 0;
+ }
priv->seq_changed = FALSE;
- if (klass->new_sequence) {
- ret = klass->new_sequence (decoder, &priv->seq_hdr,
- _seq_ext_is_valid (&priv->seq_ext) ? &priv->seq_ext : NULL,
- _seq_display_ext_is_valid (&priv->seq_display_ext) ?
- &priv->seq_display_ext : NULL,
- _seq_scalable_ext_is_valid (&priv->seq_scalable_ext) ?
- &priv->seq_scalable_ext : NULL);
+ ret = klass->new_sequence (decoder, &priv->seq_hdr,
+ _seq_ext_is_valid (&priv->seq_ext) ? &priv->seq_ext : NULL,
+ _seq_display_ext_is_valid (&priv->seq_display_ext) ?
+ &priv->seq_display_ext : NULL,
+ _seq_scalable_ext_is_valid (&priv->seq_scalable_ext) ?
+ &priv->seq_scalable_ext : NULL,
+ /* previous/next 2 pictures */
+ 2 + priv->preferred_output_delay);
- if (ret != GST_FLOW_OK) {
- GST_WARNING_OBJECT (decoder, "new sequence error");
- return ret;
- }
+ if (ret != GST_FLOW_OK) {
+ GST_WARNING_OBJECT (decoder, "new sequence error");
+ return ret;
}
}
* @decoder: a #GstMpeg2Decoder
* @seq: a #GstMpegVideoSequenceHdr
* @seq_ext: a #GstMpegVideoSequenceExt
+ * @max_dpb_size: the size of dpb including preferred output delay
+ * by subclass reported via get_preferred_output_delay method.
*
* Notifies subclass of SPS update
*
const GstMpegVideoSequenceHdr * seq,
const GstMpegVideoSequenceExt * seq_ext,
const GstMpegVideoSequenceDisplayExt * seq_display_ext,
- const GstMpegVideoSequenceScalableExt * seq_scalable_ext);
+ const GstMpegVideoSequenceScalableExt * seq_scalable_ext,
+ gint max_dpb_size);
/**
* GstMpeg2DecoderClass::new_picture:
priv->had_sequence = TRUE;
- if (klass->get_preferred_output_delay)
+ if (klass->get_preferred_output_delay) {
priv->preferred_output_delay =
klass->get_preferred_output_delay (self, priv->is_live);
- else
+ } else {
priv->preferred_output_delay = 0;
+ }
+
+ g_assert (klass->new_sequence);
- if (klass->new_sequence)
- ret = klass->new_sequence (self, frame_hdr);
+ ret = klass->new_sequence (self, frame_hdr,
+ /* last/golden/alt 3 pictures */
+ 3 + priv->preferred_output_delay);
}
return ret;
GstVideoDecoderClass parent_class;
GstFlowReturn (*new_sequence) (GstVp8Decoder * decoder,
- const GstVp8FrameHdr * frame_hdr);
+ const GstVp8FrameHdr * frame_hdr,
+ gint max_dpb_size);
/**
* GstVp8DecoderClass:new_picture:
GstVp9DecoderClass *klass = GST_VP9_DECODER_GET_CLASS (self);
GstFlowReturn ret = GST_FLOW_OK;
+ g_assert (klass->new_sequence);
+
if (priv->had_sequence && !gst_vp9_decoder_is_format_change (self, frame_hdr)) {
return GST_FLOW_OK;
}
priv->preferred_output_delay = 0;
}
- if (klass->new_sequence)
- ret = klass->new_sequence (self, frame_hdr);
+ ret = klass->new_sequence (self, frame_hdr,
+ GST_VP9_REF_FRAMES + priv->preferred_output_delay);
if (ret != GST_FLOW_OK)
priv->had_sequence = FALSE;
/**
* GstVp9DecoderClass::new_sequence:
+ * @decoder: a #GstVp9Decoder
+ * @frame_hdr: a #GstVp9FrameHeader
+ * @max_dpb_size: the size of dpb including preferred output delay
+ * by subclass reported via get_preferred_output_delay method.
*
* Notifies subclass of video sequence update such as resolution, bitdepth,
* profile.
* Since: 1.18
*/
GstFlowReturn (*new_sequence) (GstVp9Decoder * decoder,
- const GstVp9FrameHeader *frame_hdr);
+ const GstVp9FrameHeader *frame_hdr,
+ gint max_dpb_size);
/**
* GstVp9DecoderClass::new_picture:
/* GstAV1Decoder */
static GstFlowReturn gst_d3d11_av1_dec_new_sequence (GstAV1Decoder * decoder,
- const GstAV1SequenceHeaderOBU * seq_hdr);
+ const GstAV1SequenceHeaderOBU * seq_hdr, gint max_dpb_size);
static GstFlowReturn gst_d3d11_av1_dec_new_picture (GstAV1Decoder * decoder,
GstVideoCodecFrame * frame, GstAV1Picture * picture);
static GstAV1Picture *gst_d3d11_av1_dec_duplicate_picture (GstAV1Decoder *
static GstFlowReturn
gst_d3d11_av1_dec_new_sequence (GstAV1Decoder * decoder,
- const GstAV1SequenceHeaderOBU * seq_hdr)
+ const GstAV1SequenceHeaderOBU * seq_hdr, gint max_dpb_size)
{
GstD3D11AV1Dec *self = GST_D3D11_AV1_DEC (decoder);
GstD3D11AV1DecInner *inner = self->inner;
decoder, const GstMpegVideoSequenceHdr * seq,
const GstMpegVideoSequenceExt * seq_ext,
const GstMpegVideoSequenceDisplayExt * seq_display_ext,
- const GstMpegVideoSequenceScalableExt * seq_scalable_ext);
+ const GstMpegVideoSequenceScalableExt * seq_scalable_ext,
+ gint max_dpb_size);
static GstFlowReturn gst_d3d11_mpeg2_dec_new_picture (GstMpeg2Decoder * decoder,
GstVideoCodecFrame * frame, GstMpeg2Picture * picture);
static GstFlowReturn
const GstMpegVideoSequenceHdr * seq,
const GstMpegVideoSequenceExt * seq_ext,
const GstMpegVideoSequenceDisplayExt * seq_display_ext,
- const GstMpegVideoSequenceScalableExt * seq_scalable_ext)
+ const GstMpegVideoSequenceScalableExt * seq_scalable_ext, gint max_dpb_size)
{
GstD3D11Mpeg2Dec *self = GST_D3D11_MPEG2_DEC (decoder);
GstD3D11Mpeg2DecInner *inner = self->inner;
/* GstVp8Decoder */
static GstFlowReturn gst_d3d11_vp8_dec_new_sequence (GstVp8Decoder * decoder,
- const GstVp8FrameHdr * frame_hdr);
+ const GstVp8FrameHdr * frame_hdr, gint max_dpb_size);
static GstFlowReturn gst_d3d11_vp8_dec_new_picture (GstVp8Decoder * decoder,
GstVideoCodecFrame * frame, GstVp8Picture * picture);
static GstFlowReturn gst_d3d11_vp8_dec_start_picture (GstVp8Decoder * decoder,
static GstFlowReturn
gst_d3d11_vp8_dec_new_sequence (GstVp8Decoder * decoder,
- const GstVp8FrameHdr * frame_hdr)
+ const GstVp8FrameHdr * frame_hdr, gint max_dpb_size)
{
GstD3D11Vp8Dec *self = GST_D3D11_VP8_DEC (decoder);
GstD3D11Vp8DecInner *inner = self->inner;
/* GstVp9Decoder */
static GstFlowReturn gst_d3d11_vp9_dec_new_sequence (GstVp9Decoder * decoder,
- const GstVp9FrameHeader * frame_hdr);
+ const GstVp9FrameHeader * frame_hdr, gint max_dpb_size);
static GstFlowReturn gst_d3d11_vp9_dec_new_picture (GstVp9Decoder * decoder,
GstVideoCodecFrame * frame, GstVp9Picture * picture);
static GstVp9Picture *gst_d3d11_vp9_dec_duplicate_picture (GstVp9Decoder *
static GstFlowReturn
gst_d3d11_vp9_dec_new_sequence (GstVp9Decoder * decoder,
- const GstVp9FrameHeader * frame_hdr)
+ const GstVp9FrameHeader * frame_hdr, gint max_dpb_size)
{
GstD3D11Vp9Dec *self = GST_D3D11_VP9_DEC (decoder);
GstD3D11Vp9DecInner *inner = self->inner;
/* GstVp8Decoder */
static GstFlowReturn gst_nv_vp8_dec_new_sequence (GstVp8Decoder * decoder,
- const GstVp8FrameHdr * frame_hdr);
+ const GstVp8FrameHdr * frame_hdr, gint max_dpb_size);
static GstFlowReturn gst_nv_vp8_dec_new_picture (GstVp8Decoder * decoder,
GstVideoCodecFrame * frame, GstVp8Picture * picture);
static GstFlowReturn gst_nv_vp8_dec_decode_picture (GstVp8Decoder * decoder,
static GstFlowReturn
gst_nv_vp8_dec_new_sequence (GstVp8Decoder * decoder,
- const GstVp8FrameHdr * frame_hdr)
+ const GstVp8FrameHdr * frame_hdr, gint max_dpb_size)
{
GstNvVp8Dec *self = GST_NV_VP8_DEC (decoder);
gboolean modified = FALSE;
/* GstVp9Decoder */
static GstFlowReturn gst_nv_vp9_dec_new_sequence (GstVp9Decoder * decoder,
- const GstVp9FrameHeader * frame_hdr);
+ const GstVp9FrameHeader * frame_hdr, gint max_dpb_size);
static GstFlowReturn gst_nv_vp9_dec_new_picture (GstVp9Decoder * decoder,
GstVideoCodecFrame * frame, GstVp9Picture * picture);
static GstVp9Picture *gst_nv_vp9_dec_duplicate_picture (GstVp9Decoder *
static GstFlowReturn
gst_nv_vp9_dec_new_sequence (GstVp9Decoder * decoder,
- const GstVp9FrameHeader * frame_hdr)
+ const GstVp9FrameHeader * frame_hdr, gint max_dpb_size)
{
GstNvVp9Dec *self = GST_NV_VP9_DEC (decoder);
GstVideoFormat out_format = GST_VIDEO_FORMAT_UNKNOWN;
const GstMpegVideoSequenceHdr * seq,
const GstMpegVideoSequenceExt * seq_ext,
const GstMpegVideoSequenceDisplayExt * seq_display_ext,
- const GstMpegVideoSequenceScalableExt * seq_scalable_ext)
+ const GstMpegVideoSequenceScalableExt * seq_scalable_ext, gint max_dpb_size)
{
GstV4l2CodecMpeg2Dec *self = GST_V4L2_CODEC_MPEG2_DEC (decoder);
gboolean negotiation_needed = FALSE;
static GstFlowReturn
gst_v4l2_codec_vp8_dec_new_sequence (GstVp8Decoder * decoder,
- const GstVp8FrameHdr * frame_hdr)
+ const GstVp8FrameHdr * frame_hdr, gint max_dpb_size)
{
GstV4l2CodecVp8Dec *self = GST_V4L2_CODEC_VP8_DEC (decoder);
gboolean negotiation_needed = FALSE;
static GstFlowReturn
gst_v4l2_codec_vp9_dec_new_sequence (GstVp9Decoder * decoder,
- const GstVp9FrameHeader * frame_hdr)
+ const GstVp9FrameHeader * frame_hdr, gint max_dpb_size)
{
GstV4l2CodecVp9Dec *self = GST_V4L2_CODEC_VP9_DEC (decoder);
gboolean negotiation_needed = FALSE;
static GstFlowReturn
gst_va_av1_dec_new_sequence (GstAV1Decoder * decoder,
- const GstAV1SequenceHeaderOBU * seq_hdr)
+ const GstAV1SequenceHeaderOBU * seq_hdr, gint max_dpb_size)
{
GstVaAV1Dec *self = GST_VA_AV1_DEC (decoder);
GstVaBaseDec *base = GST_VA_BASE_DEC (decoder);
const GstMpegVideoSequenceHdr * seq,
const GstMpegVideoSequenceExt * seq_ext,
const GstMpegVideoSequenceDisplayExt * seq_display_ext,
- const GstMpegVideoSequenceScalableExt * seq_scalable_ext)
+ const GstMpegVideoSequenceScalableExt * seq_scalable_ext, gint max_dpb_size)
{
GstVaBaseDec *base = GST_VA_BASE_DEC (decoder);
GstVaMpeg2Dec *self = GST_VA_MPEG2_DEC (decoder);
static GstFlowReturn
gst_va_vp8_dec_new_sequence (GstVp8Decoder * decoder,
- const GstVp8FrameHdr * frame_hdr)
+ const GstVp8FrameHdr * frame_hdr, gint max_dpb_size)
{
GstVaBaseDec *base = GST_VA_BASE_DEC (decoder);
GstVaVp8Dec *self = GST_VA_VP8_DEC (decoder);
static GstFlowReturn
gst_va_vp9_new_sequence (GstVp9Decoder * decoder,
- const GstVp9FrameHeader * frame_hdr)
+ const GstVp9FrameHeader * frame_hdr, gint max_dpb_size)
{
GstVaBaseDec *base = GST_VA_BASE_DEC (decoder);
GstVaVp9Dec *self = GST_VA_VP9_DEC (decoder);