h265parser: Make gst_h265_parser_link_slice_hdr public

... and updating h265decoder/h265ccinserter to match
the changed gst_h265_parser_link_slice_hdr method

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8679>
This commit is contained in:
Seungha Yang 2025-03-26 01:33:57 +09:00 committed by GStreamer Marge Bot
parent deee13a6c3
commit 740b7564ee
5 changed files with 25 additions and 49 deletions

View File

@ -27,7 +27,6 @@
#include "gsth265reorder.h"
#include "gsth264reorder.h"
#include <gst/codecs/gsth265picture.h>
#include <gst/codecparsers/gsth265parser-private.h>
#include <string.h>
GST_DEBUG_CATEGORY_STATIC (gst_h265_reorder_debug);
@ -139,7 +138,6 @@ typedef struct
GstH265Slice slice;
} unit;
GstH265NalUnitType nalu_type;
guint pps_id;
} GstH265ReorderNalUnit;
static void gst_h265_reorder_finalize (GObject * object);
@ -589,7 +587,6 @@ gst_h265_reorder_parse_slice (GstH265Reorder * self, GstH265NalUnit * nalu)
decoder_nalu.unit.slice = slice;
decoder_nalu.nalu_type = nalu->type;
decoder_nalu.pps_id = slice.header.pps->id;
g_array_append_val (self->nalu, decoder_nalu);
@ -697,8 +694,7 @@ gst_h265_reorder_decode_nalu (GstH265Reorder * self,
break;
}
rst = gst_h265_parser_link_slice_hdr (self->parser,
&nalu->unit.slice.header, nalu->pps_id);
rst = gst_h265_parser_link_slice_hdr (self->parser, &nalu->unit.slice.header);
if (rst != GST_H265_PARSER_OK) {
GST_ERROR_OBJECT (self, "Couldn't update slice header");

View File

@ -1,32 +0,0 @@
/* GStreamer
* Copyright (C) 2025 Seungha Yang <seungha@centricular.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#pragma once
#include <gst/gst.h>
#include <gst/codecparsers/gsth265parser.h>
G_BEGIN_DECLS
GST_CODEC_PARSERS_API
GstH265ParserResult gst_h265_parser_link_slice_hdr (GstH265Parser * parser,
GstH265SliceHdr * slice,
guint pps_id);
G_END_DECLS

View File

@ -66,7 +66,6 @@
#include "nalutils.h"
#include "gsth265parser.h"
#include "gsth265parser-private.h"
#include <gst/base/gstbytereader.h>
#include <gst/base/gstbitreader.h>
@ -5136,27 +5135,40 @@ error:
#undef SKIP_CONFIG_BITS
}
/**
* gst_h265_parser_link_slice_hdr:
* @parser: a #GstH265Parser
* @slice: The #GstH265SliceHdr to fill.
*
* Link SPS and PPS of @parser to @slice. @slice must be valid and parsed
* already by @parser or other #GstH265Parser
*
* Returns: a #GstH265ParserResult
*
* Since: 1.28
*/
GstH265ParserResult
gst_h265_parser_link_slice_hdr (GstH265Parser * parser, GstH265SliceHdr * slice,
guint pps_id)
gst_h265_parser_link_slice_hdr (GstH265Parser * parser, GstH265SliceHdr * slice)
{
GstH265ParserResult ret;
GstH265PPS *pps;
g_return_val_if_fail (parser, GST_H265_PARSER_ERROR);
g_return_val_if_fail (slice, GST_H265_PARSER_ERROR);
g_return_val_if_fail (pps_id < GST_H265_MAX_PPS_COUNT, GST_H265_PARSER_ERROR);
g_return_val_if_fail (slice->pps_id < GST_H265_MAX_PPS_COUNT,
GST_H265_PARSER_ERROR);
pps = gst_h265_parser_get_pps (parser, pps_id);
pps = gst_h265_parser_get_pps (parser, slice->pps_id);
if (!pps) {
GST_WARNING
("couldn't find associated picture parameter set with id: %d", pps_id);
("couldn't find associated picture parameter set with id: %d",
slice->pps_id);
return GST_H265_PARSER_BROKEN_LINK;
}
ret = gst_h265_parser_fill_pps (parser, pps);
if (ret != GST_H265_PARSER_OK) {
GST_WARNING ("couldn't fill pps id: %d", pps_id);
GST_WARNING ("couldn't fill pps id: %d", slice->pps_id);
return ret;
}

View File

@ -2127,6 +2127,10 @@ GST_CODEC_PARSERS_API
GstH265ParserResult gst_h265_parser_update_pps (GstH265Parser * parser,
GstH265PPS * pps);
GST_CODEC_PARSERS_API
GstH265ParserResult gst_h265_parser_link_slice_hdr (GstH265Parser * parser,
GstH265SliceHdr * slice);
GST_CODEC_PARSERS_API
void gst_h265_parser_free (GstH265Parser * parser);

View File

@ -32,7 +32,6 @@
#include <gst/base/base.h>
#include "gsth265decoder.h"
#include <gst/codecparsers/gsth265parser-private.h>
GST_DEBUG_CATEGORY (gst_h265_decoder_debug);
#define GST_CAT_DEFAULT gst_h265_decoder_debug
@ -152,7 +151,6 @@ typedef struct
GstH265Slice slice;
} unit;
GstH265NalUnitType nalu_type;
guint pps_id;
} GstH265DecoderNalUnit;
typedef struct
@ -961,7 +959,6 @@ gst_h265_decoder_parse_slice (GstH265Decoder * self, GstH265NalUnit * nalu)
decoder_nalu.unit.slice = slice;
decoder_nalu.nalu_type = nalu->type;
decoder_nalu.pps_id = slice.header.pps->id;
g_array_append_val (priv->nalu, decoder_nalu);
@ -1084,8 +1081,7 @@ gst_h265_decoder_decode_nalu (GstH265Decoder * self,
break;
}
rst = gst_h265_parser_link_slice_hdr (priv->parser,
&nalu->unit.slice.header, nalu->pps_id);
rst = gst_h265_parser_link_slice_hdr (priv->parser, &nalu->unit.slice.header);
if (rst != GST_H265_PARSER_OK) {
GST_ERROR_OBJECT (self, "Couldn't update slice header");