open-webrtc-toolkit / owt-client-android

Open WebRTC Toolkit client SDK for Android applications.
https://01.org/open-webrtc-toolkit
Apache License 2.0
195 stars 96 forks source link

[P2P] Is the codec of H265 fully supported? #134

Closed wuyisheng closed 4 years ago

wuyisheng commented 5 years ago

I have two mobile phones (Pixel1-Android9.0), they all have HEVC&AVC hardware decode&encode(Qcom chip) support. I trying to modify the P2PClientConfiguration in owt.sample.p2p.MainActivity as following:

//one setting: every thing fine!
VideoEncodingParameters h264 = new VideoEncodingParameters(H264);
P2PClientConfiguration configuration = P2PClientConfiguration.builder()
        .addVideoParameters(h264)
        .build();

// another setting : publish success(SDP answer&offer is ok) , local preview success
// but play remote video fail : (
VideoEncodingParameters h265 = new VideoEncodingParameters(H265);
P2PClientConfiguration configuration = P2PClientConfiguration.builder()
        .addVideoParameters(h265)
        .build();

Am I using it incorrectly? Or OWT-P2P-Android does not support H265?

jianjunz commented 5 years ago

If you want to change codec settings, please make sure at least one codec is supported by both sides.

wuyisheng commented 5 years ago

Thanks for the reply !

I confirmed that the hevc-codec(decode&encode) is support by both sides.

More information is as follows:

int numCodecs = MediaCodecList.getCodecCount();
for (int i = 0; i < numCodecs; i++) {
    MediaCodecInfo codecInfo = MediaCodecList.getCodecInfoAt(i);
    String[] types = codecInfo.getSupportedTypes();
    for (String type : types) {
        if (!codecInfo.getName().startsWith("OMX.google")) {
            Log.e("MediaCodecList", codecInfo.getName() + type);
        }
    }
}

device one(xiaomi:MiUI:10.8.11.22 )

2019-07-22 17:37:58.831 21643-21643/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.encoder.avcvideo/avc
2019-07-22 17:37:58.831 21643-21643/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.encoder.mpeg4video/mp4v-es
2019-07-22 17:37:58.832 21643-21643/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.encoder.h263video/3gpp
2019-07-22 17:37:58.832 21643-21643/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.encoder.vp8video/x-vnd.on2.vp8
2019-07-22 17:37:58.832 21643-21643/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.encoder.hevcvideo/hevc
2019-07-22 17:37:58.832 21643-21643/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.decoder.avcvideo/avc
2019-07-22 17:37:58.832 21643-21643/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.decoder.mpeg4video/mp4v-es
2019-07-22 17:37:58.832 21643-21643/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.decoder.mpeg2video/mpeg2
2019-07-22 17:37:58.832 21643-21643/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.decoder.h263video/3gpp
2019-07-22 17:37:58.832 21643-21643/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.decoder.vc1video/x-ms-wmv
2019-07-22 17:37:58.832 21643-21643/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.decoder.divxvideo/divx
2019-07-22 17:37:58.832 21643-21643/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.decoder.divx311video/divx311
2019-07-22 17:37:58.832 21643-21643/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.decoder.divx4video/divx4
2019-07-22 17:37:58.832 21643-21643/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.decoder.vp8video/x-vnd.on2.vp8
2019-07-22 17:37:58.833 21643-21643/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.decoder.vp9video/x-vnd.on2.vp9
2019-07-22 17:37:58.833 21643-21643/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.decoder.hevcvideo/hevc

device antoher(pixel1: android9)

2019-07-22 17:39:54.717 8651-8651/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.decoder.avcvideo/avc
2019-07-22 17:39:54.717 8651-8651/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.decoder.h263video/3gpp
2019-07-22 17:39:54.717 8651-8651/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.decoder.hevcvideo/hevc
2019-07-22 17:39:54.717 8651-8651/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.decoder.mpeg4video/mp4v-es
2019-07-22 17:39:54.717 8651-8651/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.decoder.vp8video/x-vnd.on2.vp8
2019-07-22 17:39:54.717 8651-8651/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.decoder.vp9video/x-vnd.on2.vp9
2019-07-22 17:39:54.717 8651-8651/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.encoder.avcvideo/avc
2019-07-22 17:39:54.717 8651-8651/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.encoder.h263video/3gpp
2019-07-22 17:39:54.717 8651-8651/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.encoder.hevcvideo/hevc
2019-07-22 17:39:54.717 8651-8651/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.encoder.mpeg4video/mp4v-es
2019-07-22 17:39:54.717 8651-8651/owt.sample.p2p E/MediaCodecList: OMX.qcom.video.encoder.vp8video/x-vnd.on2.vp8

More logs

logcat.txt