1fa7767c5Sopenharmony_ci/*
2fa7767c5Sopenharmony_ci * Copyright (c) 2023-2023 Huawei Device Co., Ltd.
3fa7767c5Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
4fa7767c5Sopenharmony_ci * you may not use this file except in compliance with the License.
5fa7767c5Sopenharmony_ci * You may obtain a copy of the License at
6fa7767c5Sopenharmony_ci *
7fa7767c5Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
8fa7767c5Sopenharmony_ci *
9fa7767c5Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
10fa7767c5Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
11fa7767c5Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12fa7767c5Sopenharmony_ci * See the License for the specific language governing permissions and
13fa7767c5Sopenharmony_ci * limitations under the License.
14fa7767c5Sopenharmony_ci */
15fa7767c5Sopenharmony_ci
16fa7767c5Sopenharmony_ci#ifndef HISTREAMER_PLUGIN_EVENT_H
17fa7767c5Sopenharmony_ci#define HISTREAMER_PLUGIN_EVENT_H
18fa7767c5Sopenharmony_ci
19fa7767c5Sopenharmony_ci#include <cstdint> // NOLINT: using int32_t in this file
20fa7767c5Sopenharmony_ci#include <string>
21fa7767c5Sopenharmony_ci#include "meta/any.h"
22fa7767c5Sopenharmony_ci
23fa7767c5Sopenharmony_cinamespace OHOS {
24fa7767c5Sopenharmony_cinamespace Media {
25fa7767c5Sopenharmony_cinamespace Plugins {
26fa7767c5Sopenharmony_cienum struct PluginEventType : int32_t {
27fa7767c5Sopenharmony_ci    CLIENT_ERROR,
28fa7767c5Sopenharmony_ci    SERVER_ERROR,
29fa7767c5Sopenharmony_ci    OTHER_ERROR,
30fa7767c5Sopenharmony_ci    BELOW_LOW_WATERLINE,
31fa7767c5Sopenharmony_ci    ABOVE_LOW_WATERLINE,
32fa7767c5Sopenharmony_ci    AUDIO_INTERRUPT,
33fa7767c5Sopenharmony_ci    AUDIO_STATE_CHANGE,
34fa7767c5Sopenharmony_ci    EVENT_CHANNEL_OPENED,
35fa7767c5Sopenharmony_ci    EVENT_CHANNEL_OPEN_FAIL,
36fa7767c5Sopenharmony_ci    EVENT_CHANNEL_CLOSED,
37fa7767c5Sopenharmony_ci    SOURCE_DRM_INFO_UPDATE,
38fa7767c5Sopenharmony_ci    BUFFERING_START,
39fa7767c5Sopenharmony_ci    BUFFERING_PERCENT,
40fa7767c5Sopenharmony_ci    BUFFERING_END,
41fa7767c5Sopenharmony_ci    CACHED_DURATION,
42fa7767c5Sopenharmony_ci    VIDEO_SIZE_CHANGE,
43fa7767c5Sopenharmony_ci    SOURCE_BITRATE_START,
44fa7767c5Sopenharmony_ci    EVENT_BUFFER_PROGRESS,
45fa7767c5Sopenharmony_ci};
46fa7767c5Sopenharmony_ci
47fa7767c5Sopenharmony_cienum class NetworkClientErrorCode : int32_t {
48fa7767c5Sopenharmony_ci    ERROR_OK,
49fa7767c5Sopenharmony_ci    ERROR_TIME_OUT,
50fa7767c5Sopenharmony_ci    ERROR_NOT_RETRY,
51fa7767c5Sopenharmony_ci    ERROR_UNKNOWN,
52fa7767c5Sopenharmony_ci};
53fa7767c5Sopenharmony_ci
54fa7767c5Sopenharmony_ciusing NetworkServerErrorCode = int;
55fa7767c5Sopenharmony_ci
56fa7767c5Sopenharmony_cistruct PluginEvent {
57fa7767c5Sopenharmony_ci    PluginEventType type;
58fa7767c5Sopenharmony_ci    Any param;
59fa7767c5Sopenharmony_ci    std::string description;
60fa7767c5Sopenharmony_ci};
61fa7767c5Sopenharmony_ci
62fa7767c5Sopenharmony_ci} // namespace Plugins
63fa7767c5Sopenharmony_ci} // namespace Media
64fa7767c5Sopenharmony_ci} // namespace OHOS
65fa7767c5Sopenharmony_ci#endif // HISTREAMER_PLUGIN_TYPES_H
66