QGVAPConfigManager.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // QGVAPConfigManager.h
  2. // Tencent is pleased to support the open source community by making vap available.
  3. //
  4. // Copyright (C) 2020 THL A29 Limited, a Tencent company. All rights reserved.
  5. //
  6. // Licensed under the MIT License (the "License"); you may not use this file except in
  7. // compliance with the License. You may obtain a copy of the License at
  8. //
  9. // http://opensource.org/licenses/MIT
  10. //
  11. // Unless required by applicable law or agreed to in writing, software distributed under the License is
  12. // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
  13. // either express or implied. See the License for the specific language governing permissions and
  14. // limitations under the License.
  15. #import <Foundation/Foundation.h>
  16. #import "QGMP4HWDFileInfo.h"
  17. #import "QGVAPConfigModel.h"
  18. #import "VAPMacros.h"
  19. @class QGVAPSourceInfo;
  20. @protocol QGVAPConfigDelegate <NSObject>
  21. - (void)onVAPConfigResourcesLoaded:(QGVAPConfigModel *)config error:(NSError *)error;
  22. @optional
  23. - (NSString *)vap_contentForTag:(NSString *)tag resource:(QGVAPSourceInfo *)info; //替换配置中的资源占位符(不处理直接返回tag)
  24. - (void)vap_loadImageWithURL:(NSString *)urlStr context:(NSDictionary *)context completion:(VAPImageCompletionBlock)completionBlock;
  25. @end
  26. @interface QGVAPConfigManager : NSObject
  27. @property (nonatomic, weak) id<QGVAPConfigDelegate> delegate;
  28. @property (nonatomic, assign) BOOL hasValidConfig;
  29. @property (nonatomic, strong) QGVAPConfigModel *model;
  30. - (instancetype)initWith:(QGMP4HWDFileInfo *)fileInfo;
  31. - (void)loadConfigResources;
  32. - (void)loadMTLTextures:(id<MTLDevice>)device;
  33. - (void)loadMTLBuffers:(id<MTLDevice>)device;
  34. @end