google / ExoPlayer

This project is deprecated and stale. The latest ExoPlayer code is available in https://github.com/androidx/media
https://developer.android.com/media/media3/exoplayer
Apache License 2.0
21.74k stars 6.03k forks source link

The latest version of Huawei P9 plays hevc video screen rotation #7179

Closed VenryZhong closed 4 years ago

VenryZhong commented 4 years ago

Issue description

Hello, I have a problem. On Huawei P9, using exoplayer to simply play a h265 video will encounter problems. Using the old version 2.10.8 can play normally, while using the new version 2.11.3 will cause the screen to rotate. what should i do. As shown: version: 2.10.8: 2 10 8

version: 2.11.3: 2 11 3

Reproduction steps

 setContentView(R.layout.activity_main);
        // 2.11.3
        SimpleExoPlayer simpleExoPlayer =  new SimpleExoPlayer.Builder(this).build();
        // 2.10.8
//        SimpleExoPlayer simpleExoPlayer =  ExoPlayerFactory.newSimpleInstance(this);
        PlayerView exoPlayerView = findViewById(R.id.exoView);
        exoPlayerView.setPlayer(simpleExoPlayer);
        MediaSource videoSource = new ProgressiveMediaSource.Factory( new DefaultDataSourceFactory(this , "test"))
                .createMediaSource(Uri.parse("asset:///ttt.mp4"));
        simpleExoPlayer.prepare(videoSource);
        simpleExoPlayer.setPlayWhenReady(true);
<LinearLayout
    android:id="@+id/activity_main"
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <com.google.android.exoplayer2.ui.PlayerView
        android:id="@+id/exoView"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

</LinearLayout> 

Link to test content

video: ttt.mp4.zip

[REQUIRED] A full bug report captured from the device

