| 497 | } |
| 498 | |
| 499 | void Close() { |
| 500 | if (codec_context_) { |
| 501 | avcodec_free_context(&codec_context_); |
| 502 | codec_context_ = nullptr; |
| 503 | } |
| 504 | if (format_context_) { |
| 505 | avformat_close_input(&format_context_); |
| 506 | format_context_ = nullptr; |
| 507 | } |
| 508 | if (hw_device_context_) { |
| 509 | av_buffer_unref(&hw_device_context_); |
| 510 | } |
| 511 | draining_ = false; |
| 512 | video_stream_index_ = -1; |
| 513 | stream_ = nullptr; |
| 514 | } |
| 515 | |
| 516 | double Fps() const { |
| 517 | const AVRational avg = stream_->avg_frame_rate.num > 0 ? stream_->avg_frame_rate : stream_->r_frame_rate; |
no outgoing calls
no test coverage detected