3#include "codec_bridge.hpp"
4#include "../global.hpp"
5#include "../utilities/system_info.hpp"
7#include "codec_config.hpp"
17 inline HandleGuard<CodecBridge::Decoder>::HandleGuard(
void *handle) noexcept
18 : HandleGuard<CodecBridge::Decoder>(handle, [](
void *handle) { CVB_CALL_CAPI(
ReleaseObject(handle)); })
40 return std::make_unique<Decoder>(
std::move(guard));
43 explicit Decoder(HandleGuard<Decoder> &&guard) noexcept
48 Decoder(
const Decoder &other) =
delete;
49 Decoder &operator=(
const Decoder &other) =
delete;
50 Decoder(Decoder &&other) =
delete;
51 Decoder &operator=(Decoder &&other) =
delete;
55 void *Handle()
const noexcept
57 return handle_.Handle();
71 CExports::CVCBCodecStatus status = CExports::CVCBCS_ReadoutRequired;
72 CVB_CALL_CAPI_CHECKED(CVCBDecoderSendPacket(Handle(), packet.Handle(), status));
85 CExports::CVCBCodecStatus status = CExports::CVCBCS_ReadoutRequired;
86 CVB_CALL_CAPI_CHECKED(CVCBDecoderSendPacket(Handle(),
nullptr, status));
99 CExports::CVCBFRAME handle =
nullptr;
100 CVB_CALL_CAPI_CHECKED(CVCBDecoderReceiveFrame(Handle(), handle));
103 HandleGuard<Frame> guard(handle);
104 return Frame::FromHandle(
std::move(guard));
117 return Property<int>(CExports::CVCBDP_StreamIndex);
122 T Property(CExports::CVCBDecoderProperty property)
const
125 size_t size =
sizeof(T);
126 CVB_CALL_CAPI_CHECKED(CVCBDecoderGetProperty(Handle(), property, &value, size));
130 HandleGuard<Decoder> handle_;
31 class Decoder final {
…};
void Flush()
Flush the decoder and finish decoding.
Definition decoder.hpp:83
CodecStatus Decode(const Packet &packet)
Decode a packet.
Definition decoder.hpp:69
int StreamIndex() const
Get the stream index this decoder can work on.
Definition decoder.hpp:115
std::unique_ptr< Frame > ReceiveFrame()
Receive an an decoded frame.
Definition decoder.hpp:97
A packet that holds encoded data frame data.
Definition packet.hpp:27
cvbbool_t ReleaseObject(OBJ &Object)
Namespace for encoding and decoding videos.
Definition codec_bridge.hpp:24
CodecStatus
Status of the encoder/decoder after sending data.
Definition codec_bridge.hpp:186
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17