Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Side by Side Diff: webrtc/video/video_send_stream_tests.cc

Issue 1328113004: Work on flexible mode and screen sharing. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Undo renaming Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after
1882 VideoSendStream::Config* send_config, 1882 VideoSendStream::Config* send_config,
1883 std::vector<VideoReceiveStream::Config>* receive_configs, 1883 std::vector<VideoReceiveStream::Config>* receive_configs,
1884 VideoEncoderConfig* encoder_config) override { 1884 VideoEncoderConfig* encoder_config) override {
1885 vp9_settings_.flexibleMode = true; 1885 vp9_settings_.flexibleMode = true;
1886 } 1886 }
1887 1887
1888 void InspectHeader(RTPVideoHeaderVP9* vp9videoHeader) override { 1888 void InspectHeader(RTPVideoHeaderVP9* vp9videoHeader) override {
1889 EXPECT_TRUE(vp9videoHeader->flexible_mode); 1889 EXPECT_TRUE(vp9videoHeader->flexible_mode);
1890 observation_complete_->Set(); 1890 observation_complete_->Set();
1891 } 1891 }
1892 } test;
1893
1894 RunBaseTest(&test);
1895 }
1896
1897 TEST_F(VideoSendStreamTest, VP9FlexModeHasPictureId) {
1898 class FlexibleMode : public VP9HeaderObeserver {
1899 void ModifyConfigsHook(
1900 VideoSendStream::Config* send_config,
1901 std::vector<VideoReceiveStream::Config>* receive_configs,
1902 VideoEncoderConfig* encoder_config) override {
1903 vp9_settings_.flexibleMode = true;
1904 }
1905
1906 void InspectHeader(RTPVideoHeaderVP9* vp9videoHeader) override {
1907 EXPECT_TRUE(vp9videoHeader->picture_id != kNoPictureId);
1908 observation_complete_->Set();
1909 }
1910 } test;
1911
1912 RunBaseTest(&test);
1913 }
1914
1915 TEST_F(VideoSendStreamTest, VP9FlexModeRefCount) {
1916 class FlexibleMode : public VP9HeaderObeserver {
1917 void ModifyConfigsHook(
1918 VideoSendStream::Config* send_config,
1919 std::vector<VideoReceiveStream::Config>* receive_configs,
1920 VideoEncoderConfig* encoder_config) override {
1921 vp9_settings_.flexibleMode = true;
1922 }
1923
1924 void InspectHeader(RTPVideoHeaderVP9* vp9videoHeader) override {
1925 EXPECT_TRUE(vp9videoHeader->flexible_mode);
1926 if (vp9videoHeader->inter_pic_predicted) {
1927 EXPECT_GT(vp9videoHeader->num_ref_pics, 0u);
1928 observation_complete_->Set();
1929 }
1930 }
1931 } test;
1932
1933 RunBaseTest(&test);
1934 }
1935
1936 TEST_F(VideoSendStreamTest, VP9FlexModeRefs) {
1937 class FlexibleMode : public VP9HeaderObeserver {
1938 void ModifyConfigsHook(
1939 VideoSendStream::Config* send_config,
1940 std::vector<VideoReceiveStream::Config>* receive_configs,
1941 VideoEncoderConfig* encoder_config) override {
1942 vp9_settings_.flexibleMode = true;
1943 }
1944
1945 void InspectHeader(RTPVideoHeaderVP9* vp9videoHeader) override {
1946 EXPECT_TRUE(vp9videoHeader->flexible_mode);
1947 if (vp9videoHeader->inter_pic_predicted) {
1948 EXPECT_GT(vp9videoHeader->num_ref_pics, 0u);
1949 observation_complete_->Set();
1950 }
1951 }
1892 1952
1893 } test; 1953 } test;
1894 1954
1895 RunBaseTest(&test); 1955 RunBaseTest(&test);
1896 } 1956 }
1897 1957
1898 } // namespace webrtc 1958 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698