| 349 | } |
| 350 | |
| 351 | void AVCodecParametersWrapper::update() |
| 352 | { |
| 353 | if (this->param == nullptr) |
| 354 | return; |
| 355 | |
| 356 | if (this->libVer.avformat.major == 56) |
| 357 | { |
| 358 | // This data structure does not exist in avformat major version 56. |
| 359 | this->param = nullptr; |
| 360 | } |
| 361 | else if (this->libVer.avformat.major == 57 || this->libVer.avformat.major == 58 || |
| 362 | this->libVer.avformat.major == 59 || this->libVer.avformat.major == 60) |
| 363 | { |
| 364 | auto p = reinterpret_cast<AVCodecParameters_57_58_59_60 *>(this->param); |
| 365 | |
| 366 | this->codec_type = p->codec_type; |
| 367 | this->codec_id = p->codec_id; |
| 368 | this->codec_tag = p->codec_tag; |
| 369 | this->extradata = QByteArray((const char *)p->extradata, p->extradata_size); |
| 370 | this->format = p->format; |
| 371 | this->bit_rate = p->bit_rate; |
| 372 | this->bits_per_coded_sample = p->bits_per_coded_sample; |
| 373 | this->bits_per_raw_sample = p->bits_per_raw_sample; |
| 374 | this->profile = p->profile; |
| 375 | this->level = p->level; |
| 376 | this->width = p->width; |
| 377 | this->height = p->height; |
| 378 | this->sample_aspect_ratio = p->sample_aspect_ratio; |
| 379 | this->field_order = p->field_order; |
| 380 | this->color_range = p->color_range; |
| 381 | this->color_primaries = p->color_primaries; |
| 382 | this->color_trc = p->color_trc; |
| 383 | this->color_space = p->color_space; |
| 384 | this->chroma_location = p->chroma_location; |
| 385 | this->video_delay = p->video_delay; |
| 386 | } |
| 387 | else |
| 388 | throw std::runtime_error("Invalid library version"); |
| 389 | } |
| 390 | |
| 391 | } // namespace FFmpeg |
no outgoing calls
no test coverage detected