Android webrtc черный / зеленый экран с потоком UV4L - PullRequest
0 голосов
/ 21 июня 2019

Я использую UV4L с Raspberry PI для Webrtc для Android устройства.Я использую сигнальный прокси между ними.Когда выполняется вызов webrtc, звук работает, но видео становится почти чёрным экраном с зелеными блоками.

Когда я использую его с веб-клиентом, использующим тот же прокси, видео работает идеально все время.

Сигнализация правильная, и данные отправляются и принимаются в последовательности

1) на устройство - звоните

2) в приложение - предлагаете

3) TA - кандидаты льда по одному

4) TD - ответ

5) TD - ледовые кандидаты на приложения для Android

В большинстве случаев я получаю черный экран с зелеными пятнами, но иногда это работает, и я получаюполное видео.Я попытался отложить видео, приостановив видео при получении и воспроизведя его через некоторое время.В этом случае видео работает нормально.Но я не могу понять, почему это происходит.Аудио работает в обоих направлениях.

PeerConnectionClient.kt

class PeerConnectionClient(private val activity: MainActivity, private val fSignalling: FSignalling) {

    companion object {
        private val rootEglBase by lazy {
            EglBase.create()
        }

        private val mainConstraints: MediaConstraints by lazy {
            val constraints = MediaConstraints()
            constraints.mandatory.add(MediaConstraints.KeyValuePair("offerToReceiveAudio", "true"))
            constraints.mandatory.add(MediaConstraints.KeyValuePair("offerToReceiveVideo", "true"))
            constraints.optional.add(MediaConstraints.KeyValuePair("DtlsSrtpKeyAgreement", "true"))
            constraints
        }

        private val myRTCConfig: PeerConnection.RTCConfiguration by lazy {
            val rtcConfig = PeerConnection.RTCConfiguration(peerIceServers)
            // TCP candidates are only useful when connecting to a server that supports
            // ICE-TCP.
            rtcConfig.enableDtlsSrtp = true
            rtcConfig.enableRtpDataChannel = true
            rtcConfig.bundlePolicy = PeerConnection.BundlePolicy.MAXBUNDLE
            rtcConfig.rtcpMuxPolicy = PeerConnection.RtcpMuxPolicy.REQUIRE
            rtcConfig.continualGatheringPolicy = PeerConnection.ContinualGatheringPolicy.GATHER_CONTINUALLY
            // Use ECDSA encryption.
            rtcConfig.keyType = PeerConnection.KeyType.ECDSA
            rtcConfig
        }

        private val iceServersList = mutableListOf("stun:stun.l.google.com:19302")

        private var peerIceServers: MutableList<PeerConnection.IceServer> = ArrayList()
    }

    internal var isConnected = false
    internal var isEnabled = false
    internal var isIced = false
    internal var isVideoRunning = false

    private val peerConnectionFactory: PeerConnectionFactory by lazy {
        val initializationOptions = PeerConnectionFactory.InitializationOptions.builder(activity).createInitializationOptions()
        PeerConnectionFactory.initialize(initializationOptions)

        val options = PeerConnectionFactory.Options()
        val defaultVideoEncoderFactory = DefaultVideoEncoderFactory(rootEglBase.eglBaseContext, true, true)
        val defaultVideoDecoderFactory = DefaultVideoDecoderFactory(rootEglBase.eglBaseContext)
        PeerConnectionFactory.builder()
                .setOptions(options)
                .setVideoEncoderFactory(defaultVideoEncoderFactory)
                .setVideoDecoderFactory(defaultVideoDecoderFactory)
                .createPeerConnectionFactory()
    }

    private var sdpConstraints: MediaConstraints? = null
    private var localAudioTrack: AudioTrack? = null
    private var localStream: MediaStream? = null
    private var videoTrack: VideoTrack? = null
    private var audioTrack: AudioTrack? = null

    private var localPeer: PeerConnection? = null

    private var gotUserMedia: Boolean = false

