|
|
Created:
4 years, 8 months ago by nisse-webrtc Modified:
4 years, 8 months ago CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com Base URL:
https://chromium.googlesource.com/external/webrtc.git@master Target Ref:
refs/pending/heads/master Project:
webrtc Visibility:
Public. |
DescriptionAdd RTCConfiguration getter and setter methods. The immediate plan is to move some flags into an embedded MediaConfig (https://codereview.webrtc.org/1818033002/), which will be possible after Chrome is updated to use these new setter methods.
BUG=webrtc:4906
R=hbos@google.com, hbos@webrtc.org, perkj@webrtc.org, pthatcher@webrtc.org
Committed: https://crrev.com/71bdda0ededda74cdd73a8309419cf626499627f
Cr-Commit-Position: refs/heads/master@{#12177}
Patch Set 1 #
Total comments: 4
Patch Set 2 : Delete getters for now. Rename setters. #Patch Set 3 : Rename set_cpu_overuse_detection --> set_cpu_adaptation, and add getter. #
Total comments: 2
Patch Set 4 : Drop enable/disable from method names. #
Total comments: 1
Patch Set 5 : Comment improvement. #Messages
Total messages: 23 (9 generated)
nisse@webrtc.org changed reviewers: + hta@webrtc.org, perkj@webrtc.org, pthatcher@webrtc.org
This cl adds getter and setter methods for the RTCConfiguration flags which really belong in a struct MediaConfig, and which are set by chrome. Since this is intended to be public interfaces (in preference over accessing attributes directly), naming is particularly important. Feedback appreciated. I'm not sure if it should be get_enable_foo or simply enable_foo(). The latter may collide, since this is still a struct and conventions of no underscore suffix on members. Also enable_foo may be read as a verb rather than a getter, which might be confusing. I also thing consistency is important, hence everything is called [gs]et_enable_*, and I'm tempted to rename suspend_below_min_bitrate -> enable_suspend_below_min_bitrate and disable_prerenderer_smoothing -> enable_prerenderer_smoothing in MediaConfig in a later cl.
https://codereview.webrtc.org/1836083003/diff/1/webrtc/api/peerconnectioninte... File webrtc/api/peerconnectioninterface.h (right): https://codereview.webrtc.org/1836083003/diff/1/webrtc/api/peerconnectioninte... webrtc/api/peerconnectioninterface.h:232: return cpu_overuse_detection.value_or(true); Use in this cl? ie- Stop using the to be private structs. Name cpu_overuse() set_cpu_overuse(bool enabled) ? ...... https://codereview.webrtc.org/1836083003/diff/1/webrtc/api/peerconnectioninte... webrtc/api/peerconnectioninterface.h:239: return suspend_below_min_bitrate.value_or(false); dito https://codereview.webrtc.org/1836083003/diff/1/webrtc/api/peerconnectioninte... webrtc/api/peerconnectioninterface.h:245: bool get_enable_prerenderer_smoothing(bool flag) { |flag| is unused
nisse@webrtc.org changed reviewers: + hbos@webrtc.org
New version. I renamed the setter methods as simply set_<name of attribute>, which seems to be what the coding standard prescribes. I deleted the getter methods, they are not immediately needed, and proper names collides with the attributes themselves. Getter methods can be added in cl https://codereview.webrtc.org/1818033002/, if desired. https://codereview.webrtc.org/1836083003/diff/1/webrtc/api/peerconnectioninte... File webrtc/api/peerconnectioninterface.h (right): https://codereview.webrtc.org/1836083003/diff/1/webrtc/api/peerconnectioninte... webrtc/api/peerconnectioninterface.h:232: return cpu_overuse_detection.value_or(true); On 2016/03/29 15:25:11, perkj_webrtc wrote: > Use in this cl? ie- Stop using the to be private structs. (Some important words seem to be missing). My intention is to land this, update chrome, and then rebase and land https://codereview.webrtc.org/1818033002/. At that point, webrtc won't really do any read accesses to these individual flags in RTCConfiguration, just pass on a pointer/reference to the MediaConfig where they are stored. And for write accesses, it's the (deprecated) code converting constraints to config values, which will be using FindConstraint or (before my changes) ConstraintToOptionalBool. Going via the setter function there is just making things unnecessarily complicated. But there are a few uses in the test cases, and there it makes sense to update to the getter and setter methods. > Name cpu_overuse() > set_cpu_overuse(bool enabled) > ? > > ...... I think just cpu_overuse is confusing. "cpu_adaptation", maybe? I would also like (in a later cl) to make the name of the MediaConfig fields a bit more consistent. There, we have an enable_ prefix on two flags, disable_ on one flag, and one flag with no prefix. So really inconsistent. Is it reasonable to have "enable_" prefixes on the variables, but not on the methods?
lgtm On 2016/03/30 08:50:24, nisse-webrtc wrote: > New version. I renamed the setter methods as simply set_<name of attribute>, > which seems to be what the coding standard prescribes. > > I deleted the getter methods, they are not immediately needed, and proper names > collides with the attributes themselves. Getter methods can be added in cl > https://codereview.webrtc.org/1818033002/, if desired. > > https://codereview.webrtc.org/1836083003/diff/1/webrtc/api/peerconnectioninte... > File webrtc/api/peerconnectioninterface.h (right): > > https://codereview.webrtc.org/1836083003/diff/1/webrtc/api/peerconnectioninte... > webrtc/api/peerconnectioninterface.h:232: return > cpu_overuse_detection.value_or(true); > On 2016/03/29 15:25:11, perkj_webrtc wrote: > > Use in this cl? ie- Stop using the to be private structs. > > (Some important words seem to be missing). My intention is to land this, update > chrome, and then rebase and land https://codereview.webrtc.org/1818033002/. At > that point, webrtc won't really do any read accesses to these individual flags > in RTCConfiguration, just pass on a pointer/reference to the MediaConfig where > they are stored. > > And for write accesses, it's the (deprecated) code converting constraints to > config values, which will be using FindConstraint or (before my changes) > ConstraintToOptionalBool. Going via the setter function there is just making > things unnecessarily complicated. > > But there are a few uses in the test cases, and there it makes sense to update > to the getter and setter methods. > > > Name cpu_overuse() > > set_cpu_overuse(bool enabled) > > ? > > > > ...... > > I think just cpu_overuse is confusing. "cpu_adaptation", maybe? cpu_adaptation sounds nice to me. > > I would also like (in a later cl) to make the name of the MediaConfig fields a > bit more consistent. There, we have an enable_ prefix on two flags, disable_ on > one flag, and one flag with no prefix. So really inconsistent. Is it reasonable > to have "enable_" prefixes on the variables, but not on the methods? I agree with being consistent. It looks like we either have nouns (servers, bundle_policy) or verbs (prioritize_most_likely_ice_candidate_pairs, disable_ipv6). I think we should fix that for cpu_overuse_detection and combined_audio_video_bwe. Those should probably be enable_cpu_adaptation and enable_combined_audio_video_bwe. As for the two "disable_"s. If we change it to enable_, we just need to be make it very clear that the default is that they are enabled.
New version. I think it is ready.
https://codereview.webrtc.org/1836083003/diff/40001/webrtc/api/peerconnection... File webrtc/api/peerconnectioninterface.h (right): https://codereview.webrtc.org/1836083003/diff/40001/webrtc/api/peerconnection... webrtc/api/peerconnectioninterface.h:232: void set_enable_dscp(bool flag) { enable_dscp = rtc::Optional<bool>(flag); } set_dscp(bool enable) https://codereview.webrtc.org/1836083003/diff/40001/webrtc/api/peerconnection... webrtc/api/peerconnectioninterface.h:250: void set_disable_prerenderer_smoothing(bool disabled) { set_prerender_smoo.... (bool enable)
Some further renames, after discussion with Per.
hbos@google.com changed reviewers: + hbos@google.com
lgtm. Can you clarify in the CL description why you're doing this, such as what you wrote in comment #5. https://codereview.webrtc.org/1836083003/diff/60001/webrtc/api/peerconnection... File webrtc/api/peerconnectioninterface.h (right): https://codereview.webrtc.org/1836083003/diff/60001/webrtc/api/peerconnection... webrtc/api/peerconnectioninterface.h:227: // by applications, chrome in particular. super-nit: chrome -> Chrome. Also, this comment makes me ask "why?" since its a struct and all members are directly accessible. If it's because of the transition to use MediaConfig so that we don't break Chrome in the meantime, or due to replacing Optional<bool> with bool, clarify that this is why. Or perhaps this comment isn't necessary?
Oops, was signed in to google account. lgtm from webrtc account.
Description was changed from ========== Add RTCConfiguration getter and setter methods. BUG=webrtc:4906 ========== to ========== Add RTCConfiguration getter and setter methods. The immediate plan is to move some flags into an embedded MediaConfig (https://codereview.webrtc.org/1818033002/), which will be possible after Chrome is updated to use these new setter methods. BUG=webrtc:4906 ==========
lgtm
The CQ bit was checked by nisse@webrtc.org
The patchset sent to the CQ was uploaded after l-g-t-m from pthatcher@webrtc.org, hbos@webrtc.org, hbos@google.com Link to the patchset: https://codereview.webrtc.org/1836083003/#ps80001 (title: "Comment improvement.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1836083003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1836083003/80001
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: android_arm64_rel on tryserver.webrtc (JOB_TIMED_OUT, no build URL)
Description was changed from ========== Add RTCConfiguration getter and setter methods. The immediate plan is to move some flags into an embedded MediaConfig (https://codereview.webrtc.org/1818033002/), which will be possible after Chrome is updated to use these new setter methods. BUG=webrtc:4906 ========== to ========== Add RTCConfiguration getter and setter methods. The immediate plan is to move some flags into an embedded MediaConfig (https://codereview.webrtc.org/1818033002/), which will be possible after Chrome is updated to use these new setter methods. BUG=webrtc:4906 R=hbos@google.com, hbos@webrtc.org, perkj@webrtc.org, pthatcher@webrtc.org Committed: https://chromium.googlesource.com/external/webrtc/+/71bdda0ededda74cdd73a8309... ==========
Message was sent while issue was closed.
Description was changed from ========== Add RTCConfiguration getter and setter methods. The immediate plan is to move some flags into an embedded MediaConfig (https://codereview.webrtc.org/1818033002/), which will be possible after Chrome is updated to use these new setter methods. BUG=webrtc:4906 R=hbos@google.com, hbos@webrtc.org, perkj@webrtc.org, pthatcher@webrtc.org Committed: https://chromium.googlesource.com/external/webrtc/+/71bdda0ededda74cdd73a8309... ========== to ========== Add RTCConfiguration getter and setter methods. The immediate plan is to move some flags into an embedded MediaConfig (https://codereview.webrtc.org/1818033002/), which will be possible after Chrome is updated to use these new setter methods. BUG=webrtc:4906 R=hbos@google.com, hbos@webrtc.org, perkj@webrtc.org, pthatcher@webrtc.org Committed: https://crrev.com/71bdda0ededda74cdd73a8309419cf626499627f Cr-Commit-Position: refs/heads/master@{#12177} ==========
Message was sent while issue was closed.
Committed patchset #5 (id:80001) manually as 71bdda0ededda74cdd73a8309419cf626499627f (presubmit successful).
Message was sent while issue was closed.
Patchset 5 (id:??) landed as https://crrev.com/71bdda0ededda74cdd73a8309419cf626499627f Cr-Commit-Position: refs/heads/master@{#12177} |