2020-04-03 18:23:24.245 16797-16797/com.example.exoplayerdemo D/HwGalleryCacheManagerImpl: mIsEffect:false
2020-04-03 18:23:24.251 16797-16797/com.example.exoplayerdemo D/HwRTBlurUtils: check blur style for HwPhoneWindow, themeResId : 0x7f0d0005, context : com.example.exoplayerdemo.TestActivity@13907ff, Nhwext : 0, get Blur : disable with , null
2020-04-03 18:23:24.251 16797-16797/com.example.exoplayerdemo D/HwRTBlurUtils: check blur style for HwPhoneWindow, themeResId : 0x7f0d0005, context : com.example.exoplayerdemo.TestActivity@13907ff, Nhwext : 0, get Blur : disable with , null
2020-04-03 18:23:24.285 16797-16797/com.example.exoplayerdemo W/Settings: mValues not put! needsGenerationTracker: true currentGeneration: -1 name: accessibility_captioning_enabled value: null
2020-04-03 18:23:24.313 16797-16802/com.example.exoplayerdemo I/zygote64: Do partial code cache collection, code=61KB, data=43KB
2020-04-03 18:23:24.313 16797-16802/com.example.exoplayerdemo I/zygote64: After code cache collection, code=61KB, data=43KB
2020-04-03 18:23:24.313 16797-16802/com.example.exoplayerdemo I/zygote64: Increasing code cache capacity to 256KB
2020-04-03 18:23:24.331 16797-16797/com.example.exoplayerdemo I/HwCust: Constructor found for class android.net.HwCustConnectivityManagerImpl
2020-04-03 18:23:24.331 16797-16797/com.example.exoplayerdemo D/HwCust: Create obj success use class android.net.HwCustConnectivityManagerImpl
2020-04-03 18:23:24.340 16797-16797/com.example.exoplayerdemo I/ExoPlayerImpl: Init 56ca28c [ExoPlayerLib/2.11.3] [HWEVA, EVA-AL00, HUAWEI, 26]
2020-04-03 18:23:24.357 16797-16797/com.example.exoplayerdemo D/ActivityThread: add activity client record, r= ActivityRecord{41d228d token=android.os.BinderProxy@499dbd2 {com.example.exoplayerdemo/com.example.exoplayerdemo.TestActivity}} token= android.os.BinderProxy@499dbd2
2020-04-03 18:23:24.363 16797-16797/com.example.exoplayerdemo W/VRSystemServiceManager: vr service is not alive
2020-04-03 18:23:24.369 16797-16797/com.example.exoplayerdemo D/OpenGLRenderer:   HWUI Binary is  enabled
2020-04-03 18:23:24.372 16797-16825/com.example.exoplayerdemo D/OpenGLRenderer: HWUI GL Pipeline
2020-04-03 18:23:24.385 16797-16797/com.example.exoplayerdemo I/PressGestureDetector: onAttached begin
2020-04-03 18:23:24.385 16797-16797/com.example.exoplayerdemo I/PressGestureDetector: onAttached end
2020-04-03 18:23:24.387 16797-16826/com.example.exoplayerdemo I/PressGestureDetector: enabledInPad = false,isPcCastMode = false
2020-04-03 18:23:24.419 16797-16823/com.example.exoplayerdemo W/VideoCapabilities: Unrecognized profile/level 1/32 for video/mp4v-es
2020-04-03 18:23:24.419 16797-16823/com.example.exoplayerdemo I/VideoCapabilities: Unsupported profile 16384 for video/mp4v-es
2020-04-03 18:23:24.419 16797-16823/com.example.exoplayerdemo I/VideoCapabilities: Unsupported profile 16384 for video/mp4v-es
2020-04-03 18:23:24.423 16797-16823/com.example.exoplayerdemo W/VideoCapabilities: Unsupported mime video/x-pn-realvideo
2020-04-03 18:23:24.426 16797-16823/com.example.exoplayerdemo W/VideoCapabilities: Unsupported mime video/mpeg
2020-04-03 18:23:24.427 16797-16823/com.example.exoplayerdemo W/VideoCapabilities: Unrecognized profile/level 0/0 for video/mpeg2
2020-04-03 18:23:24.427 16797-16823/com.example.exoplayerdemo W/VideoCapabilities: Unrecognized profile/level 0/2 for video/mpeg2
2020-04-03 18:23:24.427 16797-16823/com.example.exoplayerdemo W/VideoCapabilities: Unrecognized profile/level 0/3 for video/mpeg2
2020-04-03 18:23:24.429 16797-16823/com.example.exoplayerdemo W/VideoCapabilities: Unrecognized profile/level 32768/2 for video/mp4v-es
2020-04-03 18:23:24.432 16797-16825/com.example.exoplayerdemo I/OpenGLRenderer: Initialized EGL, version 1.4
2020-04-03 18:23:24.432 16797-16825/com.example.exoplayerdemo D/OpenGLRenderer: Swap behavior 2
2020-04-03 18:23:24.435 16797-16823/com.example.exoplayerdemo W/VideoCapabilities: Unsupported mime video/vc1
2020-04-03 18:23:24.439 16797-16823/com.example.exoplayerdemo W/VideoCapabilities: Unsupported mime video/x-flv
2020-04-03 18:23:24.440 16797-16825/com.example.exoplayerdemo D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000
2020-04-03 18:23:24.455 16797-16823/com.example.exoplayerdemo I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
2020-04-03 18:23:24.464 16797-16823/com.example.exoplayerdemo D/MediaCodecInfo: NoSupport [sizeAndRate.support, 1920x1080x29.742565155029297] [OMX.IMG.MSVDX.Decoder.HEVC, video/hevc] [HWEVA, EVA-AL00, HUAWEI, 26]
2020-04-03 18:23:24.467 16797-16823/com.example.exoplayerdemo I/chatty: uid=10335(u0_a335) ExoPlayerImplIn identical 1 line
2020-04-03 18:23:24.473 16797-16823/com.example.exoplayerdemo D/MediaCodecInfo: NoSupport [sizeAndRate.support, 1920x1080x29.742565155029297] [OMX.IMG.MSVDX.Decoder.HEVC, video/hevc] [HWEVA, EVA-AL00, HUAWEI, 26]
2020-04-03 18:23:24.480 16797-16857/com.example.exoplayerdemo I/OMXClient: Treble IOmx obtained
2020-04-03 18:23:24.486 16797-16857/com.example.exoplayerdemo I/ACodec: In onAllocateComponent create compenent, codec name: OMX.google.hevc.decoder
2020-04-03 18:23:24.495 16797-16825/com.example.exoplayerdemo D/OpenGLRenderer:   HWUI Binary is  enabled
2020-04-03 18:23:24.497 16797-16861/com.example.exoplayerdemo E/BufferQueueProducer: [] Can not get hwsched service
2020-04-03 18:23:24.498 16797-16856/com.example.exoplayerdemo D/SurfaceUtils: connecting to surface 0x7f008c6010, reason connectToSurface
2020-04-03 18:23:24.498 16797-16856/com.example.exoplayerdemo I/MediaCodec: [OMX.google.hevc.decoder] setting surface generation to 17200129
2020-04-03 18:23:24.498 16797-16856/com.example.exoplayerdemo D/SurfaceUtils: disconnecting from surface 0x7f008c6010, reason connectToSurface(reconnect)
2020-04-03 18:23:24.498 16797-16856/com.example.exoplayerdemo D/SurfaceUtils: connecting to surface 0x7f008c6010, reason connectToSurface(reconnect)
2020-04-03 18:23:24.498 16797-16857/com.example.exoplayerdemo W/HwExtendedUtils: hw configLocalPlayBack err = -1010
2020-04-03 18:23:24.499 16797-16857/com.example.exoplayerdemo E/ACodec: [OMX.google.hevc.decoder] setPortMode on output to DynamicANWBuffer failed w/ err -1010
2020-04-03 18:23:24.499 16797-16857/com.example.exoplayerdemo I/HwExtendedCodec: mime is [video/hevc] at setVideoFormat
2020-04-03 18:23:24.500 16797-16857/com.example.exoplayerdemo I/ACodec: codec does not support config priority (err -1010)
2020-04-03 18:23:24.503 16797-16857/com.example.exoplayerdemo I/ACodec: onStart
2020-04-03 18:23:24.520 16797-16797/com.example.exoplayerdemo W/InputMethodManager: startInputReason = 1
2020-04-03 18:23:24.529 16797-16797/com.example.exoplayerdemo W/InputMethodManager: startInputReason = 5
2020-04-03 18:23:24.536 16797-16863/com.example.exoplayerdemo I/OMXClient: Treble IOmx obtained
2020-04-03 18:23:24.558 16797-16863/com.example.exoplayerdemo I/ACodec: In onAllocateComponent create compenent, codec name: OMX.google.aac.decoder
2020-04-03 18:23:24.559 16797-16863/com.example.exoplayerdemo W/HwExtendedUtils: hw configLocalPlayBack err = -2147483648
2020-04-03 18:23:24.559 16797-16863/com.example.exoplayerdemo I/ACodec: codec does not support config priority (err -2147483648)
2020-04-03 18:23:24.560 16797-16863/com.example.exoplayerdemo I/ACodec: codec does not support config operating rate (err -2147483648)
2020-04-03 18:23:24.560 16797-16863/com.example.exoplayerdemo I/ACodec: onStart
2020-04-03 18:23:24.576 16797-16856/com.example.exoplayerdemo D/SurfaceUtils: connecting to surface 0x7eeffd2010, reason connectToSurface
2020-04-03 18:23:24.577 16797-16856/com.example.exoplayerdemo I/MediaCodec: [OMX.google.hevc.decoder] setting surface generation to 17200130
2020-04-03 18:23:24.577 16797-16856/com.example.exoplayerdemo D/SurfaceUtils: disconnecting from surface 0x7eeffd2010, reason connectToSurface(reconnect)
2020-04-03 18:23:24.577 16797-16856/com.example.exoplayerdemo D/SurfaceUtils: connecting to surface 0x7eeffd2010, reason connectToSurface(reconnect)
2020-04-03 18:23:24.578 16797-16856/com.example.exoplayerdemo D/SurfaceUtils: disconnecting from surface 0x7f008c6010, reason disconnectFromSurface
2020-04-03 18:23:24.600 16797-16823/com.example.exoplayerdemo D/AudioTrack: OFFLOAD 0,mNotificationFrames 0,mStreamType =-1,mOriginalSampleRate 48000,mAfSampleRate 48000,mTransfer 3
2020-04-03 18:23:24.600 16797-16823/com.example.exoplayerdemo D/AudioTrack: Client defaulted notificationFrames to 6000 for frameCount 12000
2020-04-03 18:23:24.608 16797-16823/com.example.exoplayerdemo I/AudioTrack: audioTrack send start state to pg
2020-04-03 18:23:24.619 16797-16856/com.example.exoplayerdemo D/SoftwareRenderer: setting dataspace on output surface to #104
2020-04-03 18:23:24.649 16797-16823/com.example.exoplayerdemo D/android.media.AudioTrack: [HSM] AudioTrace play() uid: 10335, pid: 16797
2020-04-03 18:23:25.760 16797-16802/com.example.exoplayerdemo I/zygote64: Do full code cache collection, code=122KB, data=101KB
2020-04-03 18:23:25.761 16797-16802/com.example.exoplayerdemo I/zygote64: After code cache collection, code=111KB, data=65KB
2020-04-03 18:23:27.268 16797-16802/com.example.exoplayerdemo I/zygote64: Do partial code cache collection, code=121KB, data=85KB
2020-04-03 18:23:27.268 16797-16802/com.example.exoplayerdemo I/zygote64: After code cache collection, code=121KB, data=85KB
2020-04-03 18:23:27.268 16797-16802/com.example.exoplayerdemo I/zygote64: Increasing code cache capacity to 512KB
2020-04-03 18:23:28.569 16797-16823/com.example.exoplayerdemo D/AudioTrack: stop() called with 198656 frames delivered
2020-04-03 18:23:28.569 16797-16823/com.example.exoplayerdemo D/android.media.AudioTrack: [HSM] AudioTrace stop() uid: 10335, pid: 16797

