我目前正在为嵌入式设备开发Android应用(4.4)。我们正在使用QT / Qml(5.6.0)作为用户界面,以及一个依赖于SurfaceView的原生视频播放器。
之前,我们使用了2个不同的活动,但我们有很多同步问题可以在适当的时候显示视频。因此,我们决定通过在QT App树中实现视频的surfaceView来合并这两个活动。树是:
的FrameLayout
|
| ------- RelativeLayout的
| ------- |
| ------- | ------- SurfaceView(VOD播放器)
|
|
| ------- QtLayout
| ------- |
| ------- | ------- QtSurfaceView
第一次启动时一切正常,VOD显示在界面后面。 adb shell dumpsys提供以下信息:
adb shell dumpsys SurfaceFlinger
Visible layers (count = 6)
+ Layer 0x14cf518 (com.android.systemui.ImageWallpaper)
z= 21000, pos=(0,-256), size=(1280,1280), isOpaque=1, needsDithering=0, invalidate=0, alpha=0xff, flags=0x00000001, tr=[1.00, 0.00][0.00, 1.00]
client=0x14d00a0, identity=3
format= 2, activeBuffer=[1280x1280:1280, 5], transform-hint=0x00, queued-frames=0
mBufferCount=2, mSynchronousMode=1, default-size=[1280x1280], mPixelFormat=5, mTexName=-1563003837
current: {crop=[0,0,0,0], transform=0x00, current=-1}
next : {crop=[0,0,-1,-1], transform=0x00, FIFO(0)={}}
[00] state=FREE , crop=[0,0,0,0], transform=0x00, timestamp=355968597417
[01] state=FREE , crop=[0,0,-1,-1], transform=0x00, timestamp=0
Region transparentRegion (this=0x14cf6b8, count=1)
[ 0, 0, 0, 0]
Region transparentRegionScreen (this=0x14cf54c, count=1)
[ 0, 0, 0, 0]
Region visibleRegionScreen (this=0x14cf528, count=1)
[ 0, 0, 0, 0]
+ LayerDim 0x14ca948 (DimSurface)
z= 21009, pos=(0,0), size=(1280, 768), isOpaque=0, needsDithering=0, invalidate=0, alpha=0xff, flags=0x00000001, tr=[1.00, 0.00][0.00, 1.00]
client=0x14d0040, identity=6
Region transparentRegion (this=0x14caae8, count=1)
[ 0, 0, 0, 0]
Region transparentRegionScreen (this=0x14ca97c, count=1)
[ 0, 0, 0, 0]
Region visibleRegionScreen (this=0x14ca958, count=1)
[ 0, 0, 0, 0]
+ Layer 0x14d4b10 (SurfaceView)
z= 21010, pos=(0,0), size=(1280, 767), isOpaque=1, needsDithering=0, invalidate=0, alpha=0xff, flags=0x00000000, tr=[1.00, 0.00][0.00, 1.00]
client=0x14cfdb8, identity=27
format= 1, activeBuffer=[ 720x 480:4096,100], transform-hint=0x00, queued-frames=0
mBufferCount=8, mSynchronousMode=1, default-size=[1280x767], mPixelFormat=256, mTexName=1995859160
current: {crop=[0,0,720,240], transform=0x00, current=7}
next : {crop=[0,0,720,240], transform=0x00, FIFO(0)={}}
[00] state=DEQUEUED, crop=[0,0,720,240], transform=0x00, timestamp=568781738286, 0x14d35d0 [ 720x 480:4096,100]
[01] state=DEQUEUED, crop=[0,0,720,240], transform=0x00, timestamp=568646942144, 0x14d3900 [ 720x 480:4096,100]
[02] state=DEQUEUED, crop=[0,0,720,240], transform=0x00, timestamp=568814239507, 0x14d9270 [ 720x 480:4096,100]
[03] state=DEQUEUED, crop=[0,0,720,240], transform=0x00, timestamp=568616149907, 0x14d9300 [ 720x 480:4096,100]
[04] state=DEQUEUED, crop=[0,0,720,240], transform=0x00, timestamp=568748077398, 0x14d3390 [ 720x 480:4096,100]
[05] state=DEQUEUED, crop=[0,0,720,240], transform=0x00, timestamp=568681243902, 0x14cbe48 [ 720x 480:4096,100]
[06] state=DEQUEUED, crop=[0,0,720,240], transform=0x00, timestamp=568714294439, 0x14d7740 [ 720x 480:4096,100]
>[07] state=QUEUED , crop=[0,0,720,240], transform=0x00, timestamp=568846710210, 0x14d7920 [ 720x 480:4096,100]
Region transparentRegion (this=0x14d4cb0, count=1)
[ 0, 0, 0, 0]
Region transparentRegionScreen (this=0x14d4b44, count=1)
[ 0, 0, 0, 0]
Region visibleRegionScreen (this=0x14d4b20, count=1)
[ 0, 0, 1280, 767]
+ Layer 0x14d6b68 (SurfaceView)
z= 21015, pos=(0,0), size=(1280, 767), isOpaque=0, needsDithering=0, invalidate=0, alpha=0xff, flags=0x00000000, tr=[1.00, 0.00][0.00, 1.00]
client=0x14cfdb8, identity=23
format= 1, activeBuffer=[1280x 767:1280, 5], transform-hint=0x00, queued-frames=1
mBufferCount=2, mSynchronousMode=1, default-size=[1280x767], mPixelFormat=5, mTexName=1984777172
current: {crop=[0,0,0,0], transform=0x00, current=1}
next : {crop=[0,0,0,0], transform=0x00, FIFO(1)={00 }}
[00] state=QUEUED , crop=[0,0,0,0], transform=0x00, timestamp=568865600591, 0x14d93a8 [1280x 767:1280, 5]
>[01] state=QUEUED , crop=[0,0,0,0], transform=0x00, timestamp=568846252446, 0x14d9238 [1280x 767:1280, 5]
Region transparentRegion (this=0x14d6d08, count=1)
[ 0, 0, 0, 0]
Region transparentRegionScreen (this=0x14d6b9c, count=1)
[ 0, 0, 0, 0]
Region visibleRegionScreen (this=0x14d6b78, count=1)
[ 0, 0, 1280, 767]
+ Layer 0x14ca420 (com.******.ux.qml/com.******.ux.qml.*****Activity)
z= 21020, pos=(0,0), size=(1280, 767), isOpaque=0, needsDithering=0, invalidate=0, alpha=0xff, flags=0x00000000, tr=[1.00, 0.00][0.00, 1.00]
client=0x14cfdb8, identity=22
format= 1, activeBuffer=[1280x 767:1280, 5], transform-hint=0x00, queued-frames=0
mBufferCount=2, mSynchronousMode=1, default-size=[1280x767], mPixelFormat=5, mTexName=229433297
current: {crop=[0,0,0,0], transform=0x00, current=1}
next : {crop=[0,0,0,0], transform=0x00, FIFO(0)={}}
[00] state=DEQUEUED, crop=[0,0,0,0], transform=0x00, timestamp=565950469976, 0x14d8520 [1280x 767:1280, 5]
>[01] state=QUEUED , crop=[0,0,0,0], transform=0x00, timestamp=565995605474, 0x14d3628 [1280x 767:1280, 5]
Region transparentRegion (this=0x14ca5c0, count=1)
[ 0, 0, 1280, 767]
Region transparentRegionScreen (this=0x14ca454, count=1)
[ 0, 0, 1280, 767]
Region visibleRegionScreen (this=0x14ca430, count=1)
[ 0, 0, 0, 0]
+ Layer 0x14d1320 (StatusBar)
z= 141000, pos=(0,767), size=(1280, 1), isOpaque=1, needsDithering=0, invalidate=0, alpha=0xff, flags=0x00000000, tr=[1.00, 0.00][0.00, 1.00]
client=0x14d00a0, identity=2
format= 4, activeBuffer=[1280x 1:1280, 4], transform-hint=0x00, queued-frames=0
mBufferCount=2, mSynchronousMode=1, default-size=[1280x1], mPixelFormat=4, mTexName=1505553220
current: {crop=[0,0,-1,-1], transform=0x00, current=0}
next : {crop=[0,0,-1,-1], transform=0x00, FIFO(0)={}}
>[00] state=QUEUED , crop=[0,0,-1,-1], transform=0x00, timestamp=356044860845, 0x14d0440 [1280x 1:1280, 4]
[01] state=FREE , crop=[0,0,-1,-1], transform=0x00, timestamp=0
Region transparentRegion (this=0x14d14c0, count=1)
[ 0, 0, 0, 0]
Region transparentRegionScreen (this=0x14d1354, count=1)
[ 0, 0, 0, 0]
Region visibleRegionScreen (this=0x14d1330, count=1)
[ 0, 767, 1280, 768]
Purgatory state (0 entries)
SurfaceFlinger global state:
GLES: Imagination Technologies, PowerVR SGX 540, OpenGL ES-CM 1.1
EGL : 1.4 build 1.8@785978
EXTS: GL_OES_byte_coordinates GL_OES_fixed_point GL_OES_single_precision GL_OES_matrix_get GL_OES_read_format GL_OES_compressed_paletted_texture GL_OES_point_sprite GL_OES_point_size_array GL_OES_matrix_palette GL_OES_draw_texture GL_OES_query_matrix GL_OES_texture_env_crossbar GL_OES_texture_mirrored_repeat GL_OES_texture_cube_map GL_OES_blend_subtract GL_OES_blend_func_separate GL_OES_blend_equation_separate GL_OES_stencil_wrap GL_OES_extended_matrix_palette GL_OES_framebuffer_object GL_OES_rgb8_rgba8 GL_OES_depth24 GL_OES_stencil8 GL_OES_compressed_ETC1_RGB8_texture GL_OES_mapbuffer GL_OES_EGL_image GL_OES_EGL_image_external GL_EXT_multi_draw_arrays GL_OES_required_internalformat GL_IMG_read_format GL_IMG_texture_compression_pvrtc GL_IMG_texture_format_BGRA8888 GL_EXT_texture_format_BGRA8888 GL_OES_egl_sync GL_IMG_vertex_array_object
Region WormholeRegion (this=0x14b4b04, count=1)
[ 0, 0, 0, 0]
orientation=0, canDraw=1
last eglSwapBuffers() time: 18798.828000 us
last transaction time : 30.517000 us
refresh-rate : 52.582001 fps
x-dpi : 160.000000
y-dpi : 160.000000
eglSwapBuffers time: 3601.074000 us
h/w composer present and enabled
Hardware Composer state:
numHwLayers=3, flags=00000000
type | handle | hints | flags | tr | blend | format | source crop | frame name
----------+----------+----------+----------+----+-------+----------+---------------------------+--------------------------------
OVERLAY | 014d7920 | 00000000 | 00000000 | 00 | 00100 | 00000100 | [ 0, 0, 720, 240] | [ 0, 0, 1280, 767] SurfaceView
OVERLAY | 014d9238 | 00000000 | 00000000 | 00 | 00105 | 00000005 | [ 0, 0, 1280, 767] | [ 0, 0, 1280, 767] SurfaceView
OVERLAY | 014d0440 | 00000000 | 00000000 | 00 | 00100 | 00000004 | [ 0, 0, 1280, 1] | [ 0, 767, 1280, 768] StatusBar
omap4_hwc 3:
idle timeout: 250ms
layer 0:
enabled: true
buff: 0x14d7920 720x480 stride: 736
src: (0,0) 720x240
dst: (0,0) 1280x767
ix: 1
zorder: 0
layer 1:
enabled: true
buff: 0x14d9238 1280x767 stride: 5120
src: (0,0) 1280x767
dst: (0,0) 1280x767
ix: 0
zorder: 1
layer 2:
enabled: true
buff: 0x14d0440 1280x1 stride: 2560
src: (0,0) 1280x1
dst: (0,767) 1280x1
ix: 2
zorder: 2
Allocated buffers:
0x14cbe48: unknown | 720 (4096) x 480 | 100 | 0x00002b00
0x14d0440: 2.50 KiB | 1280 (1280) x 1 | 4 | 0x00000933
0x14d1928: 6400.00 KiB | 1280 (1280) x 1280 | 5 | 0x00000b00
0x14d3390: unknown | 720 (4096) x 480 | 100 | 0x00002b00
0x14d35d0: unknown | 720 (4096) x 480 | 100 | 0x00002b00
0x14d3628: 3835.00 KiB | 1280 (1280) x 767 | 5 | 0x00000b00
0x14d3900: unknown | 720 (4096) x 480 | 100 | 0x00002b00
0x14d7740: unknown | 720 (4096) x 480 | 100 | 0x00002b00
0x14d7920: unknown | 720 (4096) x 480 | 100 | 0x00002b00
0x14d8520: 3835.00 KiB | 1280 (1280) x 767 | 5 | 0x00000b00
0x14d9238: 3835.00 KiB | 1280 (1280) x 767 | 5 | 0x00000b00
0x14d9270: unknown | 720 (4096) x 480 | 100 | 0x00002b00
0x14d9300: unknown | 720 (4096) x 480 | 100 | 0x00002b00
0x14d93a8: 3835.00 KiB | 1280 (1280) x 767 | 5 | 0x00000b00
Total allocated (estimate): 21742.50 KB
IMG Graphics HAL state:
Dumping all active sync objects..
ID=93, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0x0/0x0, ROP2/ROC2=0x11/0x10, WOC DevVA=0x0d800fa4, ROC DevVA=0x0d800fac, ROC2 DevVA=0x0d800fb4
ID=91, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0x0/0x0, ROP2/ROC2=0x12/0x12, WOC DevVA=0x0d800a84, ROC DevVA=0x0d800a8c, ROC2 DevVA=0x0d800a94
ID=89, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0x0/0x0, ROP2/ROC2=0x10/0x10, WOC DevVA=0x0d800f24, ROC DevVA=0x0d800f2c, ROC2 DevVA=0x0d800f34
ID=87, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0x0/0x0, ROP2/ROC2=0x10/0x10, WOC DevVA=0x0d800ee4, ROC DevVA=0x0d800eec, ROC2 DevVA=0x0d800ef4
ID=85, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0x0/0x0, ROP2/ROC2=0x13/0x13, WOC DevVA=0x0d800ea4, ROC DevVA=0x0d800eac, ROC2 DevVA=0x0d800eb4
ID=83, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0x0/0x0, ROP2/ROC2=0x14/0x12, WOC DevVA=0x0d800c64, ROC DevVA=0x0d800c6c, ROC2 DevVA=0x0d800c74
ID=81, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0x0/0x0, ROP2/ROC2=0x11/0x11, WOC DevVA=0x0d800c24, ROC DevVA=0x0d800c2c, ROC2 DevVA=0x0d800c34
ID=79, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0x0/0x0, ROP2/ROC2=0x15/0x15, WOC DevVA=0x0d800d44, ROC DevVA=0x0d800d4c, ROC2 DevVA=0x0d800d54
ID=30, 0xP...FHWR=0x00000b00, WOP/WOC=0xf26/0xf25, ROP/ROC=0x5c/0x5c, ROP2/ROC2=0xed8/0xed6, WOC DevVA=0x0d8009e4, ROC DevVA=0x0d8009ec, ROC2 DevVA=0x0d8009f4
ID=29, 0xP...FHWR=0x00000b00, WOP/WOC=0x8/0x8, ROP/ROC=0x0/0x0, ROP2/ROC2=0x0/0x0, WOC DevVA=0x0d8009c4, ROC DevVA=0x0d8009cc, ROC2 DevVA=0x0d8009d4
ID=28, 0xP...FHWR=0x00000b00, WOP/WOC=0xf27/0xf25, ROP/ROC=0x6b/0x6b, ROP2/ROC2=0xed5/0xed4, WOC DevVA=0x0d8009a4, ROC DevVA=0x0d8009ac, ROC2 DevVA=0x0d8009b4
ID=27, 0xP...FHWR=0x00000b00, WOP/WOC=0x8/0x8, ROP/ROC=0x0/0x0, ROP2/ROC2=0x0/0x0, WOC DevVA=0x0d800e24, ROC DevVA=0x0d800e2c, ROC2 DevVA=0x0d800e34
ID=7, 0xP...FHWR=0x00000933, WOP/WOC=0x0/0x0, ROP/ROC=0x1/0x1, ROP2/ROC2=0x21e8/0x21e5, WOC DevVA=0x0d8006a4, ROC DevVA=0x0d8006ac, ROC2 DevVA=0x0d8006b4
ID=5, 0xP...FHWR=0x00000b00, WOP/WOC=0x1/0x1, ROP/ROC=0x0/0x0, ROP2/ROC2=0x0/0x0, WOC DevVA=0x0d800824, ROC DevVA=0x0d80082c, ROC2 DevVA=0x0d800834
ID=2, 0xP...FHWR=0x00001000, WOP/WOC=0xb8/0xb8, ROP/ROC=0x0/0x0, ROP2/ROC2=0xb8/0xb8, WOC DevVA=0x0d800044, ROC DevVA=0x0d80004c, ROC2 DevVA=0x0d800054
ID=1, 0xP...FHWR=0x00001000, WOP/WOC=0xb8/0xb8, ROP/ROC=0x0/0x0, ROP2/ROC2=0xb8/0xb8, WOC DevVA=0x0d800024, ROC DevVA=0x0d80002c, ROC2 DevVA=0x0d800034
但是,在我们的系统中,app可以被另一个Activity中断,onPause被trigerred然后onResume。
Visible layers (count = 6)
+ Layer 0x14cf518 (com.android.systemui.ImageWallpaper)
z= 21000, pos=(0,-256), size=(1280,1280), isOpaque=1, needsDithering=0, invalidate=0, alpha=0xff, flags=0x00000001, tr=[1.00, 0.00][0.00, 1.00]
client=0x14d00a0, identity=3
format= 2, activeBuffer=[1280x1280:1280, 5], transform-hint=0x00, queued-frames=0
mBufferCount=2, mSynchronousMode=1, default-size=[1280x1280], mPixelFormat=5, mTexName=-1563003837
current: {crop=[0,0,0,0], transform=0x00, current=-1}
next : {crop=[0,0,-1,-1], transform=0x00, FIFO(0)={}}
[00] state=FREE , crop=[0,0,0,0], transform=0x00, timestamp=355968597417
[01] state=FREE , crop=[0,0,-1,-1], transform=0x00, timestamp=0
Region transparentRegion (this=0x14cf6b8, count=1)
[ 0, 0, 0, 0]
Region transparentRegionScreen (this=0x14cf54c, count=1)
[ 0, 0, 0, 0]
Region visibleRegionScreen (this=0x14cf528, count=1)
[ 0, 0, 0, 0]
+ LayerDim 0x14ca948 (DimSurface)
z= 21009, pos=(0,0), size=(1280, 768), isOpaque=0, needsDithering=0, invalidate=0, alpha=0xff, flags=0x00000001, tr=[1.00, 0.00][0.00, 1.00]
client=0x14d0040, identity=6
Region transparentRegion (this=0x14caae8, count=1)
[ 0, 0, 0, 0]
Region transparentRegionScreen (this=0x14ca97c, count=1)
[ 0, 0, 0, 0]
Region visibleRegionScreen (this=0x14ca958, count=1)
[ 0, 0, 0, 0]
+ Layer 0x14d6b68 (SurfaceView)
z= 21010, pos=(0,0), size=(1280, 767), isOpaque=0, needsDithering=0, invalidate=0, alpha=0xff, flags=0x00000000, tr=[1.00, 0.00][0.00, 1.00]
client=0x14cfdb8, identity=23
format= 1, activeBuffer=[1280x 767:1280, 5], transform-hint=0x00, queued-frames=1
mBufferCount=2, mSynchronousMode=1, default-size=[1280x767], mPixelFormat=5, mTexName=1984777172
current: {crop=[0,0,0,0], transform=0x00, current=0}
next : {crop=[0,0,0,0], transform=0x00, FIFO(1)={01 }}
>[00] state=QUEUED , crop=[0,0,0,0], transform=0x00, timestamp=1075593353277, 0x14d93a8 [1280x 767:1280, 5]
[01] state=QUEUED , crop=[0,0,0,0], transform=0x00, timestamp=1075597686773, 0x14d9238 [1280x 767:1280, 5]
Region transparentRegion (this=0x14d6d08, count=1)
[ 0, 0, 0, 0]
Region transparentRegionScreen (this=0x14d6b9c, count=1)
[ 0, 0, 0, 0]
Region visibleRegionScreen (this=0x14d6b78, count=1)
[ 0, 0, 0, 0]
+ Layer 0x14cbd40 (SurfaceView)
z= 21015, pos=(0,0), size=(1280, 767), isOpaque=1, needsDithering=0, invalidate=0, alpha=0xff, flags=0x00000000, tr=[1.00, 0.00][0.00, 1.00]
client=0x14cfdb8, identity=29
format= 1, activeBuffer=[ 720x 480:4096,100], transform-hint=0x00, queued-frames=0
mBufferCount=8, mSynchronousMode=1, default-size=[1280x767], mPixelFormat=256, mTexName=622950690
current: {crop=[0,0,720,240], transform=0x00, current=0}
next : {crop=[0,0,720,240], transform=0x00, FIFO(0)={}}
>[00] state=QUEUED , crop=[0,0,720,240], transform=0x00, timestamp=1075593200689, 0x14d4150 [ 720x 480:4096,100]
[01] state=DEQUEUED, crop=[0,0,720,240], transform=0x00, timestamp=1075327606206, 0x14d42d8 [ 720x 480:4096,100]
[02] state=DEQUEUED, crop=[0,0,720,240], transform=0x00, timestamp=1075558044439, 0x14d4460 [ 720x 480:4096,100]
[03] state=DEQUEUED, crop=[0,0,720,240], transform=0x00, timestamp=1075425262456, 0x14d48a8 [ 720x 480:4096,100]
[04] state=DEQUEUED, crop=[0,0,720,240], transform=0x00, timestamp=1075458221441, 0x14d4a88 [ 720x 480:4096,100]
[05] state=DEQUEUED, crop=[0,0,720,240], transform=0x00, timestamp=1075391387945, 0x14d4ce0 [ 720x 480:4096,100]
[06] state=DEQUEUED, crop=[0,0,720,240], transform=0x00, timestamp=1075490966802, 0x14ca860 [ 720x 480:4096,100]
[07] state=DEQUEUED, crop=[0,0,720,240], transform=0x00, timestamp=1075524536139, 0x14d9c08 [ 720x 480:4096,100]
Region transparentRegion (this=0x14cbee0, count=1)
[ 0, 0, 0, 0]
Region transparentRegionScreen (this=0x14cbd74, count=1)
[ 0, 0, 0, 0]
Region visibleRegionScreen (this=0x14cbd50, count=1)
[ 0, 0, 1280, 767]
+ Layer 0x14ca420 (com.******.ux.qml/com.*****.ux.qml.*****Activity)
z= 21020, pos=(0,0), size=(1280, 767), isOpaque=0, needsDithering=0, invalidate=0, alpha=0xff, flags=0x00000000, tr=[1.00, 0.00][0.00, 1.00]
client=0x14cfdb8, identity=22
format= 1, activeBuffer=[1280x 767:1280, 5], transform-hint=0x00, queued-frames=0
mBufferCount=2, mSynchronousMode=1, default-size=[1280x767], mPixelFormat=5, mTexName=229433297
current: {crop=[0,0,0,0], transform=0x00, current=1}
next : {crop=[0,0,0,0], transform=0x00, FIFO(0)={}}
[00] state=DEQUEUED, crop=[0,0,0,0], transform=0x00, timestamp=709190032964, 0x14d8520 [1280x 767:1280, 5]
>[01] state=QUEUED , crop=[0,0,0,0], transform=0x00, timestamp=1061756073004, 0x14d3628 [1280x 767:1280, 5]
Region transparentRegion (this=0x14ca5c0, count=1)
[ 0, 0, 1280, 767]
Region transparentRegionScreen (this=0x14ca454, count=1)
[ 0, 0, 1280, 767]
Region visibleRegionScreen (this=0x14ca430, count=1)
[ 0, 0, 0, 0]
+ Layer 0x14d1320 (StatusBar)
z= 141000, pos=(0,767), size=(1280, 1), isOpaque=1, needsDithering=0, invalidate=0, alpha=0xff, flags=0x00000000, tr=[1.00, 0.00][0.00, 1.00]
client=0x14d00a0, identity=2
format= 4, activeBuffer=[1280x 1:1280, 4], transform-hint=0x00, queued-frames=0
mBufferCount=2, mSynchronousMode=1, default-size=[1280x1], mPixelFormat=4, mTexName=1505553220
current: {crop=[0,0,-1,-1], transform=0x00, current=0}
next : {crop=[0,0,-1,-1], transform=0x00, FIFO(0)={}}
>[00] state=QUEUED , crop=[0,0,-1,-1], transform=0x00, timestamp=356044860845, 0x14d0440 [1280x 1:1280, 4]
[01] state=FREE , crop=[0,0,-1,-1], transform=0x00, timestamp=0
Region transparentRegion (this=0x14d14c0, count=1)
[ 0, 0, 0, 0]
Region transparentRegionScreen (this=0x14d1354, count=1)
[ 0, 0, 0, 0]
Region visibleRegionScreen (this=0x14d1330, count=1)
[ 0, 767, 1280, 768]
Purgatory state (0 entries)
SurfaceFlinger global state:
GLES: Imagination Technologies, PowerVR SGX 540, OpenGL ES-CM 1.1
EGL : 1.4 build 1.8@785978
EXTS: GL_OES_byte_coordinates GL_OES_fixed_point GL_OES_single_precision GL_OES_matrix_get GL_OES_read_format GL_OES_compressed_paletted_texture GL_OES_point_sprite GL_OES_point_size_array GL_OES_matrix_palette GL_OES_draw_texture GL_OES_query_matrix GL_OES_texture_env_crossbar GL_OES_texture_mirrored_repeat GL_OES_texture_cube_map GL_OES_blend_subtract GL_OES_blend_func_separate GL_OES_blend_equation_separate GL_OES_stencil_wrap GL_OES_extended_matrix_palette GL_OES_framebuffer_object GL_OES_rgb8_rgba8 GL_OES_depth24 GL_OES_stencil8 GL_OES_compressed_ETC1_RGB8_texture GL_OES_mapbuffer GL_OES_EGL_image GL_OES_EGL_image_external GL_EXT_multi_draw_arrays GL_OES_required_internalformat GL_IMG_read_format GL_IMG_texture_compression_pvrtc GL_IMG_texture_format_BGRA8888 GL_EXT_texture_format_BGRA8888 GL_OES_egl_sync GL_IMG_vertex_array_object
Region WormholeRegion (this=0x14b4b04, count=1)
[ 0, 0, 0, 0]
orientation=0, canDraw=1
last eglSwapBuffers() time: 13214.111000 us
last transaction time : 30.518000 us
refresh-rate : 52.582001 fps
x-dpi : 160.000000
y-dpi : 160.000000
eglSwapBuffers time: 5187.988000 us
h/w composer present and enabled
Hardware Composer state:
numHwLayers=2, flags=00000000
type | handle | hints | flags | tr | blend | format | source crop | frame name
----------+----------+----------+----------+----+-------+----------+---------------------------+--------------------------------
OVERLAY | 014d4150 | 00000000 | 00000000 | 00 | 00100 | 00000100 | [ 0, 0, 720, 240] | [ 0, 0, 1280, 767] SurfaceView
OVERLAY | 014d0440 | 00000000 | 00000000 | 00 | 00100 | 00000004 | [ 0, 0, 1280, 1] | [ 0, 767, 1280, 768] StatusBar
omap4_hwc 2:
idle timeout: 250ms
layer 0:
enabled: true
buff: 0x14d4150 720x480 stride: 736
src: (0,0) 720x240
dst: (0,0) 1280x767
ix: 1
zorder: 0
layer 1:
enabled: true
buff: 0x14d0440 1280x1 stride: 2560
src: (0,0) 1280x1
dst: (0,767) 1280x1
ix: 0
zorder: 1
Allocated buffers:
0x14ca860: unknown | 720 (4096) x 480 | 100 | 0x00002b00
0x14d0440: 2.50 KiB | 1280 (1280) x 1 | 4 | 0x00000933
0x14d1928: 6400.00 KiB | 1280 (1280) x 1280 | 5 | 0x00000b00
0x14d3628: 3835.00 KiB | 1280 (1280) x 767 | 5 | 0x00000b00
0x14d4150: unknown | 720 (4096) x 480 | 100 | 0x00002b00
0x14d42d8: unknown | 720 (4096) x 480 | 100 | 0x00002b00
0x14d4460: unknown | 720 (4096) x 480 | 100 | 0x00002b00
0x14d48a8: unknown | 720 (4096) x 480 | 100 | 0x00002b00
0x14d4a88: unknown | 720 (4096) x 480 | 100 | 0x00002b00
0x14d4ce0: unknown | 720 (4096) x 480 | 100 | 0x00002b00
0x14d8520: 3835.00 KiB | 1280 (1280) x 767 | 5 | 0x00000b00
0x14d9238: 3835.00 KiB | 1280 (1280) x 767 | 5 | 0x00000b00
0x14d93a8: 3835.00 KiB | 1280 (1280) x 767 | 5 | 0x00000b00
0x14d9c08: unknown | 720 (4096) x 480 | 100 | 0x00002b00
Total allocated (estimate): 21742.50 KB
IMG Graphics HAL state:
Dumping all active sync objects..
ID=125, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0x8/0x8, ROP2/ROC2=0x278/0x278, WOC DevVA=0x0d800a64, ROC DevVA=0x0d800a6c, ROC2 DevVA=0x0d800a74
ID=123, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0x5/0x5, ROP2/ROC2=0x279/0x279, WOC DevVA=0x0d800f44, ROC DevVA=0x0d800f4c, ROC2 DevVA=0x0d800f54
ID=121, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0x11/0x11, ROP2/ROC2=0x36cc/0x36cc, WOC DevVA=0x0d800f04, ROC DevVA=0x0d800f0c, ROC2 DevVA=0x0d800f14
ID=119, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0x9/0x9, ROP2/ROC2=0x26d/0x26d, WOC DevVA=0x0d800ec4, ROC DevVA=0x0d800ecc, ROC2 DevVA=0x0d800ed4
ID=117, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0xb/0xb, ROP2/ROC2=0x272/0x272, WOC DevVA=0x0d800c84, ROC DevVA=0x0d800c8c, ROC2 DevVA=0x0d800c94
ID=115, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0x8/0x8, ROP2/ROC2=0x26b/0x26a, WOC DevVA=0x0d800c44, ROC DevVA=0x0d800c4c, ROC2 DevVA=0x0d800c54
ID=113, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0x8/0x8, ROP2/ROC2=0x26e/0x26e, WOC DevVA=0x0d800c04, ROC DevVA=0x0d800c0c, ROC2 DevVA=0x0d800c14
ID=111, 0xP...FHWR=0x00002b00, WOP/WOC=0x0/0x0, ROP/ROC=0x8/0x8, ROP2/ROC2=0x272/0x271, WOC DevVA=0x0d800fc4, ROC DevVA=0x0d800fcc, ROC2 DevVA=0x0d800fd4
ID=30, 0xP...FHWR=0x00000b00, WOP/WOC=0x4485/0x4484, ROP/ROC=0xa1/0xa1, ROP2/ROC2=0x4047/0x4047, WOC DevVA=0x0d8009e4, ROC DevVA=0x0d8009ec, ROC2 DevVA=0x0d8009f4
ID=29, 0xP...FHWR=0x00000b00, WOP/WOC=0xb/0xb, ROP/ROC=0xb/0xb, ROP2/ROC2=0x0/0x0, WOC DevVA=0x0d8009c4, ROC DevVA=0x0d8009cc, ROC2 DevVA=0x0d8009d4
ID=28, 0xP...FHWR=0x00000b00, WOP/WOC=0x4485/0x4484, ROP/ROC=0xac/0xac, ROP2/ROC2=0x4047/0x4047, WOC DevVA=0x0d8009a4, ROC DevVA=0x0d8009ac, ROC2 DevVA=0x0d8009b4
ID=27, 0xP...FHWR=0x00000b00, WOP/WOC=0xb/0xb, ROP/ROC=0x3f/0x3f, ROP2/ROC2=0x0/0x0, WOC DevVA=0x0d800e24, ROC DevVA=0x0d800e2c, ROC2 DevVA=0x0d800e34
ID=7, 0xP...FHWR=0x00000933, WOP/WOC=0x0/0x0, ROP/ROC=0x4a/0x4a, ROP2/ROC2=0x86a7/0x86a5, WOC DevVA=0x0d8006a4, ROC DevVA=0x0d8006ac, ROC2 DevVA=0x0d8006b4
ID=5, 0xP...FHWR=0x00000b00, WOP/WOC=0x1/0x1, ROP/ROC=0x0/0x0, ROP2/ROC2=0x0/0x0, WOC DevVA=0x0d800824, ROC DevVA=0x0d80082c, ROC2 DevVA=0x0d800834
ID=2, 0xP...FHWR=0x00001000, WOP/WOC=0x112/0x112, ROP/ROC=0x0/0x0, ROP2/ROC2=0x112/0x112, WOC DevVA=0x0d800044, ROC DevVA=0x0d80004c, ROC2 DevVA=0x0d800054
ID=1, 0xP...FHWR=0x00001000, WOP/WOC=0x111/0x111, ROP/ROC=0x0/0x0, ROP2/ROC2=0x111/0x111, WOC DevVA=0x0d800024, ROC DevVA=0x0d80002c, ROC2 DevVA=0x0d800034
在这些调用之后,表面顺序会发生一些事情。视频显示在QT Surface的顶部上。视频surfaceView(Layer 0x14d4b10)已更改并变为0x14cbd40(因此已重新创建),其z顺序从21010变为21015.QTSurface未更改(0x14d6b68)但z顺序已更改(21010而不是21015) 。
我尝试在Android级别更改z顺序(setZorderOnTop,setZorderMedialOverlay ...),但它没有任何影响。对我来说看起来很奇怪的是,当游戏完成并且玩家重新启动(视频循环)时,表面会被重新创建,而这次,它被放在QTSurfaceView后面!根据同样的想法,删除然后将VOD surfaceView添加到树中将其置于QT后面(但它会在玩家端引起很多不稳定)
所以我对Android如何管理SurfaceView有点迷失,如果z-order取决于何时创建SurfaceView,我们应该在onResume和删除/添加SurfaceView之间保持一致的行为。有没有办法强制z顺序?由于我们使用的是嵌入式自定义平台,因此我们可以访问任何隐藏的或原生的API来获取它,我们不仅限于" normal" Android应用。
我还想知道Android(Overlay,media ...)方面的不同z顺序级别是否依赖于硬件/实现。是否有可能我们无法管理它,因为我们的硬件或OpenGL ES-CM 1.1无法管理这些层?如何知道是否是这种情况?
非常感谢任何帮助!
编辑:经过更多调查(使用反射API检查值是否设置正确),Android Java方面没有问题。当视频表面视图设置为媒体时,QTSurface可以很好地设置为媒体覆盖,但它并不能防止出现问题。我认为它是围绕Android原生/ OpenGL / Driver的东西。 作为一种解决方法,我发现当视频完全停止时播放视频表面视图(播放器不接触表面)然后将其添加回onResume似乎正确地重新排序两个SurfaceView。我仍然需要检查这个修复程序是否与本机玩家足够稳定,但它可以做到这一点......