| 392 | } |
| 393 | |
| 394 | bool FFmpegVersionHandler::openInput(AVFormatContextWrapper &fmt, QString url) |
| 395 | { |
| 396 | AVFormatContext *f_ctx = nullptr; |
| 397 | int ret = |
| 398 | this->lib.avformat.avformat_open_input(&f_ctx, url.toStdString().c_str(), nullptr, nullptr); |
| 399 | if (ret < 0) |
| 400 | { |
| 401 | this->log(QString("Error opening file (avformat_open_input). Ret code %1").arg(ret)); |
| 402 | return false; |
| 403 | } |
| 404 | if (f_ctx == nullptr) |
| 405 | { |
| 406 | this->log(QString("Error opening file (avformat_open_input). No format context returned.")); |
| 407 | return false; |
| 408 | } |
| 409 | |
| 410 | // The wrapper will take ownership of this pointer |
| 411 | fmt = AVFormatContextWrapper(f_ctx, libVersion); |
| 412 | |
| 413 | ret = lib.avformat.avformat_find_stream_info(fmt.getFormatCtx(), nullptr); |
| 414 | if (ret < 0) |
| 415 | { |
| 416 | this->log(QString("Error opening file (avformat_find_stream_info). Ret code %1").arg(ret)); |
| 417 | return false; |
| 418 | } |
| 419 | |
| 420 | return true; |
| 421 | } |
| 422 | |
| 423 | AVCodecParametersWrapper FFmpegVersionHandler::allocCodecParameters() |
| 424 | { |
no test coverage detected