}
+/**
+ * Reference count is transfered to queue
+ */
+void
+pktref_enqueue(struct th_pktref_queue *q, th_pkt_t *pkt)
+{
+ th_pktref_t *pr = malloc(sizeof(th_pktref_t));
+ pr->pr_pkt = pkt;
+ TAILQ_INSERT_TAIL(q, pr, pr_link);
+}
+
+
+/**
+ *
+ */
+void
+pktref_remove(struct th_pktref_queue *q, th_pktref_t *pr)
+{
+ TAILQ_REMOVE(q, pr, pr_link);
+ pkt_ref_dec(pr->pr_pkt);
+ free(pr);
+}
+
+
/**
*
*/
void pktref_clear_queue(struct th_pktref_queue *q);
+// Reference count is transfered to queue
+void pktref_enqueue(struct th_pktref_queue *q, th_pkt_t *pkt);
+
+void pktref_remove(struct th_pktref_queue *q, th_pktref_t *pr);
+
+
th_pkt_t *pkt_alloc(const void *data, size_t datalen, int64_t pts, int64_t dts);
th_pkt_t *pkt_merge_header(th_pkt_t *pkt);