* 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}
Make resilience configurable in video processor integration tests.
BUG=webrtc:6783
Review-Url: https://codereview.webrtc.org/2919803002
Cr-Commit-Position: refs/heads/master@{#18493}
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 getters are not used and the implementation cannot be guaranteed
to return a correct value except when called synchronously from
the decoding thread while decoding.
The methods as is imply that the implementation needs to offer some
sort of synchronization, and that's not desirable.
BUG=webrtc:7328
R=stefan@webrtc.org
Review-Url: https://codereview.webrtc.org/2741853008 .
Cr-Commit-Position: refs/heads/master@{#17233}
* 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}
Reason for revert:
Increase in encode time larger than expected.
Original issue's description:
> Turn off error resilience for VP9 if no spatial or temporal layers are configured and NACK is enabled.
>
> Error resilience is currently always enabled for VP9 which reduces quality.
>
> BUG=webrtc:6783
>
> Committed: https://crrev.com/4eb03c76fa2320534d669fda2aabf800e7a6f579
> Cr-Commit-Position: refs/heads/master@{#15390}
TBR=stefan@webrtc.org,marpan@webrtc.org,mflodman@webrtc.org,marpan@google.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6783
Review-Url: https://codereview.webrtc.org/2554403006
Cr-Commit-Position: refs/heads/master@{#15501}
Error resilience is currently always enabled for VP9 which reduces quality.
BUG=webrtc:6783
Review-Url: https://codereview.webrtc.org/2532053002
Cr-Commit-Position: refs/heads/master@{#15390}
There's no longer any need to make the two arguments have the same
signedness, so we can drop the "u" suffix on literal integer
arguments.
NOPRESUBMIT=true
BUG=webrtc:6645
Review-Url: https://codereview.webrtc.org/2535593002
Cr-Commit-Position: refs/heads/master@{#15280}
Reason for revert:
Include fix; set profile information in CreatePayloadType for video.
Original issue's description:
> Revert of Add H264 profile to webrtc::VideoCodecH264 and webrtc::VideoPayload (patchset #1 id:40001 of https://codereview.webrtc.org/2525693003/ )
>
> Reason for revert:
> The CL doesn't actually set profile information in VideoPayload.
>
> Original issue's description:
> > Add H264 profile to webrtc::VideoCodecH264 and webrtc::VideoPayload
> >
> > It's necessary to check H264 profile information as well as payload name
> > in PayloadIsCompatible in RTPPayloadRegistry.
> >
> > BUG=webrtc:6743
> >
> > Committed: https://crrev.com/bdbc4b7ef578ba1d61ceec351bc47c33da115329
> > Cr-Commit-Position: refs/heads/master@{#15248}
>
> TBR=mflodman@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6743
>
> Committed: https://crrev.com/d7e6ccbc53fc24acdcc7507a6f3a155626473d54
> Cr-Commit-Position: refs/heads/master@{#15251}
TBR=mflodman@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6743
Review-Url: https://codereview.webrtc.org/2529153002
Cr-Commit-Position: refs/heads/master@{#15252}
Reason for revert:
The CL doesn't actually set profile information in VideoPayload.
Original issue's description:
> Add H264 profile to webrtc::VideoCodecH264 and webrtc::VideoPayload
>
> It's necessary to check H264 profile information as well as payload name
> in PayloadIsCompatible in RTPPayloadRegistry.
>
> BUG=webrtc:6743
>
> Committed: https://crrev.com/bdbc4b7ef578ba1d61ceec351bc47c33da115329
> Cr-Commit-Position: refs/heads/master@{#15248}
TBR=mflodman@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6743
Review-Url: https://codereview.webrtc.org/2529143002
Cr-Commit-Position: refs/heads/master@{#15251}
It's necessary to check H264 profile information as well as payload name
in PayloadIsCompatible in RTPPayloadRegistry.
BUG=webrtc:6743
Review-Url: https://codereview.webrtc.org/2525693003
Cr-Commit-Position: refs/heads/master@{#15248}
This approach extends the H.264 specific information with
a packetization mode enum.
Status: Parameter is in code. No way to set it yet.
Rebase of CL 2009213002
BUG=600254
Review-Url: https://codereview.webrtc.org/2337453002
Cr-Commit-Position: refs/heads/master@{#15032}
The new code is only exercised in tests so far. The H264 profile-level-id
parsing is not complete, but it should be enough for our purposes for
now.
BUG=webrtc:6400,webrtc:6337
Review-Url: https://codereview.webrtc.org/2459633002
Cr-Commit-Position: refs/heads/master@{#14850}
This refactoring allows runtime checks that functions that access
codec specific information are using the correct union member.
The API also allows replacing the union with another implementation
without changes at calling sites.
BUG=webrtc:6603
Review-Url: https://codereview.webrtc.org/2001533003
Cr-Commit-Position: refs/heads/master@{#14775}
This CL deletes the old and not used video defines in
engine_configurations.h and pre-pends voice_ to indicate there are only
voice/audio defines left in the file.
BUG=none
R=solenberg@webrtc.org
Review URL: https://codereview.webrtc.org/2401673002 .
Cr-Commit-Position: refs/heads/master@{#14558}
When the target bitrate is zero, currently VideoSendStream.Stats.target_media_bitrate_bps show the last set rate before the target was set to zero.
BUG=webrtc::5687 b/29574845
Review-Url: https://codereview.webrtc.org/2122743003
Cr-Commit-Position: refs/heads/master@{#13386}
Reason for revert:
A fix is being prepared downstream so this can now go in.
Original issue's description:
> Revert of Deprecate VCMPacketizationCallback::SendData and use EncodedImageCallback instead. (patchset #5 id:80001 of https://codereview.webrtc.org/1897233002/ )
>
> Reason for revert:
> API changes broke downstream.
>
> Original issue's description:
> > Deprecate VCMPacketizationCallback::SendData and use EncodedImageCallback instead.
> > EncodedImageCallback is used by all encoder implementations and seems to be what we should try to use in the transport.
> > EncodedImageCallback can of course be cleaned up in the future.
> >
> > This moves creation of RTPVideoHeader from the GenericEncoder to the PayLoadRouter.
> >
> > BUG=webrtc::5687
> >
> > Committed: https://crrev.com/f5d55aaecdc39e9cc66eb6e87614f04afe28f6eb
> > Cr-Commit-Position: refs/heads/master@{#12436}
>
> TBR=stefan@webrtc.org,pbos@webrtc.org,perkj@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:5687
>
> Committed: https://crrev.com/a261e6136655af33f283eda8e60a6dd93dd746a4
> Cr-Commit-Position: refs/heads/master@{#12441}
TBR=stefan@webrtc.org,pbos@webrtc.org,perkj@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5687
Review URL: https://codereview.webrtc.org/1905583002
Cr-Commit-Position: refs/heads/master@{#12442}
Reason for revert:
API changes broke downstream.
Original issue's description:
> Deprecate VCMPacketizationCallback::SendData and use EncodedImageCallback instead.
> EncodedImageCallback is used by all encoder implementations and seems to be what we should try to use in the transport.
> EncodedImageCallback can of course be cleaned up in the future.
>
> This moves creation of RTPVideoHeader from the GenericEncoder to the PayLoadRouter.
>
> BUG=webrtc::5687
>
> Committed: https://crrev.com/f5d55aaecdc39e9cc66eb6e87614f04afe28f6eb
> Cr-Commit-Position: refs/heads/master@{#12436}
TBR=stefan@webrtc.org,pbos@webrtc.org,perkj@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc::5687
Review URL: https://codereview.webrtc.org/1903193002
Cr-Commit-Position: refs/heads/master@{#12441}
EncodedImageCallback is used by all encoder implementations and seems to be what we should try to use in the transport.
EncodedImageCallback can of course be cleaned up in the future.
This moves creation of RTPVideoHeader from the GenericEncoder to the PayLoadRouter.
BUG=webrtc::5687
Review URL: https://codereview.webrtc.org/1897233002
Cr-Commit-Position: refs/heads/master@{#12436}
Constructing default options is racy when initializing multiple VP8
encoders in parallel. This is only used for VP8 temporal layers. Adding
TemporalLayerFactory to VP8 codec specifics instead of generic options.
Removes the last webrtc::Config uses/includes from video code.
Also removes VideoCodec equality operators which are no longer in use.
BUG=webrtc:5410
R=stefan@webrtc.orgTBR=mflodman@webrtc.org
Review URL: https://codereview.webrtc.org/1606613003 .
Cr-Commit-Position: refs/heads/master@{#11307}
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}
Prevents double-initialization of decoders due to resolution changes
between initial database settings and first incoming frame.
BUG=webrtc:5251
R=mflodman@webrtc.org
Review URL: https://codereview.webrtc.org/1474193002 .
Cr-Commit-Position: refs/heads/master@{#10822}
Also adds a RTC_CHECK in VideoReceiveStream that verifies that decoders
aren't null, since this will attempt to deregister a codec which would
previously fail with an obscure stack trace not indicating what actually
was wrong.
BUG=webrtc:5249
R=stefan@webrtc.org
Review URL: https://codereview.webrtc.org/1479793002 .
Cr-Commit-Position: refs/heads/master@{#10821}
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}