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 #ifndef HISTREAMER_FOUNDATION_CONSTANTS_H
17 #define HISTREAMER_FOUNDATION_CONSTANTS_H
18 
19 #include <string>
20 
21 namespace OHOS {
22 namespace Media {
23 constexpr size_t DEFAULT_QUEUE_SIZE = 10;
24 constexpr int DEFAULT_FRAME_SIZE = 2 * 1024; // 2kb
25 constexpr size_t DEFAULT_POOL_SIZE = 10;
26 constexpr uint32_t MAX_PORT_NUMBER = 1;  // max in/out port in filter
27 constexpr uint32_t MAX_ROUTE_NUMBER = 1; // max route in filter
28 extern const char* const PORT_NAME_DEFAULT;
29 
30 // audio mime
31 extern const char* const MEDIA_MIME_AUDIO_MPEG;
32 extern const char* const MEDIA_MIME_AUDIO_FLAC;
33 extern const char* const MEDIA_MIME_AUDIO_RAW;
34 extern const char* const MEDIA_MIME_AUDIO_APE;
35 extern const char* const MEDIA_MIME_AUDIO_WAV;
36 extern const char* const MEDIA_MIME_AUDIO_AAC;
37 extern const char* const MEDIA_MIME_AUDIO_AAC_ADTS;
38 extern const char* const MEDIA_MIME_AUDIO_AAC_LATM;
39 extern const char* const MEDIA_MIME_AUDIO_VORBIS;
40 extern const char* const MEDIA_MIME_AUDIO_OPUS;
41 extern const char* const MEDIA_MIME_AUDIO_AC3;
42 extern const char* const MEDIA_MIME_AUDIO_EAC3;
43 extern const char* const MEDIA_MIME_AUDIO_EAC3_JOC;
44 extern const char* const MEDIA_MIME_AUDIO_AC4;
45 extern const char* const MEDIA_MIME_AUDIO_WMA;
46 extern const char* const MEDIA_MIME_AUDIO_AMR_NB;
47 extern const char* const MEDIA_MIME_AUDIO_AMR_WB;
48 extern const char* const MEDIA_MIME_AUDIO_AVS3DA;
49 
50 // video mime
51 extern const char* const MEDIA_MIME_VIDEO_RAW;
52 extern const char* const MEDIA_MIME_VIDEO_H264;
53 extern const char* const MEDIA_MIME_VIDEO_H265;
54 extern const char* const MEDIA_MIME_VIDEO_MPEG4;
55 
56 // container mime
57 extern const char* const MEDIA_MIME_CONTAINER_MP4;
58 
59 bool IsAudioMime(const std::string& mime);
60 bool IsVideoMime(const std::string& mime);
61 bool IsRawAudio(const std::string& mime);
62 } // namespace Media
63 } // namespace OHOS
64 #endif // HISTREAMER_FOUNDATION_CONSTANTS_H
65