HUAWEI Mate20 webrtc崩溃issue:Failed设置远程应答sdp: Failed to set remote video description send parameters

HUAWEI Mate20 webrtc crash issue:Failed to set remote answer sdp: Failed to set remote video description send parameters

我正在为我们的 Android 混合应用程序添加原生 AWS webrtc。它在其他智能手机上运行良好,但在华为上会崩溃。当 webrtc 连接成功时,App 崩溃了。这是日志的一部分:

    D/webRTC: sent sdp offer
D/KinesisVideoSdpObserver: onCreateSuccess(): SDP=v=0
    o=- 4089128915904689992 2 IN IP4 127.0.0.1
    s=-
    t=0 0
    a=group:BUNDLE 0 1 2
    a=msid-semantic: WMS KvsLocalMediaStream
    m=video 9 UDP/TLS/RTP/SAVPF 96 97 98 99 100 101 127
    c=IN IP4 0.0.0.0
    a=rtcp:9 IN IP4 0.0.0.0
    a=ice-ufrag:EmPX
    a=ice-pwd:m5FQR9O6Gu+m0kQk8SFYXUg6
    a=ice-options:trickle renomination
    a=fingerprint:sha-256 71:6C:44:F7:66:58:E0:BE:C9:CB:0E:E7:54:0C:2A:05:9B:AC:B1:A8:27:60:CC:A4:CE:A7:50:D7:45:41:94:7E
    a=setup:actpass
    a=mid:0
    a=extmap:14 urn:ietf:params:rtp-hdrext:toffset
    a=extmap:13 http://www.webrtc.org/experiments/rtp-hdrext/abs-send-time
    a=extmap:12 urn:3gpp:video-orientation
    a=extmap:2 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
    a=extmap:11 http://www.webrtc.org/experiments/rtp-hdrext/playout-delay
    a=extmap:6 http://www.webrtc.org/experiments/rtp-hdrext/video-content-type
    a=extmap:7 http://www.webrtc.org/experiments/rtp-hdrext/video-timing
    a=extmap:8 http://tools.ietf.org/html/draft-ietf-avtext-framemarking-07
    a=extmap:9 http://www.webrtc.org/experiments/rtp-hdrext/color-space
    a=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid
    a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
    a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
    a=sendrecv
    a=msid:KvsLocalMediaStream KvsVideoTrack
    a=rtcp-mux
    a=rtcp-rsize
    a=rtpmap:96 VP8/90000
    a=rtcp-fb:96 goog-remb
    a=rtcp-fb:96 transport-cc
    a=rtcp-fb:96 ccm fir
    a=rtcp-fb:96 nack
    a=rtcp-fb:96 nack pli
    a=rtpmap:97 rtx/90000
    a=fmtp:97 apt=96
    a=rtpmap:98 VP9/90000
    a=rtcp-fb:98 goog-remb
    a=rtcp-fb:98 transport-cc
    a=rtcp-fb:98 ccm fir
    a=rtcp-fb:98 nack
    a=rtcp-fb:98 nack pli
    a=rtpmap:99 rtx/90000
    a=fmtp:99 apt=98
    a=rtpmap:100 red/90000
    a=rtpmap:101 rtx/90000
    a=fmtp:101 apt=100
    a=rtpmap:127 ulpfec/90000
    a=ssrc-group:FID 3389218480 1760322665
    a=ssrc:3389218480 cname:oMzbiO27u3BctYUf
    a=ssrc:3389218480 msid:KvsLocalMediaStream KvsVideoTrack
    a=ssrc:3389218480 mslabel:KvsLocalMediaStream
    a=ssrc:3389218480 label:KvsVideoTrack
    a=ssrc:1760322665 cname:oMzbiO27u3BctYUf
    a=ssrc:1760322665 msid:KvsLocalMediaStream KvsVideoTrack
    a=ssrc:1760322665 mslabel:KvsLocalMediaStream
    a=ssrc:1760322665 label:KvsVideoTrack
    m=audio 9 UDP/TLS/RTP/SAVPF 111 103 104 9 102 0 8 106 105 13 110 112 113 126
    c=IN IP4 0.0.0.0
    a=rtcp:9 IN IP4 0.0.0.0
    a=ice-ufrag:EmPX
    a=ice-pwd:m5FQR9O6Gu+m0kQk8SFYXUg6
    a=ice-options:trickle renomination
    a=fingerprint:sha-256 71:6C:44:F7:66:58:E0:BE:C9:CB:0E:E7:54:0C:2A:05:9B:AC:B1:A8:27:60:CC:A4:CE:A7:50:D7:45:41:94:7E
    a=setup:actpass
    a=mid:1
    a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
    a=extmap:2 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
    a=extmap:3 urn:ietf:params:rtp-hdrext:sdes:mid
    a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id
    a=extmap:5 urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id
    a=recvonly
    a=rtcp-mux
    a=rtpmap:111 opus/48000/2
    a=rtcp-fb:111 transport-cc
    a=fmtp:111 minptime=10;useinbandfec=1
    a=rtpmap:103 ISAC/16000
    a=rtpmap:104 ISAC/32000
    a=rtpmap:9 G722/8000
    a=rtpmap:102 ILBC/8000
    a=rtpmap:0 PCMU/8000
    a=rtpmap:8 PCMA/8000
    a=rtpmap:106 CN/32000
    a=rtpmap:105 CN/16000
    a=rtpmap:13 CN/8000
    a=rtpmap:110 telephone-event/48000
    a=rtpmap:112 telephone-event/32000
    a=rtpmap:113 telephone-event/16000
    a=rtpmap:126 telephone-event/8000
    m=application 9 UDP/DTLS/SCTP webrtc-datachannel
    c=IN IP4 0.0.0.0
    a=ice-ufrag:EmPX
    a=ice-pwd:m5FQR9O6Gu+m0kQk8SFYXUg6
    a=ice-options:trickle renomination
    a=fingerprint:sha-256 71:6C:44:F7:66:58:E0:BE:C9:CB:0E:E7:54:0C:2A:05:9B:AC:B1:A8:27:60:CC:A4:CE:A7:50:D7:45:41:94:7E
    a=setup:actpass
    a=mid:2
    a=sctp-port:5000
    a=max-message-size:262144
