{
GstAV1Decoder parent;
- GstVideoCodecState *output_state;
-
GstCudaContext *context;
GstNvDecoder *decoder;
{
GstNvAV1Dec *self = GST_NV_AV1_DEC (decoder);
- g_clear_pointer (&self->output_state, gst_video_codec_state_unref);
gst_clear_object (&self->decoder);
gst_clear_object (&self->context);
GST_DEBUG_OBJECT (self, "negotiate");
- gst_nv_decoder_negotiate (self->decoder, decoder, av1dec->input_state,
- &self->output_state);
+ gst_nv_decoder_negotiate (self->decoder, decoder, av1dec->input_state);
return GST_VIDEO_DECODER_CLASS (parent_class)->negotiate (decoder);
}
gboolean
gst_nv_decoder_negotiate (GstNvDecoder * decoder,
- GstVideoDecoder * videodec, GstVideoCodecState * input_state,
- GstVideoCodecState ** output_state)
+ GstVideoDecoder * videodec, GstVideoCodecState * input_state)
{
GstVideoCodecState *state;
GstVideoInfo *info;
g_return_val_if_fail (GST_IS_NV_DECODER (decoder), FALSE);
g_return_val_if_fail (GST_IS_VIDEO_DECODER (videodec), FALSE);
g_return_val_if_fail (input_state != NULL, FALSE);
- g_return_val_if_fail (output_state != NULL, FALSE);
if (!decoder->configured) {
GST_ERROR_OBJECT (videodec, "Should configure decoder first");
GST_VIDEO_INFO_WIDTH (info), GST_VIDEO_INFO_HEIGHT (info), input_state);
state->caps = gst_video_info_to_caps (&state->info);
- if (*output_state)
- gst_video_codec_state_unref (*output_state);
- *output_state = state;
+ /* decoder baseclass will hold other reference to output state */
+ gst_video_codec_state_unref (state);
decoder->output_type = GST_NV_DECODER_OUTPUT_TYPE_SYSTEM;
gboolean gst_nv_decoder_negotiate (GstNvDecoder * decoder,
GstVideoDecoder * videodec,
- GstVideoCodecState * input_state,
- GstVideoCodecState ** output_state);
+ GstVideoCodecState * input_state);
gboolean gst_nv_decoder_decide_allocation (GstNvDecoder * decoder,
GstVideoDecoder * videodec,
{
GstH264Decoder parent;
- GstVideoCodecState *output_state;
-
GstCudaContext *context;
GstNvDecoder *decoder;
CUVIDPICPARAMS params;
{
GstNvH264Dec *self = GST_NV_H264_DEC (decoder);
- g_clear_pointer (&self->output_state, gst_video_codec_state_unref);
gst_clear_object (&self->decoder);
gst_clear_object (&self->context);
GST_DEBUG_OBJECT (self, "negotiate");
- gst_nv_decoder_negotiate (self->decoder, decoder, h264dec->input_state,
- &self->output_state);
+ gst_nv_decoder_negotiate (self->decoder, decoder, h264dec->input_state);
/* TODO: add support D3D11 memory */
{
GstH265Decoder parent;
- GstVideoCodecState *output_state;
-
GstCudaContext *context;
GstNvDecoder *decoder;
CUVIDPICPARAMS params;
{
GstNvH265Dec *self = GST_NV_H265_DEC (decoder);
- g_clear_pointer (&self->output_state, gst_video_codec_state_unref);
gst_clear_object (&self->decoder);
gst_clear_object (&self->context);
GST_DEBUG_OBJECT (self, "negotiate");
- gst_nv_decoder_negotiate (self->decoder, decoder, h265dec->input_state,
- &self->output_state);
+ gst_nv_decoder_negotiate (self->decoder, decoder, h265dec->input_state);
/* TODO: add support D3D11 memory */
{
GstVp8Decoder parent;
- GstVideoCodecState *output_state;
-
GstCudaContext *context;
GstNvDecoder *decoder;
CUVIDPICPARAMS params;
{
GstNvVp8Dec *self = GST_NV_VP8_DEC (decoder);
- g_clear_pointer (&self->output_state, gst_video_codec_state_unref);
gst_clear_object (&self->decoder);
gst_clear_object (&self->context);
GST_DEBUG_OBJECT (self, "negotiate");
- gst_nv_decoder_negotiate (self->decoder, decoder, vp8dec->input_state,
- &self->output_state);
+ gst_nv_decoder_negotiate (self->decoder, decoder, vp8dec->input_state);
/* TODO: add support D3D11 memory */
{
GstVp9Decoder parent;
- GstVideoCodecState *output_state;
-
GstCudaContext *context;
GstNvDecoder *decoder;
CUVIDPICPARAMS params;
{
GstNvVp9Dec *self = GST_NV_VP9_DEC (decoder);
- g_clear_pointer (&self->output_state, gst_video_codec_state_unref);
gst_clear_object (&self->decoder);
gst_clear_object (&self->context);
GST_DEBUG_OBJECT (self, "negotiate");
- gst_nv_decoder_negotiate (self->decoder, decoder, vp9dec->input_state,
- &self->output_state);
+ gst_nv_decoder_negotiate (self->decoder, decoder, vp9dec->input_state);
/* TODO: add support D3D11 memory */