OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 | 10 |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 int w, | 195 int w, |
196 int h); | 196 int h); |
197 | 197 |
198 // Dumps the ARGB image out to a file, for visual inspection. | 198 // Dumps the ARGB image out to a file, for visual inspection. |
199 // ffplay tool can be used to view dump files. | 199 // ffplay tool can be used to view dump files. |
200 void DumpPlanarArgbTestImage(const std::string& prefix, | 200 void DumpPlanarArgbTestImage(const std::string& prefix, |
201 const uint8_t* img, | 201 const uint8_t* img, |
202 int w, | 202 int w, |
203 int h); | 203 int h); |
204 | 204 |
205 // Compare two I420 frames. | |
206 bool VideoFrameEqual(const VideoFrame* frame0, const VideoFrame* frame1); | |
207 | |
208 // Checks whether |codecs| contains |codec|; checks using Codec::Matches(). | 205 // Checks whether |codecs| contains |codec|; checks using Codec::Matches(). |
209 template <class C> | 206 template <class C> |
210 bool ContainsMatchingCodec(const std::vector<C>& codecs, const C& codec) { | 207 bool ContainsMatchingCodec(const std::vector<C>& codecs, const C& codec) { |
211 typename std::vector<C>::const_iterator it; | 208 typename std::vector<C>::const_iterator it; |
212 for (it = codecs.begin(); it != codecs.end(); ++it) { | 209 for (it = codecs.begin(); it != codecs.end(); ++it) { |
213 if (it->Matches(codec)) { | 210 if (it->Matches(codec)) { |
214 return true; | 211 return true; |
215 } | 212 } |
216 } | 213 } |
217 return false; | 214 return false; |
218 } | 215 } |
219 | 216 |
220 // Create Simulcast StreamParams with given |ssrcs| and |cname|. | 217 // Create Simulcast StreamParams with given |ssrcs| and |cname|. |
221 cricket::StreamParams CreateSimStreamParams(const std::string& cname, | 218 cricket::StreamParams CreateSimStreamParams(const std::string& cname, |
222 const std::vector<uint32_t>& ssrcs); | 219 const std::vector<uint32_t>& ssrcs); |
223 // Create Simulcast stream with given |ssrcs| and |rtx_ssrcs|. | 220 // Create Simulcast stream with given |ssrcs| and |rtx_ssrcs|. |
224 // The number of |rtx_ssrcs| must match number of |ssrcs|. | 221 // The number of |rtx_ssrcs| must match number of |ssrcs|. |
225 cricket::StreamParams CreateSimWithRtxStreamParams( | 222 cricket::StreamParams CreateSimWithRtxStreamParams( |
226 const std::string& cname, | 223 const std::string& cname, |
227 const std::vector<uint32_t>& ssrcs, | 224 const std::vector<uint32_t>& ssrcs, |
228 const std::vector<uint32_t>& rtx_ssrcs); | 225 const std::vector<uint32_t>& rtx_ssrcs); |
229 | 226 |
230 } // namespace cricket | 227 } // namespace cricket |
231 | 228 |
232 #endif // WEBRTC_MEDIA_BASE_TESTUTILS_H_ | 229 #endif // WEBRTC_MEDIA_BASE_TESTUTILS_H_ |
OLD | NEW |