"Wim Taymans <wim.taymans@gmail.com>");
g_object_class_install_property (G_OBJECT_CLASS (klass), PROP_CONFIG_INTERVAL,
- g_param_spec_uint ("config-interval", "Config Send Interval",
+ g_param_spec_int ("config-interval", "Config Send Interval",
"Send Config Insertion Interval in seconds (configuration headers "
- "will be multiplexed in the data stream when detected.) (0 = disabled)",
- 0, 3600, DEFAULT_CONFIG_INTERVAL,
+ "will be multiplexed in the data stream when detected.) "
+ "(0 = disabled, -1 = send with every IDR frame)",
+ -1, 3600, DEFAULT_CONFIG_INTERVAL,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
);
guint packet_len;
GstRTPBuffer rtp = { NULL };
- /* this will be the total lenght of the packet */
+ /* this will be the total length of the packet */
packet_len = gst_rtp_buffer_calc_packet_len (avail, 0, 0);
/* fill one MTU or all available bytes */
return result;
}
-/* we expect buffers starting on startcodes.
+/* we expect buffers starting on startcodes.
*/
static GstFlowReturn
gst_rtp_mp4v_pay_handle_buffer (GstRTPBasePayload * basepayload,
GstClockTime timestamp, duration;
gboolean vopi;
gboolean send_config;
+ GstClockTime running_time = GST_CLOCK_TIME_NONE;
ret = GST_FLOW_OK;
send_config = FALSE;
gst_buffer_unmap (buffer, &map);
if (strip) {
- /* strip off config if requested */
- if (!(rtpmp4vpay->config_interval > 0)) {
+ /* strip off config if requested, do not strip off if the
+ * config_interval is set to -1 */
+ if (!(rtpmp4vpay->config_interval > 0)
+ && !(rtpmp4vpay->config_interval == -1)) {
GstBuffer *subbuf;
GST_LOG_OBJECT (rtpmp4vpay, "stripping config at %d, size %d", strip,
size = gst_buffer_get_size (buffer);
} else {
- GstClockTime running_time =
+ running_time =
gst_segment_to_running_time (&basepayload->segment, GST_FORMAT_TIME,
timestamp);
/* there is a config request, see if we need to insert it */
if (vopi && (rtpmp4vpay->config_interval > 0) && rtpmp4vpay->config) {
- GstClockTime running_time =
+ running_time =
gst_segment_to_running_time (&basepayload->segment, GST_FORMAT_TIME,
timestamp);
GST_DEBUG_OBJECT (rtpmp4vpay, "no previous config time, send now");
send_config = TRUE;
}
+ }
- if (send_config) {
- /* we need to send config now first */
- GST_LOG_OBJECT (rtpmp4vpay, "inserting config in stream");
+ if (vopi && (rtpmp4vpay->config_interval == -1)) {
+ GST_DEBUG_OBJECT (rtpmp4vpay, "sending config before current IDR frame");
+ /* send config before every IDR frame */
+ send_config = TRUE;
+ }
- /* insert header */
- buffer = gst_buffer_append (gst_buffer_ref (rtpmp4vpay->config), buffer);
+ if (send_config) {
+ /* we need to send config now first */
+ GST_LOG_OBJECT (rtpmp4vpay, "inserting config in stream");
- GST_BUFFER_PTS (buffer) = timestamp;
- size = gst_buffer_get_size (buffer);
+ /* insert header */
+ buffer = gst_buffer_append (gst_buffer_ref (rtpmp4vpay->config), buffer);
- if (running_time != -1) {
- rtpmp4vpay->last_config = running_time;
- }
+ GST_BUFFER_PTS (buffer) = timestamp;
+ size = gst_buffer_get_size (buffer);
+
+ if (running_time != -1) {
+ rtpmp4vpay->last_config = running_time;
}
}
switch (prop_id) {
case PROP_CONFIG_INTERVAL:
- rtpmp4vpay->config_interval = g_value_get_uint (value);
+ rtpmp4vpay->config_interval = g_value_get_int (value);
break;
default:
break;
switch (prop_id) {
case PROP_CONFIG_INTERVAL:
- g_value_set_uint (value, rtpmp4vpay->config_interval);
+ g_value_set_int (value, rtpmp4vpay->config_interval);
break;
default:
break;