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 INNER_MSG_DEFINE_H 17 #define INNER_MSG_DEFINE_H 18 19 #include <memory> 20 #include <any> 21 #include <functional> 22 23 namespace OHOS { 24 namespace Media { 25 enum InnerMsgType : int32_t { 26 INNER_MSG_UNKNOWN, 27 INNER_MSG_ERROR, 28 INNER_MSG_WARNING, 29 INNER_MSG_INFO, 30 INNER_MSG_EOS, 31 INNER_MSG_STATE_CHANGED, 32 INNER_MSG_DURATION_CHANGED, 33 INNER_MSG_ASYNC_DONE, 34 }; 35 36 struct InnerMessage { 37 int32_t type; 38 int32_t detail1; 39 int32_t detail2; 40 std::any extend; 41 }; 42 43 using InnerMsgNotifier = std::function<void(const InnerMessage &)>; 44 } // namespace Media 45 } // namespace OHOS 46 #endif // INNER_MSG_DEFINE_H