xref: /aosp_15_r20/external/webrtc/api/media_types.cc (revision d9f758449e529ab9291ac668be2861e7a55c2422)
1 /*
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 
11 #include "api/media_types.h"
12 
13 #include "rtc_base/checks.h"
14 
15 namespace cricket {
16 
17 const char kMediaTypeVideo[] = "video";
18 const char kMediaTypeAudio[] = "audio";
19 const char kMediaTypeData[] = "data";
20 
MediaTypeToString(MediaType type)21 std::string MediaTypeToString(MediaType type) {
22   switch (type) {
23     case MEDIA_TYPE_AUDIO:
24       return kMediaTypeAudio;
25     case MEDIA_TYPE_VIDEO:
26       return kMediaTypeVideo;
27     case MEDIA_TYPE_DATA:
28       return kMediaTypeData;
29     case MEDIA_TYPE_UNSUPPORTED:
30       // Unsupported media stores the m=<mediatype> differently.
31       RTC_DCHECK_NOTREACHED();
32       return "";
33   }
34   RTC_CHECK_NOTREACHED();
35 }
36 
37 }  // namespace cricket
38