chromium/third_party/webrtc/pc/payload_type_picker.cc

/*
 *  Copyright 2024 The WebRTC Project Authors. All rights reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#include "pc/payload_type_picker.h"

#include <algorithm>
#include <utility>
#include <vector>

#include "absl/strings/match.h"
#include "api/rtc_error.h"
#include "media/base/codec.h"

namespace webrtc {

namespace {

// Due to interoperability issues with old Chrome/WebRTC versions that
// ignore the [35, 63] range prefer the lower range for new codecs.
static const int kFirstDynamicPayloadTypeLowerRange =;
static const int kLastDynamicPayloadTypeLowerRange =;

static const int kFirstDynamicPayloadTypeUpperRange =;
static const int kLastDynamicPayloadTypeUpperRange =;

// Note: The only fields we need from a Codec are the type (audio/video),
// the subtype (vp8/h264/....), the clock rate, the channel count, and the
// fmtp parameters. The use of cricket::Codec, which contains more fields,
// is only a temporary measure.

bool MatchesForSdp(const cricket::Codec& codec_1,
                   const cricket::Codec& codec_2) {}

struct MapTableEntry {};

RTCErrorOr<PayloadType> FindFreePayloadType(std::set<PayloadType> seen_pt) {}

}  // namespace

PayloadTypePicker::PayloadTypePicker() {}

RTCErrorOr<PayloadType> PayloadTypePicker::SuggestMapping(
    cricket::Codec codec,
    const PayloadTypeRecorder* excluder) {}

RTCError PayloadTypePicker::AddMapping(PayloadType payload_type,
                                       cricket::Codec codec) {}

RTCError PayloadTypeRecorder::AddMapping(PayloadType payload_type,
                                         cricket::Codec codec) {}

std::vector<std::pair<PayloadType, cricket::Codec>>
PayloadTypeRecorder::GetMappings() const {}

RTCErrorOr<PayloadType> PayloadTypeRecorder::LookupPayloadType(
    cricket::Codec codec) const {}

RTCErrorOr<cricket::Codec> PayloadTypeRecorder::LookupCodec(
    PayloadType payload_type) const {}

void PayloadTypeRecorder::Commit() {}
void PayloadTypeRecorder::Rollback() {}

}  // namespace webrtc