• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 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 #ifndef AVCODECLIST_DEMO_H
17 #define AVCODECLIST_DEMO_H
18 #include <functional>
19 #include <unordered_map>
20 #include "securec.h"
21 #include "nocopyable.h"
22 #include "avcodec_list.h"
23 #include "format.h"
24 
25 namespace OHOS {
26 namespace Media {
27 class AVCodecListDemo : public NoCopyable {
28 public:
29     AVCodecListDemo() = default;
30     virtual ~AVCodecListDemo() = default;
31 
32     void RunCase(const std::string &path);
33     void DoNext();
34 
35 private:
36     std::shared_ptr<AVCodecList> avCodecList_ = nullptr;
37     void PrintVideoCapsArray(const std::vector<std::shared_ptr<VideoCaps>> &videoCapsArray) const;
38     void PrintAudioCapsArray(const std::vector<std::shared_ptr<AudioCaps>> &audioCapsArray) const;
39     void PrintIntArray(const std::vector<int32_t> &array, const std::string &logmsg) const;
40     bool BuildFormat(Format &format);
41     void SetMediaDescriptionToFormat(Format &format, const std::string &key);
42     void GetSupportedFrameRatesDemo();
43     void GetPreferredFrameRateDemo();
44     ImgSize SetSize();
45 };
46 } // namespace Media
47 } // namespace OHOS
48 #endif // AVCODECLIST_DEMO_H
49