    init {
        peerIceServers.add(PeerConnection.IceServer.builder(iceServersList).createIceServer())

        createPeer()
    }

    private fun createPeer() {
        sdpConstraints = MediaConstraints()

        val audioConstraints = MediaConstraints()

        // add all existing audio filters to avoid having echos
        audioConstraints.mandatory.add(MediaConstraints.KeyValuePair("googEchoCancellation", "true"))
        audioConstraints.mandatory.add(MediaConstraints.KeyValuePair("googEchoCancellation2", "true"))
        audioConstraints.mandatory.add(MediaConstraints.KeyValuePair("googDAEchoCancellation", "true"))

        audioConstraints.mandatory.add(MediaConstraints.KeyValuePair("googTypingNoiseDetection", "true"))

        // audioConstraints.mandatory.add(MediaConstraints.KeyValuePair("googAutoGainControl", "true"))
        // audioConstraints.mandatory.add(MediaConstraints.KeyValuePair("googAutoGainControl2", "true"))

        audioConstraints.mandatory.add(MediaConstraints.KeyValuePair("googNoiseSuppression", "true"))
        audioConstraints.mandatory.add(MediaConstraints.KeyValuePair("googNoiseSuppression2", "true"))

        audioConstraints.mandatory.add(MediaConstraints.KeyValuePair("googAudioMirroring", "false"))
        audioConstraints.mandatory.add(MediaConstraints.KeyValuePair("googHighpassFilter", "true"))

        val audioSource = peerConnectionFactory.createAudioSource(audioConstraints)
        localAudioTrack = peerConnectionFactory.createAudioTrack("101", audioSource)
        localAudioTrack?.setEnabled(false)
        gotUserMedia = true
    }

    internal fun initPeer() {
        activity.surface_view.init(rootEglBase.eglBaseContext, null)
        activity.surface_view.setZOrderMediaOverlay(true)

        WebRtcAudioUtils.setWebRtcBasedAcousticEchoCanceler(true)
        WebRtcAudioUtils.setWebRtcBasedNoiseSuppressor(true)
        WebRtcAudioUtils.setWebRtcBasedAutomaticGainControl(true)
        // WebRtcAudioUtils.setDefaultSampleRateHz(22050)

        activity.runOnUiThread {
            if (localAudioTrack != null) {
                createPeerConnection()
            }
        }
   }

    /**
     * Creating the local peerconnection instance
     */
    private fun createPeerConnection() {

        localPeer = peerConnectionFactory.createPeerConnection(myRTCConfig, mainConstraints, object : PeerObserver {
            override fun onIceCandidate(p0: IceCandidate) {
                super.onIceCandidate(p0)
                onIceCandidateReceived(p0)
            }

            override fun onAddStream(p0: MediaStream) {
                activity.showToast("Received Remote stream")
                super.onAddStream(p0)
                gotRemoteStream(p0)
            }

        })

        localStream = peerConnectionFactory.createLocalMediaStream("102")
        localStream?.addTrack(localAudioTrack)

        // localPeer!!.addStream(localStream)
    }

    private fun onIceCandidateReceived(iceCandidate: IceCandidate) {
        //we have received ice candidate. We can set it to the other peer.
        if (localPeer == null) {
            return
        }

        val message = JSONObject()
        message.put("type", "candidate")
        message.put("label", iceCandidate.sdpMLineIndex)
        message.put("id", iceCandidate.sdpMid)
        message.put("candidate", iceCandidate.sdp) // iceCandidate.serverUrl)

        fSignalling.doSignalingSend(message.toString())
    }

    private fun gotRemoteStream(stream: MediaStream) {
        isConnected = true
        //we have remote video stream. add to the renderer.
        videoTrack = stream.videoTracks[0]
        audioTrack = stream.audioTracks[0]
        videoTrack?.setEnabled(false)
        audioTrack?.setEnabled(false)

        activity.runOnUiThread {
            try {
                videoTrack?.addSink(activity.surface_view)
            } catch (e: Exception) {
                e.printStackTrace()
            }
        }

        enableAll()
    }

