| 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 #ifndef MEDIA_BASE_TEST_HELPERS_H_ | 5 #ifndef MEDIA_BASE_TEST_HELPERS_H_ |
| 6 #define MEDIA_BASE_TEST_HELPERS_H_ | 6 #define MEDIA_BASE_TEST_HELPERS_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 15 #include "base/threading/non_thread_safe.h" | 15 #include "base/threading/non_thread_safe.h" |
| 16 #include "media/base/audio_parameters.h" | 16 #include "media/base/audio_parameters.h" |
| 17 #include "media/base/channel_layout.h" | 17 #include "media/base/channel_layout.h" |
| 18 #include "media/base/media_log.h" | 18 #include "media/base/media_log.h" |
| 19 #include "media/base/pipeline_status.h" | 19 #include "media/base/pipeline_status.h" |
| 20 #include "media/base/sample_format.h" | 20 #include "media/base/sample_format.h" |
| 21 #include "media/base/video_codecs.h" |
| 21 #include "media/base/video_decoder_config.h" | 22 #include "media/base/video_decoder_config.h" |
| 22 #include "testing/gmock/include/gmock/gmock.h" | 23 #include "testing/gmock/include/gmock/gmock.h" |
| 23 #include "ui/gfx/geometry/size.h" | 24 #include "ui/gfx/geometry/size.h" |
| 24 | 25 |
| 25 namespace base { | 26 namespace base { |
| 26 class RunLoop; | 27 class RunLoop; |
| 27 class TimeDelta; | 28 class TimeDelta; |
| 28 } | 29 } |
| 29 | 30 |
| 30 namespace media { | 31 namespace media { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 DISALLOW_COPY_AND_ASSIGN(WaitableMessageLoopEvent); | 77 DISALLOW_COPY_AND_ASSIGN(WaitableMessageLoopEvent); |
| 77 }; | 78 }; |
| 78 | 79 |
| 79 // Provides pre-canned VideoDecoderConfig. These types are used for tests that | 80 // Provides pre-canned VideoDecoderConfig. These types are used for tests that |
| 80 // don't care about detailed parameters of the config. | 81 // don't care about detailed parameters of the config. |
| 81 class TestVideoConfig { | 82 class TestVideoConfig { |
| 82 public: | 83 public: |
| 83 // Returns a configuration that is invalid. | 84 // Returns a configuration that is invalid. |
| 84 static VideoDecoderConfig Invalid(); | 85 static VideoDecoderConfig Invalid(); |
| 85 | 86 |
| 86 static VideoDecoderConfig Normal(); | 87 static VideoDecoderConfig Normal(VideoCodec codec = kCodecVP8); |
| 87 static VideoDecoderConfig NormalH264(); | 88 static VideoDecoderConfig NormalH264(); |
| 88 static VideoDecoderConfig NormalEncrypted(); | 89 static VideoDecoderConfig NormalEncrypted(VideoCodec codec = kCodecVP8); |
| 89 | 90 |
| 90 // Returns a configuration that is larger in dimensions than Normal(). | 91 // Returns a configuration that is larger in dimensions than Normal(). |
| 91 static VideoDecoderConfig Large(); | 92 static VideoDecoderConfig Large(VideoCodec codec = kCodecVP8); |
| 92 static VideoDecoderConfig LargeEncrypted(); | 93 static VideoDecoderConfig LargeEncrypted(VideoCodec codec = kCodecVP8); |
| 93 | 94 |
| 94 // Returns coded size for Normal and Large config. | 95 // Returns coded size for Normal and Large config. |
| 95 static gfx::Size NormalCodedSize(); | 96 static gfx::Size NormalCodedSize(); |
| 96 static gfx::Size LargeCodedSize(); | 97 static gfx::Size LargeCodedSize(); |
| 97 | 98 |
| 98 private: | 99 private: |
| 99 DISALLOW_COPY_AND_ASSIGN(TestVideoConfig); | 100 DISALLOW_COPY_AND_ASSIGN(TestVideoConfig); |
| 100 }; | 101 }; |
| 101 | 102 |
| 102 // Provides pre-canned AudioParameters objects. | 103 // Provides pre-canned AudioParameters objects. |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 return CONTAINS_STRING( | 245 return CONTAINS_STRING( |
| 245 arg, "Audio buffer splice at PTS=" + base::IntToString(splice_time_us) + | 246 arg, "Audio buffer splice at PTS=" + base::IntToString(splice_time_us) + |
| 246 "us. Trimmed tail of overlapped buffer (PTS=" + | 247 "us. Trimmed tail of overlapped buffer (PTS=" + |
| 247 base::IntToString(overlapped_start_us) + "us) by " + | 248 base::IntToString(overlapped_start_us) + "us) by " + |
| 248 base::IntToString(trim_duration_us)); | 249 base::IntToString(trim_duration_us)); |
| 249 } | 250 } |
| 250 | 251 |
| 251 } // namespace media | 252 } // namespace media |
| 252 | 253 |
| 253 #endif // MEDIA_BASE_TEST_HELPERS_H_ | 254 #endif // MEDIA_BASE_TEST_HELPERS_H_ |
| OLD | NEW |