ifish/Ifish/controllers/IfishYooseeFile/IfishYooseeHelper/IfishYooseeP2PCore/OpenGLView.h

99 lines
2.8 KiB
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// OpenGLView.h
// iVideoCalls
//
// Created by Kiwaro Nigas on 12-12-4.
// Copyright (c) 2012年 xizue.com. All rights reserved.
//
#import "P2PCInterface.h"
#define g_w 352
#define g_h 240
enum {
ATTRIBUTE_VERTEX,
ATTRIBUTE_TEXCOORD,
};
// shape type
enum {
SHAPE_CIRCLE = 0,// 圆形
SHAPE_180_HALF_SPHERE = 1,
SHAPE_CYLIDER = 2,//圆柱
SHAPE_BOWLE = 3,//碗状
SHAPE_FOUR_SCREEN = 4,//四分屏
};
// fisheye type
enum {
FISHEYE_360 = 0,
FISHEYE_180 = 1,
};
@protocol OpenGLRenderer
- (BOOL) isValid;
- (NSString *) fragmentShader;
- (void) resolveUniforms: (GLuint) program;
- (void) setFrame:(GAVFrame *)yuvFrame;
- (BOOL) prepareRender;
@end
@protocol OpenGLViewDelegate <NSObject>
-(void)onScreenShotted:(UIImage*)image;
@optional
-(void)onScreenShotted:(UIImage*)image timeInterval:(NSString *)timeInterval;//timeInterval秒
@end
@interface OpenGLView : UIView
{
EAGLContext *_context;
GLuint _framebuffer;
GLuint _renderbuffer;
GLuint _depthbuffer;
GLuint _program;
GLint _uniformMatrix;
id<OpenGLRenderer> _renderer;
//YES表示渲染成功退出时可截图NO表示渲染失败或渲染未完成一片黑退出时不截图
BOOL _isGetVideoFrame;
CGFloat _viewScale;
}
@property (nonatomic) BOOL Initialized;
@property (nonatomic) BOOL isScreenShotting;
@property (nonatomic) BOOL captureFinishScreen;
@property (nonatomic) BOOL isQuitMonitorInterface;//rtsp监控界面弹出修改
@property (nonatomic) BOOL isFullScreen;
@property (assign) id<OpenGLViewDelegate> delegate;
- (id)initWithIsSupportFisheyeDevice:(BOOL)isSupportFisheyeDevice installType:(int)installType deviceID:(int)deviceID fishEyeType:(int)fishEyeType;
- (BOOL)isvalid;
- (void)render:(GAVFrame *)frame;
- (UIImage *)glToUIImage;
-(void)releseromotViewSet;
-(void)getLastImgGoback;
- (void) setFullScreenHeight:(int)iheight width:(int)iwidth fullScreen:(int)isFullScreen;
- (void) setAccelerationX:(float)x Y:(float) y Z:(float)z;
//init data
- (void)initDataShapeWarpTextureWidth:(int)width textureHeight:(int)height windowWidth:(int)w_width windowHeight:(int)w_height installType:(int)installType deviceID:(int)deviceID fishEyeType:(int)fishEyeType;
// zoom in/out
- (void)setZoomInOpenGLView;
- (void)setZoomOutOpenGLView;
- (void)setZoomInOpenGLViewX:(float)x Y:(float)y;
- (void)setZoomOutOpenGLViewX:(float)x Y:(float)y;
//singalTap
- (void)singalTapInOpenGLView;
//setGestureMode
- (void)setGestureModeInOpenGLView:(int)mode;
//setKeyStatus
- (void)setKeyStatusInOpenGLView:(int)key;
//setFling
- (void)setFlingInOpenGLViewX:(float)x Y:(float)y;
//setMoveStep
- (void)setMoveStepInOpenGLViewX:(float)x Y:(float)y dX:(float)dx dY:(float)dy;
@end