4#include "codec_bridge.hpp"
5#include "../global.hpp"
6#include "../utilities/system_info.hpp"
8#include "codec_config.hpp"
18inline HandleGuard<CodecBridge::Decoder>::HandleGuard(
void* handle) noexcept
19 : HandleGuard<CodecBridge::Decoder>(handle, [](
void* handle) { CVB_CALL_CAPI(ReleaseObject(handle)); })
42 return std::make_unique<Decoder>(std::move(guard));
45 explicit Decoder(HandleGuard<Decoder>&& guard) noexcept
46 : handle_(std::move(guard))
58 void* Handle()
const noexcept
60 return handle_.Handle();
74 CExports::CVCBCodecStatus status = CExports::CVCBCS_ReadoutRequired;
75 CVB_CALL_CAPI_CHECKED(CVCBDecoderSendPacket(Handle(), packet.Handle(), status));
88 CExports::CVCBCodecStatus status = CExports::CVCBCS_ReadoutRequired;
89 CVB_CALL_CAPI_CHECKED(CVCBDecoderSendPacket(Handle(),
nullptr, status));
102 CExports::CVCBFRAME handle =
nullptr;
103 CVB_CALL_CAPI_CHECKED(CVCBDecoderReceiveFrame(Handle(), handle));
106 HandleGuard<Frame> guard(handle);
107 return Frame::FromHandle(std::move(guard));
119 return Property<int>(CExports::CVCBDP_StreamIndex);
126 T Property(CExports::CVCBDecoderProperty property)
const
129 size_t size =
sizeof(T);
130 CVB_CALL_CAPI_CHECKED(CVCBDecoderGetProperty(Handle(), property, &value, size));
134 HandleGuard<Decoder> handle_;
A decoder for video frames.
Definition: decoder.hpp:33
void Flush()
Flush the decoder and finish decoding.
Definition: decoder.hpp:86
CodecStatus Decode(const Packet &packet)
Decode a packet.
Definition: decoder.hpp:72
int StreamIndex() const
Get the stream index this decoder can work on.
Definition: decoder.hpp:117
std::unique_ptr< Frame > ReceiveFrame()
Receive an an decoded frame.
Definition: decoder.hpp:100
A packet that holds encoded data frame data.
Definition: packet.hpp:28
CodecStatus
Status of the encoder/decoder after sending data.
Definition: codec_bridge.hpp:187
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24