| 155 | } // namespace |
| 156 | |
| 157 | AVPixFmtDescriptorWrapper::AVPixFmtDescriptorWrapper(AVPixFmtDescriptor *descriptor, |
| 158 | LibraryVersion libVer) |
| 159 | { |
| 160 | if (libVer.avutil.major == 54) |
| 161 | { |
| 162 | auto p = reinterpret_cast<AVPixFmtDescriptor_54 *>(descriptor); |
| 163 | this->name = QString(p->name); |
| 164 | this->nb_components = p->nb_components; |
| 165 | this->log2_chroma_w = p->log2_chroma_w; |
| 166 | this->log2_chroma_h = p->log2_chroma_h; |
| 167 | this->flags = parseFlags(p->flags); |
| 168 | |
| 169 | for (unsigned i = 0; i < 4; i++) |
| 170 | { |
| 171 | this->comp[i].plane = p->comp[i].plane; |
| 172 | this->comp[i].step = p->comp[i].step_minus1 + 1; |
| 173 | this->comp[i].offset = p->comp[i].offset_plus1 - 1; |
| 174 | this->comp[i].shift = p->comp[i].shift; |
| 175 | this->comp[i].depth = p->comp[i].depth_minus1 + 1; |
| 176 | } |
| 177 | |
| 178 | aliases = QString(p->alias); |
| 179 | } |
| 180 | else if (libVer.avutil.major == 55) |
| 181 | { |
| 182 | auto p = reinterpret_cast<AVPixFmtDescriptor_55 *>(descriptor); |
| 183 | this->name = QString(p->name); |
| 184 | this->nb_components = p->nb_components; |
| 185 | this->log2_chroma_w = p->log2_chroma_w; |
| 186 | this->log2_chroma_h = p->log2_chroma_h; |
| 187 | this->flags = parseFlags(p->flags); |
| 188 | |
| 189 | for (unsigned i = 0; i < 4; i++) |
| 190 | { |
| 191 | this->comp[i].plane = p->comp[i].plane; |
| 192 | this->comp[i].step = p->comp[i].step; |
| 193 | this->comp[i].offset = p->comp[i].offset; |
| 194 | this->comp[i].shift = p->comp[i].shift; |
| 195 | this->comp[i].depth = p->comp[i].depth; |
| 196 | } |
| 197 | |
| 198 | aliases = QString(p->alias); |
| 199 | } |
| 200 | else if (libVer.avutil.major == 56) |
| 201 | { |
| 202 | auto p = reinterpret_cast<AVPixFmtDescriptor_56 *>(descriptor); |
| 203 | this->name = QString(p->name); |
| 204 | this->nb_components = p->nb_components; |
| 205 | this->log2_chroma_w = p->log2_chroma_w; |
| 206 | this->log2_chroma_h = p->log2_chroma_h; |
| 207 | this->flags = parseFlags(p->flags); |
| 208 | |
| 209 | for (unsigned i = 0; i < 4; i++) |
| 210 | { |
| 211 | this->comp[i].plane = p->comp[i].plane; |
| 212 | this->comp[i].step = p->comp[i].step; |
| 213 | this->comp[i].offset = p->comp[i].offset; |
| 214 | this->comp[i].shift = p->comp[i].shift; |
nothing calls this directly
no test coverage detected