|
ifm3d
|
Abstract H.264 (etc.) video decoder. More...
#include <ifm3d/rtsp/video_decoder.h>
Public Member Functions | |
| virtual int | SendPacket (const std::uint8_t *data, int size, std::uint64_t pts)=0 |
| Push one unit of compressed data into the decoder. More... | |
| virtual int | ReceiveFrame (VideoFrame &out)=0 |
| Pull a decoded frame. More... | |
| virtual int | Flush () |
| Optional: flush buffered frames at end-of-stream. | |
| virtual std::string | LastError () const |
| Optional: a human-readable description of the last error. | |
Protected Member Functions | |
| VideoDecoder (const VideoDecoder &)=default | |
| VideoDecoder & | operator= (const VideoDecoder &)=default |
| VideoDecoder (VideoDecoder &&)=default | |
| VideoDecoder & | operator= (VideoDecoder &&)=default |
Abstract H.264 (etc.) video decoder.
Instances are created through VideoDecoderFactory::CreateDecoder and owned by the caller (via std::unique_ptr).
|
pure virtual |
Pull a decoded frame.
Call repeatedly until it reports that no further frame is available.
out.pts identifies the SendPacket call this frame was decoded from. It is not necessarily the most recent one: an H.264 stream whose SPS advertises max_num_reorder_frames > 0 makes libavcodec hold frames back, so output routinely lags input by a fixed number of packets.
out, 0 = no further frame can be built from the data submitted so far, negative = error.
|
pure virtual |
Push one unit of compressed data into the decoder.
| data | compressed payload, valid for the duration of the call. |
| size | size of data in bytes. |
| pts | an opaque, caller-chosen identifier for this packet. The decoder does not interpret it; it only stores it and returns it on the VideoFrame decoded from this packet. Callers should keep it unique across the packets that may be in flight at once. Implementations that have no natural place to put it must carry it themselves. |