D/KVSPeerConnection: onSignalingChange(): signalingState = [HAVE_LOCAL_OFFER]
I/org.webrtc.Logging: NetworkMonitor: Start monitoring with native observer 502242368320
I/Liveview Success Time1: 1649211791701
D/WebSocketClient:  isOpen true
D/SignalingServiceWebSocketClient: Sending Offer
D/KinesisVideoSdpObserver: onSetSuccess(): SDP
D/KVSPeerConnection: onIceGatheringChange(): iceGatheringState = [GATHERING]
I/ice: ================
D/KVSPeerConnection: onIceCandidate(): iceCandidate = [0:0:candidate:1114595702 1 udp 2122260223 192.168.0.110 37983 typ host generation 0 ufrag EmPX network-id 3 network-cost 10:]
D/KVSWebRtcActivity: Sending IceCandidate to remote peer 0:0:candidate:1114595702 1 udp 2122260223 192.168.0.110 37983 typ host generation 0 ufrag EmPX network-id 3 network-cost 10:
D/webRTC: send IceCandidate
D/SignalingServiceWebSocketClient: Sending JSON Message= xxxxxxx
D/SignalingServiceWebSocketClient: Sending JSON Message= xxxxxxx
    Sent Ice candidate message
I/sent icecandidate time: 1649211791772
I/ice: ================
D/KVSPeerConnection: onIceCandidate(): iceCandidate = [0:0:candidate:842163049 1 udp 1686052607 223.112.52.222 37983 typ srflx raddr 192.168.0.110 rport 37983 generation 0 ufrag EmPX network-id 3 network-cost 10:stun:52.40.66.127:443]
D/KVSWebRtcActivity: Sending IceCandidate to remote peer 0:0:candidate:842163049 1 udp 1686052607 223.112.52.222 37983 typ srflx raddr 192.168.0.110 rport 37983 generation 0 ufrag EmPX network-id 3 network-cost 10:stun:52.40.66.127:443
D/webRTC: send IceCandidate
D/SignalingServiceWebSocketClient: Sending JSON Message= {"action":"ICE_CANDIDATE","messagePayload":"eyJjYW5kaWRhdGUiOiJjYW5kaWRhdGU6ODQyMTYzMDQ5IDEgdWRwIDE2ODYwNTI2MDcgMjIzLjExMi41Mi4yMjIgMzc5ODMgdHlwIHNyZmx4IHJhZGRyIDE5Mi4xNjguMC4xMTAgcnBvcnQgMzc5ODMgZ2VuZXJhdGlvbiAwIHVmcmFnIEVtUFggbmV0d29yay1pZCAzIG5ldHdvcmstY29zdCAxMCIsInNkcE1pZCI6IjAiLCJzZHBNTGluZUluZGV4IjowfQ","senderClientId":"f3338830-084f-4736-bb78-2f56cee638df"}
D/SignalingServiceWebSocketClient: Sent JSON Message= {"action":"ICE_CANDIDATE","messagePayload":"eyJjYW5kaWRhdGUiOiJjYW5kaWRhdGU6ODQyMTYzMDQ5IDEgdWRwIDE2ODYwNTI2MDcgMjIzLjExMi41Mi4yMjIgMzc5ODMgdHlwIHNyZmx4IHJhZGRyIDE5Mi4xNjguMC4xMTAgcnBvcnQgMzc5ODMgZ2VuZXJhdGlvbiAwIHVmcmFnIEVtUFggbmV0d29yay1pZCAzIG5ldHdvcmstY29zdCAxMCIsInNkcE1pZCI6IjAiLCJzZHBNTGluZUluZGV4IjowfQ","senderClientId":"f3338830-084f-4736-bb78-2f56cee638df"}
    Sent Ice candidate message
