1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- #ifndef MEDIA_BASE_TEST_UTILS_H_
- #define MEDIA_BASE_TEST_UTILS_H_
- #include <string>
- #include <vector>
- #include "media/base/media_channel.h"
- #include "media/base/video_common.h"
- #include "rtc_base/arraysize.h"
- namespace webrtc {
- class VideoFrame;
- }
- namespace cricket {
- #define I420_SIZE(w, h) (w * h + (((w + 1) / 2) * ((h + 1) / 2)) * 2)
- #define ARGB_SIZE(w, h) (w * h * 4)
- template <class T>
- inline std::vector<T> MakeVector(const T a[], size_t s) {
- return std::vector<T>(a, a + s);
- }
- #define MAKE_VECTOR(a) cricket::MakeVector(a, arraysize(a))
- template <class C>
- bool ContainsMatchingCodec(const std::vector<C>& codecs, const C& codec) {
- typename std::vector<C>::const_iterator it;
- for (it = codecs.begin(); it != codecs.end(); ++it) {
- if (it->Matches(codec)) {
- return true;
- }
- }
- return false;
- }
- cricket::StreamParams CreateSimStreamParams(const std::string& cname,
- const std::vector<uint32_t>& ssrcs);
- cricket::StreamParams CreateSimWithRtxStreamParams(
- const std::string& cname,
- const std::vector<uint32_t>& ssrcs,
- const std::vector<uint32_t>& rtx_ssrcs);
- cricket::StreamParams CreatePrimaryWithFecFrStreamParams(
- const std::string& cname,
- uint32_t primary_ssrc,
- uint32_t flexfec_ssrc);
- }
- #endif
|