blob: 6bc693860d38a37881e1b53926b16c289b1bba6b [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;
ossu7bb87ee2017-01-23 12:56:2529 }
deadbeefe814a0d2017-02-26 02:15:0930 FATAL();
deadbeef3c8771e2017-03-01 02:30:3531 // Not reachable; avoids compile warning.
32 return "";
deadbeefe814a0d2017-02-26 02:15:0933}
34
ossu7bb87ee2017-01-23 12:56:2535} // namespace cricket