I/sent icecandidate time: 1649211791991
D/Web Console: scroll refreshed
I/chromium: [INFO:CONSOLE(1)] "scroll refreshed", source: 
D/CustomMessageHandler: Received message
D/CustomMessageHandler: Received message
D/CustomMessageHandler: Received message
I/org.webrtc.Logging: EglRenderer: Duration: 4005 ms. Frames received: 0. Dropped: 0. Rendered: 0. Render fps: .0. Average render time: NA. Average swapBuffer time: NA.
I/org.webrtc.Logging: EglRenderer: Duration: 4008 ms. Frames received: 0. Dropped: 0. Rendered: 0. Render fps: .0. Average render time: NA. Average swapBuffer time: NA.
I/org.webrtc.Logging: EglRenderer: Duration: 4010 ms. Frames received: 0. Dropped: 0. Rendered: 0. Render fps: .0. Average render time: NA. Average swapBuffer time: NA.
D/CustomMessageHandler: Received message xxxxxx
D/CustomMessageHandler: Answer received: SenderClientId=null
D/KVSWebRtcActivity: SDP answer received from signaling
D/webRTC: SDP answer received from signaling
D/Event: SDP answer received from master:v=0
    o=- 1008569513 2 IN IP4 127.0.0.1
    s=-
    t=0 0
    a=group:BUNDLE 0 1 2
    a=msid-semantic: WMS myKvsVideoStream
    m=video 9 UDP/TLS/RTP/SAVPF 0
    c=IN IP4 127.0.0.1
    a=candidate:3 1 udp 16777215 0000:0000:0000:0000:0000:0000:0000:0000 0 typ relay raddr ::/0 rport 0 generation 0 network-cost 999
    a=candidate:2 1 udp 16777215 0000:0000:0000:0000:0000:0000:0000:0000 0 typ relay raddr ::/0 rport 0 generation 0 network-cost 999
    a=candidate:1 1 udp 1694498815 192.168.100.127 58511 typ srflx raddr 0.0.0.0 rport 0 generation 0 network-cost 999
    a=candidate:0 1 udp 2130706431 192.168.100.127 49366 typ host raddr 0.0.0.0 rport 0 generation 0 network-cost 999
    a=msid:myKvsVideoStream myVideoTrack
    a=ssrc:1245743577 cname:4/iWRN2u/W8ElBZu
    a=ssrc:1245743577 msid:myKvsVideoStream myVideoTrack
    a=ssrc:1245743577 mslabel:myKvsVideoStream
    a=ssrc:1245743577 label:myVideoTrack
    a=rtcp:9 IN IP4 0.0.0.0
    a=ice-ufrag:RRgY
    a=ice-pwd:TeUGFE3L9FpsBOW3dCZSIycZ
    a=ice-options:trickle
    a=fingerprint:sha-256 DC:C5:AE:21:EC:E8:40:70:05:7F:1A:07:5C:F1:FF:64:3F:1B:8D:9F:59:34:C9:7A:B8:F3:EB:BE:D9:68:92:26
    a=setup:active
    a=mid:0
    a=sendrecv
    a=rtcp-mux
    a=rtcp-rsize
    a=rtpmap:0 H264/90000
    a=rtcp-fb:0 nack
    a=rtcp-fb:0 transport-cc
    m=audio 9 UDP/TLS/RTP/SAVPF 0
    c=IN IP4 127.0.0.1
    a=candidate:3 1 udp 16777215 0000:0000:0000:0000:0000:0000:0000:0000 0 typ relay raddr ::/0 rport 0 generation 0 network-cost 999
    a=candidate:2 1 udp 16777215 0000:0000:0000:0000:0000:0000:0000:0000 0 typ relay raddr ::/0 rport 0 generation 0 network-cost 999
    a=candidate:1 1 udp 1694498815 192.168.100.127 58511 typ srflx raddr 0.0.0.0 rport 0 generation 0 network-cost 999
    a=candidate:0 1 udp 2130706431 192.168.100.127 49366 typ host raddr 0.0.0.0 rport 0 generation 0 network-cost 999
    a=msid:myKvsAudioStream myAudioTrack
    a=ssrc:1029037518 cname:4/iWRN2u/W8ElBZu
    a=ssrc:1029037518 msid:myKvsAudioStream myAudioTrack
    a=ssrc:1029037518 mslabel:myKvsAudioStream
    a=ssrc:1029037518 label:myAudioTrack
    a=rtcp:9 IN IP4 0.0.0.0
    a=ice-ufrag:RRgY
    a=ice-pwd:TeUGFE3L9FpsBOW3dCZSIycZ
    a=ice-options:trickle
    a=fingerprint:sha-256 DC:C5:AE:21:EC:E8:40:70:05:7F:1A:07:5C:F1:FF:64:3F:1B:8D:9F:59:34:C9:7A:B8:F3:EB:BE:D9:68:92:26
    a=setup:active
    a=mid:1
    a=sendonly
    a=rtcp-mux
    a=rtcp-rsize
    a=rtpmap:0 PCMU/8000
    a=rtcp-fb:0 nack
    a=rtcp-fb:0 transport-cc
    m=application 9 UDP/DTLS/SCTP webrtc-datachannel
    c=IN IP4 127.0.0.1
    a=candidate:3 1 udp 16777215 0000:0000:0000:0000:0000:0000:0000:0000 0 typ relay raddr ::/0 rport 0 generation 0 network-cost 999
    a=candidate:2 1 udp 16777215 0000:0000:0000:0000:0000:0000:0000:0000 0 typ relay raddr ::/0 rport 0 generation 0 network-cost 999
    a=candidate:1 1 udp 1694498815 192.168.100.127 58511 typ srflx raddr 0.0.0.0 rport 0 generation 0 network-cost 999
    a=candidate:0 1 udp 2130706431 192.168.100.127 49366 typ host raddr 0.0.0.0 rport 0 generation 0 network-cost 999
    a=rtcp:9 IN IP4 0.0.0.0
    a=ice-ufrag:RRgY
    a=ice-pwd:TeUGFE3L9FpsBOW3dCZSIycZ
    a=fingerprint:sha-256 DC:C5:AE:21:EC:E8:40:70:05:7F:1A:07:5C:F1:FF:64:3F:1B:8D:9F:59:34:C9:7A:B8:F3:EB:BE:D9:68:92:26
    a=setup:active
    a=mid:2
    a=sctp-port:5000
