mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-19 14:56:36 +00:00
nvdecoder: Don't hold decoder output state
It's not referenced by this implementation Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3328>
This commit is contained in:
parent
b886935e83
commit
b4c19a96b7
7 changed files with 9 additions and 33 deletions
|
@ -50,8 +50,6 @@ typedef struct _GstNvAV1Dec
|
|||
{
|
||||
GstAV1Decoder parent;
|
||||
|
||||
GstVideoCodecState *output_state;
|
||||
|
||||
GstCudaContext *context;
|
||||
GstNvDecoder *decoder;
|
||||
|
||||
|
@ -266,7 +264,6 @@ gst_nv_av1_dec_close (GstVideoDecoder * 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);
|
||||
|
||||
|
@ -292,8 +289,7 @@ gst_nv_av1_dec_negotiate (GstVideoDecoder * decoder)
|
|||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -1454,8 +1454,7 @@ gst_nv_decoder_ensure_gl_context (GstNvDecoder * decoder, GstElement * videodec)
|
|||
|
||||
gboolean
|
||||
gst_nv_decoder_negotiate (GstNvDecoder * decoder,
|
||||
GstVideoDecoder * videodec, GstVideoCodecState * input_state,
|
||||
GstVideoCodecState ** output_state)
|
||||
GstVideoDecoder * videodec, GstVideoCodecState * input_state)
|
||||
{
|
||||
GstVideoCodecState *state;
|
||||
GstVideoInfo *info;
|
||||
|
@ -1463,7 +1462,6 @@ gst_nv_decoder_negotiate (GstNvDecoder * decoder,
|
|||
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");
|
||||
|
@ -1476,9 +1474,8 @@ gst_nv_decoder_negotiate (GstNvDecoder * decoder,
|
|||
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;
|
||||
|
||||
|
|
|
@ -102,8 +102,7 @@ gboolean gst_nv_decoder_handle_context_query (GstNvDecoder * decoder,
|
|||
|
||||
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,
|
||||
|
|
|
@ -103,8 +103,6 @@ typedef struct _GstNvH264Dec
|
|||
{
|
||||
GstH264Decoder parent;
|
||||
|
||||
GstVideoCodecState *output_state;
|
||||
|
||||
GstCudaContext *context;
|
||||
GstNvDecoder *decoder;
|
||||
CUVIDPICPARAMS params;
|
||||
|
@ -354,7 +352,6 @@ gst_nv_h264_dec_close (GstVideoDecoder * decoder)
|
|||
{
|
||||
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);
|
||||
|
||||
|
@ -375,8 +372,7 @@ gst_nv_h264_dec_negotiate (GstVideoDecoder * decoder)
|
|||
|
||||
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 */
|
||||
|
||||
|
|
|
@ -102,8 +102,6 @@ typedef struct _GstNvH265Dec
|
|||
{
|
||||
GstH265Decoder parent;
|
||||
|
||||
GstVideoCodecState *output_state;
|
||||
|
||||
GstCudaContext *context;
|
||||
GstNvDecoder *decoder;
|
||||
CUVIDPICPARAMS params;
|
||||
|
@ -311,7 +309,6 @@ gst_nv_h265_dec_close (GstVideoDecoder * decoder)
|
|||
{
|
||||
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);
|
||||
|
||||
|
@ -332,8 +329,7 @@ gst_nv_h265_dec_negotiate (GstVideoDecoder * decoder)
|
|||
|
||||
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 */
|
||||
|
||||
|
|
|
@ -50,8 +50,6 @@ typedef struct _GstNvVp8Dec
|
|||
{
|
||||
GstVp8Decoder parent;
|
||||
|
||||
GstVideoCodecState *output_state;
|
||||
|
||||
GstCudaContext *context;
|
||||
GstNvDecoder *decoder;
|
||||
CUVIDPICPARAMS params;
|
||||
|
@ -235,7 +233,6 @@ gst_nv_vp8_dec_close (GstVideoDecoder * decoder)
|
|||
{
|
||||
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);
|
||||
|
||||
|
@ -250,8 +247,7 @@ gst_nv_vp8_dec_negotiate (GstVideoDecoder * decoder)
|
|||
|
||||
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 */
|
||||
|
||||
|
|
|
@ -50,8 +50,6 @@ typedef struct _GstNvVp9Dec
|
|||
{
|
||||
GstVp9Decoder parent;
|
||||
|
||||
GstVideoCodecState *output_state;
|
||||
|
||||
GstCudaContext *context;
|
||||
GstNvDecoder *decoder;
|
||||
CUVIDPICPARAMS params;
|
||||
|
@ -245,7 +243,6 @@ gst_nv_vp9_dec_close (GstVideoDecoder * decoder)
|
|||
{
|
||||
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);
|
||||
|
||||
|
@ -260,8 +257,7 @@ gst_nv_vp9_dec_negotiate (GstVideoDecoder * decoder)
|
|||
|
||||
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 */
|
||||
|
||||
|
|
Loading…
Reference in a new issue