4#include "codec_bridge.hpp"
5#include "../global.hpp"
6#include "../utilities/system_info.hpp"
18 inline HandleGuard<CodecBridge::OutputContainer>::HandleGuard(
void* handle) noexcept
19 : HandleGuard<CodecBridge::OutputContainer>(handle, [](
void* handle) { CVB_CALL_CAPI(ReleaseObject(handle)); })
50 return Internal::DoResCallObjectOut<OutputContainer>([&](
void*& handle)
52 return CVB_CALL_CAPI(CVCBCreateOutputContainerTyped(encoder.Handle(), fileName.c_str(), handle));
61 return std::make_unique<OutputContainer>(std::move(guard));
64 explicit OutputContainer(HandleGuard<OutputContainer>&& guard) noexcept
65 : handle_(std::move(guard))
70 OutputContainer(
const OutputContainer& other) =
delete;
71 OutputContainer& operator=(
const OutputContainer& other) =
delete;
72 OutputContainer(OutputContainer&& other) =
delete;
73 OutputContainer& operator=(OutputContainer&& other) =
delete;
75 ~OutputContainer() =
default;
77 void* Handle() const noexcept
79 return handle_.Handle();
91 CExports::CVCBPACKET handle = packet->Handle();
92 CVB_CALL_CAPI_CHECKED(CVCBOutputContainerWritePacket(Handle(), handle));
103 CVB_CALL_CAPI_CHECKED(CVCBOutputContainerWriteHeader(Handle()));
114 CVB_CALL_CAPI_CHECKED(CVCBOutputContainerWriteTrailer(Handle()));
120 HandleGuard<OutputContainer> handle_;
An encoder for video frames.
Definition: encoder.hpp:33
A container file for writing encoded videos to disk.
Definition: output_container.hpp:32
void WriteHeader()
Write a header to the container.
Definition: output_container.hpp:101
void WriteTrailer()
Write a trailer to the container.
Definition: output_container.hpp:112
void WritePacket(std::unique_ptr< Packet > &&packet)
Write a packet to the container.
Definition: output_container.hpp:89
static std::unique_ptr< OutputContainer > Create(const Cvb::String &fileName, Encoder &encoder)
Creates an output container based on a file name and an encoder.
Definition: output_container.hpp:48
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24