}
tsmux_stream_add_data (best->stream, GST_BUFFER_DATA (buf),
- GST_BUFFER_SIZE (buf), buf, pts, -1);
+ GST_BUFFER_SIZE (buf), buf, pts, -1, !delta);
best->queued_buf = NULL;
mux->is_delta = delta;
gint64 pts;
gint64 dts;
+ gboolean random_access;
+
void *user_data;
};
stream->pi.flags |= TSMUX_PACKET_FLAG_PES_WRITE_PTS;
}
+ if (stream->buffers) {
+ TsMuxStreamBuffer *buf = (TsMuxStreamBuffer *) (stream->buffers->data);
+ if (buf->random_access) {
+ stream->pi.flags |= TSMUX_PACKET_FLAG_RANDOM_ACCESS;
+ }
+ }
+
return TRUE;
}
* @user_data: user data to pass to release func
* @pts: PTS of access unit in @data
* @dts: DTS of access unit in @data
+ * @random_access: TRUE if random access point (keyframe)
*
* Submit @len bytes of @data into @stream. @pts and @dts can be set to the
* timestamp (against a 90Hz clock) of the first access unit in @data. A
*/
void
tsmux_stream_add_data (TsMuxStream * stream, guint8 * data, guint len,
- void *user_data, gint64 pts, gint64 dts)
+ void *user_data, gint64 pts, gint64 dts, gboolean random_access)
{
TsMuxStreamBuffer *packet;
packet->data = data;
packet->size = len;
packet->user_data = user_data;
+ packet->random_access = random_access;
packet->pts = pts;
packet->dts = dts;
/* Add a new buffer to the pool of available bytes. If pts or dts are not -1, they
* indicate the PTS or DTS of the first access unit within this packet */
void tsmux_stream_add_data (TsMuxStream *stream, guint8 *data, guint len,
- void *user_data, gint64 pts, gint64 dts);
+ void *user_data, gint64 pts, gint64 dts,
+ gboolean random_access);
void tsmux_stream_pcr_ref (TsMuxStream *stream);
void tsmux_stream_pcr_unref (TsMuxStream *stream);