理论上,NativeWindow是支持2.3系统的,但是目前测试发现,在HTC g12的手机上(2.3.3系统),没有画面,有声音,logcat日志一直显示:
03-22 21:24:09.154: E/SurfaceFlinger(1365): Layer::requestBuffer(this=0x1024fd8), index=0, pid=7517, w=512, h=288 failed (Invalid argument)
03-22 21:24:09.154: E/Surface(7517): Surface (identity=291) requestBuffer(0, 512, 288, 842094169, 00000033) returned a buffer with a null handle
03-22 21:24:09.154: E/Surface(7517): getBufferLocked(0, 512, 288, 842094169, 00000033) failed (Out of memory)
03-22 21:24:09.154: E/Surface(7517): dequeueBuffer failed (Out of memory)
03-22 21:24:09.234: W/GraphicBufferAllocator(1365): alloc(512, 288, 842094169, 00000133, ...) failed -22 (Invalid argument)
03-22 21:24:09.234: D/GraphicBufferAllocator(1365): Allocated buffers:
03-22 21:24:09.234: D/GraphicBufferAllocator(1365): 0x4d1530: 2059.38 KiB | 800 ( 800) x 659 | 1 | 0x00000133 | 1475
03-22 21:24:09.234: D/GraphicBufferAllocator(1365): 0x578700: 750.00 KiB | 480 ( 480) x 800 | 4 | 0x00000133 | 1365
03-22 21:24:09.234: D/GraphicBufferAllocator(1365): 0x5ccec8: 750.00 KiB | 480 ( 480) x 800 | 4 | 0x00000133 | 1365
03-22 21:24:09.234: D/GraphicBufferAllocator(1365): 0x8f1ce8: 1059.38 KiB | 800 ( 800) x 339 | 1 | 0x00000133 | 1475
03-22 21:24:09.234: D/GraphicBufferAllocator(1365): 0x98fc68: 1500.00 KiB | 800 ( 800) x 480 | 1 | 0x00000133 | 7517
03-22 21:24:09.234: D/GraphicBufferAllocator(1365): 0x9c13e0: 118.75 KiB | 800 ( 800) x 38 | 2 | 0x00000133 | 1475
03-22 21:24:09.234: D/GraphicBufferAllocator(1365): 0x9ddfb8: 1500.00 KiB | 800 ( 800) x 480 | 1 | 0x00000133 | 7517
03-22 21:24:09.234: D/GraphicBufferAllocator(1365): 0xae6ef0: 118.75 KiB | 800 ( 800) x 38 | 2 | 0x00000133 | 1475
#3-22 21:24:09.234: D/GraphicBufferAllocator(1365): Total allocated: 7856.25 KB
像是内存申请失败之类的错误,麻烦帮助看定位一下,谢谢!
测试用的是ijk原生的代码,从播放开始的log如下:
03-22 21:34:40.374: D/ConnectivityService(1365): getMobileDataEnabled returning false
03-22 21:34:40.645: W/AudioTrack(7517): obtainBuffer() track 0x3a53a0 disabled, restarting
03-22 21:34:41.325: W/AudioTrack(7517): obtainBuffer() track 0x3a53a0 disabled, restarting
03-22 21:34:42.006: W/AudioTrack(7517): obtainBuffer() track 0x3a53a0 disabled, restarting
03-22 21:34:42.697: W/AudioTrack(7517): obtainBuffer() track 0x3a53a0 disabled, restarting
03-22 21:34:43.377: W/AudioTrack(7517): obtainBuffer() track 0x3a53a0 disabled, restarting
03-22 21:34:43.377: D/ConnectivityService(1365): getMobileDataEnabled returning false
03-22 21:34:43.778: D/lights(1365): set_light_buttons_func: on=6710886 brightness=102
03-22 21:34:43.788: D/lights(1365): set_light_buttons_func: on=16777215 brightness=255
03-22 21:34:43.868: I/RenderThread(1485): RenderThread resumed
03-22 21:34:43.868: I/RenderThread(1485): RenderThread paused, waiting for signal
03-22 21:34:43.878: I/ActivityManager(1365): Starting activity: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=tv.danmaku.ijk.media.demo/.VideoPlayerActivity bnds=[251,211][341,301] } from pid 1485
03-22 21:34:43.928: V/HtcAppUsageStats(1365): (launch app, package): (ijkmediademo, tv.danmaku.ijk.media.demo)
03-22 21:34:43.938: I/POST_RESELECT: [spanChange](o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$START@401050e8,-1,0,-1,0)
03-22 21:34:43.948: I/POST_RESELECT: [spanChange](o, oldStart, newStart, oldEnd, newEnd)=(android.text.Selection$END@4011d768,-1,0,-1,0)
03-22 21:34:43.948: I/SurfaceFlinger(1365): SurfaceFlinger::setOrientation
03-22 21:34:43.948: I/WindowManager(1365): Setting rotation to 1, animFlags=1
03-22 21:34:43.948: D/PowerManagerService(1365): button light setOrientation:1
03-22 21:34:43.968: I/ActivityManager(1365): Config changed: { scale=1.0 imsi=460/2 loc=zh_CN touch=3 keys=1/1/2 nav=1/1 orien=2 layout=34 uiMode=17 seq=66 skin=default}
03-22 21:34:44.148: D/dalvikvm(1492): GC_EXTERNAL_ALLOC freed 189K, 50% free 3404K/6727K, external 1656K/1954K, paused 29ms
03-22 21:34:44.178: W/AudioTrack(7517): obtainBuffer() track 0x3a53a0 disabled, restarting
03-22 21:34:44.308: I/ActivityManager(1365): Displayed tv.danmaku.ijk.media.demo/.VideoPlayerActivity: +364ms
03-22 21:34:44.408: D/szipinf(2604): Initializing inflate state
03-22 21:34:44.418: W/IInputConnectionWrapper(1485): showStatusIcon on inactive InputConnection
03-22 21:34:44.418: W/IInputConnectionWrapper(1485): InputConnection = android.view.inputmethod.BaseInputConnection@406112f0, active client = false
03-22 21:34:44.418: W/InputManagerService(1365): [unbindCurrentClientLocked] Disable input method client.
03-22 21:34:44.418: W/InputManagerService(1365): [startInputLocked] Enable input method client.
03-22 21:34:44.428: D/SurfaceFlinger(1365): layer=0x1024fd8 is not in the purgatory list
03-22 21:34:44.869: W/AudioTrack(7517): obtainBuffer() track 0x3a53a0 disabled, restarting
03-22 21:34:45.029: D/dalvikvm(1492): GC_EXPLICIT freed 38K, 50% free 3393K/6727K, external 1592K/2281K, paused 63ms
03-22 21:34:45.179: D/StatusBarPolicy(1475): onSignalStrengthsChanged
03-22 21:34:45.549: W/AudioTrack(7517): obtainBuffer() track 0x3a53a0 disabled, restarting
03-22 21:34:46.240: W/AudioTrack(7517): obtainBuffer() track 0x3a53a0 disabled, restarting
03-22 21:34:46.380: D/ConnectivityService(1365): getMobileDataEnabled returning false
03-22 21:34:46.560: D/dalvikvm(1365): GC_EXPLICIT freed 1319K, 39% free 8558K/14023K, external 2940K/3117K, paused 145ms
03-22 21:34:46.931: W/AudioTrack(7517): obtainBuffer() track 0x3a53a0 disabled, restarting
03-22 21:34:47.621: W/AudioTrack(7517): obtainBuffer() track 0x3a53a0 disabled, restarting
03-22 21:34:48.302: W/AudioTrack(7517): obtainBuffer() track 0x3a53a0 disabled, restarting
03-22 21:34:48.362: D/tv.danmaku.ijk.media.widget.VideoView(7517): onPrepared
03-22 21:34:48.362: D/tv.danmaku.ijk.media.widget.VideoView(7517): onVideoSizeChanged: (512x288)
03-22 21:34:48.362: D/tv.danmaku.ijk.media.widget.VideoView(7517): VIDEO: 512x288x1.777778[SAR:0:0], Surface: 512x288, LP: 800x480, Window: 800x480x1.666667
03-22 21:34:48.372: I/AudioPolicyManagerBase(1251): setOutputDevice() output 1 device 2 delayMs 0
03-22 21:34:48.372: I/AudioPolicyManagerBase(1251): setOutputDevice() setting same device 2 or null device for output 1
03-22 21:34:48.382: D/tv.danmaku.ijk.media.widget.VideoView(7517): onVideoSizeChanged: (1x1)
03-22 21:34:48.392: D/tv.danmaku.ijk.media.widget.VideoView(7517): VIDEO: 512x288x1.777778[SAR:1:1], Surface: 512x288, LP: 800x480, Window: 800x480x1.666667
03-22 21:34:48.392: I/tv.danmaku.ijk.media.player.IjkMediaPlayer(7517): Info (701,0)
03-22 21:34:48.402: D/tv.danmaku.ijk.media.widget.VideoView(7517): onInfo: (701, 0)
03-22 21:34:48.402: D/tv.danmaku.ijk.media.widget.VideoView(7517): onInfo: (MEDIA_INFO_BUFFERING_START)
03-22 21:34:48.402: I/tv.danmaku.ijk.media.player.IjkMediaPlayer(7517): Info (702,0)
03-22 21:34:48.402: D/AudioHardwareMSM7X30(1251): acquire output wakelock
03-22 21:34:48.412: I/AudioHardwareMSM7X30(1251): do_aic3254_control (1, 0, 0)
03-22 21:34:48.412: I/AudioHardwareMSM7X30(1251): aic3254: change rx mode to 13
03-22 21:34:48.412: D/AudioHardwareMSM7X30(1251): addToTable (dec_id 5, dev_rx 6, dev_tx -1, type 1, active 1)
03-22 21:34:48.412: D/tv.danmaku.ijk.media.widget.VideoView(7517): onInfo: (702, 0)
03-22 21:34:48.412: D/tv.danmaku.ijk.media.widget.VideoView(7517): onInfo: (MEDIA_INFO_BUFFERING_END)
03-22 21:34:48.422: I/HTC Acoustic(1251): update ACDB id: (tx, rx, tx_acdb, rx_acdb) = (11, 6, 0, 607)
03-22 21:34:48.432: D/AudioHardwareMSM7X30(1251): updateACDB: (6, 11, 607, 0) success!
03-22 21:34:48.432: I/AudioHardwareMSM7X30(1251): AUDIO_START: start kernel pcm_out driver.
03-22 21:34:48.522: D/tv.danmaku.ijk.media.widget.VideoView(7517): onVideoSizeChanged: (512x288)
03-22 21:34:48.522: D/tv.danmaku.ijk.media.widget.VideoView(7517): VIDEO: 512x288x1.777778[SAR:1:1], Surface: 512x288, LP: 800x480, Window: 800x480x1.666667
03-22 21:34:48.522: W/GraphicBufferAllocator(1365): alloc(512, 288, 842094169, 00000133, ...) failed -22 (Invalid argument)
03-22 21:34:48.532: D/GraphicBufferAllocator(1365): Allocated buffers:
03-22 21:34:48.532: D/GraphicBufferAllocator(1365): 0x489ce8: 71.25 KiB | 480 ( 480) x 38 | 2 | 0x00000133 | 1475
03-22 21:34:48.532: D/GraphicBufferAllocator(1365): 0x4d53a0: 750.00 KiB | 480 ( 480) x 800 | 4 | 0x00000133 | 1365
03-22 21:34:48.532: D/GraphicBufferAllocator(1365): 0x4f50c0: 2059.38 KiB | 800 ( 800) x 659 | 1 | 0x00000133 | 1475
03-22 21:34:48.532: D/GraphicBufferAllocator(1365): 0x884280: 118.75 KiB | 800 ( 800) x 38 | 2 | 0x00000133 | 1475
03-22 21:34:48.532: D/GraphicBufferAllocator(1365): 0x8f1298: 750.00 KiB | 800 ( 800) x 480 | 4 | 0x00000133 | 1365
03-22 21:34:48.532: D/GraphicBufferAllocator(1365): 0x9ddfb8: 346.88 KiB | 800 ( 800) x 111 | 1 | 0x00000133 | 7517
03-22 21:34:48.532: D/GraphicBufferAllocator(1365): 0x9dfbb8: 1059.38 KiB | 800 ( 800) x 339 | 1 | 0x00000133 | 1475
03-22 21:34:48.532: D/GraphicBufferAllocator(1365): 0xa08da0: 1500.00 KiB | 800 ( 800) x 480 | 1 | 0x00000133 | 7517
03-22 21:34:48.532: D/GraphicBufferAllocator(1365): Total allocated: 6655.62 KB
03-22 21:34:48.532: E/SurfaceFlinger(1365): Layer::requestBuffer(this=0xa99ef0), index=0, pid=7517, w=512, h=288 failed (Invalid argument)
03-22 21:34:48.532: E/Surface(7517): Surface (identity=297) requestBuffer(0, 512, 288, 842094169, 00000033) returned a buffer with a null handle
03-22 21:34:48.532: E/Surface(7517): getBufferLocked(0, 512, 288, 842094169, 00000033) failed (Out of memory)
03-22 21:34:48.532: E/Surface(7517): dequeueBuffer failed (Out of memory)
03-22 21:34:48.532: D/tv.danmaku.ijk.media.widget.VideoView(7517): onVideoSizeChanged: (512x288)
03-22 21:34:48.532: D/tv.danmaku.ijk.media.widget.VideoView(7517): VIDEO: 512x288x1.777778[SAR:1:1], Surface: 512x288, LP: 800x480, Window: 800x480x1.666667
03-22 21:34:48.562: D/tv.danmaku.ijk.media.widget.VideoView(7517): onVideoSizeChanged: (512x288)
03-22 21:34:48.562: D/tv.danmaku.ijk.media.widget.VideoView(7517): VIDEO: 512x288x1.777778[SAR:1:1], Surface: 512x288, LP: 800x480, Window: 800x480x1.666667
03-22 21:34:48.592: W/GraphicBufferAllocator(1365): alloc(512, 288, 842094169, 00000133, ...) failed -22 (Invalid argument)
03-22 21:34:48.592: D/GraphicBufferAllocator(1365): Allocated buffers:
03-22 21:34:48.592: D/GraphicBufferAllocator(1365): 0x489ce8: 71.25 KiB | 480 ( 480) x 38 | 2 | 0x00000133 | 1475
03-22 21:34:48.592: D/GraphicBufferAllocator(1365): 0x4d53a0: 750.00 KiB | 480 ( 480) x 800 | 4 | 0x00000133 | 1365
03-22 21:34:48.592: D/GraphicBufferAllocator(1365): 0x4f50c0: 2059.38 KiB | 800 ( 800) x 659 | 1 | 0x00000133 | 1475
03-22 21:34:48.592: D/GraphicBufferAllocator(1365): 0x884280: 118.75 KiB | 800 ( 800) x 38 | 2 | 0x00000133 | 1475
03-22 21:34:48.592: D/GraphicBufferAllocator(1365): 0x8f1298: 750.00 KiB | 800 ( 800) x 480 | 4 | 0x00000133 | 1365
03-22 21:34:48.592: D/GraphicBufferAllocator(1365): 0x9ddfb8: 346.88 KiB | 800 ( 800) x 111 | 1 | 0x00000133 | 7517
03-22 21:34:48.592: D/GraphicBufferAllocator(1365): 0x9dfbb8: 1059.38 KiB | 800 ( 800) x 339 | 1 | 0x00000133 | 1475
03-22 21:34:48.592: D/GraphicBufferAllocator(1365): 0xa08da0: 1500.00 KiB | 800 ( 800) x 480 | 1 | 0x00000133 | 7517
03-22 21:34:48.592: D/GraphicBufferAllocator(1365): Total allocated: 6655.62 KB
03-22 21:34:48.592: E/SurfaceFlinger(1365): Layer::requestBuffer(this=0xa99ef0), index=0, pid=7517, w=512, h=288 failed (Invalid argument)
03-22 21:34:48.592: E/Surface(7517): Surface (identity=297) requestBuffer(0, 512, 288, 842094169, 00000033) returned a buffer with a null handle
03-22 21:34:48.592: E/Surface(7517): getBufferLocked(0, 512, 288, 842094169, 00000033) failed (Out of memory)
03-22 21:34:48.592: E/Surface(7517): dequeueBuffer failed (Out of memory)
03-22 21:34:48.663: W/GraphicBufferAllocator(1365): alloc(512, 288, 842094169, 00000133, ...) failed -22 (Invalid argument)
03-22 21:34:48.663: D/GraphicBufferAllocator(1365): Allocated buffers:
03-22 21:34:48.663: D/GraphicBufferAllocator(1365): 0x489ce8: 71.25 KiB | 480 ( 480) x 38 | 2 | 0x00000133 | 1475
03-22 21:34:48.663: D/GraphicBufferAllocator(1365): 0x4d53a0: 750.00 KiB | 480 ( 480) x 800 | 4 | 0x00000133 | 1365
03-22 21:34:48.663: D/GraphicBufferAllocator(1365): 0x4f50c0: 2059.38 KiB | 800 ( 800) x 659 | 1 | 0x00000133 | 1475
03-22 21:34:48.663: D/GraphicBufferAllocator(1365): 0x884280: 118.75 KiB | 800 ( 800) x 38 | 2 | 0x00000133 | 1475
03-22 21:34:48.663: D/GraphicBufferAllocator(1365): 0x8f1298: 750.00 KiB | 800 ( 800) x 480 | 4 | 0x00000133 | 1365
03-22 21:34:48.663: D/GraphicBufferAllocator(1365): 0x9ddfb8: 346.88 KiB | 800 ( 800) x 111 | 1 | 0x00000133 | 7517
03-22 21:34:48.663: D/GraphicBufferAllocator(1365): 0x9dfbb8: 1059.38 KiB | 800 ( 800) x 339 | 1 | 0x00000133 | 1475
03-22 21:34:48.663: D/GraphicBufferAllocator(1365): 0xa08da0: 1500.00 KiB | 800 ( 800) x 480 | 1 | 0x00000133 | 7517
03-22 21:34:48.663: D/GraphicBufferAllocator(1365): Total allocated: 6655.62 KB
03-22 21:34:48.663: E/SurfaceFlinger(1365): Layer::requestBuffer(this=0xa99ef0), index=0, pid=7517, w=512, h=288 failed (Invalid argument)
03-22 21:34:48.663: E/Surface(7517): Surface (identity=297) requestBuffer(0, 512, 288, 842094169, 00000033) returned a buffer with a null handle
03-22 21:34:48.663: E/Surface(7517): getBufferLocked(0, 512, 288, 842094169, 00000033) failed (Out of memory)
03-22 21:34:48.663: E/Surface(7517): dequeueBuffer failed (Out of memory)
03-22 21:34:48.723: W/GraphicBufferAllocator(1365): alloc(512, 288, 842094169, 00000133, ...) failed -22 (Invalid argument)
03-22 21:34:48.733: D/GraphicBufferAllocator(1365): Allocated buffers:
03-22 21:34:48.733: D/GraphicBufferAllocator(1365): 0x489ce8: 71.25 KiB | 480 ( 480) x 38 | 2 | 0x00000133 | 1475
03-22 21:34:48.733: D/GraphicBufferAllocator(1365): 0x4d53a0: 750.00 KiB | 480 ( 480) x 800 | 4 | 0x00000133 | 1365
03-22 21:34:48.733: D/GraphicBufferAllocator(1365): 0x4f50c0: 2059.38 KiB | 800 ( 800) x 659 | 1 | 0x00000133 | 1475
03-22 21:34:48.733: D/GraphicBufferAllocator(1365): 0x884280: 118.75 KiB | 800 ( 800) x 38 | 2 | 0x00000133 | 1475
03-22 21:34:48.733: D/GraphicBufferAllocator(1365): 0x8f1298: 750.00 KiB | 800 ( 800) x 480 | 4 | 0x00000133 | 1365
03-22 21:34:48.733: D/GraphicBufferAllocator(1365): 0x9ddfb8: 346.88 KiB | 800 ( 800) x 111 | 1 | 0x00000133 | 7517
03-22 21:34:48.733: D/GraphicBufferAllocator(1365): 0x9dfbb8: 1059.38 KiB | 800 ( 800) x 339 | 1 | 0x00000133 | 1475
03-22 21:34:48.733: D/GraphicBufferAllocator(1365): 0xa08da0: 1500.00 KiB | 800 ( 800) x 480 | 1 | 0x00000133 | 7517
03-22 21:34:48.733: D/GraphicBufferAllocator(1365): Total allocated: 6655.62 KB