Preserve timestamp in Android hw encoder
Android VEA currently doesn't preserve the timestamps in the input frames, causing trouble for WebRTC. The reason is MediaCodec assumes the presentation timestamp to be monotonically-growing value. But in chromium the video capture maybe paused a while or drop some frames, so the timestamps in input frames won't be continious as expected. Then we have to generate a seperate monotonically-growing timestamp for encoding instead. Here we cache the timestamps in input frames, mapping to the generated timestamp, and read them out after encoding. Then encoder can work happily and we can preserve the input timestamps. Bug: 785407 Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel Change-Id: I594190436f18437afb937c4f0667a5b1e3019280 Reviewed-on: https://chromium-review.googlesource.com/775144 Commit-Queue: Weiyong Yao <braveyao@chromium.org> Reviewed-by:Emircan Uysaler <emircan@chromium.org> Reviewed-by:
Frank Liberato <liberato@chromium.org> Cr-Commit-Position: refs/heads/master@{#517658}
Showing
Please register or sign in to comment