mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-24 01:00:37 +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;
|
GstAV1Decoder parent;
|
||||||
|
|
||||||
GstVideoCodecState *output_state;
|
|
||||||
|
|
||||||
GstCudaContext *context;
|
GstCudaContext *context;
|
||||||
GstNvDecoder *decoder;
|
GstNvDecoder *decoder;
|
||||||
|
|
||||||
|
@ -266,7 +264,6 @@ gst_nv_av1_dec_close (GstVideoDecoder * decoder)
|
||||||
{
|
{
|
||||||
GstNvAV1Dec *self = GST_NV_AV1_DEC (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->decoder);
|
||||||
gst_clear_object (&self->context);
|
gst_clear_object (&self->context);
|
||||||
|
|
||||||
|
@ -292,8 +289,7 @@ gst_nv_av1_dec_negotiate (GstVideoDecoder * decoder)
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "negotiate");
|
GST_DEBUG_OBJECT (self, "negotiate");
|
||||||
|
|
||||||
gst_nv_decoder_negotiate (self->decoder, decoder, av1dec->input_state,
|
gst_nv_decoder_negotiate (self->decoder, decoder, av1dec->input_state);
|
||||||
&self->output_state);
|
|
||||||
|
|
||||||
return GST_VIDEO_DECODER_CLASS (parent_class)->negotiate (decoder);
|
return GST_VIDEO_DECODER_CLASS (parent_class)->negotiate (decoder);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1454,8 +1454,7 @@ gst_nv_decoder_ensure_gl_context (GstNvDecoder * decoder, GstElement * videodec)
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gst_nv_decoder_negotiate (GstNvDecoder * decoder,
|
gst_nv_decoder_negotiate (GstNvDecoder * decoder,
|
||||||
GstVideoDecoder * videodec, GstVideoCodecState * input_state,
|
GstVideoDecoder * videodec, GstVideoCodecState * input_state)
|
||||||
GstVideoCodecState ** output_state)
|
|
||||||
{
|
{
|
||||||
GstVideoCodecState *state;
|
GstVideoCodecState *state;
|
||||||
GstVideoInfo *info;
|
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_NV_DECODER (decoder), FALSE);
|
||||||
g_return_val_if_fail (GST_IS_VIDEO_DECODER (videodec), 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 (input_state != NULL, FALSE);
|
||||||
g_return_val_if_fail (output_state != NULL, FALSE);
|
|
||||||
|
|
||||||
if (!decoder->configured) {
|
if (!decoder->configured) {
|
||||||
GST_ERROR_OBJECT (videodec, "Should configure decoder first");
|
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);
|
GST_VIDEO_INFO_WIDTH (info), GST_VIDEO_INFO_HEIGHT (info), input_state);
|
||||||
state->caps = gst_video_info_to_caps (&state->info);
|
state->caps = gst_video_info_to_caps (&state->info);
|
||||||
|
|
||||||
if (*output_state)
|
/* decoder baseclass will hold other reference to output state */
|
||||||
gst_video_codec_state_unref (*output_state);
|
gst_video_codec_state_unref (state);
|
||||||
*output_state = state;
|
|
||||||
|
|
||||||
decoder->output_type = GST_NV_DECODER_OUTPUT_TYPE_SYSTEM;
|
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,
|
gboolean gst_nv_decoder_negotiate (GstNvDecoder * decoder,
|
||||||
GstVideoDecoder * videodec,
|
GstVideoDecoder * videodec,
|
||||||
GstVideoCodecState * input_state,
|
GstVideoCodecState * input_state);
|
||||||
GstVideoCodecState ** output_state);
|
|
||||||
|
|
||||||
gboolean gst_nv_decoder_decide_allocation (GstNvDecoder * decoder,
|
gboolean gst_nv_decoder_decide_allocation (GstNvDecoder * decoder,
|
||||||
GstVideoDecoder * videodec,
|
GstVideoDecoder * videodec,
|
||||||
|
|
|
@ -103,8 +103,6 @@ typedef struct _GstNvH264Dec
|
||||||
{
|
{
|
||||||
GstH264Decoder parent;
|
GstH264Decoder parent;
|
||||||
|
|
||||||
GstVideoCodecState *output_state;
|
|
||||||
|
|
||||||
GstCudaContext *context;
|
GstCudaContext *context;
|
||||||
GstNvDecoder *decoder;
|
GstNvDecoder *decoder;
|
||||||
CUVIDPICPARAMS params;
|
CUVIDPICPARAMS params;
|
||||||
|
@ -354,7 +352,6 @@ gst_nv_h264_dec_close (GstVideoDecoder * decoder)
|
||||||
{
|
{
|
||||||
GstNvH264Dec *self = GST_NV_H264_DEC (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->decoder);
|
||||||
gst_clear_object (&self->context);
|
gst_clear_object (&self->context);
|
||||||
|
|
||||||
|
@ -375,8 +372,7 @@ gst_nv_h264_dec_negotiate (GstVideoDecoder * decoder)
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "negotiate");
|
GST_DEBUG_OBJECT (self, "negotiate");
|
||||||
|
|
||||||
gst_nv_decoder_negotiate (self->decoder, decoder, h264dec->input_state,
|
gst_nv_decoder_negotiate (self->decoder, decoder, h264dec->input_state);
|
||||||
&self->output_state);
|
|
||||||
|
|
||||||
/* TODO: add support D3D11 memory */
|
/* TODO: add support D3D11 memory */
|
||||||
|
|
||||||
|
|
|
@ -102,8 +102,6 @@ typedef struct _GstNvH265Dec
|
||||||
{
|
{
|
||||||
GstH265Decoder parent;
|
GstH265Decoder parent;
|
||||||
|
|
||||||
GstVideoCodecState *output_state;
|
|
||||||
|
|
||||||
GstCudaContext *context;
|
GstCudaContext *context;
|
||||||
GstNvDecoder *decoder;
|
GstNvDecoder *decoder;
|
||||||
CUVIDPICPARAMS params;
|
CUVIDPICPARAMS params;
|
||||||
|
@ -311,7 +309,6 @@ gst_nv_h265_dec_close (GstVideoDecoder * decoder)
|
||||||
{
|
{
|
||||||
GstNvH265Dec *self = GST_NV_H265_DEC (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->decoder);
|
||||||
gst_clear_object (&self->context);
|
gst_clear_object (&self->context);
|
||||||
|
|
||||||
|
@ -332,8 +329,7 @@ gst_nv_h265_dec_negotiate (GstVideoDecoder * decoder)
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "negotiate");
|
GST_DEBUG_OBJECT (self, "negotiate");
|
||||||
|
|
||||||
gst_nv_decoder_negotiate (self->decoder, decoder, h265dec->input_state,
|
gst_nv_decoder_negotiate (self->decoder, decoder, h265dec->input_state);
|
||||||
&self->output_state);
|
|
||||||
|
|
||||||
/* TODO: add support D3D11 memory */
|
/* TODO: add support D3D11 memory */
|
||||||
|
|
||||||
|
|
|
@ -50,8 +50,6 @@ typedef struct _GstNvVp8Dec
|
||||||
{
|
{
|
||||||
GstVp8Decoder parent;
|
GstVp8Decoder parent;
|
||||||
|
|
||||||
GstVideoCodecState *output_state;
|
|
||||||
|
|
||||||
GstCudaContext *context;
|
GstCudaContext *context;
|
||||||
GstNvDecoder *decoder;
|
GstNvDecoder *decoder;
|
||||||
CUVIDPICPARAMS params;
|
CUVIDPICPARAMS params;
|
||||||
|
@ -235,7 +233,6 @@ gst_nv_vp8_dec_close (GstVideoDecoder * decoder)
|
||||||
{
|
{
|
||||||
GstNvVp8Dec *self = GST_NV_VP8_DEC (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->decoder);
|
||||||
gst_clear_object (&self->context);
|
gst_clear_object (&self->context);
|
||||||
|
|
||||||
|
@ -250,8 +247,7 @@ gst_nv_vp8_dec_negotiate (GstVideoDecoder * decoder)
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "negotiate");
|
GST_DEBUG_OBJECT (self, "negotiate");
|
||||||
|
|
||||||
gst_nv_decoder_negotiate (self->decoder, decoder, vp8dec->input_state,
|
gst_nv_decoder_negotiate (self->decoder, decoder, vp8dec->input_state);
|
||||||
&self->output_state);
|
|
||||||
|
|
||||||
/* TODO: add support D3D11 memory */
|
/* TODO: add support D3D11 memory */
|
||||||
|
|
||||||
|
|
|
@ -50,8 +50,6 @@ typedef struct _GstNvVp9Dec
|
||||||
{
|
{
|
||||||
GstVp9Decoder parent;
|
GstVp9Decoder parent;
|
||||||
|
|
||||||
GstVideoCodecState *output_state;
|
|
||||||
|
|
||||||
GstCudaContext *context;
|
GstCudaContext *context;
|
||||||
GstNvDecoder *decoder;
|
GstNvDecoder *decoder;
|
||||||
CUVIDPICPARAMS params;
|
CUVIDPICPARAMS params;
|
||||||
|
@ -245,7 +243,6 @@ gst_nv_vp9_dec_close (GstVideoDecoder * decoder)
|
||||||
{
|
{
|
||||||
GstNvVp9Dec *self = GST_NV_VP9_DEC (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->decoder);
|
||||||
gst_clear_object (&self->context);
|
gst_clear_object (&self->context);
|
||||||
|
|
||||||
|
@ -260,8 +257,7 @@ gst_nv_vp9_dec_negotiate (GstVideoDecoder * decoder)
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "negotiate");
|
GST_DEBUG_OBJECT (self, "negotiate");
|
||||||
|
|
||||||
gst_nv_decoder_negotiate (self->decoder, decoder, vp9dec->input_state,
|
gst_nv_decoder_negotiate (self->decoder, decoder, vp9dec->input_state);
|
||||||
&self->output_state);
|
|
||||||
|
|
||||||
/* TODO: add support D3D11 memory */
|
/* TODO: add support D3D11 memory */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue