1 /* 2 * Copyright (c) 2024 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 OHOS_AV_PIPELINE_EVENT_H 17 #define OHOS_AV_PIPELINE_EVENT_H 18 19 #include <map> 20 #include <string> 21 22 #include "meta/any.h" 23 24 namespace OHOS { 25 namespace DistributedHardware { 26 namespace Pipeline { 27 enum struct EventType : uint32_t { 28 EVENT_READY = 0, 29 EVENT_AUDIO_PROGRESS, // unit is HST_TIME_BASE 30 EVENT_VIDEO_PROGRESS, // unit is HST_TIME_BASE 31 EVENT_COMPLETE, 32 EVENT_ERROR, 33 EVENT_PLUGIN_ERROR, 34 EVENT_PLUGIN_EVENT, 35 EVENT_BUFFERING, 36 EVENT_BUFFER_PROGRESS, 37 EVENT_DECODER_ERROR, 38 EVENT_RESOLUTION_CHANGE, 39 EVENT_VIDEO_RENDERING_START, 40 EVENT_IS_LIVE_STREAM, 41 EVENT_DRM_INFO_UPDATED, 42 EVENT_AUDIO_INTERRUPT, 43 EVENT_AUDIO_STATE_CHANGE, 44 EVENT_AUDIO_FIRST_FRAME, 45 EVENT_AUDIO_DEVICE_CHANGE, 46 EVENT_AUDIO_SERVICE_DIED, 47 BUFFERING_START, 48 BUFFERING_END, 49 EVENT_CACHED_DURATION, 50 EVENT_SOURCE_BITRATE_START, 51 EVENT_SUBTITLE_TEXT_UPDATE, 52 EVENT_AUDIO_TRACK_CHANGE, 53 EVENT_VIDEO_TRACK_CHANGE, 54 EVENT_SUBTITLE_TRACK_CHANGE, 55 EVENT_VIDEO_LAG, // player lag event detected by video sink 56 EVENT_AUDIO_LAG, // player lag event detected by audio sink 57 EVENT_STREAM_LAG, // player lag event detected by sync manager 58 }; 59 60 struct Event { 61 std::string srcFilter; 62 EventType type; 63 Media::Any param; 64 }; 65 66 typedef enum { 67 AUDIO_CODEC_AAC = 0, 68 AUDIO_CODEC_FLAC = 1, 69 AUDIO_CODEC_AAC_EN = 2, 70 AUDIO_CODEC_OPUS = 3 71 } AudioCodecType; 72 73 const char* GetEventName(EventType type); 74 } // namespace Pipeline 75 } // namespace DistributedHardware 76 } // namespace OHOS 77 #endif // OHOS_AV_PIPELINE_EVENT_H 78