-/** Get all frames which exist in the content at a given frame index.
- * @param frame Frame index.
- * @param accurate true to try hard to return frames at the precise time that was requested, otherwise frames nearby may be returned.
- * @return Frames; there may be none (if there is no video there), 1 for 2D or 2 for 3D.
- */
-list<ContentVideo>
-VideoDecoder::get_video (VideoFrame frame, bool accurate)
-{
- /* At this stage, if we have get_video()ed before, _decoded_video will contain the last frame that this
- method returned (and possibly a few more). If the requested frame is not in _decoded_video and it is not the next
- one after the end of _decoded_video we need to seek.
- */
-
- if (_decoded_video.empty() || frame < _decoded_video.front().frame || frame > (_decoded_video.back().frame + 1)) {
- seek (ContentTime::from_frames (frame, _video_content->video_frame_rate()), accurate);
- }
-
- list<ContentVideo> dec;
-
- /* Now enough pass() calls should either:
- * (a) give us what we want, or
- * (b) give us something after what we want, indicating that we will never get what we want, or
- * (c) hit the end of the decoder.
- */
- if (accurate) {
- /* We are being accurate, so we want the right frame.
- * This could all be one statement but it's split up for clarity.
- */
- while (true) {
- if (!decoded_video(frame).empty ()) {
- /* We got what we want */
- break;
- }
-
- if (pass ()) {
- /* The decoder has nothing more for us */
- break;
- }