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.cameraserver;
006
007public final class CameraServerSharedStore {
008  private static CameraServerShared cameraServerShared;
009
010  private CameraServerSharedStore() {}
011
012  /**
013   * Get the CameraServerShared object.
014   *
015   * @return The CameraServerSharedObject
016   */
017  public static synchronized CameraServerShared getCameraServerShared() {
018    if (cameraServerShared == null) {
019      cameraServerShared =
020          new CameraServerShared() {
021            @Override
022            public void reportVideoServer(int id) {}
023
024            @Override
025            public void reportUsbCamera(int id) {}
026
027            @Override
028            public void reportDriverStationError(String error) {}
029
030            @Override
031            public void reportAxisCamera(int id) {}
032
033            @Override
034            public Long getRobotMainThreadId() {
035              return null;
036            }
037          };
038    }
039    return cameraServerShared;
040  }
041
042  /**
043   * Set the CameraServerShared object.
044   *
045   * @param shared The CameraServerShared object.
046   */
047  public static synchronized void setCameraServerShared(CameraServerShared shared) {
048    cameraServerShared = shared;
049  }
050}