1 /*
2 * Copyright (c) 2021-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 #include "UtDemuxerTest2.h"
17
18 using namespace OHOS::Media::Plugin;
19
Sniff(const std::string & name,std::shared_ptr<DataSource> dataSource)20 static int Sniff(const std::string& name, std::shared_ptr<DataSource> dataSource)
21 {
22 return 0;
23 }
24
RegisterPlugins(const std::shared_ptr<Register> & reg)25 static Status RegisterPlugins(const std::shared_ptr<Register>& reg)
26 {
27 DemuxerPluginDef regInfo;
28 regInfo.name = "UtDemuxerTest2";
29 regInfo.description = "unit test demuxer test2";
30 regInfo.rank = 100; // 100
31 regInfo.creator = [](const std::string& name) -> std::shared_ptr<DemuxerPlugin> {
32 return std::make_shared<UtDemuxerTest2>(name);
33 };
34 regInfo.sniffer = Sniff;
35 return reg->AddPlugin(regInfo);
36 }
37
__anon2617241b0202null38 PLUGIN_DEFINITION(UtDemuxerTest2, LicenseType::LGPL, RegisterPlugins, [] {});
39
SetDataSource(const std::shared_ptr<DataSource> & source)40 Status UtDemuxerTest2::SetDataSource(const std::shared_ptr<DataSource> &source)
41 {
42 return Status::OK;
43 }
44
GetMediaInfo(MediaInfo & mediaInfo)45 Status UtDemuxerTest2::GetMediaInfo(MediaInfo &mediaInfo)
46 {
47 return Status::OK;
48 }
49
GetTrackCount()50 size_t UtDemuxerTest2::GetTrackCount()
51 {
52 return 0;
53 }
54
SelectTrack(int32_t trackId)55 Status UtDemuxerTest2::SelectTrack(int32_t trackId)
56 {
57 return Status::OK;
58 }
59
UnselectTrack(int32_t trackId)60 Status UtDemuxerTest2::UnselectTrack(int32_t trackId)
61 {
62 return Status::OK;
63 }
64
GetSelectedTracks(std::vector<int32_t> & trackIds)65 Status UtDemuxerTest2::GetSelectedTracks(std::vector<int32_t> &trackIds)
66 {
67 return Status::OK;
68 }
69
ReadFrame(Buffer & buffer,int32_t timeOutMs)70 Status UtDemuxerTest2::ReadFrame(Buffer &buffer, int32_t timeOutMs)
71 {
72 return Status::OK;
73 }
74
SeekTo(int32_t trackId,int64_t seekTime,SeekMode mode,int64_t & realSeekTime)75 Status UtDemuxerTest2::SeekTo(int32_t trackId, int64_t seekTime, SeekMode mode, int64_t& realSeekTime)
76 {
77 (void)trackId;
78 (void)seekTime;
79 (void)mode;
80 (void)realSeekTime;
81 return Status::OK;
82 }
83
GetAllocator()84 std::shared_ptr<Allocator> UtDemuxerTest2::GetAllocator()
85 {
86 return std::shared_ptr<Allocator>();
87 }
88
SetCallback(Callback * cb)89 Status UtDemuxerTest2::SetCallback(Callback* cb)
90 {
91 return Status::OK;
92 }
93