blob: b85fb42789ac907ad7facf7d1dcefb8481f76880 [file] [log] [blame]
Stefan Holmerf7044682018-07-17 10:16:41 +02001/*
2 * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11#ifndef CALL_RTP_PAYLOAD_PARAMS_H_
12#define CALL_RTP_PAYLOAD_PARAMS_H_
13
14#include <map>
15#include <vector>
16
17#include "api/video_codecs/video_encoder.h"
18#include "common_types.h" // NOLINT(build/include)
19#include "modules/rtp_rtcp/source/rtp_video_header.h"
20
21namespace webrtc {
22
23class RTPFragmentationHeader;
24class RtpRtcp;
25
26// Currently only VP8/VP9 specific.
27struct RtpPayloadState {
28 int16_t picture_id = -1;
29 uint8_t tl0_pic_idx = 0;
30};
31
32// State for setting picture id and tl0 pic idx, for VP8 and VP9
33// TODO(nisse): Make these properties not codec specific.
34class RtpPayloadParams final {
35 public:
36 RtpPayloadParams(const uint32_t ssrc, const RtpPayloadState* state);
37 ~RtpPayloadParams();
38
39 RTPVideoHeader GetRtpVideoHeader(
40 const EncodedImage& image,
41 const CodecSpecificInfo* codec_specific_info);
42
43 uint32_t ssrc() const;
44
45 RtpPayloadState state() const;
46
47 private:
48 void Set(RTPVideoHeader* rtp_video_header, bool first_frame_in_picture);
49
50 const uint32_t ssrc_;
51 RtpPayloadState state_;
52};
53} // namespace webrtc
54#endif // CALL_RTP_PAYLOAD_PARAMS_H_