Fixed issue with H264 packet buffer where it was not detecting presence of sps/pps for idr frames

This issue happens for default case sps_pps_idr_is_h264_keyframe_ is false

The way PacketBuffer::FindFrames works for H264 is it keeps on skipping the packets till it finds a packet which has last=1
This is checked here : if (sequence_buffer_[index].frame_end)
Inside this block there is a loop, to go back and scan all the packets till start of the frame.
Since the scan is backwards, the sequence of nalus in this scan is IDR -> PPS -> SPS.
Once IDR is detected if (h264_header->nalus[j].type == H264::NaluType::kIdr) , the code will has_h264_idr = true.
When it scans the previous packets, it skips those as has_h264_idr is true. These packets have the SPS / PPS and hence has_h264_sps / pps flags were never set to true.
This resulted in warning as no SPS/PPS has been found for IDR.

Test plan : verified loopback call on IOS simulator using H264 codec and the warning log "Received H.264-IDR frame..." is not present anymore

Bug: webrtc:11006
Change-Id: Icbe8a393e3679a8d621af6c76e4999fd60db04a0
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/155420
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Shyam Sadhwani <shyamsadhwani@fb.com>
Cr-Commit-Position: refs/heads/master@{#29386}
1 file changed
tree: a6594d1585d7b4a7328489b6dfafa15413ce575e
  1. api/
  2. audio/
  3. build_overrides/
  4. call/
  5. common_audio/
  6. common_video/
  7. data/
  8. docs/
  9. examples/
  10. logging/
  11. media/
  12. modules/
  13. p2p/
  14. pc/
  15. resources/
  16. rtc_base/
  17. rtc_tools/
  18. sdk/
  19. stats/
  20. style-guide/
  21. system_wrappers/
  22. test/
  23. tools_webrtc/
  24. video/
  25. .clang-format
  26. .git-blame-ignore-revs
  27. .gitignore
  28. .gn
  29. .vpython
  30. abseil-in-webrtc.md
  31. AUTHORS
  32. BUILD.gn
  33. CODE_OF_CONDUCT.md
  34. codereview.settings
  35. common_types.h
  36. DEPS
  37. ENG_REVIEW_OWNERS
  38. LICENSE
  39. license_template.txt
  40. native-api.md
  41. OWNERS
  42. PATENTS
  43. PRESUBMIT.py
  44. presubmit_test.py
  45. presubmit_test_mocks.py
  46. pylintrc
  47. README.chromium
  48. README.md
  49. style-guide.md
  50. WATCHLISTS
  51. webrtc.gni
  52. whitespace.txt
README.md

WebRTC is a free, open software project that provides browsers and mobile applications with Real-Time Communications (RTC) capabilities via simple APIs. The WebRTC components have been optimized to best serve this purpose.

Our mission: To enable rich, high-quality RTC applications to be developed for the browser, mobile platforms, and IoT devices, and allow them all to communicate via a common set of protocols.

The WebRTC initiative is a project supported by Google, Mozilla and Opera, amongst others.

Development

See http://www.webrtc.org/native-code/development for instructions on how to get started developing with the native code.

Authoritative list of directories that contain the native API header files.

More info