1 /* 2 * Copyright (C) 2022 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 #ifndef CAPS_UNIT_TEST_H 16 #define CAPS_UNIT_TEST_H 17 18 #include "gtest/gtest.h" 19 #include "codeclist_mock.h" 20 21 namespace OHOS { 22 namespace MediaAVCodec { 23 class CapsUnitTest : public testing::Test { 24 public: 25 static void SetUpTestCase(void); 26 static void TearDownTestCase(void); 27 void SetUp(void); 28 void TearDown(void); 29 30 protected: 31 std::shared_ptr<AVCodecList> avCodecList_ = nullptr; 32 void CheckAVDecH264(const std::shared_ptr<VideoCaps> &videoCaps) const; 33 void CheckAVDecH263(const std::shared_ptr<VideoCaps> &videoCaps) const; 34 void CheckAVDecMpeg2Video(const std::shared_ptr<VideoCaps> &videoCaps) const; 35 void CheckAVDecMpeg4(const std::shared_ptr<VideoCaps> &videoCaps) const; 36 void CheckAVDecAVC(const std::shared_ptr<VideoCaps> &videoCaps) const; 37 void CheckAVEncAVC(const std::shared_ptr<VideoCaps> &videoCaps) const; 38 void CheckAVEncMpeg4(const std::shared_ptr<VideoCaps> &videoCaps) const; 39 void CheckVideoCaps(const std::shared_ptr<VideoCaps> &videoCaps) const; 40 void CheckVideoCapsArray(const std::vector<std::shared_ptr<VideoCaps>> &videoCapsArray) const; 41 void CheckAVDecMP3(const std::shared_ptr<AudioCaps> &audioCaps) const; 42 void CheckAVDecAAC(const std::shared_ptr<AudioCaps> &audioCaps) const; 43 void CheckAVDecVorbis(const std::shared_ptr<AudioCaps> &audioCaps) const; 44 void CheckAVDecFlac(const std::shared_ptr<AudioCaps> &audioCaps) const; 45 void CheckAVDecOpus(const std::shared_ptr<AudioCaps> &audioCaps) const; 46 void CheckAVEncAAC(const std::shared_ptr<AudioCaps> &audioCaps) const; 47 void CheckAVEncOpus(const std::shared_ptr<AudioCaps> &audioCaps) const; 48 void CheckAudioCaps(const std::shared_ptr<AudioCaps> &audioCaps) const; 49 void CheckAVDecVivid(const std::shared_ptr<AudioCaps> &audioCaps) const; 50 void CheckAudioCapsArray(const std::vector<std::shared_ptr<AudioCaps>> &audioCapsArray) const; 51 52 std::vector<std::shared_ptr<VideoCaps>> GetVideoDecoderCaps(); 53 std::vector<std::shared_ptr<VideoCaps>> GetVideoEncoderCaps(); 54 std::vector<std::shared_ptr<AudioCaps>> GetAudioDecoderCaps(); 55 std::vector<std::shared_ptr<AudioCaps>> GetAudioEncoderCaps(); 56 57 std::string codecMimeKey_; 58 std::string bitrateKey_; 59 std::string widthKey_; 60 std::string heightKey_; 61 std::string pixelFormatKey_; 62 std::string frameRateKey_; 63 std::string channelCountKey_; 64 std::string sampleRateKey_; 65 bool isHardIncluded_ = false; 66 }; 67 } // namespace MediaAVCodec 68 } // namespace OHOS 69 #endif 70