1 /* 2 * Copyright (c) 2021-2021 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #include "foundation/utils/constants.h" 17 #include <string> 18 19 namespace OHOS { 20 namespace Media { 21 const char* const PORT_NAME_DEFAULT = "default"; 22 23 const char* const MEDIA_MIME_AUDIO_MPEG = "audio/mpeg"; 24 const char* const MEDIA_MIME_AUDIO_FLAC = "audio/flac"; 25 const char* const MEDIA_MIME_AUDIO_RAW = "audio/raw"; 26 const char* const MEDIA_MIME_AUDIO_APE = "audio/ape"; 27 const char* const MEDIA_MIME_AUDIO_WAV = "audio/wav"; 28 const char* const MEDIA_MIME_AUDIO_AAC = "audio/mp4a-latm"; 29 const char* const MEDIA_MIME_AUDIO_AAC_ADTS = "audio/aac-adts"; 30 const char* const MEDIA_MIME_AUDIO_AAC_LATM = "audio/aac-latm"; 31 const char* const MEDIA_MIME_AUDIO_VORBIS = "audio/vorbis"; 32 const char* const MEDIA_MIME_AUDIO_OPUS = "audio/opus"; 33 const char* const MEDIA_MIME_AUDIO_AC3 = "audio/ac3"; 34 const char* const MEDIA_MIME_AUDIO_EAC3 = "audio/eac3"; 35 const char* const MEDIA_MIME_AUDIO_EAC3_JOC = "audio/eac3-joc"; 36 const char* const MEDIA_MIME_AUDIO_AC4 = "audio/ac4"; 37 const char* const MEDIA_MIME_AUDIO_WMA = "audio/x-ms-wma"; 38 const char* const MEDIA_MIME_AUDIO_AMR_NB = "audio/3gpp"; 39 const char* const MEDIA_MIME_AUDIO_AMR_WB = "audio/amr-wb"; 40 const char* const MEDIA_MIME_AUDIO_AVS3DA = "audio/avs-3da"; 41 42 const char* const MEDIA_MIME_VIDEO_RAW = "video/raw"; 43 const char* const MEDIA_MIME_VIDEO_H264 = "video/avc"; 44 const char* const MEDIA_MIME_VIDEO_H265 = "video/hevc"; 45 const char* const MEDIA_MIME_VIDEO_MPEG4 = "video/mpeg4"; 46 47 const char* const MEDIA_MIME_CONTAINER_MP4 = "video/mp4"; 48 IsAudioMime(const std::string & mime)49bool IsAudioMime(const std::string& mime) 50 { 51 return mime.find("audio/") == 0; 52 } IsVideoMime(const std::string & mime)53bool IsVideoMime(const std::string& mime) 54 { 55 return mime.find("video/") == 0; 56 } 57 IsRawAudio(const std::string & mime)58bool IsRawAudio(const std::string& mime) 59 { 60 return mime == MEDIA_MIME_AUDIO_RAW; 61 } 62 } // namespace Media 63 } // namespace OHOS 64