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 AVMETADATAHELPER_SERVICE_CLIENT_H 17 #define AVMETADATAHELPER_SERVICE_CLIENT_H 18 19 #include "i_avmetadatahelper_service.h" 20 #include "i_standard_avmetadatahelper_service.h" 21 22 namespace OHOS { 23 namespace Media { 24 class AVMetadataHelperClient : public IAVMetadataHelperService, public NoCopyable { 25 public: 26 static std::shared_ptr<AVMetadataHelperClient> Create(const sptr<IStandardAVMetadataHelperService> &ipcProxy); 27 explicit AVMetadataHelperClient(const sptr<IStandardAVMetadataHelperService> &ipcProxy); 28 ~AVMetadataHelperClient(); 29 30 // IAVMetadataHelperService override 31 int32_t SetSource(const std::string &uri, int32_t usage) override; 32 int32_t SetSource(int32_t fd, int64_t offset, int64_t size, int32_t usage) override; 33 std::string ResolveMetadata(int32_t key) override; 34 std::unordered_map<int32_t, std::string> ResolveMetadata() override; 35 std::shared_ptr<AVSharedMemory> FetchArtPicture() override; 36 std::shared_ptr<AVSharedMemory> FetchFrameAtTime(int64_t timeUs, 37 int32_t option, const OutputConfiguration ¶m) override; 38 void Release() override; 39 40 // AVMetadataHelperClient 41 void MediaServerDied(); 42 private: 43 sptr<IStandardAVMetadataHelperService> avMetadataHelperProxy_ = nullptr; 44 std::mutex mutex_; 45 }; 46 } // namespace Media 47 } // namespace OHOS 48 #endif // AVMETADATAHELPER_SERVICE_CLIENT_H 49