ICatchIPancamPreview interface

  1. package com.icatchtek.pancam.customer;
  2. public interface ICatchIPancamPreview extends ICatchIPancamRender {
  3. ...
  4. }

This class is used to start/stop real-time preview stream, Set render mode(through it’s parent interface), get thumbnail from the stream. All operations related to live stream can be done through this class, and in order to understand the full functionality provided by this class, you should first look at the methods provided by its parent interface.

Public methods

start

  1. boolean start(com.icatchtek.reliant.customer.type.ICatchStreamParam streamParam)
  2. throws com.icatchtek.reliant.customer.exception.IchStreamNotSupportException,
  3. com.icatchtek.reliant.customer.exception.IchInvalidSessionException,
  4. com.icatchtek.reliant.customer.exception.IchInvalidArgumentException,
  5. com.icatchtek.reliant.customer.exception.IchTransportException,
  6. com.icatchtek.reliant.customer.exception.IchStreamAlreadyStartedException

Start preview stream with stream parameter.
Parameters:

  • streamParam - parameter of streaming.

Returns:
Returns true on success, otherwise false.
Throws:

  • com.icatchtek.reliant.customer.exception.IchStreamNotSupportException - stream parameter not supported by SDK.
  • com.icatchtek.reliant.customer.exception.IchInvalidSessionException - invalid session
  • com.icatchtek.reliant.customer.exception.IchInvalidArgumentException - invalid argument
  • com.icatchtek.reliant.customer.exception.IchTransportException - Transport not supported or some other errors occurred.
  • com.icatchtek.reliant.customer.exception.IchStreamAlreadyStartedException - streaming is already started, should not start again.

start

  1. boolean start(com.icatchtek.reliant.customer.type.ICatchStreamParam streamParam,
  2. boolean enableAudio)
  3. throws com.icatchtek.reliant.customer.exception.IchStreamNotSupportException,
  4. com.icatchtek.reliant.customer.exception.IchInvalidSessionException,
  5. com.icatchtek.reliant.customer.exception.IchInvalidArgumentException,
  6. com.icatchtek.reliant.customer.exception.IchTransportException,
  7. com.icatchtek.reliant.customer.exception.IchStreamAlreadyStartedException

Start preview stream with stream parameter, enable audio or not.
Parameters:

  • streamParam - The stream parameter.
  • enableAudio - enable audio or not.

Returns:
Return true if no error occurred, otherwise return false.
Throws:

  • com.icatchtek.reliant.customer.exception.IchStreamNotSupportException - Indicates Streaming not supported, the size may not match.
  • com.icatchtek.reliant.customer.exception.IchInvalidSessionException - Indicates invalid session exception.
  • com.icatchtek.reliant.customer.exception.IchTransportException - Indicates transport exception, from network or usb transport.
  • com.icatchtek.reliant.customer.exception.IchInvalidArgumentException - Invalid argument.
  • com.icatchtek.reliant.customer.exception.IchStreamAlreadyStartedException - The stream already started, should close it first.

start

  1. boolean start(com.icatchtek.reliant.customer.type.ICatchStreamParam streamParam,
  2. boolean enableAudio,
  3. int outputFPS)
  4. throws com.icatchtek.reliant.customer.exception.IchStreamNotSupportException,
  5. com.icatchtek.reliant.customer.exception.IchInvalidSessionException,
  6. com.icatchtek.reliant.customer.exception.IchInvalidArgumentException,
  7. com.icatchtek.reliant.customer.exception.IchTransportException,
  8. com.icatchtek.reliant.customer.exception.IchStreamAlreadyStartedException

Start preview stream with stream parameter, enable audio or not.
Parameters:

  • streamParam - The stream parameter.
  • enableAudio - enable audio or not.
  • outputFPS - Set the output fps of the stream.

Returns:
Return true if no error occurred, otherwise return false.
Throws:

  • com.icatchtek.reliant.customer.exception.IchStreamNotSupportException - Indicates Streaming not supported, the size may not match.
  • com.icatchtek.reliant.customer.exception.IchInvalidSessionException - Indicates invalid session exception.
  • com.icatchtek.reliant.customer.exception.IchTransportException - Indicates transport exception, from network or usb transport.
  • com.icatchtek.reliant.customer.exception.IchInvalidArgumentException - Invalid argument.
  • com.icatchtek.reliant.customer.exception.IchStreamAlreadyStartedException - The stream already started, should close it first.