I/receive sdpanswer time: 1649211803034
D/KVSPeerConnection: onSignalingChange(): signalingState = [STABLE]
D/KVSWebRtcActivity: Answer Client ID: null
E/KinesisVideoSdpObserver: onSetFailure(): Error=Failed to set remote answer sdp: Failed to set remote video description send parameters.
D/KVSWebRtcActivity: Pending ice candidates found? null
D/CustomMessageHandler: Received message{"messagePayload":"eyJjYW5kaWRhdGUiOiJjYW5kaWRhdGU6MCAxIHVkcCAyMTMwNzA2NDMxIDE5Mi4xNjguMTAwLjEyNyA0OTM2NiB0eXAgaG9zdCByYWRkciAwLjAuMC4wIHJwb3J0IDAgZ2VuZXJhdGlvbiAwIG5ldHdvcmstY29zdCA5OTkiLCJzZHBNaWQiOiIwIiwic2RwTUxpbmVJbmRleCI6MH0=","messageType":"ICE_CANDIDATE"}
D/CustomMessageHandler: Ice Candidate received: SenderClientId=null
    {"candidate":"candidate:0 1 udp 2130706431 192.168.100.127 49366 typ host raddr 0.0.0.0 rport 0 generation 0 network-cost 999","sdpMid":"0","sdpMLineIndex":0}
