Lines Matching refs:mhsink
203 static void gst_multi_handle_sink_clear (GstMultiHandleSink * mhsink);
207 static void gst_multi_handle_sink_queue_buffer (GstMultiHandleSink * mhsink,
210 mhsink, GstMultiHandleClient * mhclient, GstBuffer * buffer);
235 static void gst_multi_handle_sink_setup_dscp (GstMultiHandleSink * mhsink);
555 gst_multi_handle_sink_setup_dscp (GstMultiHandleSink * mhsink) in gst_multi_handle_sink_setup_dscp() argument
559 CLIENTS_LOCK (mhsink); in gst_multi_handle_sink_setup_dscp()
560 for (clients = mhsink->clients; clients; clients = clients->next) { in gst_multi_handle_sink_setup_dscp()
565 gst_multi_handle_sink_setup_dscp_client (mhsink, client); in gst_multi_handle_sink_setup_dscp()
567 CLIENTS_UNLOCK (mhsink); in gst_multi_handle_sink_setup_dscp()
577 GstMultiHandleSink *mhsink = GST_MULTI_HANDLE_SINK (sink); in gst_multi_handle_sink_add_full() local
580 GST_MULTI_HANDLE_SINK_GET_CLASS (mhsink); in gst_multi_handle_sink_add_full()
603 clink = g_hash_table_lookup (mhsink->handle_hash, in gst_multi_handle_sink_add_full()
612 mhclient = mhsinkclass->new_client (mhsink, handle, sync_method); in gst_multi_handle_sink_add_full()
615 clink = mhsink->clients = g_list_prepend (mhsink->clients, mhclient); in gst_multi_handle_sink_add_full()
616 g_hash_table_insert (mhsink->handle_hash, in gst_multi_handle_sink_add_full()
618 mhsink->clients_cookie++; in gst_multi_handle_sink_add_full()
627 mhsinkclass->hash_changed (mhsink); in gst_multi_handle_sink_add_full()
631 mhsinkclass->emit_client_added (mhsink, handle); in gst_multi_handle_sink_add_full()
648 mhsinkclass->emit_client_removed (mhsink, handle, in gst_multi_handle_sink_add_full()
669 GstMultiHandleSink *mhsink = GST_MULTI_HANDLE_SINK (sink); in gst_multi_handle_sink_remove() local
671 GST_MULTI_HANDLE_SINK_GET_CLASS (mhsink); in gst_multi_handle_sink_remove()
679 clink = g_hash_table_lookup (mhsink->handle_hash, in gst_multi_handle_sink_remove()
695 mhsinkclass->hash_changed (mhsink); in gst_multi_handle_sink_remove()
710 GstMultiHandleSink *mhsink = GST_MULTI_HANDLE_SINK (sink); in gst_multi_handle_sink_remove_flush() local
712 GST_MULTI_HANDLE_SINK_GET_CLASS (mhsink); in gst_multi_handle_sink_remove_flush()
720 clink = g_hash_table_lookup (mhsink->handle_hash, in gst_multi_handle_sink_remove_flush()
749 gst_multi_handle_sink_clear (GstMultiHandleSink * mhsink) in gst_multi_handle_sink_clear() argument
754 GST_MULTI_HANDLE_SINK_GET_CLASS (mhsink); in gst_multi_handle_sink_clear()
756 GST_DEBUG_OBJECT (mhsink, "clearing all clients"); in gst_multi_handle_sink_clear()
758 CLIENTS_LOCK (mhsink); in gst_multi_handle_sink_clear()
760 cookie = mhsink->clients_cookie; in gst_multi_handle_sink_clear()
761 for (clients = mhsink->clients; clients; clients = next) { in gst_multi_handle_sink_clear()
764 if (cookie != mhsink->clients_cookie) { in gst_multi_handle_sink_clear()
765 GST_DEBUG_OBJECT (mhsink, "cookie changed while removing all clients"); in gst_multi_handle_sink_clear()
775 gst_multi_handle_sink_remove_client_link (mhsink, clients); in gst_multi_handle_sink_clear()
778 mhsinkclass->hash_changed (mhsink); in gst_multi_handle_sink_clear()
780 CLIENTS_UNLOCK (mhsink); in gst_multi_handle_sink_clear()
793 GstMultiHandleSink *mhsink = GST_MULTI_HANDLE_SINK (sink); in gst_multi_handle_sink_get_stats() local
795 GST_MULTI_HANDLE_SINK_GET_CLASS (mhsink); in gst_multi_handle_sink_get_stats()
801 clink = g_hash_table_lookup (mhsink->handle_hash, in gst_multi_handle_sink_get_stats()
956 gst_multi_handle_sink_client_queue_buffer (GstMultiHandleSink * mhsink, in gst_multi_handle_sink_client_queue_buffer() argument
959 GstMultiHandleSink *sink = GST_MULTI_HANDLE_SINK (mhsink); in gst_multi_handle_sink_client_queue_buffer()
1001 if (!mhsink->resend_streamheader) { in gst_multi_handle_sink_client_queue_buffer()
1606 gst_multi_handle_sink_queue_buffer (GstMultiHandleSink * mhsink, in gst_multi_handle_sink_queue_buffer() argument
1617 GstMultiHandleSink *sink = GST_MULTI_HANDLE_SINK (mhsink); in gst_multi_handle_sink_queue_buffer()
1619 GST_MULTI_HANDLE_SINK_GET_CLASS (mhsink); in gst_multi_handle_sink_queue_buffer()
1621 CLIENTS_LOCK (mhsink); in gst_multi_handle_sink_queue_buffer()
1623 g_array_prepend_val (mhsink->bufqueue, buffer); in gst_multi_handle_sink_queue_buffer()
1624 queuelen = mhsink->bufqueue->len; in gst_multi_handle_sink_queue_buffer()
1626 if (mhsink->units_max > 0) in gst_multi_handle_sink_queue_buffer()
1627 max_buffers = get_buffers_max (mhsink, mhsink->units_max); in gst_multi_handle_sink_queue_buffer()
1631 if (mhsink->units_soft_max > 0) in gst_multi_handle_sink_queue_buffer()
1632 soft_max_buffers = get_buffers_max (mhsink, mhsink->units_soft_max); in gst_multi_handle_sink_queue_buffer()
1639 cookie = mhsink->clients_cookie; in gst_multi_handle_sink_queue_buffer()
1640 for (clients = mhsink->clients; clients; clients = clients->next) { in gst_multi_handle_sink_queue_buffer()
1651 newpos = gst_multi_handle_sink_recover_client (mhsink, mhclient); in gst_multi_handle_sink_queue_buffer()
1670 cookie = mhsink->clients_cookie; in gst_multi_handle_sink_queue_buffer()
1671 for (clients = mhsink->clients; clients; clients = next) { in gst_multi_handle_sink_queue_buffer()
1674 if (cookie != mhsink->clients_cookie) { in gst_multi_handle_sink_queue_buffer()
1683 (mhsink->timeout > 0 in gst_multi_handle_sink_queue_buffer()
1685 mhsink->timeout)) { in gst_multi_handle_sink_queue_buffer()
1694 gst_multi_handle_sink_remove_client_link (mhsink, clients); in gst_multi_handle_sink_queue_buffer()
1700 mhsinkclass->hash_adding (mhsink, mhclient); in gst_multi_handle_sink_queue_buffer()
1717 GST_TIME_ARGS (mhsink->time_min), mhsink->bytes_min, in gst_multi_handle_sink_queue_buffer()
1718 mhsink->buffers_min); in gst_multi_handle_sink_queue_buffer()
1723 find_limits (mhsink, &usage, mhsink->bytes_min, mhsink->buffers_min, in gst_multi_handle_sink_queue_buffer()
1724 mhsink->time_min, &max, -1, -1, -1); in gst_multi_handle_sink_queue_buffer()
1733 if (mhsink->def_sync_method == GST_SYNC_METHOD_LATEST_KEYFRAME || in gst_multi_handle_sink_queue_buffer()
1734 mhsink->def_sync_method == GST_SYNC_METHOD_BURST_KEYFRAME) { in gst_multi_handle_sink_queue_buffer()
1747 buf = g_array_index (mhsink->bufqueue, GstBuffer *, i); in gst_multi_handle_sink_queue_buffer()
1748 if (is_sync_frame (mhsink, buf)) { in gst_multi_handle_sink_queue_buffer()
1768 old = g_array_index (mhsink->bufqueue, GstBuffer *, i); in gst_multi_handle_sink_queue_buffer()
1769 mhsink->bufqueue = g_array_remove_index (mhsink->bufqueue, i); in gst_multi_handle_sink_queue_buffer()
1775 mhsink->buffers_queued = max_buffer_usage + 1; in gst_multi_handle_sink_queue_buffer()
1780 mhsinkclass->hash_changed (mhsink); in gst_multi_handle_sink_queue_buffer()
2076 GstMultiHandleSink *mhsink; in gst_multi_handle_sink_start() local
2081 mhsink = GST_MULTI_HANDLE_SINK (bsink); in gst_multi_handle_sink_start()
2082 mhsclass = GST_MULTI_HANDLE_SINK_GET_CLASS (mhsink); in gst_multi_handle_sink_start()
2084 if (!mhsclass->start_pre (mhsink)) in gst_multi_handle_sink_start()
2087 mhsink->bytes_to_serve = 0; in gst_multi_handle_sink_start()
2088 mhsink->bytes_served = 0; in gst_multi_handle_sink_start()
2091 mhsclass->init (mhsink); in gst_multi_handle_sink_start()
2094 mhsink->running = TRUE; in gst_multi_handle_sink_start()
2096 mhsink->thread = g_thread_new ("multihandlesink", in gst_multi_handle_sink_start()
2097 (GThreadFunc) mhsclass->thread, mhsink); in gst_multi_handle_sink_start()
2110 GstMultiHandleSink *mhsink = GST_MULTI_HANDLE_SINK (bsink); in gst_multi_handle_sink_stop() local
2112 mhclass = GST_MULTI_HANDLE_SINK_GET_CLASS (mhsink); in gst_multi_handle_sink_stop()
2117 mhsink->running = FALSE; in gst_multi_handle_sink_stop()
2119 mhclass->stop_pre (mhsink); in gst_multi_handle_sink_stop()
2121 if (mhsink->thread) { in gst_multi_handle_sink_stop()
2122 GST_DEBUG_OBJECT (mhsink, "joining thread"); in gst_multi_handle_sink_stop()
2123 g_thread_join (mhsink->thread); in gst_multi_handle_sink_stop()
2124 GST_DEBUG_OBJECT (mhsink, "joined thread"); in gst_multi_handle_sink_stop()
2125 mhsink->thread = NULL; in gst_multi_handle_sink_stop()
2129 mhclass->clear (GST_MULTI_HANDLE_SINK (mhsink)); in gst_multi_handle_sink_stop()
2132 mhclass->close (mhsink); in gst_multi_handle_sink_stop()
2134 mhclass->stop_post (mhsink); in gst_multi_handle_sink_stop()
2137 if (mhsink->bufqueue) { in gst_multi_handle_sink_stop()
2138 GST_DEBUG_OBJECT (mhsink, "Emptying bufqueue with %d buffers", in gst_multi_handle_sink_stop()
2139 mhsink->bufqueue->len); in gst_multi_handle_sink_stop()
2140 for (i = mhsink->bufqueue->len - 1; i >= 0; --i) { in gst_multi_handle_sink_stop()
2141 buf = g_array_index (mhsink->bufqueue, GstBuffer *, i); in gst_multi_handle_sink_stop()
2142 GST_LOG_OBJECT (mhsink, "Removing buffer %p (%d) with refcount %d", buf, in gst_multi_handle_sink_stop()
2145 mhsink->bufqueue = g_array_remove_index (mhsink->bufqueue, i); in gst_multi_handle_sink_stop()
2149 GST_OBJECT_FLAG_UNSET (mhsink, GST_MULTI_HANDLE_SINK_OPEN); in gst_multi_handle_sink_stop()