Files
platform-external-webrtc/call/rtp_payload_params.h
Stefan Holmer 1da4d79ba3 Move allocation and rtp conversion logic out of payload router.
Makes it easier to write tests, and allows for moving rtp module
ownership into the payload router in the future.

The RtpPayloadParams class is split into declaration and definition and
moved into separate files.

Bug: webrtc:9517
Change-Id: I8700628edff19abcacfe8d3a20e4ba7476f712ad
Reviewed-on: https://webrtc-review.googlesource.com/88564
Commit-Queue: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23983}
2018-07-16 13:34:37 +00:00

55 lines
1.5 KiB
C++

/*
* Copyright (c) 2018 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_RTP_PAYLOAD_PARAMS_H_
#define CALL_RTP_PAYLOAD_PARAMS_H_
#include <map>
#include <vector>
#include "api/video_codecs/video_encoder.h"
#include "common_types.h" // NOLINT(build/include)
#include "modules/rtp_rtcp/source/rtp_video_header.h"
namespace webrtc {
class RTPFragmentationHeader;
class RtpRtcp;
// Currently only VP8/VP9 specific.
struct RtpPayloadState {
int16_t picture_id = -1;
uint8_t tl0_pic_idx = 0;
};
// State for setting picture id and tl0 pic idx, for VP8 and VP9
// TODO(nisse): Make these properties not codec specific.
class RtpPayloadParams final {
public:
RtpPayloadParams(const uint32_t ssrc, const RtpPayloadState* state);
~RtpPayloadParams();
RTPVideoHeader GetRtpVideoHeader(
const EncodedImage& image,
const CodecSpecificInfo* codec_specific_info);
uint32_t ssrc() const;
RtpPayloadState state() const;
private:
void Set(RTPVideoHeader* rtp_video_header, bool first_frame_in_picture);
const uint32_t ssrc_;
RtpPayloadState state_;
};
} // namespace webrtc
#endif // CALL_RTP_PAYLOAD_PARAMS_H_