package h264.com;
import android.app.Activity;
import android.os.Bundle;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Log;
import android.widget.Button;
import com.tvt.p2pplayer.BMPImage;
import com.tvt.p2pplayer.P2PPlayerH264Decode;
import com.tvt.p2pplayer.VideoView;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
public class decodeActivity extends Activity implements Runnable{
Button btn_play;
P2PPlayerH264Decode decode;
private final byte[] head;
private final byte[] head1;
VideoView videoView;
public decodeActivity()
{
byte[] arrayOfByte1 = new byte[4];
arrayOfByte1[3] = 1;
this.head = arrayOfByte1;
byte[] arrayOfByte2 = new byte[3];
arrayOfByte2[2] = 1;
this.head1 = arrayOfByte2;
}
protected void Play()
{
new Thread(this).start();
}
@Override
protected void onCreate(Bundle savedInstanceState) {
// TODO Auto-generated method stub
super.onCreate(savedInstanceState);
setContentView(2130903040);
Button localButton1 = (Button)findViewById(2131034112);
this.btn_play = localButton1;
Button localButton2 = this.btn_play;
decodeActivity.1 local1 = new decodeActivity.1(this);
localButton2.setOnClickListener(local1);
VideoView localVideoView = (VideoView)findViewById(2131034113);
this.videoView = localVideoView;
}
@Override
public void run() {
// TODO Auto-generated method stub
P2PPlayerH264Decode localP2PPlayerH264Decode1 = new P2PPlayerH264Decode();
this.decode = localP2PPlayerH264Decode1;
this.decode.InitDecode();
File localFile1 = new java/io/File;
File localFile2 = localFile1;
String str1 = "/sdcard/app.264";
localFile2.<init>(str1);
int i = (int)localFile1.length();
byte[] arrayOfByte1 = new byte[i];
int j = 0;
byte[] arrayOfByte2 = (byte[])null;
byte[] arrayOfByte3 = (byte[])null;
int k = 352;
int l = 240;
int i1 = k;
int i2 = l;
BMPImage.Init(i1, i2);
int i6;
ByteArrayOutputStream localByteArrayOutputStream1;
label146: label168: label455: byte[] arrayOfByte9;
try
{
FileInputStream localFileInputStream1 = new java/io/FileInputStream;
FileInputStream localFileInputStream2 = localFileInputStream1;
File localFile3 = localFile1;
localFileInputStream2.<init>(localFile3);
int i3 = j;
int i4 = i;
Object localObject1;
int i7;
if (i3 >= i4)
{
i5 = 4;
i6 = 4;
localObject1 = null;
i7 = 30;
localByteArrayOutputStream1 = new ByteArrayOutputStream();
}
int i47;
while (true)
{
int i8 = i6;
int i9 = i;
if (i8 >= i9)
{
this.decode.Cleanup();
return;
int i10 = i - j;
FileInputStream localFileInputStream3 = localFileInputStream1;
byte[] arrayOfByte4 = arrayOfByte1;
int i11 = j;
int i12 = i10;
int i13 = localFileInputStream3.read(arrayOfByte4, i11, i12);
j += i13;
}
int i14 = arrayOfByte1[i6];
int i15 = this.head[null];
int i16 = i14;
int i17 = i15;
if (i16 == i17)
{
int i18 = i6 + 1;
int i19 = arrayOfByte1[i18];
int i20 = this.head[1];
int i21 = i19;
int i22 = i20;
if (i21 == i22)
{
int i23 = i6 + 2;
int i24 = arrayOfByte1[i23];
int i25 = this.head[2];
int i26 = i24;
int i27 = i25;
if (i26 == i27)
{
int i28 = i6 + 3;
int i29 = arrayOfByte1[i28];
int i30 = this.head[3];
int i31 = i29;
int i32 = i30;
if (i31 == i32)
break label455;
}
}
}
int i33 = arrayOfByte1[i6];
int i34 = this.head1[null];
int i35 = i33;
int i36 = i34;
if (i35 != i36)
break label1254;
int i37 = i6 + 1;
int i38 = arrayOfByte1[i37];
int i39 = this.head1[1];
int i40 = i38;
int i41 = i39;
if (i40 != i41)
break label1254;
int i42 = i6 + 2;
int i43 = arrayOfByte1[i42];
int i44 = this.head1[2];
int i45 = i43;
int i46 = i44;
if (i45 != i46)
break label1254;
Object localObject2 = null;
int i48 = arrayOfByte1[i6];
int i49 = this.head[null];
int i50 = i48;
int i51 = i49;
if (i50 == i51)
{
int i52 = i6 + 1;
int i53 = arrayOfByte1[i52];
int i54 = this.head[1];
int i55 = i53;
int i56 = i54;
if (i55 == i56)
{
int i57 = i6 + 2;
int i58 = arrayOfByte1[i57];
int i59 = this.head[2];
int i60 = i58;
int i61 = i59;
if (i60 == i61)
{
int i62 = i6 + 3;
int i63 = arrayOfByte1[i62];
int i64 = this.head[3];
int i65 = i63;
int i66 = i64;
if (i65 != i66);
}
}
}
for (i47 = 4; arrayOfByte2 == null; i47 = 3)
{
int i67 = i6 - i5;
arrayOfByte2 = new byte[i67];
StringBuilder localStringBuilder1 = new StringBuilder("sps length:");
int i68 = i67;
String str2 = i68;
Log.e("", str2);
byte[] arrayOfByte5 = arrayOfByte1;
int i69 = i5;
byte[] arrayOfByte6 = arrayOfByte2;
int i70 = null;
int i71 = i67;
System.arraycopy(arrayOfByte5, i69, arrayOfByte6, i70, i71);
i6 += i47;
i5 = i6;
break label146:
}
if (arrayOfByte3 != null)
break;
int i72 = i6 - i5;
arrayOfByte3 = new byte[i72];
StringBuilder localStringBuilder2 = new StringBuilder("pps length:");
int i73 = i72;
String str3 = i73;
Log.e("", str3);
byte[] arrayOfByte7 = arrayOfByte1;
int i74 = i5;
byte[] arrayOfByte8 = arrayOfByte3;
int i75 = null;
int i76 = i72;
System.arraycopy(arrayOfByte7, i74, arrayOfByte8, i75, i76);
i6 += i47;
i5 = i6;
}
arrayOfByte9 = new byte[i6 - i5];
int i77 = i6 - i5;
byte[] arrayOfByte10 = arrayOfByte1;
int i78 = i5;
byte[] arrayOfByte11 = arrayOfByte9;
int i79 = null;
int i80 = i77;
System.arraycopy(arrayOfByte10, i78, arrayOfByte11, i79, i80);
StringBuilder localStringBuilder3 = new StringBuilder("fins selcic:");
int i81 = i6 - i5;
String str4 = i81;
Log.e("", str4);
if (localObject1 % i7 != 0)
break label1167;
byte[] arrayOfByte12 = this.head;
ByteArrayOutputStream localByteArrayOutputStream2 = localByteArrayOutputStream1;
byte[] arrayOfByte13 = arrayOfByte12;
localByteArrayOutputStream2.write(arrayOfByte13);
localByteArrayOutputStream1.write(arrayOfByte2);
byte[] arrayOfByte14 = this.he