[−][src]Function h264_profile_level_id::generate_profile_level_id_for_answer
pub fn generate_profile_level_id_for_answer(
local_profile_level_id: Option<ProfileLevelId>,
local_level_asymmetry_allowed: bool,
remote_profile_level_id: Option<ProfileLevelId>,
remote_level_asymmetry_allowed: bool
) -> Result<ProfileLevelId, GenerateProfileLevelIdForAnswerError>
Generate codec parameters that will be used as answer in an SDP negotiation based on local
supported parameters and remote offered parameters. Both local_profile_level_id
and
remote_profile_level_id
represent sendrecv media descriptions, i.e they are a mix of both
encode and decode capabilities. In theory, when the profile in local_profile_level_id
represent a strict superset of the profile in remote_profile_level_id
, we could limit the
profile in the answer to the profile in remote_profile_level_id
.
However, to simplify the code, each supported H264 profile should be listed explicitly in the
list of local supported codecs, even if they are redundant. Then each local codec in the list
should be tested one at a time against the remote codec, and only when the profiles are equal
should this function be called. Therefore, this function does not need to handle profile
intersection, and the profile of local_profile_level_id
and remote_profile_level_id
must be
equal before calling this function. The parameters that are used when negotiating are the level
part of profile-level-id
and level-asymmetry-allowed
.
If both local_profile_level_id
and remote_profile_level_id
are None
, default value for
ProfileLevelId
will be returned.