• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 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 GST_COMMON_UTILS_H
17 #define GST_COMMON_UTILS_H
18 
19 #include <gst/gst.h>
20 
21 // only C style code is accepted in this file
22 enum VideoStreamType {
23     VIDEO_STREAM_TYPE_UNKNOWN = 0,
24     VIDEO_STREAM_TYPE_ES_AVC,
25     VIDEO_STREAM_TYPE_YUV_420,
26     VIDEO_STREAM_TYPE_RGBA,
27 };
28 
29 enum CodecBinType {
30     CODEC_BIN_TYPE_UNKNOWN = -1,
31     CODEC_BIN_TYPE_VIDEO_ENCODER = 0,
32     CODEC_BIN_TYPE_VIDEO_DECODER,
33     CODEC_BIN_TYPE_AUDIO_ENCODER,
34     CODEC_BIN_TYPE_AUDIO_DECODER,
35 };
36 
37 struct AudioBuffer {
38     uint64_t timestamp;
39     uint32_t dataSeq;
40     uint32_t dataLen;
41     uint64_t duration;
42     GstBuffer *gstBuffer;
43 };
44 
45 enum AudioStreamType {
46     AUDIO_STREAM_TYPE_UNKNOWN = 0,
47     AUDIO_STREAM_TYPE_PCM_S32_LE,
48 };
49 
50 enum AudioSourceType {
51     AUDIO_SOURCE_TYPE_UNKNOWN = -1,
52     AUDIO_SOURCE_TYPE_DEFAULT = 0,
53     AUDIO_SOURCE_TYPE_MIC = 1,
54     AUDIO_SOURCE_TYPE_INNER = 2,
55     AUDIO_SOURCE_TYPE_VOICE_CALL = 4,
56 };
57 #endif  // GST_COMMON_UTILS_H
58