Class Stream

java.lang.Object
com.flir.thermalsdk.live.streaming.Stream
All Implemented Interfaces:
StreamSource

public class Stream extends Object implements StreamSource
Basic class for managing streaming from a Camera.
Note: The implementation for thermal streaming for network cameras is still in experimental stage.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Attach a recorder object to record frames from stream.
    void
    Detach the recorder object when stopping recording.
    double
    Get the camera's streamed frame rate (zero if the frame rate cannot be obtained).
    double
    Get the highest possible frame rate for this camera stream (zero if the frame rate cannot be obtained).
    double
    Get the lowest possible frame rate for this camera stream.
    boolean
    Check if the stream is in frame grabbing state.
    boolean
    Check if a stream is thermal (contains radiometric/measurable pixels).
    void
    setFrameRate(double hz)
    Set the camera's streamed frame rate.
    Note: Some cameras will not change frame rate while streaming.
    void
    start(OnReceived<Void> onReceived, OnRemoteError onError)
    Starts the frame grabbing.
    Note: The implementation for thermal streaming for network cameras is still in experimental stage.
    void
    Stops the frame grabbing.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • start

      public void start(OnReceived<Void> onReceived, OnRemoteError onError)
      Starts the frame grabbing.
      Note: The implementation for thermal streaming for network cameras is still in experimental stage.
      Parameters:
      onReceived - Callback to receive a notification for each new frame that arrives. This callback is invoked on a separate "streaming thread", and should only be used to trigger/notify a render thread of the new image. Executing heavy processing/tasks in this callback may result in reduced performance or lost frames.
      onError - Callback to monitor if the stream is broken. Invoked on a background thread. The stream will be stopped automatically on error.
    • stop

      public void stop()
      Stops the frame grabbing.
    • isStreaming

      public boolean isStreaming()
      Check if the stream is in frame grabbing state.
    • isThermal

      public boolean isThermal()
      Check if a stream is thermal (contains radiometric/measurable pixels).
      The stream can only be used together with ThermalImage if the stream is thermal.
    • setFrameRate

      public void setFrameRate(double hz)
      Set the camera's streamed frame rate.
      Note: Some cameras will not change frame rate while streaming.
      Parameters:
      hz - Frames per second, must be in range [getMinFrameRate(), getMaxFrameRate()].
    • getFrameRate

      public double getFrameRate()
      Get the camera's streamed frame rate (zero if the frame rate cannot be obtained).
    • getMinFrameRate

      public double getMinFrameRate()
      Get the lowest possible frame rate for this camera stream.
    • getMaxFrameRate

      public double getMaxFrameRate()
      Get the highest possible frame rate for this camera stream (zero if the frame rate cannot be obtained).
    • attachRecorder

      public void attachRecorder(ThermalSequenceRecorder recorder)
      Attach a recorder object to record frames from stream.
    • detachRecorder

      public void detachRecorder()
      Detach the recorder object when stopping recording.