I am using ScreenCapturerAndroid to record the screen and create a VideoCapturer .This is how i create peer connection.
private void createPeerConnection(Context context) {
PeerConnectionFactory.InitializationOptions initializationOptions =
PeerConnectionFactory.InitializationOptions.builder(context)
.createInitializationOptions();
PeerConnectionFactory.initialize(initializationOptions);
if (rootEglBase == null) {
rootEglBase = EglBase.create();
}
PeerConnectionFactory.Options options = new PeerConnectionFactory.Options();
DefaultVideoEncoderFactory defaultVideoEncoderFactory = new DefaultVideoEncoderFactory(
rootEglBase.getEglBaseContext(), true, true);
for (int i = 0; i < defaultVideoEncoderFactory.getSupportedCodecs().length; i++) {
Log.d("Codecs", "Supported codecs: " + defaultVideoEncoderFactory.getSupportedCodecs()[i].name);
}
DefaultVideoDecoderFactory defaultVideoDecoderFactory = new DefaultVideoDecoderFactory(rootEglBase.getEglBaseContext());
final AudioDeviceModule adm = createJavaAudioDevice(context);
peerConnectionFactory = PeerConnectionFactory.builder()
.setOptions(options)
.setAudioDeviceModule(adm)
.setVideoEncoderFactory(defaultVideoEncoderFactory)
.setVideoDecoderFactory(defaultVideoDecoderFactory)
.createPeerConnectionFactory();
adm.release();
}
The app crashes when the connection is established and frame is received . The crash happens on receiver side . Following is the related logs. Any help is appreciated. The crash happens while decoding the frames .
I/org.webrtc.Logging: AndroidVideoDecoder: initDecodeInternal name: OMX.MTK.VIDEO.DECODER.VPX type: VP8 width: 1080 height: 2340
I/org.webrtc.Logging: SurfaceTextureHelper: Setting listener to org.webrtc.AndroidVideoDecoder@7ed50de
I/MediaCodec: CreateByComponentName(), name = OMX.MTK.VIDEO.DECODER.VPX
new MediaCodec()
D/ACodec: ACodec() multimedia.audio.effect.type = dirac
I/OMXClient: IOmx service obtained
I/MediaCodec: configure()
D/SurfaceUtils: connecting to surface 0x745e04a010, reason connectToSurface
D/Surface: Surface::connect(this=0x745e04a000,api=3)
I/BufferQueueProducer: [SurfaceTexture-1-11591-0](this:0x745e1f9800,id:0,api:3,p:11591,c:11591) connect(P): api=3 producer=(11591:com.scrnshr.anyscrn) producerControlledByApp=true
I/MediaCodec: [OMX.MTK.VIDEO.DECODER.VPX] setting surface generation to 11869185
D/SurfaceUtils: disconnecting from surface 0x745e04a010, reason connectToSurface(reconnect)
D/Surface: Surface::disconnect(this=0x745e04a000,api=3)
I/BufferQueueProducer: [SurfaceTexture-1-11591-0](this:0x745e1f9800,id:0,api:3,p:11591,c:11591) disconnect(P): api 3
D/SurfaceUtils: connecting to surface 0x745e04a010, reason connectToSurface(reconnect)
D/Surface: Surface::connect(this=0x745e04a000,api=3)
I/BufferQueueProducer: [SurfaceTexture-1-11591-0](this:0x745e1f9800,id:0,api:3,p:11591,c:11591) connect(P): api=3 producer=(11591:com.scrnshr.anyscrn) producerControlledByApp=true
E/ACodec: [OMX.MTK.VIDEO.DECODER.VPX] configureCodec returning error -22
signalError(omxError 0x80001001, internalError -22)
E/MediaCodec: Codec reported err 0xffffffea, actionCode 0, while in state 3
D/IAtlas: IAtlas::init CallingPid 11591
IAtlas::init this 0x748b65f800
D/SurfaceUtils: disconnecting from surface 0x745e04a010, reason disconnectFromSurface
D/Surface: Surface::disconnect(this=0x745e04a000,api=3)
I/BufferQueueProducer: [SurfaceTexture-1-11591-0](this:0x745e1f9800,id:0,api:3,p:11591,c:11591) disconnect(P): api 3
E/MediaCodec: configure failed with err 0xffffffea, resetting...
I/MediaCodec: reset()
Video release()
D/IAtlas: IAtlas::init CallingPid 11591
IAtlas::init this 0x748b65f640
D/ACodec: ACodec() multimedia.audio.effect.type = dirac
I/OMXClient: IOmx service obtained
W/System.err: java.lang.IllegalArgumentException
W/System.err: at android.media.MediaCodec.native_configure(Native Method)
at android.media.MediaCodec.configure(MediaCodec.java:2023)
at android.media.MediaCodec.configure(MediaCodec.java:1951)
at org.webrtc.MediaCodecWrapperFactoryImpl$MediaCodecWrapperImpl.configure(MediaCodecWrapperFactoryImpl.java:37)
at org.webrtc.AndroidVideoDecoder.initDecodeInternal(AndroidVideoDecoder.java:192)
at org.webrtc.AndroidVideoDecoder.initDecode(AndroidVideoDecoder.java:157)
E/rtc: #
# Fatal error in: gen/sdk/android/generated_metrics_jni/../../../../../../../../usr/local/google/home/sakal/code/webrtc-aar-release/src/sdk/android/src/jni/jni_generator_helper.h, line 94
# last system error: 0
# Check failed: !env->ExceptionCheck()
#
D/apitrace: apitrace: warning: caught signal 6
call flush from exceptionCallback
A/libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE) in tid 11805 (DecodingQueue -), pid 11591 (scrnshr.anyscrn)
from Webrtc android screen sharing crashing on devices like realme,oppo
No comments:
Post a Comment