blob: 6bc693860d38a37881e1b53926b16c289b1bba6b [file] [log] [blame]
ossu7bb87ee2017-01-23 04:56:25 -08001/*
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
Steve Anton10542f22019-01-11 09:11:00 -080011#include "api/media_types.h"
deadbeefe814a0d2017-02-25 18:15:09 -080012
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020013#include "rtc_base/checks.h"
ossu7bb87ee2017-01-23 04:56:25 -080014
15namespace cricket {
16
Niels Möller6dcd4dc2019-08-26 10:45:28 +020017const char kMediaTypeVideo[] = "video";
18const char kMediaTypeAudio[] = "audio";
19const char kMediaTypeData[] = "data";
20
ossu7bb87ee2017-01-23 04:56:25 -080021std::string MediaTypeToString(MediaType type) {
ossu7bb87ee2017-01-23 04:56:25 -080022 switch (type) {
23 case MEDIA_TYPE_AUDIO:
Niels Möller6dcd4dc2019-08-26 10:45:28 +020024 return kMediaTypeAudio;
ossu7bb87ee2017-01-23 04:56:25 -080025 case MEDIA_TYPE_VIDEO:
Niels Möller6dcd4dc2019-08-26 10:45:28 +020026 return kMediaTypeVideo;
ossu7bb87ee2017-01-23 04:56:25 -080027 case MEDIA_TYPE_DATA:
deadbeefe814a0d2017-02-25 18:15:09 -080028 return kMediaTypeData;
ossu7bb87ee2017-01-23 04:56:25 -080029 }
deadbeefe814a0d2017-02-25 18:15:09 -080030 FATAL();
deadbeef3c8771e2017-02-28 18:30:35 -080031 // Not reachable; avoids compile warning.
32 return "";
deadbeefe814a0d2017-02-25 18:15:09 -080033}
34
ossu7bb87ee2017-01-23 04:56:25 -080035} // namespace cricket