• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1  /*
2  * Copyright (c) 2024 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 MEDIA_MANAGER_FUZZER_H
17 #define MEDIA_MANAGER_FUZZER_H
18 
19 #include "media_manager.h"
20 #include <fuzzer/FuzzedDataProvider.h>
21 
22 namespace OHOS {
23 namespace CameraStandard {
24 using namespace DeferredProcessing;
25 class MediaManagerFuzzer {
26 public:
27 static std::shared_ptr<MediaManager> fuzz_;
28 
29 class AVSourceFuzz : public AVSource {
30 public:
GetSourceFormat(OHOS::Media::Format & format)31     int32_t GetSourceFormat(OHOS::Media::Format &format) override
32     {
33         return 0;
34     }
GetTrackFormat(OHOS::Media::Format & format,uint32_t trackIndex)35     int32_t GetTrackFormat(OHOS::Media::Format &format, uint32_t trackIndex) override
36     {
37         return 0;
38     }
GetUserMeta(OHOS::Media::Format & format)39     int32_t GetUserMeta(OHOS::Media::Format &format) override
40     {
41         return 0;
42     }
43 };
44 
45 static void MediaManagerFuzzTest(FuzzedDataProvider& fdp);
46 static void WriterFuzzTest(FuzzedDataProvider& fdp);
47 static void TrackFuzzTest(FuzzedDataProvider& fdp);
48 static void ReaderFuzzTest(FuzzedDataProvider& fdp);
49 static void MuxerFuzzTest(FuzzedDataProvider& fdp);
50 };
51 } //CameraStandard
52 } //OHOS
53 #endif //MEDIA_MANAGER_FUZZER_H