OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "media/base/android/media_codec_bridge.h" | 10 #include "media/base/android/media_codec_bridge.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 0x8a, 0xb3, 0x52, 0xd1, 0x3d, 0x79, 0x81, 0x4d, 0x31, 0x24, 0xf9, 0x38, | 87 0x8a, 0xb3, 0x52, 0xd1, 0x3d, 0x79, 0x81, 0x4d, 0x31, 0x24, 0xf9, 0x38, |
88 0x96, 0xbc, 0xf4, 0x8c, 0x25, 0xe9, 0xf2, 0x73, 0x94, 0x85, 0xc2, 0x61, | 88 0x96, 0xbc, 0xf4, 0x8c, 0x25, 0xe9, 0xf2, 0x73, 0x94, 0x85, 0xc2, 0x61, |
89 0x6a, 0x34, 0x68, 0x65, 0x78, 0x87, 0xa6, 0x4f | 89 0x6a, 0x34, 0x68, 0x65, 0x78, 0x87, 0xa6, 0x4f |
90 }; | 90 }; |
91 | 91 |
92 } // namespace | 92 } // namespace |
93 | 93 |
94 namespace media { | 94 namespace media { |
95 | 95 |
96 // Helper macro to skip the test if MediaCodecBridge isn't available. | 96 // Helper macro to skip the test if MediaCodecBridge isn't available. |
97 #define SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE() \ | 97 #define SKIP_TEST_IF_MEDIA_CODEC_BRIDGE_IS_NOT_AVAILABLE() \ |
98 do { \ | 98 do { \ |
99 if (!MediaCodecBridge::IsAvailable()) { \ | 99 if (!MediaCodecBridge::IsAvailable()) { \ |
100 LOG(INFO) << "Could not run test - not supported on device."; \ | 100 VLOG(0) << "Could not run test - not supported on device."; \ |
101 return; \ | 101 return; \ |
102 } \ | 102 } \ |
103 } while (0) \ | 103 } while (0) |
104 | 104 |
105 static const int kPresentationTimeBase = 100; | 105 static const int kPresentationTimeBase = 100; |
106 | 106 |
107 static inline const base::TimeDelta InfiniteTimeOut() { | 107 static inline const base::TimeDelta InfiniteTimeOut() { |
108 return base::TimeDelta::FromMicroseconds(-1); | 108 return base::TimeDelta::FromMicroseconds(-1); |
109 } | 109 } |
110 | 110 |
111 void DecodeMediaFrame( | 111 void DecodeMediaFrame( |
112 VideoCodecBridge* media_codec, const uint8* data, size_t data_size, | 112 VideoCodecBridge* media_codec, const uint8* data, size_t data_size, |
113 const base::TimeDelta input_presentation_timestamp, | 113 const base::TimeDelta input_presentation_timestamp, |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 base::TimeDelta::FromMicroseconds(5000000), | 265 base::TimeDelta::FromMicroseconds(5000000), |
266 base::TimeDelta::FromMicroseconds(4900000)); | 266 base::TimeDelta::FromMicroseconds(4900000)); |
267 } | 267 } |
268 | 268 |
269 TEST(MediaCodecBridgeTest, CreateUnsupportedCodec) { | 269 TEST(MediaCodecBridgeTest, CreateUnsupportedCodec) { |
270 EXPECT_EQ(NULL, AudioCodecBridge::Create(kUnknownAudioCodec)); | 270 EXPECT_EQ(NULL, AudioCodecBridge::Create(kUnknownAudioCodec)); |
271 EXPECT_EQ(NULL, VideoCodecBridge::Create(kUnknownVideoCodec, false)); | 271 EXPECT_EQ(NULL, VideoCodecBridge::Create(kUnknownVideoCodec, false)); |
272 } | 272 } |
273 | 273 |
274 } // namespace media | 274 } // namespace media |
OLD | NEW |