Skip to content

VideoFilterManager

Adnan Elezović edited this page Jun 11, 2024 · 1 revision

The video filter manager, handling all frame encoding and decoding and lifecycle management. Ensuring video filter implementations only need to provide the image transformation logic and emit filtered frames.



getVideoFilter()

Description

Returns the inner video filter performing the filtering logic.

Returns



notifyError(error)

Description

If the video filter encounters an unrecoverable error which wasn't thrown synchronously during initialization, it should be reported through this method. Once called, the video filter will be stopped and removed, falling back to the unfiltered video stream.

Returns

  • N/A



notifyFrameProcessed(frame, rotation, timestampNs)

  • frame: Bitmap - The filtered frame that should be sent.
  • rotation: int - The rotation of the frame. Useful if your filtering logic needs to know whether the video isn't upright (e.g. device is upside down).
  • timestampNs: Long - Timestamp of the frame in nano seconds.

Description

When applyFilter is called, once the filtered frame is ready, the video filter should be notified using this method. The supplied frame is encoded and sent as video output.

Returns

  • N/A



getFilterHandler()

Description

Returns a reference to the video filter thread handler. Only valid while the video filter is running (i.e. after start and before stop have been invoked).

Returns

  • Handler - A reference to the handler for the corresponding video filter thread.



configureFramerate(filterFps)

  • filterFps: int -The requested framerate.

Description

Configure what framerate the video filter should request filtered frames with. Doesn't affect the source framerate. The effective framerate is min(sourceFramerate, filterFramerate). If the filter configured to operate on a lower framerate than the source generates, frameskipping will occur. For example, if the source feed is 30 fps, while the video filter is configured to operate at 15 fps, every second frame will be skipped to avoid hiccups while still meeting the requirements.

Returns

  • N/A



getCurrentFramerate()

Description

Returns the current effective framerate the currently active video filter produces frames.

Returns

  • int - The current framerate.

Tutorials

Migration guides

Reference documentation

Clone this wiki locally