(2013-02-23, 09:34)Koying Wrote: We don't use a "real" surface, but a SurfaceTexture, which wraps a GL texture.
Behind the scenes, GraphicBuffers are used, which are HW buffers that the HW decoder fills with a decoded frame. On top of those, one EGLImageKHR is mapped to each native window buffer.
"SurfaceTexture::updateTexImage" just maps the latest EGLImageKHR to the GL texture.
Fact is, on the other platforms, if there is a MODxx tweak, the frame size metadata reflects this and all is well.
On rk3066, the returned frame size is not MODxx and I assume this (wrong) frame size is used to build the EGLImage -> crashes.
So, really, for this to work on rk3066, the HW buffers size should be MODxx.
Note that using SW renderer, i.e. libstagefright thumbnail mode, just crashes the mediaserver/vpu:
Code:
F/libc ( 90): Fatal signal 11 (SIGSEGV) at 0x40112000 (code=2), thread 1960 (mediaserver)
I/DEBUG ( 85): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
I/DEBUG ( 85): Build fingerprint: 'rk30sdk/rk30sdk/rk30sdk:4.1.1/JRO03H/eng.root.20130116.110927:eng/test-keys'
I/DEBUG ( 85): pid: 90, tid: 1960, name: mediaserver >>> /system/bin/mediaserver <<<
I/DEBUG ( 85): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 40112000
I/DEBUG ( 85): r0 40112000 r1 42a75020 r2 001fcfe0 r3 40c37000
I/DEBUG ( 85): r4 41b89a48 r5 41b9b420 r6 00000440 r7 00000780
I/DEBUG ( 85): r8 42678000 r9 41b900e0 sl 41b9b690 fp 41b8d428
I/DEBUG ( 85): ip 40111000 sp 42877ca8 lr 40f600d7 pc 4013f798 cpsr 20000030
I/DEBUG ( 85): d0 1010101010101010 d1 1010101010101010
I/DEBUG ( 85): d2 1010101010101010 d3 1010101010101010
I/DEBUG ( 85): d4 0000000000000000 d5 0000002800000000
I/DEBUG ( 85): d6 4220000041300000 d7 3f8000003debc8c1
I/DEBUG ( 85): d8 0000000000000000 d9 0000000000000000
I/DEBUG ( 85): d10 0000000000000000 d11 0000000000000000
I/DEBUG ( 85): d12 0000000000000000 d13 0000000000000000
I/DEBUG ( 85): d14 0000000000000000 d15 0000000000000000
I/DEBUG ( 85): d16 00000000000099cf d17 7e37e43c8800759c
I/DEBUG ( 85): d18 4000000000000000 d19 bf66c16be38d5283
I/DEBUG ( 85): d20 3fc5555533bce6df d21 3e66376972bea4d0
I/DEBUG ( 85): d22 3ff0000000000000 d23 bf6376c7f8038f6c
I/DEBUG ( 85): d24 3ff009bb63fc01c8 d25 0000000000000000
I/DEBUG ( 85): d26 0000000000000000 d27 0000000000000000
I/DEBUG ( 85): d28 0000000000000000 d29 0000000000000000
I/DEBUG ( 85): d30 0000000000000000 d31 0000000000000000
I/DEBUG ( 85): scr 60000010
I/DEBUG ( 85):
I/DEBUG ( 85): backtrace:
I/DEBUG ( 85): #00 pc 0000c798 /system/lib/libc.so
I/DEBUG ( 85): #01 pc 000fece4 <unknown>
I/DEBUG ( 85):
I/DEBUG ( 85): stack:
I/DEBUG ( 85): 42877c68 ec7a2d80
I/DEBUG ( 85): 42877c6c 42a74000 anon_inode:ion_share_fd
I/DEBUG ( 85): 42877c70 40c37000 /system/lib/libvpu.so
I/DEBUG ( 85): 42877c74 00000000
I/DEBUG ( 85): 42877c78 00000000
I/DEBUG ( 85): 42877c7c 40c37000 /system/lib/libvpu.so
I/DEBUG ( 85): 42877c80 00000000
I/DEBUG ( 85): 42877c84 40c2f514 /system/lib/libvpu.so (VPUMemInvalidate+200)
I/DEBUG ( 85): 42877c88 42877cdc
I/DEBUG ( 85): 42877c8c 42877c90
I/DEBUG ( 85): 42877c90 00000000
I/DEBUG ( 85): 42877c94 41b89a48 [heap]
I/DEBUG ( 85): 42877c98 41b9b420 [heap]
I/DEBUG ( 85): 42877c9c 00000440
I/DEBUG ( 85): 42877ca0 df0027ad
I/DEBUG ( 85): 42877ca4 00000000
I/DEBUG ( 85): #00 42877ca8 42877cdc
I/DEBUG ( 85): 42877cac 42877ce8
I/DEBUG ( 85): #01 42877cb0 00000000
I/DEBUG ( 85): 42877cb4 00000000
I/DEBUG ( 85): 42877cb8 00000000
I/DEBUG ( 85): 42877cbc 00000000
I/DEBUG ( 85): 42877cc0 41b9b6a0 [heap]
I/DEBUG ( 85): 42877cc4 00000000
emm, that is normal. Because we have modified the SoftwareRenderer to adapt to VPU_FRAME structure
This is the patch we made:
diff --git a/media/libstagefright/include/SoftwareRenderer.h b/media/libstagefright/include/SoftwareRenderer.h
index 7ab0042..994c2e1 100644
--- a/media/libstagefright/include/SoftwareRenderer.h
+++ b/media/libstagefright/include/SoftwareRenderer.h
@@ -21,7 +21,8 @@
#include <media/stagefright/ColorConverter.h>
#include <utils/RefBase.h>
#include <system/window.h>
-
+#include <utils/Vector.h>
+#include "vpu_global.h"
namespace android {
struct MetaData;
@@ -48,7 +49,13 @@ private:
int32_t mWidth, mHeight;
int32_t mCropLeft, mCropTop, mCropRight, mCropBottom;
int32_t mCropWidth, mCropHeight;
+ Vector<VPU_FRAME*> mStructId;
+ uint32_t mLastbuf;
+ bool init_Flag;
+ int32_t rga_fd;
+ int32_t power_fd;
+ int32_t mHttpFlag;
SoftwareRenderer(const SoftwareRenderer &);
SoftwareRenderer &operator=(const SoftwareRenderer &);
};