blob: f2812760255698139864a7b3359fa1c75307ab2a [file] [log] [blame]
ossu7bb87ee2017-01-23 12:56:251/*
2 * Copyright 2016 The WebRTC project authors. All Rights Reserved.
3 *
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
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
Mirko Bonadei92ea95e2017-09-15 04:47:3111#ifndef API_MEDIATYPES_H_
12#define API_MEDIATYPES_H_
ossu7bb87ee2017-01-23 12:56:2513
14#include <string>
15
Patrik Höglundb6b29e02018-06-21 14:58:0116// The cricket and webrtc have separate definitions for what a media type is.
17// They're not compatible. Watch out for this.
18
ossu7bb87ee2017-01-23 12:56:2519namespace cricket {
20
Yves Gerey665174f2018-06-19 13:03:0521enum MediaType { MEDIA_TYPE_AUDIO, MEDIA_TYPE_VIDEO, MEDIA_TYPE_DATA };
ossu7bb87ee2017-01-23 12:56:2522
23std::string MediaTypeToString(MediaType type);
deadbeefe814a0d2017-02-26 02:15:0924// Aborts on invalid string. Only expected to be used on strings that are
25// guaranteed to be valid, such as MediaStreamTrackInterface::kind().
26MediaType MediaTypeFromString(const std::string& type_str);
ossu7bb87ee2017-01-23 12:56:2527
28} // namespace cricket
29
Patrik Höglundb6b29e02018-06-21 14:58:0130namespace webrtc {
31
32enum class MediaType { ANY, AUDIO, VIDEO, DATA };
33
34} // namespace webrtc
35
Mirko Bonadei92ea95e2017-09-15 04:47:3136#endif // API_MEDIATYPES_H_