1 /* 2 * Copyright (C) 2023 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 AVMUXER_DEMO_COMMON_H 17 #define AVMUXER_DEMO_COMMON_H 18 #ifdef __cplusplus 19 extern "C" { 20 #endif 21 // only for demo 22 struct AudioTrackParam { 23 const char *fileName; 24 const char *mimeType; 25 int sampleRate; 26 int channels; 27 int frameSize; 28 }; 29 30 struct VideoTrackParam { 31 const char *fileName; 32 const char *mimeType; 33 int width; 34 int height; 35 double frameRate; 36 int videoDelay; 37 int colorPrimaries; 38 int colorTransfer; 39 int colorMatrixCoeff; 40 int colorRange; 41 int isHdrVivid; 42 }; 43 44 struct FdListStr { 45 int start[0]; 46 int outputFd; 47 int inAudioFd; 48 int inVideoFd; 49 int inCoverFd; 50 }; 51 52 extern struct AudioTrackParam g_audioMpegPar; 53 extern struct AudioTrackParam g_audioAacPar; 54 extern struct AudioTrackParam g_audioAmrNbPar; 55 extern struct AudioTrackParam g_audioAmrWbPar; 56 extern struct AudioTrackParam g_audioG711MUPar; 57 extern struct AudioTrackParam g_audioRawPar; 58 extern struct VideoTrackParam g_videoH264Par; 59 extern struct VideoTrackParam g_videoMpeg4Par; 60 extern struct VideoTrackParam g_videoH265Par; 61 extern struct VideoTrackParam g_videoHdrPar; 62 extern struct VideoTrackParam g_jpegCoverPar; 63 extern struct VideoTrackParam g_pngCoverPar; 64 extern struct VideoTrackParam g_bmpCoverPar; 65 extern const char *RUN_NORMAL; 66 extern const char *RUN_MUL_THREAD; 67 68 long long GetTimestamp(void); 69 #ifdef __cplusplus 70 } 71 #endif 72 #endif