package com.foxx.androidcast.network.control;

/*********************************************************************
 * NetworkControlPlane.java
 * Created at: Fri 15 May 2026 17:47:09 +0200
 * Updated at: Wed 20 May 2026 15:17:13 +0200 by Anton Afanasyeu <a.afanasieff@gmail.com>
 * Commit: 5d8e82d2e60a21fff3138d2a394ee4e8b4c6dcb8
 * interface NetworkControlPlane
 * Contributors:
 *    - Anton Afanasyeu <a.afanasieff@gmail.com> (2 commits, 29 lines)
 *    - Cursor Agent (project assistant)
 * Digest: SHA256	5d0720517170cb275496c433afa459fa0fb4648eeaa0effa35ba1b0d8a149388
**********************************************************************/
/**
 * Pluggable network intelligence: bandwidth estimation, congestion, transport switching.
 * Replace {@link PassThroughNetworkControlPlane} with a real implementation when ready.
 */
public interface NetworkControlPlane {
    /** Called periodically from the cast loop (sender or receiver). */
    NetworkControlAdvice tick(long nowMs);

    /** Peer stats received over the wire. */
    void onPeerStats(NetworkStatsSnapshot stats);

    /** Local stats to publish to the peer. */
    NetworkStatsSnapshot buildLocalStats(long nowMs);

    /** Apply control message received from peer (bitrate/transport hints). */
    void onPeerControl(int suggestedBitrateKbps, String suggestedTransport, boolean switchTransport, int congestionLevel);

    /** Local advice to send after {@link #tick(long)}. */
    NetworkControlAdvice getOutboundAdvice();
}
