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 #ifndef AVMETADATAHELPER_IMPL_H 16 #define AVMETADATAHELPER_IMPL_H 17 18 #include "avmetadatahelper.h" 19 #include "nocopyable.h" 20 #include "i_avmetadatahelper_service.h" 21 22 namespace OHOS { 23 namespace Media { 24 class AVMetadataHelperImpl : public AVMetadataHelper, public NoCopyable { 25 public: 26 AVMetadataHelperImpl(); 27 ~AVMetadataHelperImpl(); 28 29 int32_t SetSource(const std::string &uri, int32_t usage) override; 30 int32_t SetSource(int32_t fd, int64_t offset, int64_t size, int32_t usage) override; 31 int32_t SetSource(const std::shared_ptr<IMediaDataSource> &dataSrc) override; 32 std::string ResolveMetadata(int32_t key) override; 33 std::unordered_map<int32_t, std::string> ResolveMetadata() override; 34 std::shared_ptr<AVSharedMemory> FetchArtPicture() override; 35 std::shared_ptr<PixelMap> FetchFrameAtTime(int64_t timeUs, int32_t option, const PixelMapParams ¶m) override; 36 void Release() override; 37 int32_t Init(); 38 int32_t SetHelperCallback(const std::shared_ptr<HelperCallback> &callback) override; 39 private: 40 std::shared_ptr<IAVMetadataHelperService> avMetadataHelperService_ = nullptr; 41 }; 42 } // namespace Media 43 } // namespace OHOS 44 #endif // AVMETADATAHELPER_IMPL_H 45