gpt4 book ai didi

android - SurfaceTexture 已被废弃

转载 作者:太空宇宙 更新时间:2023-11-03 11:57:33 26 4
gpt4 key购买 nike

我是这里和 android 的新手 :)我有一个 android 应用程序,它正在从相机接收帧并尝试处理它们(也使用 OpenCv 查找特定颜色)。我使用 SurfaceTexture setPreviewCallbackWithBuffer() 然后使用 Canvas 显示它们。但是,在处理一些帧之后,我的相机卡住并且我收到:SurfaceTexture 已被放弃!请注意,在显示之前正在处理一些帧,有多少?-每次都取决于..我的问题是:这是由缓冲区、内存泄漏还是其他原因引起的?

任何帮助将不胜感激!这是我的 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
`

最佳答案

简短的回答:保留对 SurfaceTexture 的引用,这样对象就不会被垃圾回收(从而被丢弃)。

我遇到了同样的问题(在某些设备上)。在深入研究了 AOSP 代码之后,我了解到如果对象的所有强引用都消失了,那么“放弃”对象的一种方式...

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

所以我回到我的代码并注意到我正在创建一个 SurfaceTexture,将它传递给 setPreviewTexture(),然后在不保留对 SurfaceTexture 的引用的情况下退出:

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

我做了一个简单的更改,使 SurfaceTexture 成为我类的成员对象,现在“SurfaceTexture 已被放弃”错误消失了 - 我的预览继续通过 onPreviewFrame() 传送帧。

关于android - SurfaceTexture 已被废弃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23807086/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com