fyhertz / libstreaming

A solution for streaming H.264, H.263, AMR, AAC using RTP on Android
Apache License 2.0
3.47k stars 1.07k forks source link

Not working in latest android 9 version in High resolution devices #288

Closed vininandu closed 5 years ago

vininandu commented 5 years ago

2019-05-31 10:18:23.501 15887-15887/com.example.facestream W/mple.facestream: type=1400 audit(0.0:8800): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=12863 scontext=u:r:untrusted_app:s0:c171,c256,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0 2019-05-31 10:18:23.516 15887-15887/com.example.facestream E/libc: Access denied finding property "vendor.camera.aux.packagelist" 2019-05-31 10:18:23.517 15887-15887/com.example.facestream E/libc: Access denied finding property "vendor.camera.hal1.packagelist" 2019-05-31 10:18:23.501 15887-15887/com.example.facestream W/mple.facestream: type=1400 audit(0.0:8801): avc: denied { read } for name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=12871 scontext=u:r:untrusted_app:s0:c171,c256,c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0

vininandu commented 5 years ago

I have fixed the issue by selecting different media codec for high resolution devices.Hence closing issue.

yitongUp commented 5 years ago

Hi,what media codec you found?I also met this problem.

vininandu commented 5 years ago

In Mediastream.java file , I am using single codec for all modes. This line of change resolved me the problem and defaultvideoqulity I set it as 640x480 public synchronized void start() throws IllegalStateException, IOException {

    if (mDestination==null)
        throw new IllegalStateException("No destination ip address set for the stream !");

    if (mRtpPort<=0 || mRtcpPort<=0)
        throw new IllegalStateException("No destination ports set for the stream !");

    mPacketizer.setTimeToLive(mTTL);

    if (mMode != MODE_MEDIARECORDER_API) {
        encodeWithMediaCodec();
    } else {
        encodeWithMediaCodec();
    }

}