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 METADATA_EXTRACTOR_H 17 #define METADATA_EXTRACTOR_H 18 19 #include <fcntl.h> 20 #include <sstream> 21 #include <string.h> 22 #include <unistd.h> 23 24 #include "avmetadatahelper.h" 25 #include "image_source.h" 26 #include "image_type.h" 27 #include "metadata.h" 28 29 namespace OHOS { 30 namespace Media { 31 class MetadataExtractor { 32 public: 33 static int32_t Extract(std::unique_ptr<Metadata> &data); 34 static int32_t ExtractAVMetadata(std::unique_ptr<Metadata> &data); 35 static int32_t ExtractImageMetadata(std::unique_ptr<Metadata> &data); 36 37 private: 38 MetadataExtractor() = delete; 39 ~MetadataExtractor() = delete; 40 41 static void FillExtractedMetadata(const std::unordered_map<int32_t, std::string> &metadataMap, 42 std::unique_ptr<Metadata> &data); 43 }; 44 } // namespace Media 45 } // namespace OHOS 46 #endif /* METADATA_EXTRACTOR_H */ 47