* @vps: the vps of #GstH265VPS to write
* @start_code: whether adding the nal start code
* @data: (out): the bit stream generated by the sps
- * @size: (inout): the size in bits of the output
+ * @size: (inout): the size in bytes of the input and output
*
* Generating the according h265 bit stream by providing the vps.
*
**/
GstH265BitWriterResult
gst_h265_bit_writer_vps (const GstH265VPS * vps, gboolean start_code,
- guint8 * data, gsize * size)
+ guint8 * data, guint * size)
{
gboolean have_space = TRUE;
GstBitWriter bw;
goto error;
}
- *size = gst_bit_writer_get_size (&bw);
+ *size = gst_bit_writer_get_size (&bw) / 8;
gst_bit_writer_reset (&bw);
return GST_H265_BIT_WRITER_OK;
* @sps: the sps of #GstH265SPS to write
* @start_code: whether adding the nal start code
* @data: (out): the bit stream generated by the sps
- * @size: (inout): the size in bits of the output
+ * @size: (inout): the size in bytes of the input and output
*
* Generating the according h265 bit stream by providing the sps.
*
**/
GstH265BitWriterResult
gst_h265_bit_writer_sps (const GstH265SPS * sps, gboolean start_code,
- guint8 * data, gsize * size)
+ guint8 * data, guint * size)
{
gboolean have_space = TRUE;
GstBitWriter bw;
goto error;
}
- *size = gst_bit_writer_get_size (&bw);
+ *size = gst_bit_writer_get_size (&bw) / 8;
gst_bit_writer_reset (&bw);
return GST_H265_BIT_WRITER_OK;
* @pps: the pps of #GstH265PPS to write
* @start_code: whether adding the nal start code
* @data: (out): the bit stream generated by the pps
- * @size: (inout): the size in bits of the output
+ * @size: (inout): the size in bytes of the input and output
*
* Generating the according h265 bit stream by providing the pps.
*
**/
GstH265BitWriterResult
gst_h265_bit_writer_pps (const GstH265PPS * pps, gboolean start_code,
- guint8 * data, gsize * size)
+ guint8 * data, guint * size)
{
gboolean have_space = TRUE;
GstBitWriter bw;
goto error;
}
- *size = gst_bit_writer_get_size (&bw);
+ *size = gst_bit_writer_get_size (&bw) / 8;
gst_bit_writer_reset (&bw);
return GST_H265_BIT_WRITER_OK;
* @start_code: whether adding the nal start code
* @nal_type: the slice's nal type of #GstH265NalUnitType
* @data: (out): the bit stream generated by the slice header
- * @size: (inout): the size in bits of the output
+ * @size: (inout): the size in bytes of the input and output
*
* Generating the according h265 bit stream by providing the slice header.
*
**/
GstH265BitWriterResult
gst_h265_bit_writer_slice_hdr (const GstH265SliceHdr * slice,
- gboolean start_code, guint32 nal_type, guint8 * data, gsize * size)
+ gboolean start_code, guint32 nal_type, guint8 * data, guint * size)
{
gboolean have_space = TRUE;
GstBitWriter bw;
goto error;
}
- *size = gst_bit_writer_get_size (&bw);
+ *size = gst_bit_writer_get_size (&bw) / 8;
gst_bit_writer_reset (&bw);
return GST_H265_BIT_WRITER_OK;
* @sei_messages: An array of #GstH265SEIMessage to write
* @start_code: whether adding the nal start code
* @data: (out): the bit stream generated by the sei messages
- * @size: (inout): the size in bits of the output
+ * @size: (inout): the size in bytes of the input and output
*
* Generating the according h265 bit stream by providing sei messages.
*
GstH265BitWriterResult
gst_h265_bit_writer_sei (GArray * sei_messages,
GstH265NalUnitType nal_type, gboolean start_code, guint8 * data,
- gsize * size)
+ guint * size)
{
gboolean have_space = TRUE;
GstBitWriter bw;
goto error;
}
- *size = gst_bit_writer_get_size (&bw);
+ *size = gst_bit_writer_get_size (&bw) / 8;
gst_bit_writer_reset (&bw);
return GST_H265_BIT_WRITER_OK;
* as the H265 spec Table 7-2 defines
* @start_code: whether adding the nal start code
* @data: (out): the bit stream generated by the aud
- * @size: (inout): the size in bits of the output
+ * @size: (inout): the size in bytes of the input and output
*
* Generating the according h265 bit stream of an aud.
*
**/
GstH265BitWriterResult
gst_h265_bit_writer_aud (guint8 pic_type, gboolean start_code,
- guint8 * data, gsize * size)
+ guint8 * data, guint * size)
{
gboolean have_space = TRUE;
GstBitWriter bw;
goto error;
}
- *size = gst_bit_writer_get_size (&bw);
+ *size = gst_bit_writer_get_size (&bw) / 8;
gst_bit_writer_reset (&bw);
return GST_H265_BIT_WRITER_OK;
gst_h265_bit_writer_convert_to_nal (guint nal_prefix_size,
gboolean packetized, gboolean has_startcode, gboolean add_trailings,
const guint8 * raw_data, gsize raw_size, guint8 * nal_data,
- guint32 * nal_size)
+ guint * nal_size)
{
NalWriter nw;
guint8 *data;
GstH265SliceHdr slice_parsed;
guint8 header_data[2048] = { 0, };
guint8 header_nal[2048] = { 0, };
- gsize size;
+ guint size;
guint32 nal_size;
guint i, j;
nal_size = sizeof (header_nal);
ret = gst_h265_bit_writer_convert_to_nal (4, FALSE, TRUE, FALSE,
- header_data, size, header_nal, &nal_size);
+ header_data, size * 8, header_nal, &nal_size);
fail_if (ret != GST_H265_BIT_WRITER_OK);
- fail_if (nal_size < GST_ROUND_UP_8 (size) / 8);
+ fail_if (nal_size < size);
/* Parse it again */
res = gst_h265_parser_identify_nalu (parser, header_nal, 0,
nal_size = sizeof (header_nal);
ret = gst_h265_bit_writer_convert_to_nal (4, FALSE, TRUE, FALSE,
- header_data, size, header_nal, &nal_size);
+ header_data, size * 8, header_nal, &nal_size);
fail_if (ret != GST_H265_BIT_WRITER_OK);
- fail_if (nal_size < GST_ROUND_UP_8 (size) / 8);
+ fail_if (nal_size < size);
/* Parse it again */
res = gst_h265_parser_identify_nalu (parser, header_nal, 0,
nal_size = sizeof (header_nal);
ret = gst_h265_bit_writer_convert_to_nal (4, FALSE, TRUE, FALSE,
- header_data, size, header_nal, &nal_size);
+ header_data, size * 8, header_nal, &nal_size);
fail_if (ret != GST_H265_BIT_WRITER_OK);
- fail_if (nal_size < GST_ROUND_UP_8 (size) / 8);
+ fail_if (nal_size < size);
/* Parse it again */
res = gst_h265_parser_identify_nalu (parser, header_nal, 0,
nal_size = sizeof (header_nal);
ret = gst_h265_bit_writer_convert_to_nal (4, FALSE, TRUE, FALSE,
- header_data, GST_ROUND_UP_8 (size), header_nal, &nal_size);
+ header_data, size * 8, header_nal, &nal_size);
fail_if (ret != GST_H265_BIT_WRITER_OK);
- fail_if (nal_size < GST_ROUND_UP_8 (size) / 8);
+ fail_if (nal_size < size);
/* Parse it again */
res = gst_h265_parser_identify_nalu (parser, header_nal, 0,