start

  1. boolean start(com.icatchtek.reliant.customer.type.ICatchStreamParam streamParam,
  2. boolean enableAudio,
  3. int outputFPS,
  4. boolean convertVideo,
  5. boolean convertAudio)
  6. throws com.icatchtek.reliant.customer.exception.IchStreamNotSupportException,
  7. com.icatchtek.reliant.customer.exception.IchInvalidSessionException,
  8. com.icatchtek.reliant.customer.exception.IchInvalidArgumentException,
  9. com.icatchtek.reliant.customer.exception.IchTransportException,
  10. com.icatchtek.reliant.customer.exception.IchStreamAlreadyStartedException

Start preview stream with stream parameter, enable audio or not.
Parameters:

  • streamParam - The stream parameter.
  • enableAudio - enable audio or not.
  • outputFPS - Set the output fps of the stream.
  • convertVideo - decode video or not, only this time.
  • convertAudio - decode audio or not, only this time.

Returns:
Return true if no error occurred, otherwise return false.
Throws:

  • com.icatchtek.reliant.customer.exception.IchStreamNotSupportException - Indicates Streaming not supported, the size may not match.
  • com.icatchtek.reliant.customer.exception.IchInvalidSessionException - Indicates invalid session exception.
  • com.icatchtek.reliant.customer.exception.IchTransportException - Indicates transport exception, from network or usb transport.
  • com.icatchtek.reliant.customer.exception.IchInvalidArgumentException - Invalid argument.
  • com.icatchtek.reliant.customer.exception.IchStreamAlreadyStartedException - The stream already started, should close it first.

stop

  1. boolean stop()
  2. throws com.icatchtek.reliant.customer.exception.IchStreamNotRunningException,
  3. com.icatchtek.reliant.customer.exception.IchInvalidSessionException,
  4. com.icatchtek.reliant.customer.exception.IchTransportException

Stop preview streaming.
Returns:
Return true if no error occurred, otherwise return false.
Throws:

  • com.icatchtek.reliant.customer.exception.IchStreamNotRunningException - The streaming not running, so stop will fail.
  • com.icatchtek.reliant.customer.exception.IchInvalidSessionException - Indicates invalid session exception.
  • com.icatchtek.reliant.customer.exception.IchTransportException - Indicates transport exception, from network or usb transport.

stop

  1. boolean stop(int nextOps)
  2. throws com.icatchtek.reliant.customer.exception.IchStreamNotRunningException,
  3. com.icatchtek.reliant.customer.exception.IchInvalidSessionException,
  4. com.icatchtek.reliant.customer.exception.IchTransportException

Stop preview streaming.
Parameters:

  • nextOps - The next operation the app will do after closing the stream.

Returns:
Return true if no error occurred, otherwise return false.
Throws:

  • com.icatchtek.reliant.customer.exception.IchStreamNotRunningException - The streaming not running, so stop will fail.
  • com.icatchtek.reliant.customer.exception.IchInvalidSessionException - Indicates invalid session exception.
  • com.icatchtek.reliant.customer.exception.IchTransportException - Indicates transport exception, from network or usb transport.

getThumbnail

  1. boolean getThumbnail(com.icatchtek.reliant.customer.type.ICatchFrameBuffer frameBuffer,
  2. int timeoutInMS)
  3. throws com.icatchtek.reliant.customer.exception.IchVideoStreamClosedException,
  4. com.icatchtek.reliant.customer.exception.IchStreamNotRunningException,
  5. com.icatchtek.reliant.customer.exception.IchTryAgainException,
  6. com.icatchtek.reliant.customer.exception.IchInvalidSessionException,
  7. com.icatchtek.reliant.customer.exception.IchBufferTooSmallException

Get an image from default stream to use as thumbnail.
Parameters:

  • frameBuffer - Used to store image data taken from the SDK.
  • timeoutInMS - operation timeout. Tf the thumbnail could not be prepared during this time, will return false.

Returns:
Return true if a available thumbnail had been prepared.
Throws:

  • com.icatchtek.reliant.customer.exception.IchVideoStreamClosedException - The stream had been closed
  • com.icatchtek.reliant.customer.exception.IchStreamNotRunningException - The stream does not running, do you forget to start stream.
  • com.icatchtek.reliant.customer.exception.IchTryAgainException - The thumbnail could not be prepared during timeoutInMS, but the next call may succeed.
  • com.icatchtek.reliant.customer.exception.IchInvalidSessionException - Indicates invalid session exception.
  • com.icatchtek.reliant.customer.exception.IchBufferTooSmallException - Buffer too small, you must specify a bigger buffer.

