11#include <promeki/config.h>
12#if PROMEKI_ENABLE_PROAV
20PROMEKI_NAMESPACE_BEGIN
38 PROMEKI_SHARED_FINAL(EncodedDesc)
41 using Ptr = SharedPtr<EncodedDesc>;
44 using List = ::promeki::List<EncodedDesc>;
47 using PtrList = ::promeki::List<Ptr>;
50 EncodedDesc() =
default;
56 EncodedDesc(
const FourCC &codec) : _codec(codec) {}
63 EncodedDesc(
const FourCC &codec,
const ImageDesc &sourceImageDesc)
64 : _codec(codec), _sourceImageDesc(sourceImageDesc) {}
70 bool isValid()
const {
return _codec.value() != 0; }
76 FourCC codec()
const {
return _codec; }
82 void setCodec(
const FourCC &codec) {
91 const ImageDesc &sourceImageDesc()
const {
return _sourceImageDesc; }
97 void setSourceImageDesc(
const ImageDesc &desc) {
98 _sourceImageDesc = desc;
109 int quality()
const {
return _quality; }
115 void setQuality(
int q) {
121 const Metadata &metadata()
const {
return _metadata; }
124 Metadata &metadata() {
return _metadata; }
131 bool formatEquals(
const EncodedDesc &other)
const {
132 return _codec == other._codec && _quality == other._quality;
140 bool operator==(
const EncodedDesc &other)
const {
141 return formatEquals(other) && _metadata == other._metadata;
149 bool operator!=(
const EncodedDesc &other)
const {
return !(*
this == other); }
155 String toString()
const;
158 operator String()
const {
return toString(); }
161 FourCC _codec = FourCC(
'\0',
'\0',
'\0',
'\0');
162 ImageDesc _sourceImageDesc;
169PROMEKI_FORMAT_VIA_TOSTRING(promeki::EncodedDesc);