QGHWDMP4OpenGLView.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // QGHWDMP4OpenGLView.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 <UIKit/UIKit.h>
  16. #import <OpenGLES/ES2/gl.h>
  17. #import <OpenGLES/ES2/glext.h>
  18. #import "UIView+VAP.h"
  19. @protocol QGHWDMP4OpenGLViewDelegate <NSObject>
  20. - (void)onViewUnavailableStatus;
  21. @end
  22. @interface QGHWDMP4OpenGLView : UIView
  23. @property (nonatomic, strong) EAGLContext *glContext;
  24. @property (nonatomic, weak) id<QGHWDMP4OpenGLViewDelegate> displayDelegate;
  25. @property (nonatomic, assign) QGHWDTextureBlendMode blendMode;
  26. @property (nonatomic, assign) BOOL pause;
  27. - (void)setupGL;
  28. - (void)displayPixelBuffer:(CVPixelBufferRef)pixelBuffer;
  29. - (void)dispose;
  30. //update glcontext's viewport size by layer bounds
  31. - (void)updateBackingSize;
  32. @end