Version of ExoPlayer being used

2.10.3 and 2.11.3

Device(s) and version(s) of Android being used

Vendor: 8.0.0 Model: HUAWEI system-version: EVA-AL00

andrewlewis commented 4 years ago

I wonder if this is a change in video decoder capability detection between the two releases given the logging D/MediaCodecInfo: NoSupport [sizeAndRate.support, 1920x1080x29.742565155029297] [OMX.IMG.MSVDX.Decoder.HEVC, video/hevc] [HWEVA, EVA-AL00, HUAWEI, 26] and subsequent use of OMX.google.hevc.decoder. Maybe the software decoder is not handling rotation properly.

andrewlewis commented 4 years ago

@VenryZhong Please could you provide logging like the snippet above (or even better a bug report captured via adb bugreport) after playing the video on the older version so we can see what decoder is being used?

andrewlewis commented 4 years ago

Aside: OMX.google.hevc.decoder does show the video correctly on Pixel 2 XL running Q.

VenryZhong commented 4 years ago

@andrewlewis I tested a lot of mobile phones, but this problem happened on this P9, other mobile phones have no problem.

this is log fo exoplayer 2.10.8

2020-04-07 17:30:28.200 19034-19034/com.example.exoplayerdemo D/HwGalleryCacheManagerImpl: mIsEffect:false
2020-04-07 17:30:28.206 19034-19034/com.example.exoplayerdemo D/HwRTBlurUtils: check blur style for HwPhoneWindow, themeResId : 0x7f0d0005, context : com.example.exoplayerdemo.TestActivity@b70a58, Nhwext : 0, get Blur : disable with , null
2020-04-07 17:30:28.207 19034-19034/com.example.exoplayerdemo D/HwRTBlurUtils: check blur style for HwPhoneWindow, themeResId : 0x7f0d0005, context : com.example.exoplayerdemo.TestActivity@b70a58, Nhwext : 0, get Blur : disable with , null
2020-04-07 17:30:28.241 19034-19034/com.example.exoplayerdemo W/Settings: mValues not put! needsGenerationTracker: true currentGeneration: -1 name: accessibility_captioning_enabled value: null
2020-04-07 17:30:28.284 19034-19034/com.example.exoplayerdemo I/HwCust: Constructor found for class android.net.HwCustConnectivityManagerImpl
2020-04-07 17:30:28.284 19034-19034/com.example.exoplayerdemo D/HwCust: Create obj success use class android.net.HwCustConnectivityManagerImpl
2020-04-07 17:30:28.293 19034-19034/com.example.exoplayerdemo I/ExoPlayerImpl: Init ae3ad71 [ExoPlayerLib/2.10.8] [HWEVA, EVA-AL00, HUAWEI, 26]
2020-04-07 17:30:28.303 19034-19042/com.example.exoplayerdemo I/zygote64: Do partial code cache collection, code=60KB, data=44KB
2020-04-07 17:30:28.303 19034-19042/com.example.exoplayerdemo I/zygote64: After code cache collection, code=60KB, data=44KB
2020-04-07 17:30:28.303 19034-19042/com.example.exoplayerdemo I/zygote64: Increasing code cache capacity to 256KB
2020-04-07 17:30:28.309 19034-19034/com.example.exoplayerdemo D/ActivityThread: add activity client record, r= ActivityRecord{21999a9 token=android.os.BinderProxy@96ec41f {com.example.exoplayerdemo/com.example.exoplayerdemo.TestActivity}} token= android.os.BinderProxy@96ec41f
2020-04-07 17:30:28.316 19034-19034/com.example.exoplayerdemo W/VRSystemServiceManager: vr service is not alive
2020-04-07 17:30:28.322 19034-19034/com.example.exoplayerdemo D/OpenGLRenderer:   HWUI Binary is  enabled
2020-04-07 17:30:28.323 19034-19066/com.example.exoplayerdemo D/OpenGLRenderer: HWUI GL Pipeline
2020-04-07 17:30:28.336 19034-19034/com.example.exoplayerdemo I/PressGestureDetector: onAttached begin
2020-04-07 17:30:28.337 19034-19034/com.example.exoplayerdemo I/PressGestureDetector: onAttached end
2020-04-07 17:30:28.338 19034-19067/com.example.exoplayerdemo I/PressGestureDetector: enabledInPad = false,isPcCastMode = false
2020-04-07 17:30:28.374 19034-19066/com.example.exoplayerdemo I/OpenGLRenderer: Initialized EGL, version 1.4
2020-04-07 17:30:28.374 19034-19066/com.example.exoplayerdemo D/OpenGLRenderer: Swap behavior 2
2020-04-07 17:30:28.381 19034-19066/com.example.exoplayerdemo D/mali_winsys: EGLint new_window_surface(egl_winsys_display *, void *, EGLSurface, EGLConfig, egl_winsys_surface **, egl_color_buffer_format *, EGLBoolean) returns 0x3000
2020-04-07 17:30:28.385 19034-19064/com.example.exoplayerdemo W/VideoCapabilities: Unrecognized profile/level 1/32 for video/mp4v-es
2020-04-07 17:30:28.385 19034-19064/com.example.exoplayerdemo I/VideoCapabilities: Unsupported profile 16384 for video/mp4v-es
2020-04-07 17:30:28.385 19034-19064/com.example.exoplayerdemo I/VideoCapabilities: Unsupported profile 16384 for video/mp4v-es
2020-04-07 17:30:28.389 19034-19064/com.example.exoplayerdemo W/VideoCapabilities: Unsupported mime video/x-pn-realvideo
2020-04-07 17:30:28.391 19034-19064/com.example.exoplayerdemo W/VideoCapabilities: Unsupported mime video/mpeg
2020-04-07 17:30:28.392 19034-19064/com.example.exoplayerdemo W/VideoCapabilities: Unrecognized profile/level 0/0 for video/mpeg2
2020-04-07 17:30:28.392 19034-19064/com.example.exoplayerdemo W/VideoCapabilities: Unrecognized profile/level 0/2 for video/mpeg2
2020-04-07 17:30:28.392 19034-19064/com.example.exoplayerdemo W/VideoCapabilities: Unrecognized profile/level 0/3 for video/mpeg2
2020-04-07 17:30:28.395 19034-19064/com.example.exoplayerdemo W/VideoCapabilities: Unrecognized profile/level 32768/2 for video/mp4v-es
2020-04-07 17:30:28.398 19034-19064/com.example.exoplayerdemo W/VideoCapabilities: Unsupported mime video/vc1
2020-04-07 17:30:28.401 19034-19064/com.example.exoplayerdemo W/VideoCapabilities: Unsupported mime video/x-flv
2020-04-07 17:30:28.422 19034-19064/com.example.exoplayerdemo I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
2020-04-07 17:30:28.428 19034-19066/com.example.exoplayerdemo D/OpenGLRenderer:   HWUI Binary is  enabled
2020-04-07 17:30:28.431 19034-19064/com.example.exoplayerdemo D/MediaCodecInfo: NoSupport [sizeAndRate.support, 1920x1080x29.742565155029297] [OMX.IMG.MSVDX.Decoder.HEVC, video/hevc] [HWEVA, EVA-AL00, HUAWEI, 26]
2020-04-07 17:30:28.432 19034-19064/com.example.exoplayerdemo D/MediaCodecInfo: NoSupport [sizeAndRate.support, 1920x1080x29.742565155029297] [OMX.IMG.MSVDX.Decoder.HEVC, video/hevc] [HWEVA, EVA-AL00, HUAWEI, 26]
2020-04-07 17:30:28.447 19034-19082/com.example.exoplayerdemo I/OMXClient: Treble IOmx obtained
2020-04-07 17:30:28.449 19034-19082/com.example.exoplayerdemo I/ACodec: In onAllocateComponent create compenent, codec name: OMX.IMG.MSVDX.Decoder.HEVC
2020-04-07 17:30:28.451 19034-19034/com.example.exoplayerdemo W/InputMethodManager: startInputReason = 1
2020-04-07 17:30:28.457 19034-19092/com.example.exoplayerdemo E/BufferQueueProducer: [] Can not get hwsched service
2020-04-07 17:30:28.458 19034-19081/com.example.exoplayerdemo D/SurfaceUtils: connecting to surface 0x7e2804e010, reason connectToSurface
2020-04-07 17:30:28.458 19034-19081/com.example.exoplayerdemo I/MediaCodec: [OMX.IMG.MSVDX.Decoder.HEVC] setting surface generation to 19490817
2020-04-07 17:30:28.458 19034-19081/com.example.exoplayerdemo D/SurfaceUtils: disconnecting from surface 0x7e2804e010, reason connectToSurface(reconnect)
2020-04-07 17:30:28.458 19034-19081/com.example.exoplayerdemo D/SurfaceUtils: connecting to surface 0x7e2804e010, reason connectToSurface(reconnect)
2020-04-07 17:30:28.463 19034-19082/com.example.exoplayerdemo W/HwExtendedUtils: hw configLocalPlayBack err = -1010
2020-04-07 17:30:28.463 19034-19082/com.example.exoplayerdemo E/ACodec: [OMX.IMG.MSVDX.Decoder.HEVC] setPortMode on output to DynamicANWBuffer failed w/ err -1010
2020-04-07 17:30:28.463 19034-19082/com.example.exoplayerdemo W/ACodec: [OMX.IMG.MSVDX.Decoder.HEVC] prepareForAdaptivePlayback failed w/ err -1010
2020-04-07 17:30:28.464 19034-19082/com.example.exoplayerdemo I/HwExtendedCodec: mime is [video/hevc] at setVideoFormat
2020-04-07 17:30:28.464 19034-19082/com.example.exoplayerdemo I/ACodec: codec does not support config priority (err -1010)
2020-04-07 17:30:28.466 19034-19082/com.example.exoplayerdemo I/ACodec: onStart
2020-04-07 17:30:28.473 19034-19034/com.example.exoplayerdemo W/InputMethodManager: startInputReason = 5
2020-04-07 17:30:28.491 19034-19082/com.example.exoplayerdemo I/HwExtendedUtils: error setConfig queuesToNativeWindow (err -1010)
2020-04-07 17:30:28.491 19034-19082/com.example.exoplayerdemo D/SurfaceUtils: disconnecting from surface 0x7e2804e010, reason setNativeWindowSizeFormatAndUsage
2020-04-07 17:30:28.491 19034-19082/com.example.exoplayerdemo D/SurfaceUtils: connecting to surface 0x7e2804e010, reason setNativeWindowSizeFormatAndUsage
2020-04-07 17:30:28.491 19034-19082/com.example.exoplayerdemo D/SurfaceUtils: set up nativeWindow 0x7e2804e010 for 1920x1088, color 0x300, rotation 90, usage 0x20002900
2020-04-07 17:30:28.491 19034-19082/com.example.exoplayerdemo W/GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2000
2020-04-07 17:30:28.493 19034-19082/com.example.exoplayerdemo W/GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2000
2020-04-07 17:30:28.494 19034-19082/com.example.exoplayerdemo W/GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2000
2020-04-07 17:30:28.495 19034-19082/com.example.exoplayerdemo W/GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2000
2020-04-07 17:30:28.497 19034-19082/com.example.exoplayerdemo W/GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2000
2020-04-07 17:30:28.499 19034-19082/com.example.exoplayerdemo W/GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2000
2020-04-07 17:30:28.508 19034-19082/com.example.exoplayerdemo I/HwExtendedUtils: error setConfig queuesToNativeWindow (err -1010)
2020-04-07 17:30:28.508 19034-19082/com.example.exoplayerdemo D/SurfaceUtils: disconnecting from surface 0x7e2804e010, reason setNativeWindowSizeFormatAndUsage
2020-04-07 17:30:28.508 19034-19082/com.example.exoplayerdemo D/SurfaceUtils: connecting to surface 0x7e2804e010, reason setNativeWindowSizeFormatAndUsage
2020-04-07 17:30:28.508 19034-19082/com.example.exoplayerdemo D/SurfaceUtils: set up nativeWindow 0x7e2804e010 for 1920x1088, color 0x300, rotation 90, usage 0x20002900
2020-04-07 17:30:28.508 19034-19082/com.example.exoplayerdemo W/GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2000
2020-04-07 17:30:28.510 19034-19099/com.example.exoplayerdemo I/OMXClient: Treble IOmx obtained
2020-04-07 17:30:28.510 19034-19082/com.example.exoplayerdemo W/GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2000
2020-04-07 17:30:28.512 19034-19082/com.example.exoplayerdemo W/GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2000
2020-04-07 17:30:28.513 19034-19082/com.example.exoplayerdemo W/GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2000
2020-04-07 17:30:28.515 19034-19082/com.example.exoplayerdemo W/GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2000
2020-04-07 17:30:28.517 19034-19082/com.example.exoplayerdemo W/GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2000
2020-04-07 17:30:28.519 19034-19082/com.example.exoplayerdemo W/GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2000
2020-04-07 17:30:28.521 19034-19082/com.example.exoplayerdemo W/GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2000
2020-04-07 17:30:28.523 19034-19082/com.example.exoplayerdemo W/GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2000
2020-04-07 17:30:28.524 19034-19082/com.example.exoplayerdemo W/GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2000
2020-04-07 17:30:28.525 19034-19082/com.example.exoplayerdemo W/GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2000
2020-04-07 17:30:28.527 19034-19082/com.example.exoplayerdemo W/GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2000
2020-04-07 17:30:28.528 19034-19082/com.example.exoplayerdemo W/GrallocMapperPassthrough: buffer descriptor with invalid usage bits 0x2000
2020-04-07 17:30:28.531 19034-19099/com.example.exoplayerdemo I/ACodec: In onAllocateComponent create compenent, codec name: OMX.google.aac.decoder
2020-04-07 17:30:28.532 19034-19099/com.example.exoplayerdemo W/HwExtendedUtils: hw configLocalPlayBack err = -2147483648
2020-04-07 17:30:28.532 19034-19099/com.example.exoplayerdemo I/ACodec: codec does not support config priority (err -2147483648)
2020-04-07 17:30:28.532 19034-19099/com.example.exoplayerdemo I/ACodec: codec does not support config operating rate (err -2147483648)
2020-04-07 17:30:28.532 19034-19099/com.example.exoplayerdemo I/ACodec: onStart
2020-04-07 17:30:28.539 19034-19081/com.example.exoplayerdemo D/SurfaceUtils: connecting to surface 0x7e2809c010, reason connectToSurface
2020-04-07 17:30:28.539 19034-19081/com.example.exoplayerdemo I/MediaCodec: [OMX.IMG.MSVDX.Decoder.HEVC] setting surface generation to 19490818
2020-04-07 17:30:28.539 19034-19081/com.example.exoplayerdemo D/SurfaceUtils: disconnecting from surface 0x7e2809c010, reason connectToSurface(reconnect)
2020-04-07 17:30:28.539 19034-19081/com.example.exoplayerdemo D/SurfaceUtils: connecting to surface 0x7e2809c010, reason connectToSurface(reconnect)
2020-04-07 17:30:28.540 19034-19082/com.example.exoplayerdemo D/SurfaceUtils: disconnecting from surface 0x7e2809c010, reason setNativeWindowSizeFormatAndUsage
2020-04-07 17:30:28.540 19034-19082/com.example.exoplayerdemo D/SurfaceUtils: connecting to surface 0x7e2809c010, reason setNativeWindowSizeFormatAndUsage
2020-04-07 17:30:28.540 19034-19082/com.example.exoplayerdemo D/SurfaceUtils: set up nativeWindow 0x7e2809c010 for 1920x1088, color 0x300, rotation 90, usage 0x20002900
2020-04-07 17:30:28.542 19034-19081/com.example.exoplayerdemo D/SurfaceUtils: disconnecting from surface 0x7e2804e010, reason disconnectFromSurface
2020-04-07 17:30:28.561 19034-19064/com.example.exoplayerdemo D/AudioTrack: OFFLOAD 0,mNotificationFrames 0,mStreamType =-1,mOriginalSampleRate 48000,mAfSampleRate 48000,mTransfer 3
2020-04-07 17:30:28.561 19034-19064/com.example.exoplayerdemo D/AudioTrack: Client defaulted notificationFrames to 6000 for frameCount 12000
2020-04-07 17:30:28.570 19034-19064/com.example.exoplayerdemo I/AudioTrack: audioTrack send start state to pg
2020-04-07 17:30:28.595 19034-19064/com.example.exoplayerdemo D/android.media.AudioTrack: [HSM] AudioTrace play() uid: 10335, pid: 19034
2020-04-07 17:30:29.889 19034-19042/com.example.exoplayerdemo I/zygote64: Do full code cache collection, code=124KB, data=96KB
2020-04-07 17:30:29.891 19034-19042/com.example.exoplayerdemo I/zygote64: After code cache collection, code=114KB, data=65KB
2020-04-07 17:30:30.977 19034-19042/com.example.exoplayerdemo I/zygote64: Do partial code cache collection, code=116KB, data=79KB
2020-04-07 17:30:30.978 19034-19042/com.example.exoplayerdemo I/zygote64: After code cache collection, code=116KB, data=79KB
2020-04-07 17:30:30.978 19034-19042/com.example.exoplayerdemo I/zygote64: Increasing code cache capacity to 512KB
2020-04-07 17:30:32.503 19034-19064/com.example.exoplayerdemo D/AudioTrack: stop() called with 198656 frames delivered
2020-04-07 17:30:32.504 19034-19064/com.example.exoplayerdemo D/android.media.AudioTrack: [HSM] AudioTrace stop() uid: 10335, pid: 19034
andrewlewis commented 4 years ago

