OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stddef.h> | 5 #include <stddef.h> |
6 #include <stdint.h> | 6 #include <stdint.h> |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1851 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_VideoOnly) { | 1851 TEST_F(PipelineIntegrationTest, ChunkDemuxerAbortRead_VideoOnly) { |
1852 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-video-only.webm", kVideoOnlyWebM, | 1852 ASSERT_TRUE(TestSeekDuringRead("bear-320x240-video-only.webm", kVideoOnlyWebM, |
1853 32768, | 1853 32768, |
1854 base::TimeDelta::FromMilliseconds(167), | 1854 base::TimeDelta::FromMilliseconds(167), |
1855 base::TimeDelta::FromMilliseconds(1668), | 1855 base::TimeDelta::FromMilliseconds(1668), |
1856 0x1C896, 65536)); | 1856 0x1C896, 65536)); |
1857 } | 1857 } |
1858 | 1858 |
1859 // Verify that Opus audio in WebM containers can be played back. | 1859 // Verify that Opus audio in WebM containers can be played back. |
1860 TEST_F(PipelineIntegrationTest, BasicPlayback_AudioOnly_Opus_WebM) { | 1860 TEST_F(PipelineIntegrationTest, BasicPlayback_AudioOnly_Opus_WebM) { |
1861 ASSERT_EQ(PIPELINE_OK, Start("bear-opus-end-trimming.webm")); | 1861 ASSERT_EQ(PIPELINE_OK, Start("bear-opus-end-trimming.webm", kClockless)); |
1862 Play(); | 1862 Play(); |
1863 ASSERT_TRUE(WaitUntilOnEnded()); | 1863 ASSERT_TRUE(WaitUntilOnEnded()); |
1864 } | 1864 } |
1865 | 1865 |
1866 // Verify that VP9 video in WebM containers can be played back. | 1866 // Verify that VP9 video in WebM containers can be played back. |
1867 TEST_F(PipelineIntegrationTest, BasicPlayback_VideoOnly_VP9_WebM) { | 1867 TEST_F(PipelineIntegrationTest, BasicPlayback_VideoOnly_VP9_WebM) { |
1868 ASSERT_EQ(PIPELINE_OK, Start("bear-vp9.webm")); | 1868 ASSERT_EQ(PIPELINE_OK, Start("bear-vp9.webm", kClockless)); |
1869 Play(); | 1869 Play(); |
1870 ASSERT_TRUE(WaitUntilOnEnded()); | 1870 ASSERT_TRUE(WaitUntilOnEnded()); |
1871 } | 1871 } |
1872 | 1872 |
1873 // Verify that VP9 video and Opus audio in the same WebM container can be played | 1873 // Verify that VP9 video and Opus audio in the same WebM container can be played |
1874 // back. | 1874 // back. |
1875 TEST_F(PipelineIntegrationTest, BasicPlayback_VP9_Opus_WebM) { | 1875 TEST_F(PipelineIntegrationTest, BasicPlayback_VP9_Opus_WebM) { |
1876 ASSERT_EQ(PIPELINE_OK, Start("bear-vp9-opus.webm")); | 1876 ASSERT_EQ(PIPELINE_OK, Start("bear-vp9-opus.webm", kClockless)); |
1877 Play(); | 1877 Play(); |
1878 ASSERT_TRUE(WaitUntilOnEnded()); | 1878 ASSERT_TRUE(WaitUntilOnEnded()); |
1879 } | 1879 } |
1880 | 1880 |
1881 // Verify that VP8 video with alpha channel can be played back. | 1881 // Verify that VP8 video with alpha channel can be played back. |
1882 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8A_WebM) { | 1882 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8A_WebM) { |
1883 ASSERT_EQ(PIPELINE_OK, Start("bear-vp8a.webm")); | 1883 ASSERT_EQ(PIPELINE_OK, Start("bear-vp8a.webm", kClockless)); |
1884 Play(); | 1884 Play(); |
1885 ASSERT_TRUE(WaitUntilOnEnded()); | 1885 ASSERT_TRUE(WaitUntilOnEnded()); |
1886 EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, PIXEL_FORMAT_YV12A); | 1886 EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, PIXEL_FORMAT_YV12A); |
1887 } | 1887 } |
1888 | 1888 |
1889 // Verify that VP8A video with odd width/height can be played back. | 1889 // Verify that VP8A video with odd width/height can be played back. |
1890 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8A_Odd_WebM) { | 1890 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8A_Odd_WebM) { |
1891 ASSERT_EQ(PIPELINE_OK, Start("bear-vp8a-odd-dimensions.webm")); | 1891 ASSERT_EQ(PIPELINE_OK, Start("bear-vp8a-odd-dimensions.webm", kClockless)); |
1892 Play(); | 1892 Play(); |
1893 ASSERT_TRUE(WaitUntilOnEnded()); | 1893 ASSERT_TRUE(WaitUntilOnEnded()); |
1894 EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, PIXEL_FORMAT_YV12A); | 1894 EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, PIXEL_FORMAT_YV12A); |
1895 } | 1895 } |
1896 | 1896 |
1897 // Verify that VP9 video with odd width/height can be played back. | 1897 // Verify that VP9 video with odd width/height can be played back. |
1898 TEST_F(PipelineIntegrationTest, BasicPlayback_VP9_Odd_WebM) { | 1898 TEST_F(PipelineIntegrationTest, BasicPlayback_VP9_Odd_WebM) { |
1899 ASSERT_EQ(PIPELINE_OK, Start("bear-vp9-odd-dimensions.webm")); | 1899 ASSERT_EQ(PIPELINE_OK, Start("bear-vp9-odd-dimensions.webm", kClockless)); |
1900 Play(); | 1900 Play(); |
1901 ASSERT_TRUE(WaitUntilOnEnded()); | 1901 ASSERT_TRUE(WaitUntilOnEnded()); |
1902 } | 1902 } |
1903 | 1903 |
| 1904 // Verify that VP9 video with alpha channel can be played back. |
| 1905 TEST_F(PipelineIntegrationTest, BasicPlayback_VP9A_WebM) { |
| 1906 ASSERT_EQ(PIPELINE_OK, Start("bear-vp9a.webm", kClockless)); |
| 1907 Play(); |
| 1908 ASSERT_TRUE(WaitUntilOnEnded()); |
| 1909 EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, PIXEL_FORMAT_YV12A); |
| 1910 } |
| 1911 |
| 1912 // Verify that VP9A video with odd width/height can be played back. |
| 1913 TEST_F(PipelineIntegrationTest, BasicPlayback_VP9A_Odd_WebM) { |
| 1914 ASSERT_EQ(PIPELINE_OK, Start("bear-vp9a-odd-dimensions.webm", kClockless)); |
| 1915 Play(); |
| 1916 ASSERT_TRUE(WaitUntilOnEnded()); |
| 1917 EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, PIXEL_FORMAT_YV12A); |
| 1918 } |
| 1919 |
1904 #if !defined(DISABLE_TEXT_TRACK_TESTS) | 1920 #if !defined(DISABLE_TEXT_TRACK_TESTS) |
1905 // Verify that VP8 video with inband text track can be played back. | 1921 // Verify that VP8 video with inband text track can be played back. |
1906 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8_WebVTT_WebM) { | 1922 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8_WebVTT_WebM) { |
1907 EXPECT_CALL(*this, OnAddTextTrack(_, _)); | 1923 EXPECT_CALL(*this, OnAddTextTrack(_, _)); |
1908 ASSERT_EQ(PIPELINE_OK, Start("bear-vp8-webvtt.webm")); | 1924 ASSERT_EQ(PIPELINE_OK, Start("bear-vp8-webvtt.webm")); |
1909 Play(); | 1925 Play(); |
1910 ASSERT_TRUE(WaitUntilOnEnded()); | 1926 ASSERT_TRUE(WaitUntilOnEnded()); |
1911 } | 1927 } |
1912 #endif // !defined(DISABLE_TEXT_TRACK_TESTS) | 1928 #endif // !defined(DISABLE_TEXT_TRACK_TESTS) |
1913 | 1929 |
1914 // Verify that VP9 video with 4:4:4 subsampling can be played back. | 1930 // Verify that VP9 video with 4:4:4 subsampling can be played back. |
1915 TEST_F(PipelineIntegrationTest, P444_VP9_WebM) { | 1931 TEST_F(PipelineIntegrationTest, P444_VP9_WebM) { |
1916 ASSERT_EQ(PIPELINE_OK, Start("bear-320x240-P444.webm")); | 1932 ASSERT_EQ(PIPELINE_OK, Start("bear-320x240-P444.webm", kClockless)); |
1917 Play(); | 1933 Play(); |
1918 ASSERT_TRUE(WaitUntilOnEnded()); | 1934 ASSERT_TRUE(WaitUntilOnEnded()); |
1919 EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, PIXEL_FORMAT_YV24); | 1935 EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, PIXEL_FORMAT_YV24); |
1920 } | 1936 } |
1921 | 1937 |
1922 // Verify that frames of VP9 video in the BT.709 color space have the YV12HD | 1938 // Verify that frames of VP9 video in the BT.709 color space have the YV12HD |
1923 // format. | 1939 // format. |
1924 TEST_F(PipelineIntegrationTest, BT709_VP9_WebM) { | 1940 TEST_F(PipelineIntegrationTest, BT709_VP9_WebM) { |
1925 ASSERT_EQ(PIPELINE_OK, Start("bear-vp9-bt709.webm")); | 1941 ASSERT_EQ(PIPELINE_OK, Start("bear-vp9-bt709.webm", kClockless)); |
1926 Play(); | 1942 Play(); |
1927 ASSERT_TRUE(WaitUntilOnEnded()); | 1943 ASSERT_TRUE(WaitUntilOnEnded()); |
1928 EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, PIXEL_FORMAT_YV12); | 1944 EXPECT_VIDEO_FORMAT_EQ(last_video_frame_format_, PIXEL_FORMAT_YV12); |
1929 EXPECT_COLOR_SPACE_EQ(last_video_frame_color_space_, COLOR_SPACE_HD_REC709); | 1945 EXPECT_COLOR_SPACE_EQ(last_video_frame_color_space_, COLOR_SPACE_HD_REC709); |
1930 } | 1946 } |
1931 | 1947 |
1932 // Verify that videos with an odd frame size playback successfully. | 1948 // Verify that videos with an odd frame size playback successfully. |
1933 TEST_F(PipelineIntegrationTest, BasicPlayback_OddVideoSize) { | 1949 TEST_F(PipelineIntegrationTest, BasicPlayback_OddVideoSize) { |
1934 ASSERT_EQ(PIPELINE_OK, Start("butterfly-853x480.webm")); | 1950 ASSERT_EQ(PIPELINE_OK, Start("butterfly-853x480.webm", kClockless)); |
1935 Play(); | 1951 Play(); |
1936 ASSERT_TRUE(WaitUntilOnEnded()); | 1952 ASSERT_TRUE(WaitUntilOnEnded()); |
1937 } | 1953 } |
1938 | 1954 |
1939 // Verify that OPUS audio in a webm which reports a 44.1kHz sample rate plays | 1955 // Verify that OPUS audio in a webm which reports a 44.1kHz sample rate plays |
1940 // correctly at 48kHz | 1956 // correctly at 48kHz |
1941 TEST_F(PipelineIntegrationTest, BasicPlayback_Opus441kHz) { | 1957 TEST_F(PipelineIntegrationTest, BasicPlayback_Opus441kHz) { |
1942 ASSERT_EQ(PIPELINE_OK, Start("sfx-opus-441.webm")); | 1958 ASSERT_EQ(PIPELINE_OK, Start("sfx-opus-441.webm")); |
1943 Play(); | 1959 Play(); |
1944 ASSERT_TRUE(WaitUntilOnEnded()); | 1960 ASSERT_TRUE(WaitUntilOnEnded()); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2004 | 2020 |
2005 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { | 2021 TEST_F(PipelineIntegrationTest, BasicPlaybackPositiveStartTime) { |
2006 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); | 2022 ASSERT_EQ(PIPELINE_OK, Start("nonzero-start-time.webm")); |
2007 Play(); | 2023 Play(); |
2008 ASSERT_TRUE(WaitUntilOnEnded()); | 2024 ASSERT_TRUE(WaitUntilOnEnded()); |
2009 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), | 2025 ASSERT_EQ(base::TimeDelta::FromMicroseconds(396000), |
2010 demuxer_->GetStartTime()); | 2026 demuxer_->GetStartTime()); |
2011 } | 2027 } |
2012 | 2028 |
2013 } // namespace media | 2029 } // namespace media |
OLD | NEW |