#ifndef GST_WEBRTC_PIPELINE_H
#define GST_WEBRTC_PIPELINE_H

#include <json-glib/json-glib.h>
#include "app_state.h"

gboolean gst_webrtc_pipeline_build(AppState *app);
void gst_webrtc_pipeline_prewarm(AppState *app);
void gst_webrtc_pipeline_link_media(AppState *app);
void gst_webrtc_pipeline_teardown(AppState *app);
gboolean gst_webrtc_pipeline_offer_in_flight(const AppState *app);
gboolean gst_webrtc_pipeline_negotiation_busy(const AppState *app);
gboolean gst_webrtc_pipeline_survives_signaling_drop(const AppState *app);
void gst_webrtc_pipeline_debug_log_state(const AppState *app, const char *tag);
void gst_webrtc_pipeline_on_rx_offer_sdp(AppState *app, const gchar *sdp);
void gst_webrtc_pipeline_on_peer_left(AppState *app);
void gst_webrtc_pipeline_on_driver_switch(AppState *app);
gboolean gst_webrtc_pipeline_is_phone_reconnect_offer(const AppState *app, const gchar *sdp);
gboolean gst_webrtc_pipeline_should_ignore_phone_offer(const AppState *app, const gchar *sdp);
gboolean gst_webrtc_pipeline_can_renegotiate(const AppState *app, const gchar *sdp);
void gst_webrtc_pipeline_renegotiate_remote_offer(AppState *app, const gchar *sdp_text);
void gst_webrtc_pipeline_on_peer_count(AppState *app, gint peer_count);
void gst_webrtc_pipeline_try_start_offer(AppState *app);
void gst_webrtc_pipeline_start_offer_retry(AppState *app);
void gst_webrtc_pipeline_stop_offer_retry(void);
void gst_webrtc_pipeline_apply_remote_offer(AppState *app, const gchar *sdp_text);
void gst_webrtc_handle_remote_offer(AppState *app, const gchar *sdp_text);
void gst_webrtc_handle_remote_answer(AppState *app, const gchar *sdp_text);
void gst_webrtc_handle_remote_ice(AppState *app, JsonObject *candidate_obj);

#endif
