Android: Add helper functions for comparing H264 codecs

These helper functions will be useful when making the legacy video
codecs injectable.

Bug: webrtc:7925
Change-Id: Id5a480666f07eccc3116d2c2e61803cc4daf7c9f
Reviewed-on: https://webrtc-review.googlesource.com/88365
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Commit-Queue: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23954}
This commit is contained in:
Magnus Jedvert
2018-07-12 17:05:12 +02:00
committed by Commit Bot
parent 3f84f498e4
commit 1045af2989
5 changed files with 70 additions and 26 deletions

View File

@ -84,13 +84,7 @@ class MediaCodecUtils {
case VP9:
return new HashMap<String, String>();
case H264:
Map<String, String> properties = new HashMap<>();
properties.put(VideoCodecInfo.H264_FMTP_LEVEL_ASYMMETRY_ALLOWED, "1");
properties.put(VideoCodecInfo.H264_FMTP_PACKETIZATION_MODE, "1");
properties.put(VideoCodecInfo.H264_FMTP_PROFILE_LEVEL_ID,
highProfile ? VideoCodecInfo.H264_CONSTRAINED_HIGH_3_1
: VideoCodecInfo.H264_CONSTRAINED_BASELINE_3_1);
return properties;
return H264Utils.getDefaultH264Params(highProfile);
default:
throw new IllegalArgumentException("Unsupported codec: " + type);
}