D/KVSWebRtcActivity: Received IceCandidate from remote 
D/KVSWebRtcActivity: Peer connection found already
D/KVSPeerConnection: onIceConnectionChange(): iceConnectionState = [CHECKING]
D/KVSWebRtcActivity: Added ice candidate 0:0:candidate:0 1 udp 2130706431 192.168.100.127 49366 typ host raddr 0.0.0.0 rport 0 generation 0 network-cost 999: Successfully
D/CustomMessageHandler: Received message{"messagePayload":"eyJjYW5kaWRhdGUiOiJjYW5kaWRhdGU6MSAxIHVkcCAxNjk0NDk4ODE1IDIyMy4xMTIuNTIuMjIyIDU4NTExIHR5cCBzcmZseCByYWRkciAwLjAuMC4wIHJwb3J0IDAgZ2VuZXJhdGlvbiAwIG5ldHdvcmstY29zdCA5OTkiLCJzZHBNaWQiOiIwIiwic2RwTUxpbmVJbmRleCI6MH0=","messageType":"ICE_CANDIDATE"}
D/CustomMessageHandler: Ice Candidate received: SenderClientId=null
D/CustomMessageHandler: {"candidate":"candidate:1 1 udp 1694498815 223.112.52.222 58511 typ srflx raddr 0.0.0.0 rport 0 generation 0 network-cost 999","sdpMid":"0","sdpMLineIndex":0}
D/KVSWebRtcActivity: Received IceCandidate from remote 
D/KVSWebRtcActivity: Peer connection found already
D/KVSWebRtcActivity: Added ice candidate 0:0:candidate:1 1 udp 1694498815 223.112.52.222 58511 typ srflx raddr 0.0.0.0 rport 0 generation 0 network-cost 999: Successfully
D/KVSPeerConnection: onIceConnectionChange(): iceConnectionState = [CONNECTED]
I/org.webrtc.Logging: WebRtcAudioTrackExternal: initPlayout(sampleRate=48000, channels=1)
I/org.webrtc.Logging: WebRtcAudioTrackExternal: byteBuffer.capacity: 960
I/org.webrtc.Logging: WebRtcAudioTrackExternal: AudioTrack.getMinBufferSize: 3848
    WebRtcAudioTrackExternal: createAudioTrackOnLollipopOrHigher
I/org.webrtc.Logging: WebRtcAudioTrackExternal: nativeOutputSampleRate: 48000
I/AudioTrack-JNI: AudioTrack_setup for usage=2 content=1 flags=0x0x800 tags=
I/org.webrtc.Logging: WebRtcAudioTrackExternal: AudioTrack: session ID: 305, channels: 1, sample rate: 48000, max gain: 1.0
I/org.webrtc.Logging: WebRtcAudioTrackExternal: AudioTrack: buffer size in frames: 3848
    WebRtcAudioTrackExternal: AudioTrack: buffer capacity in frames: 3848
I/org.webrtc.Logging: VolumeLogger: start@[name=worker_thread - 23606, id=18331]
V/AudioManager: getMode...
I/org.webrtc.Logging: VolumeLogger: audio mode is: MODE_NORMAL
V/AudioManager: getStreamMaxVolume  treamType: 2
    getStreamMaxVolume  treamType: 0
