• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 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 DEMUXER_SET_DATA_SOURCE_WITH_PROB_SIZE_H
17 #define DEMUXER_SET_DATA_SOURCE_WITH_PROB_SIZE_H
18 
19 #include "stream_demuxer.h"
20 #include "demuxer_plugin_manager.h"
21 #include "plugin/plugin_manager_v2.h"
22 
23 namespace OHOS {
24 namespace Media {
25 class DemuxerPluginTest {
26 public:
27     bool CreateDataSource(const std::string& filePath);
28     bool CreateDemuxerPluginByName(const std::string& typeName, const std::string& filePath, int probSize);
29     bool PluginSelectTracks();
30     bool PluginReadSample(uint32_t idx, uint32_t& flag);
31     bool PluginReadAllSample();
32     bool Run(const std::string& typeName, const std::string& filePath, int probSize);
33 
34     int streamId_ = 0;
35     std::vector<uint32_t> selectedTrackIds_;
36     std::vector<uint8_t> buffer_;
37 
38     std::shared_ptr<Media::StreamDemuxer> realStreamDemuxer_{ nullptr };
39     std::shared_ptr<Media::MediaSource> mediaSource_{ nullptr };
40     std::shared_ptr<Media::Source> realSource_{ nullptr };
41     std::shared_ptr<Media::PluginBase> pluginBase_{ nullptr };
42     std::shared_ptr<DataSourceImpl> dataSourceImpl_{ nullptr };
43 };
44 } // namespace Media
45 } // namespace OHOS
46 
47 #endif // DEMUXER_SET_DATA_SOURCE_WITH_PROB_SIZE_H
48