package com.foxx.androidcast.network.transport;

/*********************************************************************
 * StreamProtectionMode.java
 * Created at: Sat 16 May 2026 18:50:36 +0200
 * Updated at: Wed 20 May 2026 15:17:13 +0200 by Anton Afanasyeu <a.afanasieff@gmail.com>
 * Commit: 5d8e82d2e60a21fff3138d2a394ee4e8b4c6dcb8
 * enum StreamProtectionMode
 * Contributors:
 *    - Anton Afanasyeu <a.afanasieff@gmail.com> (4 commits, 45 lines)
 *    - Cursor Agent (project assistant)
 * Digest: SHA256	70fb0edd14bcdef8391f5739ab0f54beba0cee3a5e9dc90e7e8e1c0347134b6c
**********************************************************************/
/** Active UDP stream protection mode. */
public enum StreamProtectionMode {
    NONE,
    FEC_3_4,
    FEC_REED_SOLOMON,
    NACK,
    FEC_NACK;

    public boolean isActive() {
        return this != NONE;
    }

    public boolean usesFec() {
        return this == FEC_3_4 || this == FEC_REED_SOLOMON || this == FEC_NACK;
    }

    public boolean usesNack() {
        return this == NACK || this == FEC_NACK;
    }

    public String wireLabel() {
        switch (this) {
            case FEC_3_4:
                return "FEC 3/4";
            case FEC_REED_SOLOMON:
                return "FEC Reed-Solomon";
            case NACK:
                return "NACK";
            case FEC_NACK:
                return "FEC 3/4 + NACK";
            case NONE:
            default:
                return "NONE";
        }
    }
}
