001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005package edu.wpi.first.cscore;
006
007/**
008 * A source that represents an Axis IP camera.
009 *
010 * @deprecated Use HttpCamera instead.
011 */
012@Deprecated(forRemoval = true, since = "2025")
013public class AxisCamera extends HttpCamera {
014  private static String hostToUrl(String host) {
015    return "http://" + host + "/mjpg/video.mjpg";
016  }
017
018  private static String[] hostToUrl(String[] hosts) {
019    String[] urls = new String[hosts.length];
020    for (int i = 0; i < hosts.length; i++) {
021      urls[i] = hostToUrl(hosts[i]);
022    }
023    return urls;
024  }
025
026  /**
027   * Create a source for an Axis IP camera.
028   *
029   * @param name Source name (arbitrary unique identifier)
030   * @param host Camera host IP or DNS name (e.g. "10.x.y.11")
031   */
032  public AxisCamera(String name, String host) {
033    super(name, hostToUrl(host), HttpCameraKind.kAxis);
034  }
035
036  /**
037   * Create a source for an Axis IP camera.
038   *
039   * @param name Source name (arbitrary unique identifier)
040   * @param hosts Array of Camera host IPs/DNS names
041   */
042  public AxisCamera(String name, String[] hosts) {
043    super(name, hostToUrl(hosts), HttpCameraKind.kAxis);
044  }
045}