    internal fun enableAll() {
        if (isConnected && isEnabled && isIced) {
            Log.d("Peer Enable", "Enabling Peer")
            localAudioTrack?.setEnabled(true)
            videoTrack?.setEnabled(true)
            audioTrack?.setEnabled(true)

            isVideoRunning = true
        }
    }

    internal fun disableAll() {
        if (isConnected) {
            localAudioTrack?.setEnabled(false)
            videoTrack?.setEnabled(false)
            audioTrack?.setEnabled(false)
        }
        isVideoRunning = false
    }

    fun onReceivePeerMessage(data: JSONObject) {
        if (data.getString("type") == "offer") {
            // val sdpReturned = SdpUtils.forceChosenVideoCodec(data.getString("sdp"), "H264")
            val sdpReturned = data.getString("sdp")
            // data.remove("sdp")
            // data.put("sdp", sdpReturned)

            val sessionDescription = SessionDescription(SessionDescription.Type.OFFER, sdpReturned)

            localPeer?.setRemoteDescription(object: mySdpObserver {
                override fun onSetSuccess() {
                    super.onSetSuccess()
                    localPeer?.addStream(localStream)
                }
            }, sessionDescription)

            localPeer?.createAnswer(object : mySdpObserver {
                override fun onCreateSuccess(p0: SessionDescription) {
                    super.onCreateSuccess(p0)

                    localPeer!!.setLocalDescription( object : mySdpObserver {}, p0)

                    val description = JSONObject()
                    description.put("type", p0.type.canonicalForm())
                    description.put("sdp", p0.description)

                    this@PeerConnectionClient.fSignalling.doSignalingSend(description.toString())
                }

                override fun onCreateFailure(p0: String) {
                    super.onCreateFailure(p0)
                    activity.showToast("Failed to create answer")
                }

            }, MediaConstraints())

        } else if (data.getString("type") == "candidate") {
            val iceCandidate = IceCandidate(data.getString("id"), data.getInt("label"), data.getString("candidate"))
            localPeer?.addIceCandidate(iceCandidate)

            if (iceCandidate.sdp == "") {
                isIced = true
                enableAll()
            }
        }
    }

    internal fun close() {
        isConnected = false
        isIced = false
        localPeer?.close()
        localPeer = null
    }

}

Сообщения об ошибках в Android, когда видео не работает:

