blob: c7635b52decc72833186611706457babae04db6f [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
Steve Anton10542f22019-01-11 17:11:0011#include "api/media_types.h"
deadbeefe814a0d2017-02-26 02:15:0912
Mirko Bonadei92ea95e2017-09-15 04:47:3113#include "rtc_base/checks.h"
ossu7bb87ee2017-01-23 12:56:2514
15namespace cricket {
16
Niels Möller6dcd4dc2019-08-26 08:45:2817const char kMediaTypeVideo[] = "video";
18const char kMediaTypeAudio[] = "audio";
19const char kMediaTypeData[] = "data";
20
ossu7bb87ee2017-01-23 12:56:2521std::string MediaTypeToString(MediaType type) {
ossu7bb87ee2017-01-23 12:56:2522 switch (type) {
23 case MEDIA_TYPE_AUDIO:
Niels Möller6dcd4dc2019-08-26 08:45:2824 return kMediaTypeAudio;
ossu7bb87ee2017-01-23 12:56:2525 case MEDIA_TYPE_VIDEO:
Niels Möller6dcd4dc2019-08-26 08:45:2826 return kMediaTypeVideo;
ossu7bb87ee2017-01-23 12:56:2527 case MEDIA_TYPE_DATA:
deadbeefe814a0d2017-02-26 02:15:0928 return kMediaTypeData;
Philipp Hancke4e8c1152020-10-13 10:43:1529 case MEDIA_TYPE_UNSUPPORTED:
30 // Unsupported media stores the m=<mediatype> differently.
31 RTC_NOTREACHED();
32 return "";
ossu7bb87ee2017-01-23 12:56:2533 }
deadbeefe814a0d2017-02-26 02:15:0934 FATAL();
deadbeef3c8771e2017-03-01 02:30:3535 // Not reachable; avoids compile warning.
36 return "";
deadbeefe814a0d2017-02-26 02:15:0937}
38
ossu7bb87ee2017-01-23 12:56:2539} // namespace cricket