程序包 org.openni

类 Recorder


  • public class Recorder
    extends java.lang.Object
    The Recorder class is used to record streams to an ONI file. After a recorder is instantiated, it must be initialized with a specific filename where the recording will be stored. The recorder is then attached to one or more streams. Once this is complete, the recorder can be told to start recording. The recorder will store every frame from every stream to the specified file. Later, this file can be used to initialize a file Device, and used to play back the same data that was recorded. Opening a file device is done by passing its path as the uri to the Device.open(String) method. PlaybackControl for options available to play a recorded file.
    • 构造器概要

      构造器 
      构造器 说明
      Recorder()  
    • 方法概要

      所有方法 静态方法 实例方法 具体方法 
      修饰符和类型 方法 说明
      void addStream​(VideoStream stream, boolean allowLossyCompression)
      Attaches a stream to the recorder.
      static Recorder create​(java.lang.String fileName)
      Initializes a recorder.
      void destroy()
      Destroys a recorder.
      long getHandle()
      This function return recorded handle.
      void start()
      Starts recording.
      void stop()
      Stops recording.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • Recorder

        public Recorder()
    • 方法详细资料

      • create

        public static Recorder create​(java.lang.String fileName)
        Initializes a recorder. You can initialize the recorder only once. Attempts to initialize more than once will result in an error code being returned. Initialization assigns the recorder to an output file that will be used for recording. Before use, the addStream(VideoStream, boolean) function must also be used to assign input data to the Recorder.
        参数:
        fileName - The name of a file which will contain the recording.
      • getHandle

        public long getHandle()
        This function return recorded handle.
        返回:
        OpenNI recorder handle.
      • addStream

        public void addStream​(VideoStream stream,
                              boolean allowLossyCompression)
        Attaches a stream to the recorder. Note, this won't start recording, you should explicitly start it using start() method. As soon as the recording process has been started, no more streams can be attached to the recorder.
        参数:
        stream - The stream to be recorded.
        allowLossyCompression - If this value is true, the recorder might use a lossy compression, which means that when the recording will be played-back, there might be small differences from the original frame. Default value is false.
      • start

        public void start()
        Starts recording. Once this method is called, the recorder will take all subsequent frames from the attached streams and store them in the file. You may not add additional streams once recording was started.
      • stop

        public void stop()
        Stops recording. You may use start() to resume the recording.
      • destroy

        public void destroy()
        Destroys a recorder. This will also stop recording.