V/AudioManager: getMode...
I/org.webrtc.Logging: WebRtcAudioTrackExternal: startPlayout
V/PlayerBase: baseStart() piid=391
D/android.media.AudioTrack: [HSM] AudioTrace play() uid: 10240, pid: 22933
I/org.webrtc.Logging: WebRtcAudioTrackExternal: AudioTrackThread@[name=AudioTrackJavaThread, id=18345]
D/CustomMessageHandler: Received message{"messagePayload":"eyJjYW5kaWRhdGUiOiJjYW5kaWRhdGU6MiAxIHVkcCAxNjc3NzIxNSAxOC4yMzYuMTYyLjE0NSA1ODUyOSB0eXAgcmVsYXkgcmFkZHIgMC4wLjAuMCBycG9ydCAwIGdlbmVyYXRpb24gMCBuZXR3b3JrLWNvc3QgOTk5Iiwic2RwTWlkIjoiMCIsInNkcE1MaW5lSW5kZXgiOjB9","messageType":"ICE_CANDIDATE"}
    Ice Candidate received: SenderClientId=null
D/CustomMessageHandler: {"candidate":"candidate:2 1 udp 16777215 18.236.162.145 58529 typ relay raddr 0.0.0.0 rport 0 generation 0 network-cost 999","sdpMid":"0","sdpMLineIndex":0}
D/KVSWebRtcActivity: Received IceCandidate from remote 
D/KVSWebRtcActivity: Peer connection found already
D/KVSWebRtcActivity: Added ice candidate 0:0:candidate:2 1 udp 16777215 18.236.162.145 58529 typ relay raddr 0.0.0.0 rport 0 generation 0 network-cost 999: Successfully
A/m.sercomm.s1ap: thread-inl.h:269] Transitioning to runnable with checkpoint flag,  flags=58403 state=2
A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x753b600000 in tid 23629 (AudioTrackJavaT), pid 22933 (m.sercomm.s1app)
E/RtgSchedManager: endActivityTransaction: margin state not match
Disconnected from the target VM, address: 'localhost:53093', transport: 'socket'

主要错误信息为:

E/KinesisVideoSdpObserver: onSetFailure(): Error=Failed to set remote answer sdp: Failed to set remote video description send parameters.

让我感到困惑的是,在 sdp 中,编解码器是这样的:

a=rtpmap:98 VP9/90000

但在 sdp 答案中我发现:

a=rtpmap:0 H264/90000

这是导致崩溃的主要原因吗?在其他智能手机上(我试过小米,三星,vivo),这两条sdp线都是H264。但是华为确实支持H264,这是我的HUAWEI Mate 20 codecInfo:

    E/MediaCodecList, name:: c2.android.aac.decoder,type:audio/mp4a-latm
    OMX.google.aac.decoder,type:audio/mp4a-latm
    c2.android.aac.encoder,type:audio/mp4a-latm
    OMX.google.aac.encoder,type:audio/mp4a-latm
    c2.android.amrnb.decoder,type:audio/3gpp
E/MediaCodecList, name:: OMX.google.amrnb.decoder,type:audio/3gpp
    c2.android.amrnb.encoder,type:audio/3gpp
    OMX.google.amrnb.encoder,type:audio/3gpp
    c2.android.amrwb.decoder,type:audio/amr-wb
    OMX.google.amrwb.decoder,type:audio/amr-wb
    c2.android.amrwb.encoder,type:audio/amr-wb
    OMX.google.amrwb.encoder,type:audio/amr-wb
    c2.android.flac.decoder,type:audio/flac
    OMX.google.flac.decoder,type:audio/flac
    c2.android.flac.encoder,type:audio/flac
    OMX.google.flac.encoder,type:audio/flac
    c2.android.g711.alaw.decoder,type:audio/g711-alaw
    OMX.google.g711.alaw.decoder,type:audio/g711-alaw
    c2.android.g711.mlaw.decoder,type:audio/g711-mlaw
    OMX.google.g711.mlaw.decoder,type:audio/g711-mlaw
    c2.android.gsm.decoder,type:audio/gsm
