| 213 | } |
| 214 | |
| 215 | FramesDecoderBase::FramesDecoderBase(const std::string &filename, DALIImageType image_type) { |
| 216 | av_log_set_level(AV_LOG_ERROR); |
| 217 | filename_ = filename; |
| 218 | DALI_ENFORCE(image_type == DALI_YCbCr || image_type == DALI_RGB, |
| 219 | make_string("Invalid image type: ", image_type)); |
| 220 | image_type_ = image_type; |
| 221 | int ret = OpenFile(filename); |
| 222 | if (ret < 0) { |
| 223 | DALI_WARN(make_string("Failed to open video file \"", Filename(), "\", due to ", |
| 224 | av_error_string(ret))); |
| 225 | return; |
| 226 | } |
| 227 | |
| 228 | packet_.reset(av_packet_alloc()); |
| 229 | DALI_ENFORCE(packet_, "Could not allocate av packet"); |
| 230 | |
| 231 | is_valid_ = true; |
| 232 | can_seek_ = true; |
| 233 | next_frame_idx_ = 0; |
| 234 | } |
| 235 | |
| 236 | FramesDecoderBase::FramesDecoderBase(const char *memory_file, size_t memory_file_size, std::string_view source_info, DALIImageType image_type) { |
| 237 | av_log_set_level(AV_LOG_ERROR); |
nothing calls this directly
no test coverage detected