Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 #include <algorithm> // max | 10 #include <algorithm> // max |
| (...skipping 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1814 | 1814 |
| 1815 virtual void InspectHeader(RTPVideoHeaderVP9* vp9videoHeader) = 0; | 1815 virtual void InspectHeader(RTPVideoHeaderVP9* vp9videoHeader) = 0; |
| 1816 | 1816 |
| 1817 private: | 1817 private: |
| 1818 const int kVp9PayloadType = 105; | 1818 const int kVp9PayloadType = 105; |
| 1819 | 1819 |
| 1820 void ModifyConfigs(VideoSendStream::Config* send_config, | 1820 void ModifyConfigs(VideoSendStream::Config* send_config, |
| 1821 std::vector<VideoReceiveStream::Config>* receive_configs, | 1821 std::vector<VideoReceiveStream::Config>* receive_configs, |
| 1822 VideoEncoderConfig* encoder_config) override { | 1822 VideoEncoderConfig* encoder_config) override { |
| 1823 encoder_config->encoder_specific_settings = &vp9_settings_; | 1823 encoder_config->encoder_specific_settings = &vp9_settings_; |
| 1824 encoder_config->content_type = VideoEncoderConfig::ContentType::kScreen; | |
| 1824 send_config->encoder_settings.encoder = vp9_encoder_.get(); | 1825 send_config->encoder_settings.encoder = vp9_encoder_.get(); |
| 1825 send_config->encoder_settings.payload_name = "VP9"; | 1826 send_config->encoder_settings.payload_name = "VP9"; |
| 1826 send_config->encoder_settings.payload_type = kVp9PayloadType; | 1827 send_config->encoder_settings.payload_type = kVp9PayloadType; |
| 1827 ModifyConfigsHook(send_config, receive_configs, encoder_config); | 1828 ModifyConfigsHook(send_config, receive_configs, encoder_config); |
| 1828 } | 1829 } |
| 1829 | 1830 |
| 1830 void PerformTest() override { | 1831 void PerformTest() override { |
| 1831 EXPECT_EQ(kEventSignaled, Wait()) | 1832 EXPECT_EQ(kEventSignaled, Wait()) |
| 1832 << "Test timed out waiting for VP9 packet"; | 1833 << "Test timed out waiting for VP9 packet"; |
| 1833 } | 1834 } |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1884 VideoSendStream::Config* send_config, | 1885 VideoSendStream::Config* send_config, |
| 1885 std::vector<VideoReceiveStream::Config>* receive_configs, | 1886 std::vector<VideoReceiveStream::Config>* receive_configs, |
| 1886 VideoEncoderConfig* encoder_config) override { | 1887 VideoEncoderConfig* encoder_config) override { |
| 1887 vp9_settings_.flexibleMode = true; | 1888 vp9_settings_.flexibleMode = true; |
| 1888 } | 1889 } |
| 1889 | 1890 |
| 1890 void InspectHeader(RTPVideoHeaderVP9* vp9videoHeader) override { | 1891 void InspectHeader(RTPVideoHeaderVP9* vp9videoHeader) override { |
| 1891 EXPECT_TRUE(vp9videoHeader->flexible_mode); | 1892 EXPECT_TRUE(vp9videoHeader->flexible_mode); |
| 1892 observation_complete_->Set(); | 1893 observation_complete_->Set(); |
| 1893 } | 1894 } |
| 1895 } test; | |
| 1896 | |
| 1897 RunBaseTest(&test); | |
| 1898 } | |
| 1899 | |
| 1900 TEST_F(VideoSendStreamTest, VP9FlexModeHasPictureId) { | |
| 1901 class FlexibleMode : public VP9HeaderObeserver { | |
| 1902 void ModifyConfigsHook( | |
| 1903 VideoSendStream::Config* send_config, | |
| 1904 std::vector<VideoReceiveStream::Config>* receive_configs, | |
| 1905 VideoEncoderConfig* encoder_config) override { | |
| 1906 vp9_settings_.flexibleMode = true; | |
| 1907 } | |
| 1908 | |
| 1909 void InspectHeader(RTPVideoHeaderVP9* vp9videoHeader) override { | |
| 1910 EXPECT_TRUE(vp9videoHeader->picture_id != kNoPictureId); | |
|
sprang_webrtc
2015/09/15 15:41:22
EXPECT_NE(kNoPictureId, vp9videoHeader->picture_id
philipel
2015/09/16 09:35:54
Done.
| |
| 1911 observation_complete_->Set(); | |
| 1912 } | |
| 1913 } test; | |
| 1914 | |
| 1915 RunBaseTest(&test); | |
| 1916 } | |
| 1917 | |
| 1918 TEST_F(VideoSendStreamTest, VP9FlexModeRefCount) { | |
| 1919 class FlexibleMode : public VP9HeaderObeserver { | |
| 1920 void ModifyConfigsHook( | |
| 1921 VideoSendStream::Config* send_config, | |
| 1922 std::vector<VideoReceiveStream::Config>* receive_configs, | |
| 1923 VideoEncoderConfig* encoder_config) override { | |
| 1924 vp9_settings_.flexibleMode = true; | |
| 1925 } | |
| 1926 | |
| 1927 void InspectHeader(RTPVideoHeaderVP9* vp9videoHeader) override { | |
| 1928 EXPECT_TRUE(vp9videoHeader->flexible_mode); | |
| 1929 if (vp9videoHeader->inter_pic_predicted) { | |
| 1930 EXPECT_GT(vp9videoHeader->num_ref_pics, 0u); | |
| 1931 observation_complete_->Set(); | |
| 1932 } | |
| 1933 } | |
| 1934 } test; | |
| 1935 | |
| 1936 RunBaseTest(&test); | |
| 1937 } | |
| 1938 | |
| 1939 TEST_F(VideoSendStreamTest, VP9FlexModeRefs) { | |
| 1940 class FlexibleMode : public VP9HeaderObeserver { | |
| 1941 void ModifyConfigsHook( | |
| 1942 VideoSendStream::Config* send_config, | |
| 1943 std::vector<VideoReceiveStream::Config>* receive_configs, | |
| 1944 VideoEncoderConfig* encoder_config) override { | |
| 1945 vp9_settings_.flexibleMode = true; | |
| 1946 } | |
| 1947 | |
| 1948 void InspectHeader(RTPVideoHeaderVP9* vp9videoHeader) override { | |
| 1949 EXPECT_TRUE(vp9videoHeader->flexible_mode); | |
| 1950 if (vp9videoHeader->inter_pic_predicted) { | |
| 1951 EXPECT_GT(vp9videoHeader->num_ref_pics, 0u); | |
| 1952 observation_complete_->Set(); | |
| 1953 } | |
| 1954 } | |
| 1894 | 1955 |
| 1895 } test; | 1956 } test; |
| 1896 | 1957 |
| 1897 RunBaseTest(&test); | 1958 RunBaseTest(&test); |
| 1898 } | 1959 } |
| 1899 | 1960 |
| 1900 } // namespace webrtc | 1961 } // namespace webrtc |
| OLD | NEW |