getThumbnail

  1. boolean getThumbnail(int streamNo,
  2. com.icatchtek.reliant.customer.type.ICatchFrameBuffer frameBuffer,
  3. int timeoutInMS)
  4. throws com.icatchtek.reliant.customer.exception.IchVideoStreamClosedException,
  5. com.icatchtek.reliant.customer.exception.IchStreamNotRunningException,
  6. com.icatchtek.reliant.customer.exception.IchTryAgainException,
  7. com.icatchtek.reliant.customer.exception.IchInvalidSessionException,
  8. com.icatchtek.reliant.customer.exception.IchBufferTooSmallException

Get an image from a specified stream to use as thumbnail, and the stream is specified by streamNo, the streamNo parameter can be obtained by ‘getVideo Formats/getVideo Format’.
Parameters:

  • streamNo - The number of stream which you want to get thumbnail from.
  • frameBuffer - Used to store image data taken from the SDK.
  • timeoutInMS - operation timeout. Tf the thumbnail could not be prepared during this time, will return false.

Returns:
Return true if a available thumbnail had been prepared.
Throws:

  • com.icatchtek.reliant.customer.exception.IchVideoStreamClosedException - The stream had been closed
  • com.icatchtek.reliant.customer.exception.IchStreamNotRunningException - The stream does not running, do you forget to start stream.
  • com.icatchtek.reliant.customer.exception.IchTryAgainException - The thumbnail could not be prepared during timeoutInMS, but the next call may succeed.
  • com.icatchtek.reliant.customer.exception.IchInvalidSessionException - Indicates invalid session exception.
  • com.icatchtek.reliant.customer.exception.IchBufferTooSmallException - Buffer too small, you must specify a bigger buffer.

isStreamingOn

  1. boolean isStreamingOn()
  2. throws com.icatchtek.reliant.customer.exception.IchInvalidSessionException,
  3. com.icatchtek.reliant.customer.exception.IchTransportException

Get the status of the video playback stream, is turned on?
Returns:
Return true if the stream is already opened, otherwise return false.
Throws:**

  • com.icatchtek.reliant.customer.exception.IchInvalidSessionException - Indicates invalid session exception.
  • com.icatchtek.reliant.customer.exception.IchTransportException - Indicates transport exception, from network or usb transport.

getStreamControl

  1. ICatchIStreamControl getStreamControl()
  2. throws com.icatchtek.reliant.customer.exception.IchStreamNotRunningException,
  3. com.icatchtek.reliant.customer.exception.IchNotSupportedException

Get stream control instance, You can use this instance to control this stream.
Returns:
The stream control instance.
Throws:

  • com.icatchtek.reliant.customer.exception.IchStreamNotRunningException - stream not running, forget to start stream?
  • com.icatchtek.reliant.customer.exception.IchNotSupportedException - stream does not support app to control the stream though the SDK.

getStreamPublish

  1. ICatchIStreamPublish getStreamPublish()
  2. throws com.icatchtek.reliant.customer.exception.IchStreamNotRunningException,
  3. com.icatchtek.reliant.customer.exception.IchNotSupportedException

Get stream publish instance. You can use this instance to publish stream to the specified server, such as youtube.
Returns:
The stream publish instance.
Throws:

  • com.icatchtek.reliant.customer.exception.IchStreamNotRunningException - stream not running, forget to start stream?
  • com.icatchtek.reliant.customer.exception.IchNotSupportedException - stream does not support app to publish the stream through the SDK.

getStreamStablization

  1. ICatchIStreamStablization getStreamStablization()
  2. throws com.icatchtek.reliant.customer.exception.IchStreamNotRunningException,
  3. com.icatchtek.reliant.customer.exception.IchNotSupportedException

Get Stream Stablization instance. You can use this instance to control the stream stablization feature, And this instance is used when the stream contains EIS information.
Returns:
The stream stablization instance.
Throws:

  • com.icatchtek.reliant.customer.exception.IchStreamNotRunningException - stream not running, forget to start stream?
  • com.icatchtek.reliant.customer.exception.IchNotSupportedException - stream does not support app to control the stream stablization though the SDK.