• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 ISOURCE_ENGINE_H
17 #define ISOURCE_ENGINE_H
18 
19 #include <cstdint>
20 #include "format.h"
21 #include "avcodec_common.h"
22 #include "avsharedmemory.h"
23 #include "i_source_engine.h"
24 
25 namespace OHOS {
26 namespace MediaAVCodec {
27 class ISourceEngine {
28 public:
29     virtual ~ISourceEngine() = default;
30     virtual int32_t Init() = 0;
31     virtual int32_t GetTrackCount(uint32_t &trackCount) = 0;
32     virtual int32_t GetSourceFormat(Format &format) = 0;
33     virtual int32_t GetTrackFormat(Format &format, uint32_t trackIndex) = 0;
34     virtual uintptr_t GetSourceAddr() = 0;
35 };
36 
37 class __attribute__((visibility("default"))) ISourceEngineFactory {
38 public:
39     static std::shared_ptr<ISourceEngine> CreateSourceEngine(const std::string& uri);
40 private:
41     ISourceEngineFactory() = default;
42     ~ISourceEngineFactory() = default;
43 };
44 } // namespace MediaAVCodec
45 } // namespace OHOS
46 #endif // ISOURCE_ENGINE_H