2014-05-22 143 views
2

我是一個新手在這裏,併爲Android :) 我有一個Android應用程序接收來自相機的幀,並試圖處理它們(使用OpenCv找到一個特定的顏色)。即時通訊使用SurfaceTexture setPreviewCallbackWithBuffer(),然後使用畫布顯示它們。 但是,在處理了一些幀後,我的相機凍結了,我收到了:SurfaceTexture已經被放棄了! 請注意,處理一些幀之前,顯示這一點,每次有多少?取決於..我的問題是:這是由緩衝區,內存泄漏或其他?SurfaceTexture已被放棄

任何幫助將是apreciated! 這裏是我的logcat:

05-22 15:06:12.665: I/Sample::SurfaceView(9765): openCamera 
05-22 15:06:12.665: I/Sample::SurfaceView(9765): releaseCamera 
05-22 15:06:12.907: I/Choreographer(9765): Skipped 47 frames! The application may be doing too much work on its main thread. 
05-22 15:06:12.923: D/libEGL(9765): loaded /vendor/lib/egl/libEGL_POWERVR_SGX540_120.so 
05-22 15:06:12.939: D/libEGL(9765): loaded /vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so 
05-22 15:06:12.947: D/libEGL(9765): loaded /vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so 
05-22 15:06:13.056: D/OpenGLRenderer(9765): Enabling debug mode 0 
05-22 15:06:13.079: I/Sample::SurfaceView(9765): surfaceCreated 
05-22 15:06:13.079: I/Sample::SurfaceView(9765): surfaceChanged 
05-22 15:06:13.079: I/Sample::SurfaceView(9765): Starting processing thread 
05-22 15:06:13.079: I/Sample::SurfaceView(9765): setupCamera 
05-22 15:06:13.079: I/Sample::SurfaceView(9765): 1024 527 
05-22 15:06:13.118: D/dalvikvm(9765): GC_FOR_ALLOC freed 189K, 9% free 7542K/8199K, paused 20ms, total 20ms 
05-22 15:06:13.118: I/dalvikvm-heap(9765): Grow heap (frag case) to 8.619MB for 847888-byte allocation 
05-22 15:06:13.157: D/dalvikvm(9765): GC_CONCURRENT freed 1K, 8% free 8369K/9031K, paused 12ms+2ms, total 35ms 
05-22 15:06:13.157: D/dalvikvm(9765): WAIT_FOR_CONCURRENT_GC blocked 20ms 
05-22 15:06:13.157: E/OpenCV_for_Tegra(9765): Tegra Version detected: 0 
05-22 15:06:13.173: D/dalvikvm(9765): GC_FOR_ALLOC freed 1K, 8% free 8370K/9031K, paused 16ms, total 16ms 
05-22 15:06:13.181: I/dalvikvm-heap(9765): Grow heap (frag case) to 10.775MB for 2261008-byte allocation 
05-22 15:06:13.212: D/dalvikvm(9765): GC_CONCURRENT freed 0K, 7% free 10578K/11271K, paused 12ms+2ms, total 35ms 
05-22 15:06:13.212: D/dalvikvm(9765): WAIT_FOR_CONCURRENT_GC blocked 21ms 
05-22 15:06:13.814: I/Choreographer(9765): Skipped 53 frames! The application may be doing too much work on its main thread. 
05-22 15:06:14.384: I/Sample::Activity(9765): x=1.0 y=1.0 x543.0 y551.0 
05-22 15:06:14.384: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:14.392: I/Sample::SurfaceView(9765): frame 
05-22 15:06:14.657: I/Sample::Activity(9765): x=122.0 y=13.0 x452.0 y246.0 
05-22 15:06:14.657: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:14.657: I/Sample::SurfaceView(9765): frame 
05-22 15:06:14.845: I/Sample::Activity(9765): x=6.0 y=270.0 x8.0 y278.0 
05-22 15:06:14.845: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:14.853: I/Sample::SurfaceView(9765): frame 
05-22 15:06:15.056: I/Sample::Activity(9765): x=108.0 y=488.0 x111.0 y490.0 
05-22 15:06:15.056: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:15.064: I/Sample::SurfaceView(9765): frame 
05-22 15:06:15.228: I/Sample::Activity(9765): x=180.0 y=192.0 x184.0 y196.0 
05-22 15:06:15.228: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:15.236: I/Sample::SurfaceView(9765): frame 
05-22 15:06:15.423: I/Sample::Activity(9765): x=151.0 y=509.0 x154.0 y514.0 
05-22 15:06:15.423: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:15.431: I/Sample::SurfaceView(9765): frame 
05-22 15:06:15.642: I/Sample::Activity(9765): x=132.0 y=200.0 x135.0 y204.0 
05-22 15:06:15.642: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:15.650: I/Sample::SurfaceView(9765): frame 
05-22 15:06:15.868: I/Sample::Activity(9765): x=14.0 y=270.0 x16.0 y276.0 
05-22 15:06:15.868: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:15.868: I/Sample::SurfaceView(9765): frame 
05-22 15:06:16.103: I/Sample::Activity(9765): x=120.0 y=458.0 x128.0 y462.0 
05-22 15:06:16.103: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:16.118: I/Sample::SurfaceView(9765): frame 
05-22 15:06:16.243: I/Sample::Activity(9765): x=152.0 y=127.0 x156.0 y130.0 
05-22 15:06:16.251: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:16.251: I/Sample::SurfaceView(9765): frame 
05-22 15:06:16.423: I/Sample::Activity(9765): x=502.0 y=490.0 x504.0 y492.0 
05-22 15:06:16.423: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:16.439: I/Sample::SurfaceView(9765): frame 
05-22 15:06:16.626: I/Sample::Activity(9765): x=140.0 y=284.0 x160.0 y288.0 
05-22 15:06:16.626: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:16.634: I/Sample::SurfaceView(9765): frame 
05-22 15:06:16.845: I/Sample::Activity(9765): x=122.0 y=460.0 x138.0 y466.0 
05-22 15:06:16.853: I/Sample::SurfaceView(9765): frame 
05-22 15:06:17.017: I/Sample::Activity(9765): x=196.0 y=220.0 x208.0 y226.0 
05-22 15:06:17.017: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:17.025: I/Sample::SurfaceView(9765): frame 
05-22 15:06:17.118: I/Sample::Activity(9765): x=66.0 y=484.0 x80.0 y492.0 
05-22 15:06:17.118: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:17.126: I/Sample::SurfaceView(9765): frame 
05-22 15:06:17.228: I/Sample::Activity(9765): x=176.0 y=226.0 x187.0 y238.0 
05-22 15:06:17.228: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:17.236: I/Sample::SurfaceView(9765): frame 
05-22 15:06:17.447: I/Sample::Activity(9765): x=214.0 y=226.0 x231.0 y230.0 
05-22 15:06:17.447: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:17.447: I/TAG(9765): ddaaaaaa 
05-22 15:06:17.447: I/Sample::SurfaceView(9765): frame 
05-22 15:06:17.642: I/Sample::Activity(9765): x=114.0 y=494.0 x122.0 y506.0 
05-22 15:06:17.642: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:17.650: I/Sample::SurfaceView(9765): frame 
05-22 15:06:17.829: I/Sample::Activity(9765): x=1.0 y=270.0 x26.0 y282.0 
05-22 15:06:17.829: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:17.829: I/Sample::SurfaceView(9765): frame 
05-22 15:06:17.931: I/Sample::Activity(9765): x=12.0 y=276.0 x20.0 y284.0 
05-22 15:06:17.939: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:17.947: I/Sample::SurfaceView(9765): frame 
05-22 15:06:18.150: I/Sample::Activity(9765): x=128.0 y=494.0 x136.0 y502.0 
05-22 15:06:18.150: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:18.157: I/Sample::SurfaceView(9765): frame 
05-22 15:06:18.361: I/Sample::Activity(9765): x=6.0 y=100.0 x18.0 y110.0 
05-22 15:06:18.361: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:18.368: I/Sample::SurfaceView(9765): frame 
05-22 15:06:18.532: I/Sample::Activity(9765): x=206.0 y=508.0 x220.0 y512.0 
05-22 15:06:18.532: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:18.540: I/Sample::SurfaceView(9765): frame 
05-22 15:06:18.634: I/Sample::Activity(9765): x=240.0 y=506.0 x248.0 y512.0 
05-22 15:06:18.634: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:18.642: I/Sample::SurfaceView(9765): frame 
05-22 15:06:18.743: I/Sample::Activity(9765): x=170.0 y=292.0 x184.0 y294.0 
05-22 15:06:18.743: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:18.743: I/TAG(9765): ddaaaaaa 
05-22 15:06:18.743: I/Sample::SurfaceView(9765): frame 
05-22 15:06:18.954: I/Sample::Activity(9765): x=90.0 y=238.0 x102.0 y256.0 
05-22 15:06:18.954: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:18.954: I/TAG(9765): ddaaaaaa 
05-22 15:06:18.962: I/Sample::SurfaceView(9765): frame 
05-22 15:06:19.157: I/Sample::Activity(9765): x=200.0 y=504.0 x215.0 y508.0 
05-22 15:06:19.157: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:19.165: I/Sample::SurfaceView(9765): frame 
05-22 15:06:19.361: I/Sample::Activity(9765): x=196.0 y=498.0 x226.0 y506.0 
05-22 15:06:19.361: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:19.368: I/Sample::SurfaceView(9765): frame 
05-22 15:06:19.540: I/Sample::Activity(9765): x=192.0 y=494.0 x220.0 y504.0 
05-22 15:06:19.540: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:19.556: I/Sample::SurfaceView(9765): frame 
05-22 15:06:19.775: I/Sample::Activity(9765): x=196.0 y=498.0 x216.0 y502.0 
05-22 15:06:19.775: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:19.775: I/Sample::SurfaceView(9765): frame 
05-22 15:06:19.954: I/Sample::Activity(9765): x=196.0 y=496.0 x214.0 y504.0 
05-22 15:06:19.954: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:19.962: I/Sample::SurfaceView(9765): frame 
05-22 15:06:20.150: I/Sample::Activity(9765): x=188.0 y=490.0 x212.0 y498.0 
05-22 15:06:20.150: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:20.157: I/Sample::SurfaceView(9765): frame 
05-22 15:06:20.275: I/Sample::Activity(9765): x=182.0 y=494.0 x210.0 y502.0 
05-22 15:06:20.275: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:20.275: I/Sample::SurfaceView(9765): frame 
05-22 15:06:20.454: I/Sample::Activity(9765): x=182.0 y=500.0 x204.0 y506.0 
05-22 15:06:20.454: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:20.462: I/Sample::SurfaceView(9765): frame 
05-22 15:06:20.556: I/Sample::Activity(9765): x=172.0 y=498.0 x198.0 y510.0 
05-22 15:06:20.556: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:20.564: I/Sample::SurfaceView(9765): frame 
05-22 15:06:20.657: I/Sample::Activity(9765): x=160.0 y=500.0 x190.0 y508.0 
05-22 15:06:20.657: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:20.665: I/Sample::SurfaceView(9765): frame 
05-22 15:06:20.751: I/Sample::Activity(9765): x=160.0 y=502.0 x187.0 y510.0 
05-22 15:06:20.751: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:20.759: I/Sample::SurfaceView(9765): frame 
05-22 15:06:20.853: I/Sample::Activity(9765): x=160.0 y=502.0 x172.0 y510.0 
05-22 15:06:20.853: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:20.861: I/Sample::SurfaceView(9765): frame 
05-22 15:06:20.962: I/Sample::Activity(9765): x=195.0 y=504.0 x206.0 y510.0 
05-22 15:06:20.962: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:20.962: I/Sample::SurfaceView(9765): frame 
05-22 15:06:21.064: I/Sample::Activity(9765): x=174.0 y=506.0 x188.0 y512.0 
05-22 15:06:21.064: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:21.072: I/Sample::SurfaceView(9765): frame 
05-22 15:06:21.173: I/Sample::Activity(9765): x=171.0 y=506.0 x186.0 y514.0 
05-22 15:06:21.173: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:21.181: I/Sample::SurfaceView(9765): frame 
05-22 15:06:21.384: I/Sample::Activity(9765): x=154.0 y=508.0 x180.0 y514.0 
05-22 15:06:21.384: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:21.384: I/Sample::SurfaceView(9765): frame 
05-22 15:06:21.587: I/Sample::Activity(9765): x=176.0 y=512.0 x188.0 y516.0 
05-22 15:06:21.587: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:21.587: I/Sample::SurfaceView(9765): frame 
05-22 15:06:21.790: I/Sample::Activity(9765): x=154.0 y=512.0 x172.0 y520.0 
05-22 15:06:21.790: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:21.798: I/Sample::SurfaceView(9765): frame 
05-22 15:06:21.993: I/Sample::Activity(9765): x=158.0 y=514.0 x172.0 y516.0 
05-22 15:06:21.993: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:22.001: I/Sample::SurfaceView(9765): frame 
05-22 15:06:22.189: I/Sample::Activity(9765): x=166.0 y=508.0 x182.0 y514.0 
05-22 15:06:22.189: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:22.197: I/Sample::SurfaceView(9765): frame 
05-22 15:06:22.384: I/Sample::Activity(9765): x=160.0 y=508.0 x182.0 y516.0 
05-22 15:06:22.384: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:22.392: I/Sample::SurfaceView(9765): frame 
05-22 15:06:22.587: I/Sample::Activity(9765): x=162.0 y=508.0 x178.0 y514.0 
05-22 15:06:22.587: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:22.595: I/Sample::SurfaceView(9765): frame 
05-22 15:06:22.822: I/Sample::Activity(9765): x=160.0 y=506.0 x184.0 y512.0 
05-22 15:06:22.822: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:22.822: I/Sample::SurfaceView(9765): frame 
05-22 15:06:23.009: I/Sample::Activity(9765): x=160.0 y=505.0 x186.0 y514.0 
05-22 15:06:23.009: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:23.017: I/Sample::SurfaceView(9765): frame 
05-22 15:06:23.204: I/Sample::Activity(9765): x=156.0 y=506.0 x188.0 y512.0 
05-22 15:06:23.204: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:23.212: I/Sample::SurfaceView(9765): frame 
05-22 15:06:23.376: I/Sample::Activity(9765): x=160.0 y=502.0 x187.0 y510.0 
05-22 15:06:23.376: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:23.384: I/Sample::SurfaceView(9765): frame 
05-22 15:06:23.478: I/Sample::Activity(9765): x=162.0 y=506.0 x182.0 y514.0 
05-22 15:06:23.478: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:23.486: I/Sample::SurfaceView(9765): frame 
05-22 15:06:23.579: I/Sample::Activity(9765): x=161.0 y=508.0 x174.0 y514.0 
05-22 15:06:23.579: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:23.587: I/Sample::SurfaceView(9765): frame 
05-22 15:06:23.681: I/Sample::Activity(9765): x=190.0 y=502.0 x204.0 y514.0 
05-22 15:06:23.681: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:23.689: I/Sample::SurfaceView(9765): frame 
05-22 15:06:23.790: I/Sample::Activity(9765): x=182.0 y=502.0 x206.0 y510.0 
05-22 15:06:23.790: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:23.790: I/Sample::SurfaceView(9765): frame 
05-22 15:06:24.009: I/Sample::Activity(9765): x=154.0 y=503.0 x185.0 y512.0 
05-22 15:06:24.009: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:24.009: I/Sample::SurfaceView(9765): frame 
05-22 15:06:24.189: I/Sample::Activity(9765): x=154.0 y=504.0 x170.0 y512.0 
05-22 15:06:24.189: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:24.197: I/Sample::SurfaceView(9765): frame 
05-22 15:06:24.290: I/Sample::Activity(9765): x=156.0 y=502.0 x184.0 y513.0 
05-22 15:06:24.290: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:24.298: I/Sample::SurfaceView(9765): frame 
05-22 15:06:24.384: I/Sample::Activity(9765): x=158.0 y=504.0 x184.0 y510.0 
05-22 15:06:24.392: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:24.392: I/Sample::SurfaceView(9765): frame 
05-22 15:06:24.493: I/Sample::Activity(9765): x=154.0 y=502.0 x186.0 y510.0 
05-22 15:06:24.493: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:24.493: I/Sample::SurfaceView(9765): frame 
05-22 15:06:24.587: I/Sample::Activity(9765): x=152.0 y=506.0 x172.0 y510.0 
05-22 15:06:24.587: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:24.595: I/Sample::SurfaceView(9765): frame 
05-22 15:06:24.689: I/Sample::Activity(9765): x=154.0 y=504.0 x184.0 y512.0 
05-22 15:06:24.689: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:24.697: I/Sample::SurfaceView(9765): frame 
05-22 15:06:24.798: I/Sample::Activity(9765): x=160.0 y=504.0 x184.0 y512.0 
05-22 15:06:24.798: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:24.806: I/Sample::SurfaceView(9765): frame 
05-22 15:06:24.892: I/Sample::Activity(9765): x=172.0 y=506.0 x184.0 y512.0 
05-22 15:06:24.892: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:24.900: I/Sample::SurfaceView(9765): frame 
05-22 15:06:24.993: I/Sample::Activity(9765): x=158.0 y=508.0 x182.0 y514.0 
05-22 15:06:24.993: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:24.993: I/Sample::SurfaceView(9765): frame 
05-22 15:06:25.095: I/Sample::Activity(9765): x=154.0 y=508.0 x179.0 y514.0 
05-22 15:06:25.095: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:25.095: I/Sample::SurfaceView(9765): frame 
05-22 15:06:25.197: I/Sample::Activity(9765): x=168.0 y=504.0 x184.0 y514.0 
05-22 15:06:25.197: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:25.204: I/Sample::SurfaceView(9765): frame 
05-22 15:06:25.290: I/Sample::Activity(9765): x=190.0 y=504.0 x200.0 y510.0 
05-22 15:06:25.290: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:25.298: I/Sample::SurfaceView(9765): frame 
05-22 15:06:25.400: I/Sample::Activity(9765): x=156.0 y=502.0 x184.0 y510.0 
05-22 15:06:25.400: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:25.407: I/Sample::SurfaceView(9765): frame 
05-22 15:06:25.501: I/Sample::Activity(9765): x=156.0 y=502.0 x186.0 y512.0 
05-22 15:06:25.501: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:25.525: I/Sample::SurfaceView(9765): frame 
05-22 15:06:25.736: I/Sample::Activity(9765): x=154.0 y=500.0 x184.0 y512.0 
05-22 15:06:25.736: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:25.743: I/Sample::SurfaceView(9765): frame 
05-22 15:06:25.915: I/Sample::Activity(9765): x=162.0 y=502.0 x184.0 y508.0 
05-22 15:06:25.915: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:25.923: I/Sample::SurfaceView(9765): frame 
05-22 15:06:26.111: I/Sample::Activity(9765): x=164.0 y=500.0 x186.0 y508.0 
05-22 15:06:26.111: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:26.118: I/Sample::SurfaceView(9765): frame 
05-22 15:06:26.259: I/Sample::Activity(9765): x=156.0 y=500.0 x184.0 y506.0 
05-22 15:06:26.259: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:26.267: I/Sample::SurfaceView(9765): frame 
05-22 15:06:26.423: I/Sample::Activity(9765): x=160.0 y=500.0 x184.0 y506.0 
05-22 15:06:26.423: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:26.439: I/Sample::SurfaceView(9765): frame 
05-22 15:06:26.603: I/Sample::Activity(9765): x=160.0 y=506.0 x180.0 y514.0 
05-22 15:06:26.603: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:26.611: I/Sample::SurfaceView(9765): frame 
05-22 15:06:26.712: I/Sample::Activity(9765): x=168.0 y=512.0 x180.0 y518.0 
05-22 15:06:26.712: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:26.720: I/Sample::SurfaceView(9765): frame 
05-22 15:06:26.822: I/Sample::Activity(9765): x=152.0 y=516.0 x164.0 y524.0 
05-22 15:06:26.822: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:26.822: I/Sample::SurfaceView(9765): frame 
05-22 15:06:26.915: I/Sample::Activity(9765): x=154.0 y=514.0 x198.0 y524.0 
05-22 15:06:26.915: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:26.923: I/Sample::SurfaceView(9765): frame 
05-22 15:06:27.017: I/Sample::Activity(9765): x=152.0 y=516.0 x181.0 y524.0 
05-22 15:06:27.017: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:27.025: I/Sample::SurfaceView(9765): frame 
05-22 15:06:27.118: I/Sample::Activity(9765): x=156.0 y=516.0 x180.0 y522.0 
05-22 15:06:27.118: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:27.126: I/Sample::SurfaceView(9765): frame 
05-22 15:06:27.212: I/Sample::Activity(9765): x=148.0 y=516.0 x178.0 y524.0 
05-22 15:06:27.220: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:27.220: I/Sample::SurfaceView(9765): frame 
05-22 15:06:27.314: I/Sample::Activity(9765): x=148.0 y=520.0 x168.0 y528.0 
05-22 15:06:27.314: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:27.322: I/Sample::SurfaceView(9765): frame 
05-22 15:06:27.439: I/Sample::Activity(9765): x=146.0 y=516.0 x175.0 y526.0 
05-22 15:06:27.439: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:27.447: I/Sample::SurfaceView(9765): frame 
05-22 15:06:27.657: I/Sample::Activity(9765): x=142.0 y=520.0 x154.0 y528.0 
05-22 15:06:27.657: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:27.657: I/Sample::SurfaceView(9765): frame 
05-22 15:06:27.853: I/Sample::Activity(9765): x=14.0 y=100.0 x32.0 y118.0 
05-22 15:06:27.853: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:27.861: I/Sample::SurfaceView(9765): frame 
05-22 15:06:28.056: I/Sample::Activity(9765): x=150.0 y=518.0 x172.0 y526.0 
05-22 15:06:28.056: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:28.064: I/Sample::SurfaceView(9765): frame 
05-22 15:06:28.259: I/Sample::Activity(9765): x=160.0 y=518.0 x173.0 y530.0 
05-22 15:06:28.259: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:28.267: I/Sample::SurfaceView(9765): frame 
05-22 15:06:28.462: I/Sample::Activity(9765): x=10.0 y=144.0 x22.0 y164.0 
05-22 15:06:28.462: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:28.470: I/Sample::SurfaceView(9765): frame 
05-22 15:06:28.634: I/Sample::Activity(9765): x=6.0 y=102.0 x24.0 y122.0 
05-22 15:06:28.634: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:28.642: I/Sample::SurfaceView(9765): frame 
05-22 15:06:28.736: I/Sample::Activity(9765): x=138.0 y=524.0 x169.0 y534.0 
05-22 15:06:28.743: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:28.751: I/Sample::SurfaceView(9765): frame 
05-22 15:06:28.962: I/Sample::Activity(9765): x=1.0 y=92.0 x40.0 y128.0 
05-22 15:06:28.962: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:28.962: I/Sample::SurfaceView(9765): frame 
05-22 15:06:29.157: I/Sample::Activity(9765): x=8.0 y=192.0 x26.0 y214.0 
05-22 15:06:29.157: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:29.157: I/TAG(9765): ddaaaaaa 
05-22 15:06:29.165: I/Sample::SurfaceView(9765): frame 
05-22 15:06:29.368: I/Sample::Activity(9765): x=156.0 y=518.0 x178.0 y530.0 
05-22 15:06:29.368: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:29.376: I/Sample::SurfaceView(9765): frame 
05-22 15:06:29.556: I/Sample::Activity(9765): x=1.0 y=96.0 x24.0 y122.0 
05-22 15:06:29.556: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:29.564: I/Sample::SurfaceView(9765): frame 
05-22 15:06:29.775: I/Sample::Activity(9765): x=126.0 y=526.0 x150.0 y533.0 
05-22 15:06:29.775: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:29.782: I/Sample::SurfaceView(9765): frame 
05-22 15:06:29.954: I/Sample::Activity(9765): x=1.0 y=182.0 x16.0 y202.0 
05-22 15:06:29.954: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:29.962: I/Sample::SurfaceView(9765): frame 
05-22 15:06:30.056: I/Sample::Activity(9765): x=1.0 y=108.0 x24.0 y126.0 
05-22 15:06:30.056: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:30.064: I/Sample::SurfaceView(9765): frame 
05-22 15:06:30.157: I/Sample::Activity(9765): x=6.0 y=184.0 x22.0 y202.0 
05-22 15:06:30.157: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:30.165: I/Sample::SurfaceView(9765): frame 
05-22 15:06:30.243: I/Sample::Activity(9765): x=1.0 y=114.0 x14.0 y124.0 
05-22 15:06:30.243: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:30.251: I/Sample::SurfaceView(9765): frame 
05-22 15:06:30.353: I/Sample::Activity(9765): x=150.0 y=530.0 x158.0 y538.0 
05-22 15:06:30.353: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:30.361: I/Sample::SurfaceView(9765): frame 
05-22 15:06:30.579: I/Sample::Activity(9765): x=1.0 y=104.0 x16.0 y124.0 
05-22 15:06:30.579: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:30.587: I/Sample::SurfaceView(9765): frame 
05-22 15:06:30.775: I/Sample::Activity(9765): x=104.0 y=534.0 x124.0 y544.0 
05-22 15:06:30.775: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:30.782: I/Sample::SurfaceView(9765): frame 
05-22 15:06:30.954: I/Sample::Activity(9765): x=104.0 y=532.0 x130.0 y540.0 
05-22 15:06:30.954: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:30.970: I/Sample::SurfaceView(9765): frame 
05-22 15:06:31.056: I/Sample::Activity(9765): x=1.0 y=160.0 x20.0 y168.0 
05-22 15:06:31.056: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:31.056: I/Sample::SurfaceView(9765): frame 
05-22 15:06:31.157: I/Sample::Activity(9765): x=104.0 y=532.0 x134.0 y541.0 
05-22 15:06:31.157: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:31.165: I/Sample::SurfaceView(9765): frame 
05-22 15:06:31.275: I/Sample::Activity(9765): x=112.0 y=532.0 x138.0 y538.0 
05-22 15:06:31.275: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:31.282: I/Sample::SurfaceView(9765): frame 
05-22 15:06:31.486: I/Sample::Activity(9765): x=142.0 y=530.0 x156.0 y542.0 
05-22 15:06:31.486: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:31.493: I/Sample::SurfaceView(9765): frame 
05-22 15:06:31.665: I/Sample::Activity(9765): x=145.0 y=532.0 x152.0 y540.0 
05-22 15:06:31.665: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:31.673: I/Sample::SurfaceView(9765): frame 
05-22 15:06:31.767: I/Sample::Activity(9765): x=144.0 y=530.0 x160.0 y540.0 
05-22 15:06:31.767: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:31.775: I/Sample::SurfaceView(9765): frame 
05-22 15:06:31.868: I/Sample::Activity(9765): x=1.0 y=108.0 x10.0 y126.0 
05-22 15:06:31.868: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:31.868: I/Sample::SurfaceView(9765): frame 
05-22 15:06:31.962: I/Sample::Activity(9765): x=1.0 y=158.0 x12.0 y166.0 
05-22 15:06:31.970: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:31.970: I/Sample::SurfaceView(9765): frame 
05-22 15:06:32.064: I/Sample::Activity(9765): x=139.0 y=532.0 x154.0 y542.0 
05-22 15:06:32.064: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:32.072: I/Sample::SurfaceView(9765): frame 
05-22 15:06:32.165: I/Sample::Activity(9765): x=1.0 y=116.0 x18.0 y148.0 
05-22 15:06:32.165: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:32.173: I/Sample::SurfaceView(9765): frame 
05-22 15:06:32.267: I/Sample::Activity(9765): x=142.0 y=532.0 x158.0 y540.0 
05-22 15:06:32.267: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:32.275: I/Sample::SurfaceView(9765): frame 
05-22 15:06:32.384: I/Sample::Activity(9765): x=1.0 y=120.0 x22.0 y126.0 
05-22 15:06:32.384: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:32.392: I/Sample::SurfaceView(9765): frame 
05-22 15:06:32.587: I/Sample::Activity(9765): x=106.0 y=542.0 x134.0 y548.0 
05-22 15:06:32.587: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:32.595: I/Sample::SurfaceView(9765): frame 
05-22 15:06:32.806: I/Sample::Activity(9765): x=1.0 y=174.0 x18.0 y186.0 
05-22 15:06:32.806: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:32.806: I/Sample::SurfaceView(9765): frame 
05-22 15:06:32.993: I/Sample::Activity(9765): x=141.0 y=534.0 x156.0 y544.0 
05-22 15:06:32.993: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:33.001: I/Sample::SurfaceView(9765): frame 
05-22 15:06:33.204: I/Sample::Activity(9765): x=2.0 y=100.0 x18.0 y114.0 
05-22 15:06:33.204: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:33.212: I/Sample::SurfaceView(9765): frame 
05-22 15:06:33.251: D/dalvikvm(9765): GC_CONCURRENT freed 314K, 7% free 11279K/12103K, paused 12ms+13ms, total 66ms 
05-22 15:06:33.376: I/Sample::Activity(9765): x=104.0 y=538.0 x134.0 y545.0 
05-22 15:06:33.376: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:33.384: I/Sample::SurfaceView(9765): frame 
05-22 15:06:33.384: E/BufferQueue(9765): [unnamed-9765-0] queueBuffer: SurfaceTexture has been abandoned! 
05-22 15:06:33.392: E/BufferQueue(9765): [unnamed-9765-0] dequeueBuffer: SurfaceTexture has been abandoned! 
05-22 15:06:33.478: I/Sample::Activity(9765): x=1.0 y=96.0 x18.0 y118.0 
05-22 15:06:33.478: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:33.493: E/BufferQueue(9765): [unnamed-9765-0] queueBuffer: SurfaceTexture has been abandoned! 
05-22 15:06:33.501: E/BufferQueue(9765): [unnamed-9765-0] dequeueBuffer: SurfaceTexture has been abandoned! 
05-22 15:06:33.501: I/Sample::SurfaceView(9765): frame 
05-22 15:06:33.587: E/BufferQueue(9765): [unnamed-9765-0] queueBuffer: SurfaceTexture has been abandoned! 
05-22 15:06:33.587: E/BufferQueue(9765): [unnamed-9765-0] dequeueBuffer: SurfaceTexture has been abandoned! 
05-22 15:06:33.697: E/BufferQueue(9765): [unnamed-9765-0] queueBuffer: SurfaceTexture has been abandoned! 
05-22 15:06:33.697: E/BufferQueue(9765): [unnamed-9765-0] dequeueBuffer: SurfaceTexture has been abandoned! 
05-22 15:06:33.697: I/Sample::Activity(9765): x=1.0 y=242.0 x16.0 y256.0 
05-22 15:06:33.697: I/Sample::Activity(9765): hiiii828 1024 
05-22 15:06:33.712: I/Sample::SurfaceView(9765): frame 
05-22 15:06:38.548: I/Sample::Activity(9765): onPause 
05-22 15:06:38.548: I/Sample::SurfaceView(9765): releaseCamera 
05-22 15:06:39.056: I/Sample::SurfaceView(9765): surfaceDestroyed 
05-22 15:06:39.056: I/Sample::SurfaceView(9765): releaseCamera 
05-22 15:06:39.072: W/SurfaceView(9765): CHECK surface infomation creating=false formatChanged=false sizeChanged=false visible=false visibleChanged=true surfaceChanged=true realSizeChanged=false redrawNeeded=false left=false top=false 
05-22 15:06:39.314: W/IInputConnectionWrapper(9765): showStatusIcon on inactive InputConnection 
` 
+0

檢查此 - http://stackoverflow.com/questions/14006337/opencv-android-bufferqueue-error-surface-texture-has-been-abandoned –

+0

謝謝,我已經擁有它像這樣..相機工作,它只是在一段時間後停止..沒有錯誤,只有表面已被放棄.. – pika

回答

6

答案很簡單:讓對象不會被垃圾回收(從而放棄)請參考您的表面紋理。

我得到了同樣的問題(在某些設備上)。通過AOSP代碼的一些挖後,我得知了一個對象的一種方式被「拋棄」如果對所有的強引用的走開......

void ConsumerBase::onLastStrongRef(const void* id) { 
    abandon(); 
} 

於是我又回到了我的代碼,發現我創建一個表面紋理,它傳遞給setPreviewTexture(),然後不保持一個參考表面紋理退出:

SurfaceTexture texture = new SurfaceTexture(10); 
try { 
    mCamera.setPreviewTexture(texture); 
} catch (IOException e) { 
    Log.d(Tag, "Failed to setPreviewTexture"); 
    return 0; 
} 

我做了一個簡單的變化,使表面紋理我班的一個成員對象,現在的「SurfaceTexture已被放棄」錯誤消失 - 我的預覽繼續通過onPreviewFrame()傳遞幀。

+0

驚奇的是,相機不保留其預覽紋理的強烈參考!他們至少應該證明這一點。 –