return TRUE;
}
-static gboolean
+static GstFlowReturn
gst_avtp_cvf_pay_push_packets (GstAvtpCvfPay * avtpcvfpay,
GPtrArray * avtp_packets)
{
int i;
+ GstFlowReturn ret;
GstAvtpBasePayload *avtpbasepayload = GST_AVTP_BASE_PAYLOAD (avtpcvfpay);
for (i = 0; i < avtp_packets->len; i++) {
GstBuffer *packet;
packet = g_ptr_array_index (avtp_packets, i);
- if (gst_pad_push (avtpbasepayload->srcpad, packet) != GST_FLOW_OK)
- return FALSE;
+ ret = gst_pad_push (avtpbasepayload->srcpad, packet);
+ if (ret != GST_FLOW_OK)
+ return ret;
}
- return TRUE;
+ return GST_FLOW_OK;
}
static GstFlowReturn
avtp_packets = g_ptr_array_new ();
gst_avtp_cvf_pay_prepare_avtp_packets (avtpcvfpay, nals, avtp_packets);
- if (!gst_avtp_cvf_pay_push_packets (avtpcvfpay, avtp_packets))
- ret = GST_FLOW_ERROR;
+ ret = gst_avtp_cvf_pay_push_packets (avtpcvfpay, avtp_packets);
/* Contents of both ptr_arrays should be unref'd or transferred
* to rightful owner by this point, no need to unref them again */
return result;
}
+GST_START_TEST (test_payloader_downstream_eos)
+{
+ GstHarness *h;
+ GstBuffer *in;
+
+ /* Create the harness for the avtpcvfpay */
+ h = gst_harness_new_parse
+ ("avtpcvfpay streamid=0xAABBCCDDEEFF0001 mtt=1000000 tu=1000000 processing-deadline=0 ! fakesink num-buffers=1");
+ gst_harness_set_src_caps (h, generate_caps (4));
+
+ /* Buffer must have the nal len (4 bytes) and the nal (4 bytes) */
+ in = gst_harness_create_buffer (h, 8);
+ add_nal (in, 4, 1, 0);
+ GST_BUFFER_DTS (in) = 1000000;
+ GST_BUFFER_PTS (in) = 2000000;
+
+ fail_unless_equals_int (gst_harness_push (h, in), GST_FLOW_EOS);
+
+ gst_harness_teardown (h);
+}
+
+GST_END_TEST;
+
GST_START_TEST (test_payloader_zero_sized_nal)
{
GstHarness *h;
tcase_add_test (tc_chain, test_payloader_properties);
tcase_add_test (tc_chain, test_payloader_no_codec_data);
tcase_add_test (tc_chain, test_payloader_zero_sized_nal);
+ tcase_add_test (tc_chain, test_payloader_downstream_eos);
return s;
}