This change moves the PayloadType strong alias definition from call/payload_type.h to api/payload_type.h to allow it to be used in api/ interfaces without circular dependencies. This is part of a larger refactoring to enforce type safety for payload types. Bug: webrtc:360058654 Change-Id: If8ee7da21d1fc14904172a9d7a6fea2473ea6379 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/448660 Reviewed-by: Tomas Gunnarsson <tommi@webrtc.org> Commit-Queue: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#46887}
44 lines
1.4 KiB
C++
44 lines
1.4 KiB
C++
/*
|
|
* 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.
|
|
*/
|
|
|
|
#ifndef CALL_PAYLOAD_TYPE_H_
|
|
#define CALL_PAYLOAD_TYPE_H_
|
|
|
|
|
|
#include "absl/strings/string_view.h"
|
|
#include "api/payload_type.h"
|
|
#include "api/rtc_error.h"
|
|
#include "media/base/codec.h"
|
|
|
|
namespace webrtc {
|
|
|
|
class PayloadTypePicker;
|
|
|
|
class PayloadTypeSuggester {
|
|
public:
|
|
virtual ~PayloadTypeSuggester() = default;
|
|
|
|
// Suggest a payload type for a given codec on a given media section.
|
|
// Media section is indicated by MID.
|
|
// The function will either return a PT already in use on the connection
|
|
// or a newly suggested one.
|
|
virtual RTCErrorOr<PayloadType> SuggestPayloadType(absl::string_view mid,
|
|
const Codec& codec) = 0;
|
|
// Register a payload type as mapped to a specific codec for this MID
|
|
// at this time.
|
|
virtual RTCError AddLocalMapping(absl::string_view mid,
|
|
PayloadType payload_type,
|
|
const Codec& codec) = 0;
|
|
};
|
|
|
|
} // namespace webrtc
|
|
|
|
#endif // CALL_PAYLOAD_TYPE_H_
|