| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Add runtime version of ChannelLayoutConfig::FromLayout()
Bug: 483461268
Change-Id: Ib37b8e0ec24926b8eb0bba026bfc1b0f6b7a893cAdding a tiny description about how this will help reduce `{foo_layout, ChannelLayoutToChannelCount(foo_layout)}` would be helpful.
auto quad_layout = CHANNEL_LAYOUT_QUAD;Throughout, I'm not sure that using `auto foo_layout = CHANNEL_LAYOUT_FOO` is adding to the readability or maintainability.
Inlining all the layouts seems fine to me.
auto quad_layout_config = ChannelLayoutConfig::FromLayout(quad_layout);NIT: Add const throughout.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
Add runtime version of ChannelLayoutConfig::FromLayout()
Bug: 483461268
Change-Id: Ib37b8e0ec24926b8eb0bba026bfc1b0f6b7a893cAdding a tiny description about how this will help reduce `{foo_layout, ChannelLayoutToChannelCount(foo_layout)}` would be helpful.
Done
Throughout, I'm not sure that using `auto foo_layout = CHANNEL_LAYOUT_FOO` is adding to the readability or maintainability.
Inlining all the layouts seems fine to me.
Done
auto quad_layout_config = ChannelLayoutConfig::FromLayout(quad_layout);NIT: Add const throughout.
Ended up inlining the two-check layouts (e.g. quad) as well, since ChannelLayoutConfig should be cheap to make. Let me know if I should change it back (+ add const).
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
auto quad_layout_config = ChannelLayoutConfig::FromLayout(quad_layout);Syed AbuTalibNIT: Add const throughout.
Ended up inlining the two-check layouts (e.g. quad) as well, since ChannelLayoutConfig should be cheap to make. Let me know if I should change it back (+ add const).
I think the following is cleanest:
```
const auto quad_layout =
ChannelLayougConfig::FromLayout(CHANNEL_LAYOUT_QUAD);
EXPECT_EQ(CHANNEL_LAYOUT_QUAD, quad_layout.channel_layout());
EXPECT_EQ(4, quad_layout.channels());
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
auto quad_layout_config = ChannelLayoutConfig::FromLayout(quad_layout);Syed AbuTalibNIT: Add const throughout.
Thomas GuilbertEnded up inlining the two-check layouts (e.g. quad) as well, since ChannelLayoutConfig should be cheap to make. Let me know if I should change it back (+ add const).
I think the following is cleanest:
```
const auto quad_layout =
ChannelLayougConfig::FromLayout(CHANNEL_LAYOUT_QUAD);
EXPECT_EQ(CHANNEL_LAYOUT_QUAD, quad_layout.channel_layout());
EXPECT_EQ(4, quad_layout.channels());
```
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
5 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: media/base/channel_layout_unittest.cc
Insertions: 11, Deletions: 15.
@@ -162,26 +162,22 @@
EXPECT_EQ(ChannelLayoutConfig::Stereo(),
ChannelLayoutConfig::FromLayout(CHANNEL_LAYOUT_STEREO));
- EXPECT_EQ(
- CHANNEL_LAYOUT_QUAD,
- ChannelLayoutConfig::FromLayout(CHANNEL_LAYOUT_QUAD).channel_layout());
- EXPECT_EQ(4, ChannelLayoutConfig::FromLayout(CHANNEL_LAYOUT_QUAD).channels());
+ const auto quad_layout = ChannelLayoutConfig::FromLayout(CHANNEL_LAYOUT_QUAD);
+ EXPECT_EQ(CHANNEL_LAYOUT_QUAD, quad_layout.channel_layout());
+ EXPECT_EQ(4, quad_layout.channels());
EXPECT_EQ(ChannelLayoutConfig(),
ChannelLayoutConfig::FromLayout(CHANNEL_LAYOUT_NONE));
- EXPECT_EQ(CHANNEL_LAYOUT_UNSUPPORTED,
- ChannelLayoutConfig::FromLayout(CHANNEL_LAYOUT_UNSUPPORTED)
- .channel_layout());
- EXPECT_EQ(
- 0,
- ChannelLayoutConfig::FromLayout(CHANNEL_LAYOUT_UNSUPPORTED).channels());
+ const auto unsupported_layout =
+ ChannelLayoutConfig::FromLayout(CHANNEL_LAYOUT_UNSUPPORTED);
+ EXPECT_EQ(CHANNEL_LAYOUT_UNSUPPORTED, unsupported_layout.channel_layout());
+ EXPECT_EQ(0, unsupported_layout.channels());
- EXPECT_EQ(CHANNEL_LAYOUT_BITSTREAM,
- ChannelLayoutConfig::FromLayout(CHANNEL_LAYOUT_BITSTREAM)
- .channel_layout());
- EXPECT_EQ(
- 0, ChannelLayoutConfig::FromLayout(CHANNEL_LAYOUT_BITSTREAM).channels());
+ const auto bitstream_layout =
+ ChannelLayoutConfig::FromLayout(CHANNEL_LAYOUT_BITSTREAM);
+ EXPECT_EQ(CHANNEL_LAYOUT_BITSTREAM, bitstream_layout.channel_layout());
+ EXPECT_EQ(0, bitstream_layout.channels());
}
#if GTEST_HAS_DEATH_TEST
```
Add runtime version of ChannelLayoutConfig::FromLayout()
There are several cases where we create a ChannelLayoutConfig doing
`{foo_layout, ChannelLayoutToChannelCount(foo_layout)}`. Adding a
nontemplated FromLayout method will clean these cases to be a simple
call.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |