ICatchIPancamGL interface
package com.icatchtek.pancam.customer.stream;public interface ICatchIStreamProvider {...}
This interface is used to obtain information related to the stream, such as: 1. Get whether the SDK contains audio or video streams. 1. Get the format of audio stream video streams. 2. Get the frames for this video or audio streams. After getting this interface, the general programming flow is(take video rendering as an example): first determine whether there is video stream, then get the format of the video stream and initialize the decoder according to the format(codec, width, height .etc), finally get video frames. It should be noted that if the stream contains both audio and video frames, you need to take audio frames first and control the interval between frames in a more precise way, such as the hardware delay of the audio player.
Public methods
containsVideoStream
boolean containsVideoStream()throws com.icatchtek.reliant.customer.exception.IchTransportException,com.icatchtek.reliant.customer.exception.IchInvalidSessionException,com.icatchtek.reliant.customer.exception.IchStreamNotRunningException,com.icatchtek.reliant.customer.exception.IchDeprecatedException
Query whether The SDK contains video stream or not.
Returns:
Return true if the SDK contains video stream, otherwise return false.
Throws:
- com.icatchtek.reliant.customer.exception.IchInvalidSessionException - The session is closed or not prepared.
- com.icatchtek.reliant.customer.exception.IchStreamNotRunningException - stream closed by the App or the camera.
- com.icatchtek.reliant.customer.exception.IchTransportException - Indicates transport exception, from network or usb transport.
- com.icatchtek.reliant.customer.exception.IchDeprecatedException - The instance is deprecated, You should get new one through ICatchIPancamRender.disableRender.
containsAudioStream
boolean containsAudioStream()
throws com.icatchtek.reliant.customer.exception.IchTransportException,
com.icatchtek.reliant.customer.exception.IchInvalidSessionException,
com.icatchtek.reliant.customer.exception.IchStreamNotRunningException,
com.icatchtek.reliant.customer.exception.IchDeprecatedException
Query whether The SDK contains audio stream or not.
Returns:
Return true if the SDK contains audio stream, otherwise return false.
Throws:
- com.icatchtek.reliant.customer.exception.IchInvalidSessionException - The session is closed or not prepared.
- com.icatchtek.reliant.customer.exception.IchStreamNotRunningException - stream closed by the App or the camera.
- com.icatchtek.reliant.customer.exception.IchTransportException - Indicates transport exception, from network or usb transport.
- com.icatchtek.reliant.customer.exception.IchDeprecatedException - The instance is deprecated, You should get new one through ICatchIPancamRender.disableRender.
getVideoFormat
com.icatchtek.reliant.customer.type.ICatchVideoFormat getVideoFormat()
throws com.icatchtek.reliant.customer.exception.IchInvalidSessionException,
com.icatchtek.reliant.customer.exception.IchStreamNotRunningException,
com.icatchtek.reliant.customer.exception.IchTransportException,
com.icatchtek.reliant.customer.exception.IchDeprecatedException
Get the format information of the video stream, such as video width, video height, csd-0, csd-1, codec name. Using the default streamNo, which is enough for most situations.
Returns:
The instance of ICatchVideoFormat.
Throws:
- com.icatchtek.reliant.customer.exception.IchInvalidSessionException - The session is closed or not prepared.
- com.icatchtek.reliant.customer.exception.IchStreamNotRunningException - stream closed by the App or the camera.
- com.icatchtek.reliant.customer.exception.IchTransportException - Indicates transport exception, from network or usb transport.
- com.icatchtek.reliant.customer.exception.IchDeprecatedException - The instance is deprecated, You should get new one through ICatchIPancamRender.disableRender.
getVideoFormats
java.util.List<com.icatchtek.reliant.customer.type.ICatchVideoFormat> getVideoFormats()
throws com.icatchtek.reliant.customer.exception.IchInvalidSessionException,
com.icatchtek.reliant.customer.exception.IchStreamNotRunningException,
com.icatchtek.reliant.customer.exception.IchTransportException,
com.icatchtek.reliant.customer.exception.IchDeprecatedException
Get all supported video stream formats. For some specific camera platforms, there may be more than one video stream. For example, some security cameras can receive IR and RGB streams at the same time. Each video stream has a unique streamNo corresponding to it, which can be obtained by each instance int the list.
Returns:
List of supported video stream formats.
Throws:
- com.icatchtek.reliant.customer.exception.IchInvalidSessionException - The session is closed or not prepared.
- com.icatchtek.reliant.customer.exception.IchStreamNotRunningException - stream closed by the App or the camera.
- com.icatchtek.reliant.customer.exception.IchTransportException - Indicates transport exception, from network or usb transport.
- com.icatchtek.reliant.customer.exception.IchDeprecatedException - The instance is deprecated, You should get new one through ICatchIPancamRender.disableRender.
getAudioFormat
com.icatchtek.reliant.customer.type.ICatchAudioFormat getAudioFormat()
throws com.icatchtek.reliant.customer.exception.IchInvalidSessionException,
com.icatchtek.reliant.customer.exception.IchStreamNotRunningException,
com.icatchtek.reliant.customer.exception.IchTransportException,
com.icatchtek.reliant.customer.exception.IchDeprecatedException
Get the format of the audio stream, such as sample rate, bit width, number of channels. Using the default streamNo, which is enough for most situations.
Returns:
The instance of ICatchAudioFormat.
Throws:
- com.icatchtek.reliant.customer.exception.IchInvalidSessionException - The session is closed or not prepared.
- com.icatchtek.reliant.customer.exception.IchStreamNotRunningException - stream closed by the App or the camera.
- com.icatchtek.reliant.customer.exception.IchTransportException - Indicates transport exception, from network or usb transport.
- com.icatchtek.reliant.customer.exception.IchDeprecatedException - The instance is deprecated, You should get new one through ICatchIPancamRender.disableRender.
getAudioFormats
java.util.List<com.icatchtek.reliant.customer.type.ICatchAudioFormat> getAudioFormats()
throws com.icatchtek.reliant.customer.exception.IchInvalidSessionException,
com.icatchtek.reliant.customer.exception.IchStreamNotRunningException,
com.icatchtek.reliant.customer.exception.IchTransportException,
com.icatchtek.reliant.customer.exception.IchDeprecatedException
Get all supported audio stream formats. For some specific camera platforms, there may be more than one audio stream. Each audio stream has a unique streamNo corresponding to it, which can be obtained by each instance int the list.
Returns:
List of supported audio stream formats.
Throws:
- com.icatchtek.reliant.customer.exception.IchInvalidSessionException - The session is closed or not prepared.
- com.icatchtek.reliant.customer.exception.IchStreamNotRunningException - stream closed by the App or the camera.
- com.icatchtek.reliant.customer.exception.IchTransportException - Indicates transport exception, from network or usb transport.
- com.icatchtek.reliant.customer.exception.IchDeprecatedException - The instance is deprecated, You should get new one through ICatchIPancamRender.disableRender.
getNextVideoFrame
boolean getNextVideoFrame(com.icatchtek.reliant.customer.type.ICatchFrameBuffer frameBuffer)
throws com.icatchtek.reliant.customer.exception.IchTransportException,
com.icatchtek.reliant.customer.exception.IchVideoStreamClosedException,
com.icatchtek.reliant.customer.exception.IchStreamNotRunningException,
com.icatchtek.reliant.customer.exception.IchTryAgainException,
com.icatchtek.reliant.customer.exception.IchInvalidSessionException,
com.icatchtek.reliant.customer.exception.IchBufferTooSmallException,
com.icatchtek.reliant.customer.exception.IchPbStreamPausedException,
com.icatchtek.reliant.customer.exception.IchDeprecatedException
Get video frame from SDK. if no frames are available in the current SDK, this API will block for a while and then trows try again exception. Using the default streamNo, which is enough for most situations.
Parameters:
- frameBuffer - Used to store frame information, such as content, frame size, timestamp.
Returns:
Return true if no error occurred, otherwise return false.
Throws:
- com.icatchtek.reliant.customer.exception.IchTransportException - Indicates transport exception, from network or usb transport.
- com.icatchtek.reliant.customer.exception.IchVideoStreamClosedException - video stream closed.
- com.icatchtek.reliant.customer.exception.IchStreamNotRunningException - stream closed by the App or the camera.
- com.icatchtek.reliant.customer.exception.IchTryAgainException - could not get frame at this moment, should try again next.
- com.icatchtek.reliant.customer.exception.IchInvalidSessionException - The session has not been prepared or already been destroyed..
- com.icatchtek.reliant.customer.exception.IchBufferTooSmallException - The input buffer too small, please allocate a new buffer with bigger size.
- com.icatchtek.reliant.customer.exception.IchPbStreamPausedException - The stream had been paused by SDK or APP in video playback mode.
- com.icatchtek.reliant.customer.exception.IchDeprecatedException - The instance is deprecated, You should get new one using ICatchIPancamRender.disableRender.
getNextVideoFrame
boolean getNextVideoFrame(int streamNo,
com.icatchtek.reliant.customer.type.ICatchFrameBuffer frameBuffer)
throws com.icatchtek.reliant.customer.exception.IchTransportException,
com.icatchtek.reliant.customer.exception.IchVideoStreamClosedException,
com.icatchtek.reliant.customer.exception.IchStreamNotRunningException,
com.icatchtek.reliant.customer.exception.IchTryAgainException,
com.icatchtek.reliant.customer.exception.IchInvalidSessionException,
com.icatchtek.reliant.customer.exception.IchBufferTooSmallException,
com.icatchtek.reliant.customer.exception.IchPbStreamPausedException,
com.icatchtek.reliant.customer.exception.IchDeprecatedException
Get video frame from SDK. if no frames are available in the current SDK, this API will block for a while and then trows try again exception. Using the default streamNo, which is enough for most situations.
Parameters:
- streamNo - The streamNo of which stream you want to get frame from.
- frameBuffer - Used to store frame information, such as content, frame size, timestamp.
Returns:
Return true if no error occurred, otherwise return false.
Throws:
- com.icatchtek.reliant.customer.exception.IchTransportException - Indicates transport exception, from network or usb transport.
- com.icatchtek.reliant.customer.exception.IchVideoStreamClosedException - video stream closed.
- com.icatchtek.reliant.customer.exception.IchStreamNotRunningException - stream closed by the App or the camera.
- com.icatchtek.reliant.customer.exception.IchTryAgainException - could not get frame at this moment, should try again next.
- com.icatchtek.reliant.customer.exception.IchInvalidSessionException - The session has not been prepared or already been destroyed..
- com.icatchtek.reliant.customer.exception.IchBufferTooSmallException - The input buffer too small, please allocate a new buffer with bigger size.
- com.icatchtek.reliant.customer.exception.IchPbStreamPausedException - The stream had been paused by SDK or APP in video playback mode.
- com.icatchtek.reliant.customer.exception.IchDeprecatedException - The instance is deprecated, You should get new one using ICatchIPancamRender.disableRender.
getNextAudioFrame
boolean getNextAudioFrame(com.icatchtek.reliant.customer.type.ICatchFrameBuffer frameBuffer)
throws com.icatchtek.reliant.customer.exception.IchTransportException,
com.icatchtek.reliant.customer.exception.IchAudioStreamClosedException,
com.icatchtek.reliant.customer.exception.IchStreamNotRunningException,
com.icatchtek.reliant.customer.exception.IchTryAgainException,
com.icatchtek.reliant.customer.exception.IchInvalidSessionException,
com.icatchtek.reliant.customer.exception.IchBufferTooSmallException,
com.icatchtek.reliant.customer.exception.IchPbStreamPausedException,
com.icatchtek.reliant.customer.exception.IchDeprecatedException
Get audio frame from SDK. if no frames are available in the current SDK, this API will block for a while and then trows try again exception. Using the default streamNo, which is enough for most situations.
Parameters:
- frameBuffer - Used to store frame information, such as content, frame size, timestamp.
Returns:
Return true if no error occurred, otherwise return false.
Throws:
- com.icatchtek.reliant.customer.exception.IchTransportException - Indicates transport exception, from network or usb transport.
- com.icatchtek.reliant.customer.exception.IchVideoStreamClosedException - video stream closed.
- com.icatchtek.reliant.customer.exception.IchStreamNotRunningException - stream closed by the App or the camera.
- com.icatchtek.reliant.customer.exception.IchTryAgainException - could not get frame at this moment, should try again next.
- com.icatchtek.reliant.customer.exception.IchInvalidSessionException - The session has not been prepared or already been destroyed..
- com.icatchtek.reliant.customer.exception.IchBufferTooSmallException - The input buffer too small, please allocate a new buffer with bigger size.
- com.icatchtek.reliant.customer.exception.IchPbStreamPausedException - The stream had been paused by SDK or APP in video playback mode.
- com.icatchtek.reliant.customer.exception.IchDeprecatedException - The instance is deprecated, You should get new one using ICatchIPancamRender.disableRender.
getNextAudioFrame
boolean getNextAudioFrame(int streamNo,
com.icatchtek.reliant.customer.type.ICatchFrameBuffer frameBuffer)
throws com.icatchtek.reliant.customer.exception.IchTransportException,
com.icatchtek.reliant.customer.exception.IchAudioStreamClosedException,
com.icatchtek.reliant.customer.exception.IchStreamNotRunningException,
com.icatchtek.reliant.customer.exception.IchTryAgainException,
com.icatchtek.reliant.customer.exception.IchInvalidSessionException,
com.icatchtek.reliant.customer.exception.IchBufferTooSmallException,
com.icatchtek.reliant.customer.exception.IchPbStreamPausedException,
com.icatchtek.reliant.customer.exception.IchDeprecatedException
Get audio frame from SDK. if no frames are available in the current SDK, this API will block for a while and then trows try again exception. Using the default streamNo, which is enough for most situations.
Parameters:
- streamNo - The streamNo of which stream you want to get frame from.
- frameBuffer - Used to store frame information, such as content, frame size, timestamp.
Returns:
Return true if no error occurred, otherwise return false.
Throws:
- com.icatchtek.reliant.customer.exception.IchTransportException - Indicates transport exception, from network or usb transport.
- com.icatchtek.reliant.customer.exception.IchVideoStreamClosedException - video stream closed.
- com.icatchtek.reliant.customer.exception.IchStreamNotRunningException - stream closed by the App or the camera.
- com.icatchtek.reliant.customer.exception.IchTryAgainException - could not get frame at this moment, should try again next.
- com.icatchtek.reliant.customer.exception.IchInvalidSessionException - The session has not been prepared or already been destroyed..
- com.icatchtek.reliant.customer.exception.IchBufferTooSmallException - The input buffer too small, please allocate a new buffer with bigger size.
- com.icatchtek.reliant.customer.exception.IchPbStreamPausedException - The stream had been paused by SDK or APP in video playback mode.
- com.icatchtek.reliant.customer.exception.IchDeprecatedException - The instance is deprecated, You should get new one using ICatchIPancamRender.disableRender.
