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 1806 matching lines...) Loading... |
1817 | 1817 |
1818 virtual void InspectHeader(RTPVideoHeaderVP9* vp9videoHeader) = 0; | 1818 virtual void InspectHeader(RTPVideoHeaderVP9* vp9videoHeader) = 0; |
1819 | 1819 |
1820 private: | 1820 private: |
1821 const int kVp9PayloadType = 105; | 1821 const int kVp9PayloadType = 105; |
1822 | 1822 |
1823 void ModifyConfigs(VideoSendStream::Config* send_config, | 1823 void ModifyConfigs(VideoSendStream::Config* send_config, |
1824 std::vector<VideoReceiveStream::Config>* receive_configs, | 1824 std::vector<VideoReceiveStream::Config>* receive_configs, |
1825 VideoEncoderConfig* encoder_config) override { | 1825 VideoEncoderConfig* encoder_config) override { |
1826 encoder_config->encoder_specific_settings = &vp9_settings_; | 1826 encoder_config->encoder_specific_settings = &vp9_settings_; |
| 1827 encoder_config->content_type = VideoEncoderConfig::ContentType::kScreen; |
1827 send_config->encoder_settings.encoder = vp9_encoder_.get(); | 1828 send_config->encoder_settings.encoder = vp9_encoder_.get(); |
1828 send_config->encoder_settings.payload_name = "VP9"; | 1829 send_config->encoder_settings.payload_name = "VP9"; |
1829 send_config->encoder_settings.payload_type = kVp9PayloadType; | 1830 send_config->encoder_settings.payload_type = kVp9PayloadType; |
1830 ModifyConfigsHook(send_config, receive_configs, encoder_config); | 1831 ModifyConfigsHook(send_config, receive_configs, encoder_config); |
1831 } | 1832 } |
1832 | 1833 |
1833 void PerformTest() override { | 1834 void PerformTest() override { |
1834 EXPECT_EQ(kEventSignaled, Wait()) | 1835 EXPECT_EQ(kEventSignaled, Wait()) |
1835 << "Test timed out waiting for VP9 packet"; | 1836 << "Test timed out waiting for VP9 packet"; |
1836 } | 1837 } |
(...skipping 52 matching lines...) Loading... |
1889 VideoSendStream::Config* send_config, | 1890 VideoSendStream::Config* send_config, |
1890 std::vector<VideoReceiveStream::Config>* receive_configs, | 1891 std::vector<VideoReceiveStream::Config>* receive_configs, |
1891 VideoEncoderConfig* encoder_config) override { | 1892 VideoEncoderConfig* encoder_config) override { |
1892 vp9_settings_.flexibleMode = true; | 1893 vp9_settings_.flexibleMode = true; |
1893 } | 1894 } |
1894 | 1895 |
1895 void InspectHeader(RTPVideoHeaderVP9* vp9videoHeader) override { | 1896 void InspectHeader(RTPVideoHeaderVP9* vp9videoHeader) override { |
1896 EXPECT_TRUE(vp9videoHeader->flexible_mode); | 1897 EXPECT_TRUE(vp9videoHeader->flexible_mode); |
1897 observation_complete_->Set(); | 1898 observation_complete_->Set(); |
1898 } | 1899 } |
| 1900 } test; |
| 1901 |
| 1902 RunBaseTest(&test); |
| 1903 } |
| 1904 |
| 1905 TEST_F(VideoSendStreamTest, VP9FlexModeHasPictureId) { |
| 1906 class FlexibleMode : public VP9HeaderObeserver { |
| 1907 void ModifyConfigsHook( |
| 1908 VideoSendStream::Config* send_config, |
| 1909 std::vector<VideoReceiveStream::Config>* receive_configs, |
| 1910 VideoEncoderConfig* encoder_config) override { |
| 1911 vp9_settings_.flexibleMode = true; |
| 1912 } |
| 1913 |
| 1914 void InspectHeader(RTPVideoHeaderVP9* vp9videoHeader) override { |
| 1915 EXPECT_NE(vp9videoHeader->picture_id, kNoPictureId); |
| 1916 observation_complete_->Set(); |
| 1917 } |
| 1918 } test; |
| 1919 |
| 1920 RunBaseTest(&test); |
| 1921 } |
| 1922 |
| 1923 TEST_F(VideoSendStreamTest, VP9FlexModeRefCount) { |
| 1924 class FlexibleMode : public VP9HeaderObeserver { |
| 1925 void ModifyConfigsHook( |
| 1926 VideoSendStream::Config* send_config, |
| 1927 std::vector<VideoReceiveStream::Config>* receive_configs, |
| 1928 VideoEncoderConfig* encoder_config) override { |
| 1929 vp9_settings_.flexibleMode = true; |
| 1930 } |
| 1931 |
| 1932 void InspectHeader(RTPVideoHeaderVP9* vp9videoHeader) override { |
| 1933 EXPECT_TRUE(vp9videoHeader->flexible_mode); |
| 1934 if (vp9videoHeader->inter_pic_predicted) { |
| 1935 EXPECT_GT(vp9videoHeader->num_ref_pics, 0u); |
| 1936 observation_complete_->Set(); |
| 1937 } |
| 1938 } |
| 1939 } test; |
| 1940 |
| 1941 RunBaseTest(&test); |
| 1942 } |
| 1943 |
| 1944 TEST_F(VideoSendStreamTest, VP9FlexModeRefs) { |
| 1945 class FlexibleMode : public VP9HeaderObeserver { |
| 1946 void ModifyConfigsHook( |
| 1947 VideoSendStream::Config* send_config, |
| 1948 std::vector<VideoReceiveStream::Config>* receive_configs, |
| 1949 VideoEncoderConfig* encoder_config) override { |
| 1950 vp9_settings_.flexibleMode = true; |
| 1951 } |
| 1952 |
| 1953 void InspectHeader(RTPVideoHeaderVP9* vp9videoHeader) override { |
| 1954 EXPECT_TRUE(vp9videoHeader->flexible_mode); |
| 1955 if (vp9videoHeader->inter_pic_predicted) { |
| 1956 EXPECT_GT(vp9videoHeader->num_ref_pics, 0u); |
| 1957 observation_complete_->Set(); |
| 1958 } |
| 1959 } |
1899 | 1960 |
1900 } test; | 1961 } test; |
1901 | 1962 |
1902 RunBaseTest(&test); | 1963 RunBaseTest(&test); |
1903 } | 1964 } |
1904 | 1965 |
1905 } // namespace webrtc | 1966 } // namespace webrtc |
OLD | NEW |