• Home
  • Raw
  • Download

Lines Matching full:frame

48 // Max number of decoded frame info that will be saved.
51 // The time it's allowed for a frame to be late to its rendering prediction and
112 // while waiting. Continue with frame delivery. in StartWaitForNextFrameOnQueue()
113 std::unique_ptr<EncodedFrame> frame; in StartWaitForNextFrameOnQueue() local
119 frame = GetNextFrame(); in StartWaitForNextFrameOnQueue()
123 // means that the frame buffer was cleared between creation and in StartWaitForNextFrameOnQueue()
131 // Deliver frame, if any. Otherwise signal timeout. in StartWaitForNextFrameOnQueue()
132 frame_handler(std::move(frame)); in StartWaitForNextFrameOnQueue()
152 EncodedFrame* frame = frame_it->second.frame.get(); in FindNextFrame() local
154 if (keyframe_required_ && !frame->is_keyframe()) in FindNextFrame()
164 AheadOf(*last_decoded_frame_timestamp, frame->Timestamp())) { in FindNextFrame()
171 bool last_layer_completed = frame_it->second.frame->is_last_spatial_layer; in FindNextFrame()
176 if (next_frame_it == frames_.end() || !next_frame_it->second.frame) { in FindNextFrame()
180 if (next_frame_it->second.frame->Timestamp() != frame->Timestamp() || in FindNextFrame()
188 i < next_frame_it->second.frame->num_references; in FindNextFrame()
190 if (next_frame_it->second.frame->references[i] >= frame_it->first) { in FindNextFrame()
196 // If the frame has an undecoded dependency that is not within the same in FindNextFrame()
197 // temporal unit then this frame is not yet ready to be decoded. If it in FindNextFrame()
199 // is just a lower spatial frame, which is ok. in FindNextFrame()
207 last_layer_completed = next_frame_it->second.frame->is_last_spatial_layer; in FindNextFrame()
218 absl::optional<Timestamp> render_time = frame->RenderTimestamp(); in FindNextFrame()
220 render_time = timing_->RenderTime(frame->Timestamp(), now); in FindNextFrame()
221 frame->SetRenderTime(render_time->ms()); in FindNextFrame()
229 // This will cause the frame buffer to prefer high framerate rather in FindNextFrame()
253 const EncodedFrame& first_frame = *frames_to_decode_[0]->second.frame; in GetNextFrame()
269 std::unique_ptr<EncodedFrame> frame = std::move(frame_it->second.frame); in GetNextFrame() local
271 frame->SetRenderTime(render_time->ms()); in GetNextFrame()
273 superframe_delayed_by_retransmission |= frame->delayed_by_retransmission(); in GetNextFrame()
274 receive_time_ms = std::max(receive_time_ms, frame->ReceivedTime()); in GetNextFrame()
275 superframe_size += DataSize::Bytes(frame->size()); in GetNextFrame()
278 decoded_frames_history_.InsertDecoded(frame_it->first, frame->Timestamp()); in GetNextFrame()
282 frames_out.emplace_back(std::move(frame)); in GetNextFrame()
346 bool FrameBuffer::ValidReferences(const EncodedFrame& frame) const { in ValidReferences()
347 for (size_t i = 0; i < frame.num_references; ++i) { in ValidReferences()
348 if (frame.references[i] >= frame.Id()) in ValidReferences()
351 for (size_t j = i + 1; j < frame.num_references; ++j) { in ValidReferences()
352 if (frame.references[i] == frame.references[j]) in ValidReferences()
368 int64_t FrameBuffer::InsertFrame(std::unique_ptr<EncodedFrame> frame) { in InsertFrame() argument
370 RTC_DCHECK(frame); in InsertFrame()
376 if (!ValidReferences(*frame)) { in InsertFrame()
377 RTC_LOG(LS_WARNING) << "Frame " << frame->Id() in InsertFrame()
378 << " has invalid frame references, dropping frame."; in InsertFrame()
383 if (frame->is_keyframe()) { in InsertFrame()
384 RTC_LOG(LS_WARNING) << "Inserting keyframe " << frame->Id() in InsertFrame()
386 " buffer and inserting the frame."; in InsertFrame()
389 RTC_LOG(LS_WARNING) << "Frame " << frame->Id() in InsertFrame()
390 << " could not be inserted due to the frame " in InsertFrame()
391 "buffer being full, dropping frame."; in InsertFrame()
399 if (last_decoded_frame && frame->Id() <= *last_decoded_frame) { in InsertFrame()
400 if (AheadOf(frame->Timestamp(), *last_decoded_frame_timestamp) && in InsertFrame()
401 frame->is_keyframe()) { in InsertFrame()
402 // If this frame has a newer timestamp but an earlier frame id then we in InsertFrame()
403 // assume there has been a jump in the frame id due to some encoder in InsertFrame()
405 // to spec we can still continue to decode from this frame if it is a in InsertFrame()
408 << "A jump in frame id was detected, clearing buffer."; in InsertFrame()
412 RTC_LOG(LS_WARNING) << "Frame " << frame->Id() << " inserted after frame " in InsertFrame()
414 << " was handed off for decoding, dropping frame."; in InsertFrame()
419 // Test if inserting this frame would cause the order of the frames to become in InsertFrame()
421 // when the frame id make large jumps mid stream. in InsertFrame()
422 if (!frames_.empty() && frame->Id() < frames_.begin()->first && in InsertFrame()
423 frames_.rbegin()->first < frame->Id()) { in InsertFrame()
424 RTC_LOG(LS_WARNING) << "A jump in frame id was detected, clearing buffer."; in InsertFrame()
429 auto info = frames_.emplace(frame->Id(), FrameInfo()).first; in InsertFrame()
431 if (info->second.frame) { in InsertFrame()
435 if (!UpdateFrameInfoWithIncomingFrame(*frame, info)) in InsertFrame()
439 if (!frame->delayed_by_retransmission() && frame->ReceivedTime() >= 0) in InsertFrame()
440 timing_->IncomingTimestamp(frame->Timestamp(), in InsertFrame()
441 Timestamp::Millis(frame->ReceivedTime())); in InsertFrame()
443 // It can happen that a frame will be reported as fully received even if a in InsertFrame()
444 // lower spatial layer frame is missing. in InsertFrame()
445 info->second.frame = std::move(frame); in InsertFrame()
452 // Since we now have new continuous frames there might be a better frame in InsertFrame()
478 auto frame = continuous_frames.front(); in PropagateContinuity() local
481 if (!last_continuous_frame_ || *last_continuous_frame_ < frame->first) { in PropagateContinuity()
482 last_continuous_frame_ = frame->first; in PropagateContinuity()
485 // Loop through all dependent frames, and if that frame no longer has in PropagateContinuity()
486 // any unfulfilled dependencies then that frame is continuous as well. in PropagateContinuity()
487 for (size_t d = 0; d < frame->second.dependent_frames.size(); ++d) { in PropagateContinuity()
488 auto frame_ref = frames_.find(frame->second.dependent_frames[d]); in PropagateContinuity()
516 bool FrameBuffer::UpdateFrameInfoWithIncomingFrame(const EncodedFrame& frame, in UpdateFrameInfoWithIncomingFrame() argument
522 // In this function we determine how many missing dependencies this `frame` in UpdateFrameInfoWithIncomingFrame()
523 // has to become continuous/decodable. If a frame that this `frame` depend in UpdateFrameInfoWithIncomingFrame()
527 // For all other frames we will register a backwards reference to this `frame` in UpdateFrameInfoWithIncomingFrame()
537 for (size_t i = 0; i < frame.num_references; ++i) { in UpdateFrameInfoWithIncomingFrame()
538 // Does `frame` depend on a frame earlier than the last decoded one? in UpdateFrameInfoWithIncomingFrame()
539 if (last_decoded_frame && frame.references[i] <= *last_decoded_frame) { in UpdateFrameInfoWithIncomingFrame()
540 // Was that frame decoded? If not, this `frame` will never become in UpdateFrameInfoWithIncomingFrame()
542 if (!decoded_frames_history_.WasDecoded(frame.references[i])) { in UpdateFrameInfoWithIncomingFrame()
546 << "Frame " << frame.Id() in UpdateFrameInfoWithIncomingFrame()
547 << " depends on a non-decoded frame more previous than the last " in UpdateFrameInfoWithIncomingFrame()
548 "decoded frame, dropping frame."; in UpdateFrameInfoWithIncomingFrame()
554 auto ref_info = frames_.find(frame.references[i]); in UpdateFrameInfoWithIncomingFrame()
558 {frame.references[i], ref_continuous}); in UpdateFrameInfoWithIncomingFrame()
569 frames_[dep.frame_id].dependent_frames.push_back(frame.Id()); in UpdateFrameInfoWithIncomingFrame()
589 for (auto& frame : frames) { in CombineAndDeleteFrames() local
590 inlined.push_back(std::move(frame)); in CombineAndDeleteFrames()