On 2.10.8 it looks like we use OMX.IMG.MSVDX.Decoder.HEVC even though the stream exceeds the decoder capabilities (NoSupport [sizeAndRate.support, 1920x1080x29.742565155029297] [OMX.IMG.MSVDX.Decoder.HEVC, video/hevc] [HWEVA, EVA-AL00, HUAWEI, 26]). In the log from 2.11.3 we are using OMX.google.hevc.decoder. So I think this is indeed a case of falling back to software decoding.

If the decoder is underreporting capabilities, the OEM should fix that. However, it's quite possible that the decoder does not support the format in the general case. I don't think we should prevent all usage of OMX.google.hevc.decoder on this device because it will probably work well for other use cases that don't have rotation (and also works with rotation on recent Android versions).

For a quick fix in your app, you could pass a custom MediaCodecSelector that delegates to the default one but removes the problematic decoder based on its name.

Side note: it might be interesting to know whether OMX.IMG.MSVDX.Decoder.HEVC gets selected if you modify the frame rate to 30 fps (or 25 fps).

VenryZhong commented 4 years ago

ok,thanks, i kown how to fix it. in huawei P9 , OMX.IMG.MSVDX.Decoder.HEVC , getSupportedWidths is [96, 536] , in android.media.MediaCodecInfo.VideoCapabilities#areSizeAndRateSupported will return false , this makes the OMX.IMG.MSVDX.Decoder.HEVC decoder unable to select him normally.

andrewlewis commented 4 years ago

Thanks for the information. If the capabilities are being under-reported please report this to the OEM. Alternatively, the capabilities may also be correct in the general case even if you can find a particular higher resolution stream that plays (they are a safe underestimate), in which case this is working as intended.