Reason for revert: Reverting again. The perf regression does not seem to be related to dropping frames. Original issue's description: > Reland of Split IncomingVideoStream into two implementations, with smoothing and without. > > Original issue's description: > > Split IncomingVideoStream into two implementations, with smoothing and without. > > This CL fixes an issue with the non-smoothing implementation where frames were delivered on the decoder thread. No-smoothing is now done in a separate class that uses a TaskQueue. The implementation may drop frames if the renderer doesn't keep up and it doesn't block the decoder thread. > > Further work done: > > * I added TODOs and documentation for VideoReceiveStream::OnFrame, where we today grab 5 locks. > > * I removed the Start/Stop methods from the IncomingVideoStream implementations. Now, when an instance is created, it should be considered to be "running" and when it is deleted, it's "not running". This saves on resources and also reduces the amount of locking required and I could remove one critical section altogether. > > * I changed the VideoStreamDecoder class to not depend on IncomingVideoStream but rather use the generic rtc::VideoSinkInterface<VideoFrame> interface. This means that any implementation of that interface can be used and the decoder can be made to just use the 'renderer' from the config. Once we do that, we can decouple the IncomingVideoStream implementations from the decoder and VideoReceiveStream implementations and leave it up to the application for how to do smoothing. The app can choose to use the Incoming* classes or roll its own (which may be preferable since applications often have their own scheduling mechanisms). > > * The non-smoothing IncomingVideoStream implementation currently allows only 1 outstanding pending frame. If we exceed that, the current frame won't be delivered to the renderer and instead we deliver the next one (since when this happens, the renderer is falling behind). > > * The lifetime of the VideoStreamDecoder instance is now bound to Start/Stop in VideoReceiveStream and not all of the lifetime of VideoReceiveStream. > > * Fixed VideoStreamDecoder to unregister callbacks in the dtor that were registered in the ctor. (this was open to a use-after-free regression) > > * Delay and callback pointers are now passed via the ctors to the IncomingVideoStream classes. The thread primitives in the IncomingVideoStream classes are also constructed/destructed at the same time as the owning object, which allowed me to remove one more lock. > > * Removed code in the VideoStreamDecoder that could overwrite the VideoReceiveStream render delay with a fixed value of 10ms on construction. This wasn't a problem with the previous implementation (it would be now though) but seemed to me like the wrong place to be setting that value. > > * Made the render delay value in VideoRenderFrames, const. > > BUG=chromium:620232 > TBR=mflodman > > Committed: https://crrev.com/e03f8787377bbc03a4e00184bb14b7561b108cbb > Cr-Commit-Position: refs/heads/master@{#13175} TBR=mflodman@webrtc.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=chromium:620232 Review-Url: https://codereview.webrtc.org/2071093002 Cr-Commit-Position: refs/heads/master@{#13176}
101 lines
2.9 KiB
Python
101 lines
2.9 KiB
Python
# Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
|
|
#
|
|
# Use of this source code is governed by a BSD-style license
|
|
# that can be found in the LICENSE file in the root of the source
|
|
# tree. An additional intellectual property rights grant can be found
|
|
# in the file PATENTS. All contributing project authors may
|
|
# be found in the AUTHORS file in the root of the source tree.
|
|
|
|
{
|
|
'includes': ['../build/common.gypi'],
|
|
'targets': [
|
|
{
|
|
'target_name': 'common_video_unittests',
|
|
'type': '<(gtest_target_type)',
|
|
'dependencies': [
|
|
'<(webrtc_root)/common_video/common_video.gyp:common_video',
|
|
'<(DEPTH)/testing/gtest.gyp:gtest',
|
|
'<(webrtc_root)/system_wrappers/system_wrappers.gyp:system_wrappers',
|
|
'<(webrtc_root)/test/test.gyp:test_support_main',
|
|
'<(webrtc_root)/test/test.gyp:video_test_common',
|
|
],
|
|
'sources': [
|
|
'bitrate_adjuster_unittest.cc',
|
|
'h264/pps_parser_unittest.cc',
|
|
'h264/sps_parser_unittest.cc',
|
|
'h264/sps_vui_rewriter_unittest.cc',
|
|
'i420_buffer_pool_unittest.cc',
|
|
'i420_video_frame_unittest.cc',
|
|
'libyuv/libyuv_unittest.cc',
|
|
],
|
|
# Disable warnings to enable Win64 build, issue 1323.
|
|
'msvs_disabled_warnings': [
|
|
4267, # size_t to int truncation.
|
|
],
|
|
'conditions': [
|
|
['OS=="android"', {
|
|
'dependencies': [
|
|
'<(DEPTH)/testing/android/native_test.gyp:native_test_native_code',
|
|
],
|
|
}],
|
|
['OS=="ios"', {
|
|
'mac_bundle_resources': [
|
|
'<(DEPTH)/resources/foreman_cif.yuv',
|
|
],
|
|
}],
|
|
],
|
|
},
|
|
], # targets
|
|
'conditions': [
|
|
['OS=="android"', {
|
|
'targets': [
|
|
{
|
|
'target_name': 'common_video_unittests_apk_target',
|
|
'type': 'none',
|
|
'dependencies': [
|
|
'<(android_tests_path):common_video_unittests_apk',
|
|
],
|
|
},
|
|
],
|
|
'conditions': [
|
|
['test_isolation_mode != "noop"',
|
|
{
|
|
'targets': [
|
|
{
|
|
'target_name': 'common_video_unittests_apk_run',
|
|
'type': 'none',
|
|
'dependencies': [
|
|
'<(android_tests_path):common_video_unittests_apk',
|
|
],
|
|
'includes': [
|
|
'../build/isolate.gypi',
|
|
],
|
|
'sources': [
|
|
'common_video_unittests_apk.isolate',
|
|
],
|
|
},
|
|
],
|
|
},
|
|
],
|
|
],
|
|
}], # OS=="android"
|
|
['test_isolation_mode != "noop"', {
|
|
'targets': [
|
|
{
|
|
'target_name': 'common_video_unittests_run',
|
|
'type': 'none',
|
|
'dependencies': [
|
|
'common_video_unittests',
|
|
],
|
|
'includes': [
|
|
'../build/isolate.gypi',
|
|
],
|
|
'sources': [
|
|
'common_video_unittests.isolate',
|
|
],
|
|
},
|
|
],
|
|
}],
|
|
],
|
|
}
|