{
g_clear_pointer (&rtph265pay->bundle, gst_buffer_list_unref);
rtph265pay->bundle_size = 0;
- rtph265pay->bundle_contains_vcl = FALSE;
+ rtph265pay->bundle_contains_vcl_or_suffix = FALSE;
}
static GstFlowReturn
GST_DEBUG_OBJECT (rtph265pay, "creating new AP aggregate");
bundle = rtph265pay->bundle = gst_buffer_list_new ();
bundle_size = rtph265pay->bundle_size = 2;
- rtph265pay->bundle_contains_vcl = FALSE;
+ rtph265pay->bundle_contains_vcl_or_suffix = FALSE;
}
GST_DEBUG_OBJECT (rtph265pay,
ret = GST_FLOW_OK;
/* In H.265, all VCL NAL units are < 32 */
- if (nal_type < 32)
- rtph265pay->bundle_contains_vcl = TRUE;
+ if (nal_type < 32 || nal_type == GST_H265_NAL_EOS ||
+ nal_type == GST_H265_NAL_EOB || nal_type == GST_H265_NAL_SUFFIX_SEI ||
+ (nal_type >= 45 && nal_type <= 47) || (nal_type >= 56 && nal_type < 63))
+ rtph265pay->bundle_contains_vcl_or_suffix = TRUE;
if (marker) {
GST_DEBUG_OBJECT (rtph265pay, "sending bundle at marker");
if (ret == GST_FLOW_OK && rtph265pay->bundle_size > 0 &&
rtph265pay->aggregate_mode == GST_RTP_H265_AGGREGATE_ZERO_LATENCY &&
- rtph265pay->bundle_contains_vcl) {
+ rtph265pay->bundle_contains_vcl_or_suffix) {
GST_DEBUG_OBJECT (rtph265pay, "sending bundle at end incoming packet");
ret = gst_rtp_h265_pay_send_bundle (rtph265pay, FALSE);
}
0x00, 0x3e, 0x40, 0x92, 0x0c, 0x78
};
+
GST_START_TEST (test_rtph265pay_two_slices_timestamp)
{
GstHarness *h = gst_harness_new_parse ("rtph265pay timestamp-offset=123");
GST_END_TEST;
+/* EOS */
+static guint8 h265_eos[] = {
+ 0x00, 0x00, 0x00, 0x01, (36 << 1), 0x00
+};
+
GST_START_TEST (test_rtph265pay_aggregate_until_vcl)
{
ret = gst_harness_push (h, buffer);
fail_unless_equals_int (ret, GST_FLOW_OK);
-
fail_unless_equals_int (gst_harness_buffers_in_queue (h), 1);
buffer = gst_harness_pull (h);
gst_rtp_buffer_unmap (&rtp);
gst_buffer_unref (buffer);
+ /* Push EOS now */
+
+ buffer = wrap_static_buffer_with_pts (h265_eos, sizeof (h265_eos), 0);
+ ret = gst_harness_push (h, buffer);
+ fail_unless_equals_int (ret, GST_FLOW_OK);
+
+ fail_unless_equals_int (gst_harness_buffers_in_queue (h), 1);
+
+ buffer = gst_harness_pull (h);
+ fail_unless (gst_rtp_buffer_map (buffer, GST_MAP_READ, &rtp));
+ fail_unless_equals_uint64 (GST_BUFFER_PTS (buffer), 0);
+ fail_unless_equals_uint64 (gst_rtp_buffer_get_timestamp (&rtp), 123);
+ fail_unless_equals_int (gst_buffer_get_size (buffer), 12 +
+ sizeof (h265_eos) - 4);
+ gst_rtp_buffer_unmap (&rtp);
+ gst_buffer_unref (buffer);
+
gst_harness_teardown (h);
}