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 I_STANDARD_MEDIA_DATA_SOURCE_H
17 #define I_STANDARD_MEDIA_DATA_SOURCE_H
18 
19 #include "ipc_types.h"
20 #include "iremote_broker.h"
21 #include "iremote_proxy.h"
22 #include "iremote_stub.h"
23 #include "media_data_source.h"
24 #include "nocopyable.h"
25 
26 namespace OHOS {
27 namespace Media {
28 class IStandardMediaDataSource : public IRemoteBroker {
29 public:
30     virtual ~IStandardMediaDataSource() = default;
31     virtual int32_t ReadAt(const std::shared_ptr<AVSharedMemory> &mem, uint32_t length, int64_t pos = -1,
32         bool isHistreamer = false) = 0;
33     virtual int32_t GetSize(int64_t &size) = 0;
34 
35     enum class ListenerMsg : uint8_t {
36         READ_AT = 0,
37         GET_SIZE,
38     };
39 
40     enum class CacheFlag : uint8_t {
41         HIT_CACHE = 1,
42         UPDATE_CACHE,
43     };
44 
45     DECLARE_INTERFACE_DESCRIPTOR(u"IStandardMediaDataSource");
46 };
47 } // namespace Media
48 } // namespace OHOS
49 #endif // I_STANDARD__LISTENER_H