動画ファイルの同時再生で例外発生

417 views
Skip to first unread message

徳永

unread,
Sep 12, 2018, 11:40:31 AM9/12/18
to 日本Androidの会
お世話になっております。徳永と申します。

動画ファイルを2画面同時に再生させようとしているのですがうまくいきません。
お知恵をお借りできませんでしょうか。

【方法】
・内部ストレージ直下に動画ファイル(mp4)を2つ用意。
・activity_main.xmlに2つSurfaceViewを用意。
・MediaCodecを使って動画再生。

【現象】
再生できる端末と再生できない端末がある。

●再生可能な端末
 XperiaZ4、404SH、MediaPad M3 Lite Wifiモデル

●再生不可能な端末
  Huawei P10
 MediaCodecのconfigureで例外発生してアプリが落ちる。

【ソースコード】

【備考】
再生可能な端末はすべてSnapDragonを積んでいます。
一方、再生不可能な端末はKirinを積んでいます。

【ログ】
Huawei P10で例外発生時のログです。

------------------------------------------------------------------------------------------------------

09/05 18:23:26: Launching app
$ adb shell am start -n "com.example.kohshin.dougasample/com.example.kohshin.dougasample.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Waiting for application to come online: com.example.kohshin.dougasample | com.example.kohshin.dougasample.test
Waiting for application to come online: com.example.kohshin.dougasample | com.example.kohshin.dougasample.test
Waiting for application to come online: com.example.kohshin.dougasample | com.example.kohshin.dougasample.test
Waiting for application to come online: com.example.kohshin.dougasample | com.example.kohshin.dougasample.test
Connecting to com.example.kohshin.dougasample
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/zygote64: Debugger is active
I/System.out: Debugger has connected
              waiting for debugger to settle...
Connected to the target VM, address: 'localhost:8600', transport: 'socket'
I/chatty: uid=10474(u0_a474) com.example.kohshin.dougasample identical 1 line
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: waiting for debugger to settle...
I/System.out: debugger has settled (1335)
D/HwFLClassLoader: get used feature list :/feature/used-list failed!
                   USE_FEATURE_LIST had not init!
I/InstantRun: starting instant run server: is main process
E/MemoryLeakMonitorManager: MemoryLeakMonitor.jar is not exist!
E/Minikin: Could not get cmap table size!
I/HwCust: Constructor found for class android.app.HwCustActivityImpl
D/HwCust: Create obj success use class android.app.HwCustActivityImpl
V/HwPolicyFactory: : success to get AllImpl object and return....
I/HwCust: Constructor found for class android.app.HwCustHwWallpaperManagerImpl
D/HwCust: Create obj success use class android.app.HwCustHwWallpaperManagerImpl
V/HwWidgetFactory: : successes to get AllImpl object and return....
V/ActivityThread: ActivityThread,callActivityOnCreate
D/HwRTBlurUtils: check blur style for HwPhoneWindow, themeResId : 0x7f0f0008, context : com.example.kohshin.dougasample.MainActivity@5737564, Nhwext : 0, get Blur : disable with , null
D/ActivityThread: add activity client record, r= ActivityRecord{cf2c6a9 token=android.os.BinderProxy@7f50eca {com.example.kohshin.dougasample/com.example.kohshin.dougasample.MainActivity}} token= android.os.BinderProxy@7f50eca
I/HwSecImmHelper: mSecurityInputMethodService is null
D/OpenGLRenderer:   HWUI Binary is  enabled
D/OpenGLRenderer: HWUI GL Pipeline
I/PressGestureDetector: HiTouch restricted: AboardArea.
V/ActivityThread: Handle window ActivityRecord{cf2c6a9 token=android.os.BinderProxy@7f50eca {com.example.kohshin.dougasample/com.example.kohshin.dougasample.MainActivity}} visibility: true
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 2
D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000
E/vndksupport: Could not load vendor/lib64/egl/libGLES_mali_v2.so from sphal namespace: dlopen failed: library "vendor/lib64/egl/libGLES_mali_v2.so" not found.
I/MediaExtractor: Create (null)
W/MediaExtractor: creating media extractor in calling process
W/MediaExtractor: uid 10474.  not using HwExtendedExtractor
I/MediaExtractor: content 'video/mp4' with conf 0.40
I/SampleTable: There are reordered frames present.
I/SampleTable: There are reordered frames present.
I/Utils: vstride = 0,vsliceHeight = 0
D/MediaBufferGroup: creating MemoryDealer
I/OMXClient: Treble IOmx obtained
I/ACodec: In onAllocateComponent create compenent, codec name: OMX.hisi.video.decoder.avc
D/SurfaceUtils: connecting to surface 0x7cf9c7d010, reason connectToSurface
E/SurfaceUtils: Failed to connect to surface 0x7cf9c7d010, err -22
E/MediaCodec: nativeWindowConnect returned an error: Invalid argument (-22)
E/MediaCodec: configure failed with err 0xffffffea, resetting...
I/OMXClient: Treble IOmx obtained
I/ACodec: In onAllocateComponent create compenent, codec name: OMX.hisi.video.decoder.avc
E/AndroidRuntime: FATAL EXCEPTION: Thread-7 --------------------------------------------------------------------------------------------------->ここで落ちる。
                  Process: com.example.kohshin.dougasample, PID: 10814
                  java.lang.IllegalArgumentException
                      at android.media.MediaCodec.native_configure(Native Method)
                      at android.media.MediaCodec.configure(MediaCodec.java:1948)
                      at android.media.MediaCodec.configure(MediaCodec.java:1877)
                      at com.example.kohshin.dougasample.PlayView$PlayerThread.run(PlayView.java:80)
I/Process: Sending signal. PID: 10814 SIG: 9
--------------------------------------------------------------------------------------------------------------------------------------------------------------------


Reply all
Reply to author
Forward
0 new messages