今奥全景相机
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

270 lines
6.7 KiB

.class public Lcom/via/gpuimage/GPUVideoTexture;
.super Lcom/via/gpuimage/GPUTexture;
.source "GPUVideoTexture.java"
# instance fields
.field protected TEXTURE:[F
.field private mOrigTexture:I
.field private mVideoExtractFilter:Lcom/via/gpuimage/GPUImageVideoExtractorFilter;
# direct methods
.method public constructor <init>()V
.locals 3
.prologue
const/4 v2, 0x0
.line 23
invoke-direct {p0}, Lcom/via/gpuimage/GPUTexture;-><init>()V
.line 14
const/16 v0, 0x8
new-array v0, v0, [F
fill-array-data v0, :array_0
iput-object v0, p0, Lcom/via/gpuimage/GPUVideoTexture;->TEXTURE:[F
.line 24
sget-object v0, Lcom/via/gpuimage/GPUVideoTexture;->CUBE:[F
array-length v0, v0
mul-int/lit8 v0, v0, 0x4
invoke-static {v0}, Ljava/nio/ByteBuffer;->allocateDirect(I)Ljava/nio/ByteBuffer;
move-result-object v0
.line 25
invoke-static {}, Ljava/nio/ByteOrder;->nativeOrder()Ljava/nio/ByteOrder;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;
move-result-object v0
.line 26
invoke-virtual {v0}, Ljava/nio/ByteBuffer;->asFloatBuffer()Ljava/nio/FloatBuffer;
move-result-object v0
iput-object v0, p0, Lcom/via/gpuimage/GPUVideoTexture;->mGLCubeBuffer:Ljava/nio/FloatBuffer;
.line 27
iget-object v0, p0, Lcom/via/gpuimage/GPUVideoTexture;->mGLCubeBuffer:Ljava/nio/FloatBuffer;
sget-object v1, Lcom/via/gpuimage/GPUVideoTexture;->CUBE:[F
invoke-virtual {v0, v1}, Ljava/nio/FloatBuffer;->put([F)Ljava/nio/FloatBuffer;
move-result-object v0
invoke-virtual {v0, v2}, Ljava/nio/FloatBuffer;->position(I)Ljava/nio/Buffer;
.line 29
iget-object v0, p0, Lcom/via/gpuimage/GPUVideoTexture;->TEXTURE:[F
array-length v0, v0
mul-int/lit8 v0, v0, 0x4
invoke-static {v0}, Ljava/nio/ByteBuffer;->allocateDirect(I)Ljava/nio/ByteBuffer;
move-result-object v0
.line 30
invoke-static {}, Ljava/nio/ByteOrder;->nativeOrder()Ljava/nio/ByteOrder;
move-result-object v1
invoke-virtual {v0, v1}, Ljava/nio/ByteBuffer;->order(Ljava/nio/ByteOrder;)Ljava/nio/ByteBuffer;
move-result-object v0
.line 31
invoke-virtual {v0}, Ljava/nio/ByteBuffer;->asFloatBuffer()Ljava/nio/FloatBuffer;
move-result-object v0
iput-object v0, p0, Lcom/via/gpuimage/GPUVideoTexture;->mGLTextureBuffer:Ljava/nio/FloatBuffer;
.line 32
iget-object v0, p0, Lcom/via/gpuimage/GPUVideoTexture;->mGLTextureBuffer:Ljava/nio/FloatBuffer;
iget-object v1, p0, Lcom/via/gpuimage/GPUVideoTexture;->TEXTURE:[F
invoke-virtual {v0, v1}, Ljava/nio/FloatBuffer;->put([F)Ljava/nio/FloatBuffer;
move-result-object v0
invoke-virtual {v0, v2}, Ljava/nio/FloatBuffer;->position(I)Ljava/nio/Buffer;
.line 34
const/4 v0, 0x2
iput v0, p0, Lcom/via/gpuimage/GPUVideoTexture;->mFramebufferNum:I
.line 35
return-void
.line 14
nop
:array_0
.array-data 4
0x0
0x3f800000 # 1.0f
0x3f800000 # 1.0f
0x3f800000 # 1.0f
0x0
0x0
0x3f800000 # 1.0f
0x0
.end array-data
.end method
.method private extractVideoTexture()V
.locals 7
.prologue
const v6, 0x8d40
const/4 v2, 0x0
const/4 v5, 0x0
.line 38
iget-object v0, p0, Lcom/via/gpuimage/GPUVideoTexture;->mVideoExtractFilter:Lcom/via/gpuimage/GPUImageVideoExtractorFilter;
if-nez v0, :cond_0
.line 39
new-instance v0, Lcom/via/gpuimage/GPUImageVideoExtractorFilter;
invoke-direct {v0}, Lcom/via/gpuimage/GPUImageVideoExtractorFilter;-><init>()V
iput-object v0, p0, Lcom/via/gpuimage/GPUVideoTexture;->mVideoExtractFilter:Lcom/via/gpuimage/GPUImageVideoExtractorFilter;
.line 40
iget-object v0, p0, Lcom/via/gpuimage/GPUVideoTexture;->mVideoExtractFilter:Lcom/via/gpuimage/GPUImageVideoExtractorFilter;
invoke-virtual {v0}, Lcom/via/gpuimage/GPUImageVideoExtractorFilter;->init()V
.line 42
:cond_0
iget-object v0, p0, Lcom/via/gpuimage/GPUVideoTexture;->mFramebuffer:[I
const/4 v1, 0x1
aget v0, v0, v1
invoke-static {v6, v0}, Landroid/opengl/GLES20;->glBindFramebuffer(II)V
.line 43
const/high16 v0, 0x3f800000 # 1.0f
invoke-static {v2, v2, v2, v0}, Landroid/opengl/GLES20;->glClearColor(FFFF)V
.line 44
const/16 v0, 0x4000
invoke-static {v0}, Landroid/opengl/GLES20;->glClear(I)V
.line 45
iget v0, p0, Lcom/via/gpuimage/GPUVideoTexture;->mWidth:I
iget v1, p0, Lcom/via/gpuimage/GPUVideoTexture;->mHeight:I
invoke-static {v5, v5, v0, v1}, Landroid/opengl/GLES20;->glViewport(IIII)V
.line 46
iget-object v0, p0, Lcom/via/gpuimage/GPUVideoTexture;->mVideoExtractFilter:Lcom/via/gpuimage/GPUImageVideoExtractorFilter;
const v1, 0x8d65
iget v2, p0, Lcom/via/gpuimage/GPUVideoTexture;->mOrigTexture:I
iget-object v3, p0, Lcom/via/gpuimage/GPUVideoTexture;->mGLCubeBuffer:Ljava/nio/FloatBuffer;
iget-object v4, p0, Lcom/via/gpuimage/GPUVideoTexture;->mGLTextureBuffer:Ljava/nio/FloatBuffer;
invoke-virtual {v0, v1, v2, v3, v4}, Lcom/via/gpuimage/GPUImageVideoExtractorFilter;->onDraw(IILjava/nio/FloatBuffer;Ljava/nio/FloatBuffer;)V
.line 48
invoke-static {v6, v5}, Landroid/opengl/GLES20;->glBindFramebuffer(II)V
.line 49
const/16 v0, 0xde1
invoke-static {v0, v5}, Landroid/opengl/GLES20;->glBindTexture(II)V
.line 50
return-void
.end method
# virtual methods
.method public draw()V
.locals 2
.prologue
.line 57
invoke-direct {p0}, Lcom/via/gpuimage/GPUVideoTexture;->extractVideoTexture()V
.line 58
iget-object v0, p0, Lcom/via/gpuimage/GPUVideoTexture;->mOffscreenTexture:[I
const/4 v1, 0x1
aget v0, v0, v1
iput v0, p0, Lcom/via/gpuimage/GPUVideoTexture;->mMediaTexture:I
.line 59
invoke-super {p0}, Lcom/via/gpuimage/GPUTexture;->draw()V
.line 60
return-void
.end method
.method public releaseGL()V
.locals 1
.prologue
.line 63
iget-object v0, p0, Lcom/via/gpuimage/GPUVideoTexture;->mVideoExtractFilter:Lcom/via/gpuimage/GPUImageVideoExtractorFilter;
if-eqz v0, :cond_0
.line 64
iget-object v0, p0, Lcom/via/gpuimage/GPUVideoTexture;->mVideoExtractFilter:Lcom/via/gpuimage/GPUImageVideoExtractorFilter;
invoke-virtual {v0}, Lcom/via/gpuimage/GPUImageVideoExtractorFilter;->destroy()V
.line 66
:cond_0
invoke-super {p0}, Lcom/via/gpuimage/GPUTexture;->releaseGL()V
.line 67
return-void
.end method
.method public setMediaTexture(I)V
.locals 0
.prologue
.line 53
iput p1, p0, Lcom/via/gpuimage/GPUVideoTexture;->mMediaTexture:I
iput p1, p0, Lcom/via/gpuimage/GPUVideoTexture;->mOrigTexture:I
.line 54
return-void
.end method