2019-06-21 14:55:18.489 12310-12310/com.akshit.webrtcTest I/org.webrtc.Logging: EglRenderer: surface_viewInitializing EglRenderer
2019-06-21 14:55:18.491 12310-17205/com.akshit.webrtcTest I/org.webrtc.Logging: EglRenderer: surface_viewEglBase.create shared context
2019-06-21 14:55:18.491 12310-17205/com.akshit.webrtcTest I/org.webrtc.Logging: EglBase14: SDK version: 28. isEGL14Supported: true
2019-06-21 14:55:18.493 12310-12310/com.akshit.webrtcTest W/org.webrtc.Logging: WebRtcAudioUtils: setWebRtcBasedAutomaticGainControl() is deprecated
2019-06-21 14:55:18.522 12310-12310/com.akshit.webrtcTest I/org.webrtc.Logging: SurfaceViewRenderer: surface_view: onMeasure(). New size: 1440x1868
2019-06-21 14:55:18.523 12310-12310/com.akshit.webrtcTest I/org.webrtc.Logging: EglRenderer: surface_viewsetLayoutAspectRatio: 0.77087796
2019-06-21 14:55:20.495 12310-12382/com.akshit.webrtcTest I/org.webrtc.Logging: AndroidVideoDecoder: ctor name: OMX.qcom.video.decoder.vp8 type: VP8 color format: 19 context: org.webrtc.EglBase14$Context@52ec5d
2019-06-21 14:55:20.501 12310-12382/com.akshit.webrtcTest I/org.webrtc.Logging: AndroidVideoDecoder: ctor name: OMX.qcom.video.decoder.vp9 type: VP9 color format: 19 context: org.webrtc.EglBase14$Context@52ec5d
2019-06-21 14:55:20.506 12310-12382/com.akshit.webrtcTest I/org.webrtc.Logging: AndroidVideoDecoder: ctor name: OMX.qcom.video.decoder.avc type: H264 color format: 19 context: org.webrtc.EglBase14$Context@52ec5d
2019-06-21 14:55:20.510 12310-12382/com.akshit.webrtcTest I/org.webrtc.Logging: AndroidVideoDecoder: ctor name: OMX.google.h264.decoder type: H264 color format: 19 context: org.webrtc.EglBase14$Context@52ec5d
2019-06-21 14:55:20.519 12310-12382/com.akshit.webrtcTest D/OpenSLESPlayer: InitPlayout[tid=12382]
2019-06-21 14:55:20.519 12310-12382/com.akshit.webrtcTest D/OpenSLESPlayer: ObtainEngineInterface
2019-06-21 14:55:20.519 12310-12382/com.akshit.webrtcTest D/OpenSLESPlayer: CreateMix
2019-06-21 14:55:20.520 12310-12382/com.akshit.webrtcTest D/OpenSLESPlayer: StartPlayout[tid=12382]
2019-06-21 14:55:20.520 12310-12382/com.akshit.webrtcTest D/OpenSLESPlayer: CreateAudioPlayer
2019-06-21 14:55:20.521 12310-12382/com.akshit.webrtcTest I/libOpenSLES: Emulating old channel mask behavior (ignoring positional mask 0x4, using default mask 0x1 based on channel count of 1)
2019-06-21 14:55:20.522 12310-12382/com.akshit.webrtcTest W/AudioTrack: AUDIO_OUTPUT_FLAG_FAST denied by server; frameCount 0 -> 1924
2019-06-21 14:55:20.536 12310-12382/com.akshit.webrtcTest I/org.webrtc.Logging: AndroidVideoDecoder: ctor name: OMX.qcom.video.decoder.avc type: H264 color format: 19 context: org.webrtc.EglBase14$Context@52ec5d
2019-06-21 14:55:20.538 12310-12382/com.akshit.webrtcTest I/org.webrtc.Logging: AndroidVideoDecoder: ctor name: OMX.google.h264.decoder type: H264 color format: 19 context: org.webrtc.EglBase14$Context@52ec5d
2019-06-21 14:55:20.539 12310-12382/com.akshit.webrtcTest D/OpenSLESRecorder: EnableBuiltInAEC(0)
2019-06-21 14:55:20.539 12310-12382/com.akshit.webrtcTest E/OpenSLESRecorder: Not implemented
2019-06-21 14:55:20.540 12310-12382/com.akshit.webrtcTest D/OpenSLESRecorder: EnableBuiltInNS(1)
2019-06-21 14:55:20.540 12310-12382/com.akshit.webrtcTest E/OpenSLESRecorder: Not implemented
2019-06-21 14:55:20.540 12310-12381/com.akshit.webrtcTest I/org.webrtc.Logging: NetworkMonitor: Start monitoring with native observer 495752937792
2019-06-21 14:55:20.556 12310-12355/com.akshit.webrtcTest I/org.webrtc.Logging: NetworkMonitorAutoDetect: Network becomes available: 156
2019-06-21 14:55:20.570 12310-12355/com.akshit.webrtcTest I/org.webrtc.Logging: NetworkMonitorAutoDetect: capabilities changed: [ Transports: WIFI Capabilities: NOT_METERED&INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&VALIDATED&NOT_ROAMING&FOREGROUND&NOT_CONGESTED&NOT_SUSPENDED Unwanted:  LinkUpBandwidth>=1048576Kbps LinkDnBandwidth>=1048576Kbps SignalStrength: -65 SSID: "Whosonthedoor"]
2019-06-21 14:55:20.583 12310-12355/com.akshit.webrtcTest I/org.webrtc.Logging: NetworkMonitorAutoDetect: link properties changed: {InterfaceName: wlan0 LinkAddresses: [fe80::4a60:5fff:fe2e:4d9e/64,192.168.0.102/24,]  Routes: [fe80::/64 -> :: wlan0,192.168.0.0/24 -> 0.0.0.0 wlan0,0.0.0.0/0 -> 192.168.0.1 wlan0,] DnsAddresses: [192.168.0.1,] UsePrivateDns: false PrivateDnsServerName: null Domains: null MTU: 0 TcpBufferSizes: 524288,2097152,8388608,262144,524288,4194304}
2019-06-21 14:55:20.916 12310-12310/com.akshit.webrtcTest D/Peer Enable: Enabling Peer
2019-06-21 14:55:21.247 12310-12382/com.akshit.webrtcTest D/OpenSLESRecorder: EnableBuiltInAEC(0)
2019-06-21 14:55:21.247 12310-12382/com.akshit.webrtcTest E/OpenSLESRecorder: Not implemented
2019-06-21 14:55:21.248 12310-12382/com.akshit.webrtcTest D/OpenSLESRecorder: EnableBuiltInNS(1)
2019-06-21 14:55:21.248 12310-12382/com.akshit.webrtcTest E/OpenSLESRecorder: Not implemented
2019-06-21 14:55:21.248 12310-12382/com.akshit.webrtcTest D/OpenSLESRecorder: InitRecording[tid=12382]
2019-06-21 14:55:21.248 12310-12382/com.akshit.webrtcTest D/OpenSLESRecorder: ObtainEngineInterface
2019-06-21 14:55:21.248 12310-12382/com.akshit.webrtcTest D/OpenSLESRecorder: CreateAudioRecorder
2019-06-21 14:55:21.248 12310-12382/com.akshit.webrtcTest D/OpenSLESRecorder: StartRecording[tid=12382]
2019-06-21 14:55:21.248 12310-12382/com.akshit.webrtcTest D/OpenSLESRecorder: state.count:2 state.index:0
2019-06-21 14:55:21.469 12310-17234/com.akshit.webrtcTest I/org.webrtc.Logging: EglBase14: SDK version: 28. isEGL14Supported: true
2019-06-21 14:55:21.475 12310-17234/com.akshit.webrtcTest I/org.webrtc.Logging: SurfaceTextureHelper: Setting listener to org.webrtc.AndroidVideoDecoder@1f45b6e
2019-06-21 14:55:21.475 12310-17217/com.akshit.webrtcTest I/org.webrtc.Logging: AndroidVideoDecoder: initDecodeInternal name: OMX.qcom.video.decoder.avc type: H264 width: 640 height: 480
2019-06-21 14:55:21.480 12310-17236/com.akshit.webrtcTest I/OMXClient: IOmx service obtained
2019-06-21 14:55:21.498 12310-17235/com.akshit.webrtcTest D/SurfaceUtils: connecting to surface 0x736c242010, reason connectToSurface
2019-06-21 14:55:21.498 12310-17235/com.akshit.webrtcTest I/MediaCodec: [OMX.qcom.video.decoder.avc] setting surface generation to 12605445
2019-06-21 14:55:21.498 12310-17235/com.akshit.webrtcTest D/SurfaceUtils: disconnecting from surface 0x736c242010, reason connectToSurface(reconnect)
2019-06-21 14:55:21.498 12310-17235/com.akshit.webrtcTest D/SurfaceUtils: connecting to surface 0x736c242010, reason connectToSurface(reconnect)
2019-06-21 14:55:21.515 12310-17236/com.akshit.webrtcTest D/SurfaceUtils: set up nativeWindow 0x736c242010 for 640x480, color 0x7fa30c06, rotation 0, usage 0x20002900
2019-06-21 14:55:21.523 12310-17217/com.akshit.webrtcTest I/org.webrtc.Logging: AndroidVideoDecoder: initDecodeInternal done
2019-06-21 14:55:21.523 12310-17236/com.akshit.webrtcTest W/MapperHal: buffer descriptor with invalid usage bits 0x2000
2019-06-21 14:55:21.526 12310-17236/com.akshit.webrtcTest I/chatty: uid=10223(com.akshit.webrtcTest) CodecLooper identical 1 line
2019-06-21 14:55:21.527 12310-17236/com.akshit.webrtcTest W/MapperHal: buffer descriptor with invalid usage bits 0x2000
2019-06-21 14:55:21.535 12310-17240/com.akshit.webrtcTest I/org.webrtc.Logging: AndroidVideoDecoder: Decoder format changed: {crop-right=639, color-format=2141391878, slice-height=480, mime=video/raw, hdr-static-info=java.nio.HeapByteBuffer[pos=0 lim=25 cap=25], stride=640, color-standard=4, color-transfer=3, crop-bottom=479, crop-left=0, width=640, color-range=2, crop-top=0, height=480}
2019-06-21 14:55:21.535 12310-17240/com.akshit.webrtcTest I/org.webrtc.Logging: AndroidVideoDecoder: Frame stride and slice height: 640 x 480
2019-06-21 14:55:21.537 12310-17236/com.akshit.webrtcTest W/MapperHal: buffer descriptor with invalid usage bits 0x2000
2019-06-21 14:55:21.538 12310-17216/com.akshit.webrtcTest I/org.webrtc.Logging: SurfaceEglRenderer: surface_view: Reporting first rendered frame.
2019-06-21 14:55:21.539 12310-17216/com.akshit.webrtcTest I/org.webrtc.Logging: SurfaceEglRenderer: surface_view: Reporting frame resolution changed to 640x480 with rotation 0
2019-06-21 14:55:21.552 12310-17236/com.akshit.webrtcTest W/MapperHal: buffer descriptor with invalid usage bits 0x2000
2019-06-21 14:55:21.563 12310-12310/com.akshit.webrtcTest I/org.webrtc.Logging: SurfaceViewRenderer: surface_view: onMeasure(). New size: 1440x2383
2019-06-21 14:55:21.571 12310-12310/com.akshit.webrtcTest I/org.webrtc.Logging: SurfaceViewRenderer: surface_view: onMeasure(). New size: 1440x1868
2019-06-21 14:55:21.582 12310-17236/com.akshit.webrtcTest W/MapperHal: buffer descriptor with invalid usage bits 0x2000
2019-06-21 14:55:21.583 12310-12310/com.akshit.webrtcTest I/org.webrtc.Logging: EglRenderer: surface_viewsetLayoutAspectRatio: 0.77087796
2019-06-21 14:55:21.590 12310-17236/com.akshit.webrtcTest W/MapperHal: buffer descriptor with invalid usage bits 0x2000
2019-06-21 14:55:21.641 12310-17236/com.akshit.webrtcTest W/MapperHal: buffer descriptor with invalid usage bits 0x2000
2019-06-21 14:55:21.677 12310-17236/com.akshit.webrtcTest W/MapperHal: buffer descriptor with invalid usage bits 0x2000
2019-06-21 14:55:21.712 12310-17236/com.akshit.webrtcTest W/MapperHal: buffer descriptor with invalid usage bits 0x2000
2019-06-21 14:55:21.746 12310-17236/com.akshit.webrtcTest W/MapperHal: buffer descriptor with invalid usage bits 0x2000
2019-06-21 14:55:21.783 12310-17236/com.akshit.webrtcTest W/MapperHal: buffer descriptor with invalid usage bits 0x2000
2019-06-21 14:55:21.812 12310-17236/com.akshit.webrtcTest W/MapperHal: buffer descriptor with invalid usage bits 0x2000
2019-06-21 14:55:21.844 12310-17236/com.akshit.webrtcTest W/MapperHal: buffer descriptor with invalid usage bits 0x2000
2019-06-21 14:55:21.881 12310-17236/com.akshit.webrtcTest W/MapperHal: buffer descriptor with invalid usage bits 0x2000
2019-06-21 14:55:21.914 12310-17236/com.akshit.webrtcTest W/MapperHal: buffer descriptor with invalid usage bits 0x2000
2019-06-21 14:55:21.949 12310-17236/com.akshit.webrtcTest W/MapperHal: buffer descriptor with invalid usage bits 0x2000
2019-06-21 14:55:21.981 12310-17236/com.akshit.webrtcTest W/MapperHal: buffer descriptor with invalid usage bits 0x2000
2019-06-21 14:55:22.015 12310-17236/com.akshit.webrtcTest W/MapperHal: buffer descriptor with invalid usage bits 0x2000
2019-06-21 14:55:22.510 12310-17205/com.akshit.webrtcTest I/org.webrtc.Logging: EglRenderer: surface_viewDuration: 4010 ms. Frames received: 2. Dropped: 0. Rendered: 2. Render fps: .5. Average render time: 5662 us. Average swapBuffer time: 2670 us.
2019-06-21 14:55:23.926 12310-17236/com.akshit.webrtcTest W/MapperHal: buffer descriptor with invalid usage bits 0x2000
2019-06-21 14:55:26.518 12310-17205/com.akshit.webrtcTest I/org.webrtc.Logging: EglRenderer: surface_viewDuration: 4012 ms. Frames received: 1. Dropped: 0. Rendered: 1. Render fps: .2. Average render time: 6881 us. Average swapBuffer time: 5200 us.
2019-06-21 14:55:27.676 12310-12355/com.akshit.webrtcTest I/org.webrtc.Logging: NetworkMonitorAutoDetect: Network becomes available: 167
2019-06-21 14:55:27.685 12310-12355/com.akshit.webrtcTest I/org.webrtc.Logging: NetworkMonitorAutoDetect: capabilities changed: [ Transports: CELLULAR Capabilities: SUPL&INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&NOT_ROAMING&FOREGROUND&NOT_CONGESTED&NOT_SUSPENDED Unwanted:  LinkUpBandwidth>=51200Kbps LinkDnBandwidth>=102400Kbps Specifier: <1>]
2019-06-21 14:55:27.694 12310-12355/com.akshit.webrtcTest I/org.webrtc.Logging: NetworkMonitorAutoDetect: link properties changed: {InterfaceName: rmnet_data0 LinkAddresses: [25.70.239.124/29,]  Routes: [0.0.0.0/0 -> 25.70.239.125 rmnet_data0,25.70.239.120/29 -> 0.0.0.0 rmnet_data0,] DnsAddresses: [49.45.0.1,] UsePrivateDns: false PrivateDnsServerName: null Domains: null MTU: 1500 TcpBufferSizes: 524288,1048576,8388608,262144,524288,4194304}
2019-06-21 14:55:28.296 12310-12355/com.akshit.webrtcTest I/org.webrtc.Logging: NetworkMonitorAutoDetect: link properties changed: {InterfaceName: rmnet_data0 LinkAddresses: [25.70.239.124/29,2405:204:8406:c337:b82b:bc48:9cfc:2e56/64,]  Routes: [0.0.0.0/0 -> 25.70.239.125 rmnet_data0,::/0 -> fe80::d468:ec39:62d3:f326 rmnet_data0,25.70.239.120/29 -> 0.0.0.0 rmnet_data0,2405:204:8406:c337::/64 -> :: rmnet_data0,] DnsAddresses: [49.45.0.1,2405:200:800::1,] UsePrivateDns: false PrivateDnsServerName: null Domains: null MTU: 1500 TcpBufferSizes: 524288,1048576,8388608,262144,524288,4194304}
2019-06-21 14:55:30.528 12310-17205/com.akshit.webrtcTest I/org.webrtc.Logging: EglRenderer: surface_viewDuration: 4008 ms. Frames received: 12. Dropped: 0. Rendered: 12. Render fps: 3.0. Average render time: 5893 us. Average swapBuffer time: 3960 us.
2019-06-21 14:55:34.193 12310-12355/com.akshit.webrtcTest I/org.webrtc.Logging: NetworkMonitorAutoDetect: capabilities changed: [ Transports: CELLULAR Capabilities: SUPL&INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN&VALIDATED&NOT_ROAMING&FOREGROUND&NOT_CONGESTED&NOT_SUSPENDED Unwanted:  LinkUpBandwidth>=51200Kbps LinkDnBandwidth>=102400Kbps Specifier: <1>]
2019-06-21 14:55:34.532 12310-17205/com.akshit.webrtcTest I/org.webrtc.Logging: EglRenderer: surface_viewDuration: 4005 ms. Frames received: 22. Dropped: 0. Rendered: 22. Render fps: 5.5. Average render time: 4742 us. Average swapBuffer time: 3293 us.
2019-06-21 14:55:36.887 12310-12382/com.akshit.webrtcTest D/OpenSLESRecorder: StopRecording[tid=12382]
2019-06-21 14:55:36.940 12310-12382/com.akshit.webrtcTest I/org.webrtc.Logging: AndroidVideoDecoder: release
2019-06-21 14:55:36.940 12310-17240/com.akshit.webrtcTest I/org.webrtc.Logging: AndroidVideoDecoder: Releasing MediaCodec on output thread
2019-06-21 14:55:36.948 12310-17235/com.akshit.webrtcTest D/SurfaceUtils: disconnecting from surface 0x736c242010, reason disconnectFromSurface
2019-06-21 14:55:36.959 12310-17240/com.akshit.webrtcTest I/org.webrtc.Logging: AndroidVideoDecoder: Release on output thread done
2019-06-21 14:55:36.959 12310-12382/com.akshit.webrtcTest I/org.webrtc.Logging: SurfaceTextureHelper: stopListening()
2019-06-21 14:55:36.960 12310-12382/com.akshit.webrtcTest I/org.webrtc.Logging: SurfaceTextureHelper: dispose()
2019-06-21 14:55:36.963 12310-12382/com.akshit.webrtcTest D/OpenSLESPlayer: StopPlayout[tid=12382]
2019-06-21 14:55:36.963 12310-12382/com.akshit.webrtcTest D/AudioTrack: stop() called with 791040 frames delivered
2019-06-21 14:55:36.964 12310-12382/com.akshit.webrtcTest D/OpenSLESPlayer: DestroyAudioPlayer
2019-06-21 14:55:36.967 12310-12381/com.akshit.webrtcTest I/org.webrtc.Logging: NetworkMonitor: Stop monitoring with native observer 495752937792
2019-06-21 14:55:36.967 12310-12381/com.akshit.webrtcTest I/org.webrtc.Logging: NetworkMonitorAutoDetect: Unregister network callback
2019-06-21 14:55:36.968 12310-12381/com.akshit.webrtcTest I/org.webrtc.Logging: NetworkMonitorAutoDetect: Unregister network callback
2019-06-21 14:55:36.976 12310-17205/com.akshit.webrtcTest I/org.webrtc.Logging: EglRenderer: surface_viewclearSurface
2019-06-21 14:55:36.976 12310-12310/com.akshit.webrtcTest I/org.webrtc.Logging: EglRenderer: surface_viewReleasing.
2019-06-21 14:55:36.979 12310-17205/com.akshit.webrtcTest I/org.webrtc.Logging: GlShader: Deleting shader.
2019-06-21 14:55:36.980 12310-17205/com.akshit.webrtcTest I/org.webrtc.Logging: EglRenderer: surface_vieweglBase detach and release.
2019-06-21 14:55:36.983 12310-12310/com.akshit.webrtcTest I/org.webrtc.Logging: EglRenderer: surface_viewReleasing done.
2019-06-21 14:55:36.983 12310-17205/com.akshit.webrtcTest I/org.webrtc.Logging: EglRenderer: surface_viewQuitting render thread.

1 Ответ

0 голосов
/ 02 июля 2019

Изменение кодировки на VP9 заставило вещи работать.Я полагаю, аппаратное декодирование не подходит для библиотеки Android Webrtc.

...