E/MediaCodecList, name:: OMX.google.gsm.decoder,type:audio/gsm
    c2.android.mp3.decoder,type:audio/mpeg
    OMX.google.mp3.decoder,type:audio/mpeg
    c2.android.opus.decoder,type:audio/opus
    OMX.google.opus.decoder,type:audio/opus
    c2.android.opus.encoder,type:audio/opus
    c2.android.raw.decoder,type:audio/raw
    OMX.google.raw.decoder,type:audio/raw
    c2.android.vorbis.decoder,type:audio/vorbis
    OMX.google.vorbis.decoder,type:audio/vorbis
    OMX.dolby.ac3.decoder,type:audio/ac3
    OMX.dolby.ac4.decoder,type:audio/ac4
    OMX.dolby.eac3.decoder,type:audio/eac3
    OMX.dolby.eac3_joc.decoder,type:audio/eac3-joc
    OMX.hisi.video.decoder.avc,type:video/avc
    OMX.hisi.video.decoder.hevc,type:video/hevc
    OMX.hisi.video.decoder.mpeg2,type:video/mpeg2
    OMX.hisi.video.decoder.mpeg4,type:video/mp4v-es
    OMX.hisi.video.decoder.vp8,type:video/x-vnd.on2.vp8
    OMX.hisi.video.decoder.vp9,type:video/x-vnd.on2.vp9
E/MediaCodecList, name:: OMX.hisi.video.encoder.avc,type:video/avc
    OMX.hisi.video.encoder.hevc,type:video/hevc
    c2.android.av1.decoder,type:video/av01
    c2.android.avc.decoder,type:video/avc
    OMX.google.h264.decoder,type:video/avc
    c2.android.avc.encoder,type:video/avc
    OMX.google.h264.encoder,type:video/avc
    c2.android.h263.decoder,type:video/3gpp
    OMX.google.h263.decoder,type:video/3gpp
    c2.android.h263.encoder,type:video/3gpp
    OMX.google.h263.encoder,type:video/3gpp
    c2.android.hevc.decoder,type:video/hevc
    OMX.google.hevc.decoder,type:video/hevc
    c2.android.hevc.encoder,type:video/hevc
    c2.android.mpeg4.decoder,type:video/mp4v-es
    OMX.google.mpeg4.decoder,type:video/mp4v-es
    c2.android.mpeg4.encoder,type:video/mp4v-es
    OMX.google.mpeg4.encoder,type:video/mp4v-es
    c2.android.vp8.decoder,type:video/x-vnd.on2.vp8
E/MediaCodecList, name:: OMX.google.vp8.decoder,type:video/x-vnd.on2.vp8
    c2.android.vp8.encoder,type:video/x-vnd.on2.vp8
    OMX.google.vp8.encoder,type:video/x-vnd.on2.vp8
    c2.android.vp9.decoder,type:video/x-vnd.on2.vp9
    OMX.google.vp9.decoder,type:video/x-vnd.on2.vp9
    c2.android.vp9.encoder,type:video/x-vnd.on2.vp9
    OMX.google.vp9.encoder,type:video/x-vnd.on2.vp9

我也尝试阅读 webrtc 代码,我在 MediaCodecVideoDecoderFactory 中找到了这个:

private boolean isH264HighProfileSupported(MediaCodecInfo info) {
String name = info.getName();
if (VERSION.SDK_INT >= 21 && name.startsWith("OMX.qcom.")) {
    return true;
} else {
    return VERSION.SDK_INT >= 23 && name.startsWith("OMX.Exynos.");
}

}

我怀疑 webrtc 不支持像 OMX.google.xxxxx 这样的编解码器。但是我不能修改这段代码,请问如何修改才能验证。

顺便说一下,这是我在 gradle 中的 webrtc 实现,如果有帮助:

implementation 'org.webrtc:google-webrtc:1.0.28513'

AWS webrtc代码来自AWS webrtc demo App,你可以在这里获取:awswebrtcdemoapp

很抱歉我不能提供我的源代码。

WebRTC Android只支持qcom和Exynos硬件H264编码器,可以修改HardwareVideoEncoderFactory中的isHardwareSupportedInCurrentSdkH264来支持其他平台如OMX.hisi,OMX.MTK.

然后构建 WebRTC 以在您的项目中使用 libwebrtc.jar 和 libjingle_peerconnection_so.so 而不是

implementation 'org.webrtc:google-webrtc:1.0.28513'

如何下载和构建 WebRTC Android: https://webrtc.github.io/webrtc-org/native-code/android/