| 638 | } |
| 639 | |
| 640 | void FramesDecoderBase::DecodeFrames(uint8_t *data, span<const int> frame_ids, |
| 641 | boundary::BoundaryType boundary_type, |
| 642 | const uint8_t *constant_frame, |
| 643 | span<double> out_timestamps) { |
| 644 | LOG_LINE << "DecodeFrames: " << frame_ids.size() << " frames, boundary_type=" |
| 645 | << boundary::to_string(boundary_type) << std::endl; |
| 646 | |
| 647 | SmallVector<std::pair<int, int>, 32> sorted_frame_ids; |
| 648 | size_t num_frames = frame_ids.size(); |
| 649 | sorted_frame_ids.reserve(num_frames); |
| 650 | for (int i = 0; i < static_cast<int>(frame_ids.size()); i++) { |
| 651 | sorted_frame_ids.push_back({HandleBoundary(boundary_type, frame_ids[i], 0, NumFrames()), i}); |
| 652 | } |
| 653 | std::sort(sorted_frame_ids.begin(), sorted_frame_ids.end()); |
| 654 | DecodeFramesImpl(data, sorted_frame_ids, boundary_type, constant_frame, out_timestamps); |
| 655 | } |
| 656 | |
| 657 | |
| 658 | void FramesDecoderBase::DecodeFrames(uint8_t *data, int start_frame, int end_frame, int stride, |