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 #include "avformat_capi_mock.h"
17
18 namespace OHOS {
19 namespace MediaAVCodec {
CreateFormat()20 std::shared_ptr<FormatMock> FormatMockFactory::CreateFormat()
21 {
22 std::shared_ptr<FormatMock> format = std::make_shared<AVFormatCapiMock>();
23 format->InitTrackFormat();
24 return format;
25 }
26
CreateAudioFormat(const std::string_view & mimeType,int32_t sampleRate,int32_t channelCount)27 std::shared_ptr<FormatMock> FormatMockFactory::CreateAudioFormat(
28 const std::string_view &mimeType, int32_t sampleRate, int32_t channelCount)
29 {
30 std::shared_ptr<FormatMock> format = std::make_shared<AVFormatCapiMock>();
31 format->InitAudioTrackFormat(mimeType, sampleRate, channelCount);
32 return format;
33 }
34
CreateVideoFormat(const std::string_view & mimeType,int32_t width,int32_t height)35 std::shared_ptr<FormatMock> FormatMockFactory::CreateVideoFormat(
36 const std::string_view &mimeType, int32_t width, int32_t height)
37 {
38 std::shared_ptr<FormatMock> format = std::make_shared<AVFormatCapiMock>();
39 format->InitVideoTrackFormat(mimeType, width, height);
40 return format;
41 }
42
CreateTimedMetadataFormat(const std::string_view & mimeType,const std::string_view & metadataKey,int32_t srcTrackID)43 std::shared_ptr<FormatMock> FormatMockFactory::CreateTimedMetadataFormat(
44 const std::string_view &mimeType, const std::string_view &metadataKey, int32_t srcTrackID)
45 {
46 static_cast<void>(mimeType);
47 static_cast<void>(metadataKey);
48 static_cast<void>(srcTrackID);
49 return nullptr;
50 }
51 } // namespace MediaAVCodec
52 } // namespace OHOS