* Remove the ReleaseDecoder and Release methods that were used in combination with deleting the decoder object. Now simply deleting the object does the right thing.
* Remove 'friend' relationship between the two classes since they don't need to touch each other's state directly anymore.
* Use std::unique_ptr for holding pointers and transferring ownership.
These changes were previously reviewed here:
https://codereview.webrtc.org/2764573002/
BUG=webrtc:7361, 695438
Review-Url: https://codereview.webrtc.org/2966823002
Cr-Commit-Position: refs/heads/master@{#18908}
I used a command like this to update the paths:
perl -pi -e "s/webrtc\/base/webrtc\/rtc_base/g" `find webrtc/rtc_base -name "*.cc" -o -name "*.h"`
The only manual edit is to add an include of webrtc/rtc_base/checks.h in
webrtc/modules/audio_device/android/opensles_common.h, which likely
was needed due to changed include paths due to 'git cl format'.
BUG=webrtc:7634
NOTRY=True
NOPRESUBMIT=True
Review-Url: https://codereview.webrtc.org/2969653002
Cr-Commit-Position: refs/heads/master@{#18871}
Timing information is gathered in EncodedImage,
starting at encoders. Then it's sent using RTP header extension. In the
end, it's gathered at the GenericDecoder. Actual reporting and tests
will be in the next CLs.
BUG=webrtc:7594
Review-Url: https://codereview.webrtc.org/2911193002
Cr-Commit-Position: refs/heads/master@{#18659}
Reason for revert:
Breaks android buildbots.
Original issue's description:
> Reland of Add content type information to encoded images and corresponding rtp extension header (patchset #1 id:1 of https://codereview.webrtc.org/2816463002/ )
>
> Reason for revert:
> Reland with appropriate changes to API to not break depending projects.
>
> Original issue's description:
> > Revert of Add content type information to encoded images and corresponding rtp extension header (patchset #31 id:600001 of https://codereview.webrtc.org/2772033002/ )
> >
> > Reason for revert:
> > Breaks dependent projects.
> >
> > Original issue's description:
> > > Add content type information to Encoded Images and add corresponding RTP extension header.
> > > Use it to separate UMA e2e delay metric between screenshare from video.
> > > Content type extension is set based on encoder settings and processed and decoders.
> > >
> > > Also,
> > > Fix full-stack-tests to calculate RTT correctly, so new metric could be tested.
> > >
> > > BUG=webrtc:7420
> > >
> > > Review-Url: https://codereview.webrtc.org/2772033002
> > > Cr-Commit-Position: refs/heads/master@{#17640}
> > > Committed: 64e739aeae
> >
> > TBR=tommi@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,nisse@webrtc.org,mflodman@webrtc.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=webrtc:7420
> >
> > Review-Url: https://codereview.webrtc.org/2816463002
> > Cr-Commit-Position: refs/heads/master@{#17644}
> > Committed: 5721866808
>
> TBR=tommi@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,nisse@webrtc.org,mflodman@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7420
>
> Review-Url: https://codereview.webrtc.org/2812913002
> Cr-Commit-Position: refs/heads/master@{#17651}
> Committed: 774f6b4b96TBR=tommi@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,nisse@webrtc.org,mflodman@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7420
Review-Url: https://codereview.webrtc.org/2809653004
Cr-Commit-Position: refs/heads/master@{#17653}
Reason for revert:
Reland with appropriate changes to API to not break depending projects.
Original issue's description:
> Revert of Add content type information to encoded images and corresponding rtp extension header (patchset #31 id:600001 of https://codereview.webrtc.org/2772033002/ )
>
> Reason for revert:
> Breaks dependent projects.
>
> Original issue's description:
> > Add content type information to Encoded Images and add corresponding RTP extension header.
> > Use it to separate UMA e2e delay metric between screenshare from video.
> > Content type extension is set based on encoder settings and processed and decoders.
> >
> > Also,
> > Fix full-stack-tests to calculate RTT correctly, so new metric could be tested.
> >
> > BUG=webrtc:7420
> >
> > Review-Url: https://codereview.webrtc.org/2772033002
> > Cr-Commit-Position: refs/heads/master@{#17640}
> > Committed: 64e739aeae
>
> TBR=tommi@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,nisse@webrtc.org,mflodman@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7420
>
> Review-Url: https://codereview.webrtc.org/2816463002
> Cr-Commit-Position: refs/heads/master@{#17644}
> Committed: 5721866808TBR=tommi@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,nisse@webrtc.org,mflodman@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7420
Review-Url: https://codereview.webrtc.org/2812913002
Cr-Commit-Position: refs/heads/master@{#17651}
Reason for revert:
Relanded by mistake.
Original issue's description:
> Reland of Add content type information to encoded images and corresponding rtp extension header (patchset #1 id:1 of https://codereview.webrtc.org/2816463002/ )
>
> Reason for revert:
> Reland with fixes which break API
>
> Original issue's description:
> > Revert of Add content type information to encoded images and corresponding rtp extension header (patchset #31 id:600001 of https://codereview.webrtc.org/2772033002/ )
> >
> > Reason for revert:
> > Breaks dependent projects.
> >
> > Original issue's description:
> > > Add content type information to Encoded Images and add corresponding RTP extension header.
> > > Use it to separate UMA e2e delay metric between screenshare from video.
> > > Content type extension is set based on encoder settings and processed and decoders.
> > >
> > > Also,
> > > Fix full-stack-tests to calculate RTT correctly, so new metric could be tested.
> > >
> > > BUG=webrtc:7420
> > >
> > > Review-Url: https://codereview.webrtc.org/2772033002
> > > Cr-Commit-Position: refs/heads/master@{#17640}
> > > Committed: 64e739aeae
> >
> > TBR=tommi@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,nisse@webrtc.org,mflodman@webrtc.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=webrtc:7420
> >
> > Review-Url: https://codereview.webrtc.org/2816463002
> > Cr-Commit-Position: refs/heads/master@{#17644}
> > Committed: 5721866808
>
> TBR=tommi@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,nisse@webrtc.org,mflodman@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7420
>
> Review-Url: https://codereview.webrtc.org/2811963002
> Cr-Commit-Position: refs/heads/master@{#17645}
> Committed: 4fa0c4f97fTBR=tommi@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,nisse@webrtc.org,mflodman@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7420
Review-Url: https://codereview.webrtc.org/2810923004
Cr-Commit-Position: refs/heads/master@{#17648}
Reason for revert:
Reland with fixes which break API
Original issue's description:
> Revert of Add content type information to encoded images and corresponding rtp extension header (patchset #31 id:600001 of https://codereview.webrtc.org/2772033002/ )
>
> Reason for revert:
> Breaks dependent projects.
>
> Original issue's description:
> > Add content type information to Encoded Images and add corresponding RTP extension header.
> > Use it to separate UMA e2e delay metric between screenshare from video.
> > Content type extension is set based on encoder settings and processed and decoders.
> >
> > Also,
> > Fix full-stack-tests to calculate RTT correctly, so new metric could be tested.
> >
> > BUG=webrtc:7420
> >
> > Review-Url: https://codereview.webrtc.org/2772033002
> > Cr-Commit-Position: refs/heads/master@{#17640}
> > Committed: 64e739aeae
>
> TBR=tommi@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,nisse@webrtc.org,mflodman@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7420
>
> Review-Url: https://codereview.webrtc.org/2816463002
> Cr-Commit-Position: refs/heads/master@{#17644}
> Committed: 5721866808TBR=tommi@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,nisse@webrtc.org,mflodman@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7420
Review-Url: https://codereview.webrtc.org/2811963002
Cr-Commit-Position: refs/heads/master@{#17645}
Reason for revert:
Breaks dependent projects.
Original issue's description:
> Add content type information to Encoded Images and add corresponding RTP extension header.
> Use it to separate UMA e2e delay metric between screenshare from video.
> Content type extension is set based on encoder settings and processed and decoders.
>
> Also,
> Fix full-stack-tests to calculate RTT correctly, so new metric could be tested.
>
> BUG=webrtc:7420
>
> Review-Url: https://codereview.webrtc.org/2772033002
> Cr-Commit-Position: refs/heads/master@{#17640}
> Committed: 64e739aeaeTBR=tommi@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,nisse@webrtc.org,mflodman@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7420
Review-Url: https://codereview.webrtc.org/2816463002
Cr-Commit-Position: refs/heads/master@{#17644}
Use it to separate UMA e2e delay metric between screenshare from video.
Content type extension is set based on encoder settings and processed and decoders.
Also,
Fix full-stack-tests to calculate RTT correctly, so new metric could be tested.
BUG=webrtc:7420
Review-Url: https://codereview.webrtc.org/2772033002
Cr-Commit-Position: refs/heads/master@{#17640}
Reason for revert:
Breaks Chrome FYI Android bots.
See:
https://build.chromium.org/p/chromium.webrtc.fyi/builders/Android%20Tests%20%28dbg%29%20%28L%20Nexus9%29/builds/20418https://build.chromium.org/p/chromium.webrtc.fyi/builders/Android%20Tests%20%28dbg%29%20%28L%20Nexus6%29/builds/14724https://build.chromium.org/p/chromium.webrtc.fyi/builders/Android%20Tests%20%28dbg%29%20%28L%20Nexus5%29/builds/20133https://build.chromium.org/p/chromium.webrtc.fyi/builders/Android%20Tests%20%28dbg%29%20%28K%20Nexus5%29/builds/15111
Original issue's description:
> Deliver video frames on Android, on the decode thread.
>
> VideoCoding
> * Adding a method for polling for frames on Android only until the capture implementation takes care of this (longer term plan).
>
> CodecDatabase
> * Add an accessor for the current decoder
> * Use std::unique_ptr<> for ownership.
> * Remove "Release()" and "ReleaseDecoder()". Instead just delete.
> * Remove |friend| relationship between CodecDatabase and VCMGenericDecoder.
>
> VCMDecodedFrameCallback
> * DCHECKs for thread correctness.
> * Remove |lock_| now that a threading model has been established and verified.
>
> VCMGenericDecoder
> * All methods now have thread checks.
> * Variable access associated with thread checkers.
>
> VideoReceiver
> * Added two notification methods, DecoderThreadStarting() and DecoderThreadStopped()
> * Allows us to establish a period when the decoder thread is not running and it is safe to modify variables such as callbacks, that are only read when the decoder thread is running.
> * Allows us to DCHECK thread guarantees.
> * Allows synchronizing callbacks from the module process thread and have them only active while the decoder thread is running.
> * The above, allows us to establish two modes for the thread, single-threaded-mutable and multi-threaded-const.
> * Using that knowledge, we can remove |receive_crit_| as well as locking for a number of member variables.
>
> MediaCodecVideoDecoder
> * Removed frame polling code from this class, since this is now done from the root thread function in VideoReceiveStream.
>
> VideoReceiveStream
> * On Android: Polls for decoded frames every 10ms (same interval as previously in MediaCodecVideoDecoder)
> * [Un]Registers the |video_receiver_| with the module thread only around the time the decoder thread is started/stopped.
> * Notifies the receiver of start/stop events of the decoder thread.
> * Changed the decoder thread to use the new PlatformThread callback type.
>
> BUG=webrtc:7361, 695438
>
> Review-Url: https://codereview.webrtc.org/2764573002
> Cr-Commit-Position: refs/heads/master@{#17527}
> Committed: e3aa88bbd5TBR=sakal@webrtc.org,mflodman@webrtc.org,stefan@webrtc.org,tommi@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7361, 695438
Review-Url: https://codereview.webrtc.org/2792033003
Cr-Commit-Position: refs/heads/master@{#17530}
VideoCoding
* Adding a method for polling for frames on Android only until the capture implementation takes care of this (longer term plan).
CodecDatabase
* Add an accessor for the current decoder
* Use std::unique_ptr<> for ownership.
* Remove "Release()" and "ReleaseDecoder()". Instead just delete.
* Remove |friend| relationship between CodecDatabase and VCMGenericDecoder.
VCMDecodedFrameCallback
* DCHECKs for thread correctness.
* Remove |lock_| now that a threading model has been established and verified.
VCMGenericDecoder
* All methods now have thread checks.
* Variable access associated with thread checkers.
VideoReceiver
* Added two notification methods, DecoderThreadStarting() and DecoderThreadStopped()
* Allows us to establish a period when the decoder thread is not running and it is safe to modify variables such as callbacks, that are only read when the decoder thread is running.
* Allows us to DCHECK thread guarantees.
* Allows synchronizing callbacks from the module process thread and have them only active while the decoder thread is running.
* The above, allows us to establish two modes for the thread, single-threaded-mutable and multi-threaded-const.
* Using that knowledge, we can remove |receive_crit_| as well as locking for a number of member variables.
MediaCodecVideoDecoder
* Removed frame polling code from this class, since this is now done from the root thread function in VideoReceiveStream.
VideoReceiveStream
* On Android: Polls for decoded frames every 10ms (same interval as previously in MediaCodecVideoDecoder)
* [Un]Registers the |video_receiver_| with the module thread only around the time the decoder thread is started/stopped.
* Notifies the receiver of start/stop events of the decoder thread.
* Changed the decoder thread to use the new PlatformThread callback type.
BUG=webrtc:7361, 695438
Review-Url: https://codereview.webrtc.org/2764573002
Cr-Commit-Position: refs/heads/master@{#17527}
* The _receiveCallback member of VCMDecodedFrameCallback does actually not require locking now that the threading model is slightly clearer. Documentation and checks have been added.
* UserReceiveCallback() never returns null and must always be called on the decoder thread. Checks have been added and the two test suites that were failing to set this callback, have been fixed and a new mock class added. (looks like sakal@ may have hit some issues with flaky tests there).
* Changed VcmPayloadSink to use move semantics which I suspect was the intention at the time the code was written (when we didn't have move semantics).
* Added thread checker to a couple of classes and started adding thread checks for known behavior. There's more to be done there.
* Remove the |_decoder| member variable in VideoReceiver. It is not needed and as it could be used, left us open to a race.
* TODOs added for places where we can reduce locking. I suspect that we can get away with not needing a lock around _codecDataBase in VideoReceiver once we've got a clear picture of the threading model and ensured that all adhere to it.
BUG=webrtc:7328
Review-Url: https://codereview.webrtc.org/2744013002
Cr-Commit-Position: refs/heads/master@{#17226}
This is not implemented yet in any of the decoders.
BUG=webrtc:6541
Review-Url: https://codereview.webrtc.org/2649133005
Cr-Commit-Position: refs/heads/master@{#16475}
The purpose is so that a decoder (Android) that only have a limited number of output buffers can make sure that decoding is done just before the frame is needed.
Removed unused iSupportsRenderTiming and the settings structs since it was not used.
Added VCMReceiver::FrameForDecoding unit test for the case when PreferDecodeLate is set.
Note that this does not change the current behaviour. We actually currently always decode frames late. This cl is to make sure the behaviour is kept for Android, if the default behaviour is changed.
Review URL: https://codereview.webrtc.org/1428293003
Cr-Commit-Position: refs/heads/master@{#10974}
Also doing some simplifications inside video_coding. No CHECKs added,
since they appear to have introduced breakages in downstream tests.
Overall reducing the number of potential ways a decoder could possibly
be set null. Removing deregistration of external decoders should also
give a quicker shutdown time since that may attempt to register
internal decoders.
BUG=chromium:563299
TBR=stefan@webrtc.org
Review URL: https://codereview.webrtc.org/1483423002 .
Cr-Commit-Position: refs/heads/master@{#10858}
Reason for revert:
Speculative revert since a downstream test started failing with this.
Original issue's description:
> Add _decoder CHECK to VCMGenericDecoder constructor.
>
> This should never be using a null decoder, but it looks like it's
> crashing out in the field. Adding a CHECK to see if it catches any
> interesting stack traces.
>
> Also making the _decoder pointer const to show that it should never be
> changing.
>
> BUG=chromium:563299
> R=stefan@webrtc.org
>
> Committed: a443ec1a75TBR=stefan@webrtc.org,pbos@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:563299
Review URL: https://codereview.webrtc.org/1490703002
Cr-Commit-Position: refs/heads/master@{#10851}
This should never be using a null decoder, but it looks like it's
crashing out in the field. Adding a CHECK to see if it catches any
interesting stack traces.
Also making the _decoder pointer const to show that it should never be
changing.
BUG=chromium:563299
R=stefan@webrtc.org
Review URL: https://codereview.webrtc.org/1485713002 .
Cr-Commit-Position: refs/heads/master@{#10843}
The main purpose was the interface-> include rename, but other files
were also moved, eliminating the "main" dir.
To avoid breaking downstream, the "interface" directories were copied
into a new "video_coding/include" dir. The old headers got pragma
warnings added about deprecation (a very short deprecation since I plan
to remove them as soon downstream is updated).
Other files also moved:
video_coding/main/source -> video_coding
video_coding/main/test -> video_coding/test
BUG=webrtc:5095
TESTED=Passing compile-trybots with --clobber flag:
git cl try --clobber --bot=win_compile_rel --bot=linux_compile_rel --bot=android_compile_rel --bot=mac_compile_rel --bot=ios_rel --bot=linux_gn_rel --bot=win_x64_gn_rel --bot=mac_x64_gn_rel --bot=android_gn_rel -m tryserver.webrtc
R=stefan@webrtc.org, tommi@webrtc.org
Review URL: https://codereview.webrtc.org/1417283007 .
Cr-Commit-Position: refs/heads/master@{#10694}