webrtc_m130/call/rtp_payload_params_unittest.cc

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

563 lines
21 KiB
C++
Raw Normal View History

Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
/*
* 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.
*/
#include "call/rtp_payload_params.h"
#include <string.h>
#include <map>
#include <set>
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
#include "absl/container/inlined_vector.h"
#include "absl/types/optional.h"
#include "absl/types/variant.h"
#include "api/video/video_content_type.h"
#include "api/video/video_rotation.h"
#include "modules/video_coding/codecs/h264/include/h264_globals.h"
#include "modules/video_coding/codecs/interface/common_constants.h"
#include "modules/video_coding/codecs/vp8/include/vp8_globals.h"
#include "modules/video_coding/codecs/vp9/include/vp9_globals.h"
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
#include "modules/video_coding/include/video_codec_interface.h"
#include "test/field_trial.h"
#include "test/gmock.h"
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
#include "test/gtest.h"
using ::testing::ElementsAre;
using ::testing::IsEmpty;
namespace webrtc {
namespace {
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
const uint32_t kSsrc1 = 12345;
const uint32_t kSsrc2 = 23456;
const int16_t kPictureId = 123;
const int16_t kTl0PicIdx = 20;
const uint8_t kTemporalIdx = 1;
const int16_t kInitialPictureId1 = 222;
const int16_t kInitialTl0PicIdx1 = 99;
const int64_t kDontCare = 0;
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
} // namespace
TEST(RtpPayloadParamsTest, InfoMappedToRtpVideoHeader_Vp8) {
RtpPayloadState state2;
state2.picture_id = kPictureId;
state2.tl0_pic_idx = kTl0PicIdx;
std::map<uint32_t, RtpPayloadState> states = {{kSsrc2, state2}};
RtpPayloadParams params(kSsrc2, &state2);
EncodedImage encoded_image;
encoded_image.rotation_ = kVideoRotation_90;
encoded_image.content_type_ = VideoContentType::SCREENSHARE;
encoded_image.SetSpatialIndex(1);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
CodecSpecificInfo codec_info;
codec_info.codecType = kVideoCodecVP8;
codec_info.codecSpecific.VP8.temporalIdx = 0;
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
codec_info.codecSpecific.VP8.keyIdx = kNoKeyIdx;
codec_info.codecSpecific.VP8.layerSync = false;
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
codec_info.codecSpecific.VP8.nonReference = true;
RTPVideoHeader header =
params.GetRtpVideoHeader(encoded_image, &codec_info, kDontCare);
codec_info.codecType = kVideoCodecVP8;
codec_info.codecSpecific.VP8.temporalIdx = 1;
codec_info.codecSpecific.VP8.layerSync = true;
header = params.GetRtpVideoHeader(encoded_image, &codec_info, 1);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
EXPECT_EQ(kVideoRotation_90, header.rotation);
EXPECT_EQ(VideoContentType::SCREENSHARE, header.content_type);
EXPECT_EQ(1, header.simulcastIdx);
EXPECT_EQ(kVideoCodecVP8, header.codec);
Reland "Remove RTPVideoHeader::vp8() accessors." This reverts commit 1811c04f22a26da3ed2832373a5c92a9786420c3. Reason for revert: Downstream projects fixed. Original change's description: > Revert "Remove RTPVideoHeader::vp8() accessors." > > This reverts commit af7afc66427b0e9109e7d492f2805d63d239b914. > > Reason for revert: Break downstream projects. > > Original change's description: > > Remove RTPVideoHeader::vp8() accessors. > > > > Bug: none > > Change-Id: Ia7d65148fb36a8f26647bee8a876ce7217ff8a68 > > Reviewed-on: https://webrtc-review.googlesource.com/93321 > > Reviewed-by: Niels Moller <nisse@webrtc.org> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Commit-Queue: Philip Eliasson <philipel@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#24626} > > TBR=danilchap@webrtc.org,nisse@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org,holmer@google.com > > Change-Id: I3f7f19c0ea810c0fd988c59e6556bbea9b756b33 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: none > Reviewed-on: https://webrtc-review.googlesource.com/98864 > Reviewed-by: Philip Eliasson <philipel@webrtc.org> > Commit-Queue: Philip Eliasson <philipel@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#24628} TBR=danilchap@webrtc.org,nisse@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org,holmer@google.com Change-Id: I9246f36e638108ae4fc46c1ae4559c8205d50fc1 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: none Reviewed-on: https://webrtc-review.googlesource.com/98841 Reviewed-by: Philip Eliasson <philipel@webrtc.org> Commit-Queue: Philip Eliasson <philipel@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24629}
2018-09-07 13:03:55 +00:00
const auto& vp8_header =
absl::get<RTPVideoHeaderVP8>(header.video_type_header);
EXPECT_EQ(kPictureId + 2, vp8_header.pictureId);
EXPECT_EQ(kTemporalIdx, vp8_header.temporalIdx);
EXPECT_EQ(kTl0PicIdx + 1, vp8_header.tl0PicIdx);
EXPECT_EQ(kNoKeyIdx, vp8_header.keyIdx);
EXPECT_TRUE(vp8_header.layerSync);
EXPECT_TRUE(vp8_header.nonReference);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
}
TEST(RtpPayloadParamsTest, InfoMappedToRtpVideoHeader_Vp9) {
RtpPayloadState state;
state.picture_id = kPictureId;
state.tl0_pic_idx = kTl0PicIdx;
RtpPayloadParams params(kSsrc1, &state);
EncodedImage encoded_image;
encoded_image.rotation_ = kVideoRotation_90;
encoded_image.content_type_ = VideoContentType::SCREENSHARE;
encoded_image.SetSpatialIndex(0);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
CodecSpecificInfo codec_info;
codec_info.codecType = kVideoCodecVP9;
codec_info.codecSpecific.VP9.num_spatial_layers = 3;
codec_info.codecSpecific.VP9.first_frame_in_picture = true;
codec_info.codecSpecific.VP9.temporal_idx = 2;
codec_info.codecSpecific.VP9.end_of_picture = false;
RTPVideoHeader header =
params.GetRtpVideoHeader(encoded_image, &codec_info, kDontCare);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
EXPECT_EQ(kVideoRotation_90, header.rotation);
EXPECT_EQ(VideoContentType::SCREENSHARE, header.content_type);
EXPECT_EQ(kVideoCodecVP9, header.codec);
EXPECT_FALSE(header.color_space);
const auto& vp9_header =
absl::get<RTPVideoHeaderVP9>(header.video_type_header);
EXPECT_EQ(kPictureId + 1, vp9_header.picture_id);
EXPECT_EQ(kTl0PicIdx, vp9_header.tl0_pic_idx);
EXPECT_EQ(vp9_header.temporal_idx, codec_info.codecSpecific.VP9.temporal_idx);
EXPECT_EQ(vp9_header.spatial_idx, encoded_image.SpatialIndex());
EXPECT_EQ(vp9_header.num_spatial_layers,
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
codec_info.codecSpecific.VP9.num_spatial_layers);
EXPECT_EQ(vp9_header.end_of_picture,
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
codec_info.codecSpecific.VP9.end_of_picture);
// Next spatial layer.
codec_info.codecSpecific.VP9.first_frame_in_picture = false;
codec_info.codecSpecific.VP9.end_of_picture = true;
encoded_image.SetSpatialIndex(1);
ColorSpace color_space(
ColorSpace::PrimaryID::kSMPTE170M, ColorSpace::TransferID::kSMPTE170M,
ColorSpace::MatrixID::kSMPTE170M, ColorSpace::RangeID::kFull);
encoded_image.SetColorSpace(color_space);
header = params.GetRtpVideoHeader(encoded_image, &codec_info, kDontCare);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
EXPECT_EQ(kVideoRotation_90, header.rotation);
EXPECT_EQ(VideoContentType::SCREENSHARE, header.content_type);
EXPECT_EQ(kVideoCodecVP9, header.codec);
EXPECT_EQ(absl::make_optional(color_space), header.color_space);
EXPECT_EQ(kPictureId + 1, vp9_header.picture_id);
EXPECT_EQ(kTl0PicIdx, vp9_header.tl0_pic_idx);
EXPECT_EQ(vp9_header.temporal_idx, codec_info.codecSpecific.VP9.temporal_idx);
EXPECT_EQ(vp9_header.spatial_idx, encoded_image.SpatialIndex());
EXPECT_EQ(vp9_header.num_spatial_layers,
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
codec_info.codecSpecific.VP9.num_spatial_layers);
EXPECT_EQ(vp9_header.end_of_picture,
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
codec_info.codecSpecific.VP9.end_of_picture);
}
TEST(RtpPayloadParamsTest, InfoMappedToRtpVideoHeader_H264) {
RtpPayloadState state;
state.picture_id = kPictureId;
state.tl0_pic_idx = kInitialTl0PicIdx1;
RtpPayloadParams params(kSsrc1, &state);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
EncodedImage encoded_image;
CodecSpecificInfo codec_info;
CodecSpecificInfoH264* h264info = &codec_info.codecSpecific.H264;
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
codec_info.codecType = kVideoCodecH264;
h264info->packetization_mode = H264PacketizationMode::SingleNalUnit;
h264info->temporal_idx = kNoTemporalIdx;
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
RTPVideoHeader header =
params.GetRtpVideoHeader(encoded_image, &codec_info, kDontCare);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
EXPECT_EQ(0, header.simulcastIdx);
EXPECT_EQ(kVideoCodecH264, header.codec);
const auto& h264 = absl::get<RTPVideoHeaderH264>(header.video_type_header);
EXPECT_EQ(H264PacketizationMode::SingleNalUnit, h264.packetization_mode);
// test temporal param 1
h264info->temporal_idx = 1;
h264info->base_layer_sync = true;
h264info->idr_frame = false;
header = params.GetRtpVideoHeader(encoded_image, &codec_info, kDontCare);
EXPECT_EQ(kVideoCodecH264, header.codec);
EXPECT_EQ(header.frame_marking.tl0_pic_idx, kInitialTl0PicIdx1);
EXPECT_EQ(header.frame_marking.temporal_id, h264info->temporal_idx);
EXPECT_EQ(header.frame_marking.base_layer_sync, h264info->base_layer_sync);
EXPECT_EQ(header.frame_marking.independent_frame, h264info->idr_frame);
// test temporal param 2
h264info->temporal_idx = 0;
h264info->base_layer_sync = false;
h264info->idr_frame = true;
header = params.GetRtpVideoHeader(encoded_image, &codec_info, kDontCare);
EXPECT_EQ(kVideoCodecH264, header.codec);
EXPECT_EQ(header.frame_marking.tl0_pic_idx, kInitialTl0PicIdx1 + 1);
EXPECT_EQ(header.frame_marking.temporal_id, h264info->temporal_idx);
EXPECT_EQ(header.frame_marking.base_layer_sync, h264info->base_layer_sync);
EXPECT_EQ(header.frame_marking.independent_frame, h264info->idr_frame);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
}
TEST(RtpPayloadParamsTest, PictureIdIsSetForVp8) {
RtpPayloadState state;
state.picture_id = kInitialPictureId1;
state.tl0_pic_idx = kInitialTl0PicIdx1;
EncodedImage encoded_image;
CodecSpecificInfo codec_info;
codec_info.codecType = kVideoCodecVP8;
RtpPayloadParams params(kSsrc1, &state);
RTPVideoHeader header =
params.GetRtpVideoHeader(encoded_image, &codec_info, kDontCare);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
EXPECT_EQ(kVideoCodecVP8, header.codec);
Reland "Remove RTPVideoHeader::vp8() accessors." This reverts commit 1811c04f22a26da3ed2832373a5c92a9786420c3. Reason for revert: Downstream projects fixed. Original change's description: > Revert "Remove RTPVideoHeader::vp8() accessors." > > This reverts commit af7afc66427b0e9109e7d492f2805d63d239b914. > > Reason for revert: Break downstream projects. > > Original change's description: > > Remove RTPVideoHeader::vp8() accessors. > > > > Bug: none > > Change-Id: Ia7d65148fb36a8f26647bee8a876ce7217ff8a68 > > Reviewed-on: https://webrtc-review.googlesource.com/93321 > > Reviewed-by: Niels Moller <nisse@webrtc.org> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Commit-Queue: Philip Eliasson <philipel@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#24626} > > TBR=danilchap@webrtc.org,nisse@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org,holmer@google.com > > Change-Id: I3f7f19c0ea810c0fd988c59e6556bbea9b756b33 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: none > Reviewed-on: https://webrtc-review.googlesource.com/98864 > Reviewed-by: Philip Eliasson <philipel@webrtc.org> > Commit-Queue: Philip Eliasson <philipel@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#24628} TBR=danilchap@webrtc.org,nisse@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org,holmer@google.com Change-Id: I9246f36e638108ae4fc46c1ae4559c8205d50fc1 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: none Reviewed-on: https://webrtc-review.googlesource.com/98841 Reviewed-by: Philip Eliasson <philipel@webrtc.org> Commit-Queue: Philip Eliasson <philipel@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24629}
2018-09-07 13:03:55 +00:00
EXPECT_EQ(kInitialPictureId1 + 1,
absl::get<RTPVideoHeaderVP8>(header.video_type_header).pictureId);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
// State should hold latest used picture id and tl0_pic_idx.
state = params.state();
EXPECT_EQ(kInitialPictureId1 + 1, state.picture_id);
EXPECT_EQ(kInitialTl0PicIdx1 + 1, state.tl0_pic_idx);
}
TEST(RtpPayloadParamsTest, PictureIdWraps) {
RtpPayloadState state;
state.picture_id = kMaxTwoBytePictureId;
state.tl0_pic_idx = kInitialTl0PicIdx1;
EncodedImage encoded_image;
CodecSpecificInfo codec_info;
codec_info.codecType = kVideoCodecVP8;
codec_info.codecSpecific.VP8.temporalIdx = kNoTemporalIdx;
RtpPayloadParams params(kSsrc1, &state);
RTPVideoHeader header =
params.GetRtpVideoHeader(encoded_image, &codec_info, kDontCare);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
EXPECT_EQ(kVideoCodecVP8, header.codec);
Reland "Remove RTPVideoHeader::vp8() accessors." This reverts commit 1811c04f22a26da3ed2832373a5c92a9786420c3. Reason for revert: Downstream projects fixed. Original change's description: > Revert "Remove RTPVideoHeader::vp8() accessors." > > This reverts commit af7afc66427b0e9109e7d492f2805d63d239b914. > > Reason for revert: Break downstream projects. > > Original change's description: > > Remove RTPVideoHeader::vp8() accessors. > > > > Bug: none > > Change-Id: Ia7d65148fb36a8f26647bee8a876ce7217ff8a68 > > Reviewed-on: https://webrtc-review.googlesource.com/93321 > > Reviewed-by: Niels Moller <nisse@webrtc.org> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Commit-Queue: Philip Eliasson <philipel@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#24626} > > TBR=danilchap@webrtc.org,nisse@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org,holmer@google.com > > Change-Id: I3f7f19c0ea810c0fd988c59e6556bbea9b756b33 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: none > Reviewed-on: https://webrtc-review.googlesource.com/98864 > Reviewed-by: Philip Eliasson <philipel@webrtc.org> > Commit-Queue: Philip Eliasson <philipel@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#24628} TBR=danilchap@webrtc.org,nisse@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org,holmer@google.com Change-Id: I9246f36e638108ae4fc46c1ae4559c8205d50fc1 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: none Reviewed-on: https://webrtc-review.googlesource.com/98841 Reviewed-by: Philip Eliasson <philipel@webrtc.org> Commit-Queue: Philip Eliasson <philipel@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24629}
2018-09-07 13:03:55 +00:00
EXPECT_EQ(0,
absl::get<RTPVideoHeaderVP8>(header.video_type_header).pictureId);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
// State should hold latest used picture id and tl0_pic_idx.
EXPECT_EQ(0, params.state().picture_id); // Wrapped.
EXPECT_EQ(kInitialTl0PicIdx1, params.state().tl0_pic_idx);
}
TEST(RtpPayloadParamsTest, Tl0PicIdxUpdatedForVp8) {
RtpPayloadState state;
state.picture_id = kInitialPictureId1;
state.tl0_pic_idx = kInitialTl0PicIdx1;
EncodedImage encoded_image;
// Modules are sending for this test.
// OnEncodedImage, temporalIdx: 1.
CodecSpecificInfo codec_info;
codec_info.codecType = kVideoCodecVP8;
codec_info.codecSpecific.VP8.temporalIdx = 1;
RtpPayloadParams params(kSsrc1, &state);
RTPVideoHeader header =
params.GetRtpVideoHeader(encoded_image, &codec_info, kDontCare);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
EXPECT_EQ(kVideoCodecVP8, header.codec);
Reland "Remove RTPVideoHeader::vp8() accessors." This reverts commit 1811c04f22a26da3ed2832373a5c92a9786420c3. Reason for revert: Downstream projects fixed. Original change's description: > Revert "Remove RTPVideoHeader::vp8() accessors." > > This reverts commit af7afc66427b0e9109e7d492f2805d63d239b914. > > Reason for revert: Break downstream projects. > > Original change's description: > > Remove RTPVideoHeader::vp8() accessors. > > > > Bug: none > > Change-Id: Ia7d65148fb36a8f26647bee8a876ce7217ff8a68 > > Reviewed-on: https://webrtc-review.googlesource.com/93321 > > Reviewed-by: Niels Moller <nisse@webrtc.org> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Commit-Queue: Philip Eliasson <philipel@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#24626} > > TBR=danilchap@webrtc.org,nisse@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org,holmer@google.com > > Change-Id: I3f7f19c0ea810c0fd988c59e6556bbea9b756b33 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: none > Reviewed-on: https://webrtc-review.googlesource.com/98864 > Reviewed-by: Philip Eliasson <philipel@webrtc.org> > Commit-Queue: Philip Eliasson <philipel@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#24628} TBR=danilchap@webrtc.org,nisse@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org,holmer@google.com Change-Id: I9246f36e638108ae4fc46c1ae4559c8205d50fc1 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: none Reviewed-on: https://webrtc-review.googlesource.com/98841 Reviewed-by: Philip Eliasson <philipel@webrtc.org> Commit-Queue: Philip Eliasson <philipel@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24629}
2018-09-07 13:03:55 +00:00
const auto& vp8_header =
absl::get<RTPVideoHeaderVP8>(header.video_type_header);
EXPECT_EQ(kInitialPictureId1 + 1, vp8_header.pictureId);
EXPECT_EQ(kInitialTl0PicIdx1, vp8_header.tl0PicIdx);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
// OnEncodedImage, temporalIdx: 0.
codec_info.codecSpecific.VP8.temporalIdx = 0;
header = params.GetRtpVideoHeader(encoded_image, &codec_info, kDontCare);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
EXPECT_EQ(kVideoCodecVP8, header.codec);
Reland "Remove RTPVideoHeader::vp8() accessors." This reverts commit 1811c04f22a26da3ed2832373a5c92a9786420c3. Reason for revert: Downstream projects fixed. Original change's description: > Revert "Remove RTPVideoHeader::vp8() accessors." > > This reverts commit af7afc66427b0e9109e7d492f2805d63d239b914. > > Reason for revert: Break downstream projects. > > Original change's description: > > Remove RTPVideoHeader::vp8() accessors. > > > > Bug: none > > Change-Id: Ia7d65148fb36a8f26647bee8a876ce7217ff8a68 > > Reviewed-on: https://webrtc-review.googlesource.com/93321 > > Reviewed-by: Niels Moller <nisse@webrtc.org> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Commit-Queue: Philip Eliasson <philipel@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#24626} > > TBR=danilchap@webrtc.org,nisse@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org,holmer@google.com > > Change-Id: I3f7f19c0ea810c0fd988c59e6556bbea9b756b33 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: none > Reviewed-on: https://webrtc-review.googlesource.com/98864 > Reviewed-by: Philip Eliasson <philipel@webrtc.org> > Commit-Queue: Philip Eliasson <philipel@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#24628} TBR=danilchap@webrtc.org,nisse@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org,holmer@google.com Change-Id: I9246f36e638108ae4fc46c1ae4559c8205d50fc1 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: none Reviewed-on: https://webrtc-review.googlesource.com/98841 Reviewed-by: Philip Eliasson <philipel@webrtc.org> Commit-Queue: Philip Eliasson <philipel@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24629}
2018-09-07 13:03:55 +00:00
EXPECT_EQ(kInitialPictureId1 + 2, vp8_header.pictureId);
EXPECT_EQ(kInitialTl0PicIdx1 + 1, vp8_header.tl0PicIdx);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
// State should hold latest used picture id and tl0_pic_idx.
EXPECT_EQ(kInitialPictureId1 + 2, params.state().picture_id);
EXPECT_EQ(kInitialTl0PicIdx1 + 1, params.state().tl0_pic_idx);
}
TEST(RtpPayloadParamsTest, Tl0PicIdxUpdatedForVp9) {
RtpPayloadState state;
state.picture_id = kInitialPictureId1;
state.tl0_pic_idx = kInitialTl0PicIdx1;
EncodedImage encoded_image;
// Modules are sending for this test.
// OnEncodedImage, temporalIdx: 1.
CodecSpecificInfo codec_info;
codec_info.codecType = kVideoCodecVP9;
codec_info.codecSpecific.VP9.temporal_idx = 1;
codec_info.codecSpecific.VP9.first_frame_in_picture = true;
RtpPayloadParams params(kSsrc1, &state);
RTPVideoHeader header =
params.GetRtpVideoHeader(encoded_image, &codec_info, kDontCare);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
EXPECT_EQ(kVideoCodecVP9, header.codec);
const auto& vp9_header =
absl::get<RTPVideoHeaderVP9>(header.video_type_header);
EXPECT_EQ(kInitialPictureId1 + 1, vp9_header.picture_id);
EXPECT_EQ(kInitialTl0PicIdx1, vp9_header.tl0_pic_idx);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
// OnEncodedImage, temporalIdx: 0.
codec_info.codecSpecific.VP9.temporal_idx = 0;
header = params.GetRtpVideoHeader(encoded_image, &codec_info, kDontCare);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
EXPECT_EQ(kVideoCodecVP9, header.codec);
EXPECT_EQ(kInitialPictureId1 + 2, vp9_header.picture_id);
EXPECT_EQ(kInitialTl0PicIdx1 + 1, vp9_header.tl0_pic_idx);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
// OnEncodedImage, first_frame_in_picture = false
codec_info.codecSpecific.VP9.first_frame_in_picture = false;
header = params.GetRtpVideoHeader(encoded_image, &codec_info, kDontCare);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
EXPECT_EQ(kVideoCodecVP9, header.codec);
EXPECT_EQ(kInitialPictureId1 + 2, vp9_header.picture_id);
EXPECT_EQ(kInitialTl0PicIdx1 + 1, vp9_header.tl0_pic_idx);
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
// State should hold latest used picture id and tl0_pic_idx.
EXPECT_EQ(kInitialPictureId1 + 2, params.state().picture_id);
EXPECT_EQ(kInitialTl0PicIdx1 + 1, params.state().tl0_pic_idx);
}
TEST(RtpPayloadParamsTest, PictureIdForOldGenericFormat) {
test::ScopedFieldTrials generic_picture_id(
"WebRTC-GenericPictureId/Enabled/");
RtpPayloadState state{};
EncodedImage encoded_image;
CodecSpecificInfo codec_info;
codec_info.codecType = kVideoCodecGeneric;
RtpPayloadParams params(kSsrc1, &state);
RTPVideoHeader header =
params.GetRtpVideoHeader(encoded_image, &codec_info, kDontCare);
EXPECT_EQ(kVideoCodecGeneric, header.codec);
ASSERT_TRUE(header.generic);
EXPECT_EQ(0, header.generic->frame_id);
header = params.GetRtpVideoHeader(encoded_image, &codec_info, kDontCare);
ASSERT_TRUE(header.generic);
EXPECT_EQ(1, header.generic->frame_id);
}
TEST(RtpPayloadParamsTest, GenericDescriptorForGenericCodec) {
test::ScopedFieldTrials generic_picture_id(
"WebRTC-GenericDescriptor/Enabled/");
RtpPayloadState state{};
EncodedImage encoded_image;
encoded_image._frameType = VideoFrameType::kVideoFrameKey;
CodecSpecificInfo codec_info;
codec_info.codecType = kVideoCodecGeneric;
RtpPayloadParams params(kSsrc1, &state);
RTPVideoHeader header =
params.GetRtpVideoHeader(encoded_image, &codec_info, 0);
EXPECT_EQ(kVideoCodecGeneric, header.codec);
ASSERT_TRUE(header.generic);
EXPECT_EQ(0, header.generic->frame_id);
EXPECT_THAT(header.generic->dependencies, IsEmpty());
encoded_image._frameType = VideoFrameType::kVideoFrameDelta;
header = params.GetRtpVideoHeader(encoded_image, &codec_info, 1);
ASSERT_TRUE(header.generic);
EXPECT_EQ(1, header.generic->frame_id);
EXPECT_THAT(header.generic->dependencies, ElementsAre(0));
}
class RtpPayloadParamsVp8ToGenericTest : public ::testing::Test {
public:
enum LayerSync { kNoSync, kSync };
Reland "Added field trial WebRTC-GenericDescriptor for the new generic descriptor." This reverts commit 6f68324adbf52b247e10b33a4e83a586e66cc6df. Reason for revert: Removed full stack tests that cause timeout. Original change's description: > Revert "Added field trial WebRTC-GenericDescriptor for the new generic descriptor." > > This reverts commit 3f4a4fad8cd661309ff5d9a631e89518f32e7c5e. > > Reason for revert: Breaking internal tests > > Original change's description: > > Added field trial WebRTC-GenericDescriptor for the new generic descriptor. > > > > Also parameterized tests to test the new generic descriptor and > > added --generic_descriptor flag to loopback tests. > > > > Bug: webrtc:9361 > > Change-Id: I2b76889606fe2e81249ecdebb0b7b61151682485 > > Reviewed-on: https://webrtc-review.googlesource.com/101900 > > Commit-Queue: Philip Eliasson <philipel@webrtc.org> > > Reviewed-by: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#24835} > > TBR=danilchap@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org > > Change-Id: I4d4714a9f4ab0e95adf0f4130bc1a932efc448fa > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9361 > Reviewed-on: https://webrtc-review.googlesource.com/101940 > Reviewed-by: Lu Liu <lliuu@webrtc.org> > Commit-Queue: Lu Liu <lliuu@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#24839} TBR=danilchap@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org,lliuu@webrtc.org Change-Id: Ibcf0a1d3aa947b84e3b891b1975d0fc2c730f2ae No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9361 Reviewed-on: https://webrtc-review.googlesource.com/102064 Commit-Queue: Philip Eliasson <philipel@webrtc.org> Reviewed-by: Philip Eliasson <philipel@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24845}
2018-09-26 12:25:31 +02:00
RtpPayloadParamsVp8ToGenericTest()
: generic_descriptor_field_trial_("WebRTC-GenericDescriptor/Enabled/"),
state_(),
params_(123, &state_) {}
void ConvertAndCheck(int temporal_index,
int64_t shared_frame_id,
VideoFrameType frame_type,
LayerSync layer_sync,
const std::set<int64_t>& expected_deps,
uint16_t width = 0,
uint16_t height = 0) {
EncodedImage encoded_image;
encoded_image._frameType = frame_type;
encoded_image._encodedWidth = width;
encoded_image._encodedHeight = height;
CodecSpecificInfo codec_info;
codec_info.codecType = kVideoCodecVP8;
codec_info.codecSpecific.VP8.temporalIdx = temporal_index;
codec_info.codecSpecific.VP8.layerSync = layer_sync == kSync;
RTPVideoHeader header =
params_.GetRtpVideoHeader(encoded_image, &codec_info, shared_frame_id);
ASSERT_TRUE(header.generic);
EXPECT_EQ(header.generic->spatial_index, 0);
EXPECT_EQ(header.generic->frame_id, shared_frame_id);
EXPECT_EQ(header.generic->temporal_index, temporal_index);
std::set<int64_t> actual_deps(header.generic->dependencies.begin(),
header.generic->dependencies.end());
EXPECT_EQ(expected_deps, actual_deps);
EXPECT_EQ(header.width, width);
EXPECT_EQ(header.height, height);
}
protected:
Reland "Added field trial WebRTC-GenericDescriptor for the new generic descriptor." This reverts commit 6f68324adbf52b247e10b33a4e83a586e66cc6df. Reason for revert: Removed full stack tests that cause timeout. Original change's description: > Revert "Added field trial WebRTC-GenericDescriptor for the new generic descriptor." > > This reverts commit 3f4a4fad8cd661309ff5d9a631e89518f32e7c5e. > > Reason for revert: Breaking internal tests > > Original change's description: > > Added field trial WebRTC-GenericDescriptor for the new generic descriptor. > > > > Also parameterized tests to test the new generic descriptor and > > added --generic_descriptor flag to loopback tests. > > > > Bug: webrtc:9361 > > Change-Id: I2b76889606fe2e81249ecdebb0b7b61151682485 > > Reviewed-on: https://webrtc-review.googlesource.com/101900 > > Commit-Queue: Philip Eliasson <philipel@webrtc.org> > > Reviewed-by: Erik Språng <sprang@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Reviewed-by: Stefan Holmer <stefan@webrtc.org> > > Cr-Commit-Position: refs/heads/master@{#24835} > > TBR=danilchap@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org > > Change-Id: I4d4714a9f4ab0e95adf0f4130bc1a932efc448fa > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9361 > Reviewed-on: https://webrtc-review.googlesource.com/101940 > Reviewed-by: Lu Liu <lliuu@webrtc.org> > Commit-Queue: Lu Liu <lliuu@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#24839} TBR=danilchap@webrtc.org,sprang@webrtc.org,stefan@webrtc.org,philipel@webrtc.org,lliuu@webrtc.org Change-Id: Ibcf0a1d3aa947b84e3b891b1975d0fc2c730f2ae No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9361 Reviewed-on: https://webrtc-review.googlesource.com/102064 Commit-Queue: Philip Eliasson <philipel@webrtc.org> Reviewed-by: Philip Eliasson <philipel@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24845}
2018-09-26 12:25:31 +02:00
test::ScopedFieldTrials generic_descriptor_field_trial_;
RtpPayloadState state_;
RtpPayloadParams params_;
};
TEST_F(RtpPayloadParamsVp8ToGenericTest, Keyframe) {
ConvertAndCheck(0, 0, VideoFrameType::kVideoFrameKey, kNoSync, {}, 480, 360);
ConvertAndCheck(0, 1, VideoFrameType::kVideoFrameDelta, kNoSync, {0});
ConvertAndCheck(0, 2, VideoFrameType::kVideoFrameKey, kNoSync, {}, 480, 360);
}
TEST_F(RtpPayloadParamsVp8ToGenericTest, TooHighTemporalIndex) {
ConvertAndCheck(0, 0, VideoFrameType::kVideoFrameKey, kNoSync, {}, 480, 360);
EncodedImage encoded_image;
encoded_image._frameType = VideoFrameType::kVideoFrameDelta;
CodecSpecificInfo codec_info;
codec_info.codecType = kVideoCodecVP8;
codec_info.codecSpecific.VP8.temporalIdx =
RtpGenericFrameDescriptor::kMaxTemporalLayers;
codec_info.codecSpecific.VP8.layerSync = false;
RTPVideoHeader header =
params_.GetRtpVideoHeader(encoded_image, &codec_info, 1);
EXPECT_FALSE(header.generic);
}
TEST_F(RtpPayloadParamsVp8ToGenericTest, LayerSync) {
// 02120212 pattern
ConvertAndCheck(0, 0, VideoFrameType::kVideoFrameKey, kNoSync, {}, 480, 360);
ConvertAndCheck(2, 1, VideoFrameType::kVideoFrameDelta, kNoSync, {0});
ConvertAndCheck(1, 2, VideoFrameType::kVideoFrameDelta, kNoSync, {0});
ConvertAndCheck(2, 3, VideoFrameType::kVideoFrameDelta, kNoSync, {0, 1, 2});
ConvertAndCheck(0, 4, VideoFrameType::kVideoFrameDelta, kNoSync, {0});
ConvertAndCheck(2, 5, VideoFrameType::kVideoFrameDelta, kNoSync, {2, 3, 4});
ConvertAndCheck(1, 6, VideoFrameType::kVideoFrameDelta, kSync,
{4}); // layer sync
ConvertAndCheck(2, 7, VideoFrameType::kVideoFrameDelta, kNoSync, {4, 5, 6});
}
TEST_F(RtpPayloadParamsVp8ToGenericTest, FrameIdGaps) {
// 0101 pattern
ConvertAndCheck(0, 0, VideoFrameType::kVideoFrameKey, kNoSync, {}, 480, 360);
ConvertAndCheck(1, 1, VideoFrameType::kVideoFrameDelta, kNoSync, {0});
ConvertAndCheck(0, 5, VideoFrameType::kVideoFrameDelta, kNoSync, {0});
ConvertAndCheck(1, 10, VideoFrameType::kVideoFrameDelta, kNoSync, {1, 5});
ConvertAndCheck(0, 15, VideoFrameType::kVideoFrameDelta, kNoSync, {5});
ConvertAndCheck(1, 20, VideoFrameType::kVideoFrameDelta, kNoSync, {10, 15});
}
class RtpPayloadParamsH264ToGenericTest : public ::testing::Test {
public:
enum LayerSync { kNoSync, kSync };
RtpPayloadParamsH264ToGenericTest()
: generic_descriptor_field_trial_("WebRTC-GenericDescriptor/Enabled/"),
state_(),
params_(123, &state_) {}
void ConvertAndCheck(int temporal_index,
int64_t shared_frame_id,
VideoFrameType frame_type,
LayerSync layer_sync,
const std::set<int64_t>& expected_deps,
uint16_t width = 0,
uint16_t height = 0) {
EncodedImage encoded_image;
encoded_image._frameType = frame_type;
encoded_image._encodedWidth = width;
encoded_image._encodedHeight = height;
CodecSpecificInfo codec_info;
codec_info.codecType = kVideoCodecH264;
codec_info.codecSpecific.H264.temporal_idx = temporal_index;
codec_info.codecSpecific.H264.base_layer_sync = layer_sync == kSync;
RTPVideoHeader header =
params_.GetRtpVideoHeader(encoded_image, &codec_info, shared_frame_id);
ASSERT_TRUE(header.generic);
EXPECT_EQ(header.generic->spatial_index, 0);
EXPECT_EQ(header.generic->frame_id, shared_frame_id);
EXPECT_EQ(header.generic->temporal_index, temporal_index);
std::set<int64_t> actual_deps(header.generic->dependencies.begin(),
header.generic->dependencies.end());
EXPECT_EQ(expected_deps, actual_deps);
EXPECT_EQ(header.width, width);
EXPECT_EQ(header.height, height);
}
protected:
test::ScopedFieldTrials generic_descriptor_field_trial_;
RtpPayloadState state_;
RtpPayloadParams params_;
};
TEST_F(RtpPayloadParamsH264ToGenericTest, Keyframe) {
ConvertAndCheck(0, 0, VideoFrameType::kVideoFrameKey, kNoSync, {}, 480, 360);
ConvertAndCheck(0, 1, VideoFrameType::kVideoFrameDelta, kNoSync, {0});
ConvertAndCheck(0, 2, VideoFrameType::kVideoFrameKey, kNoSync, {}, 480, 360);
}
TEST_F(RtpPayloadParamsH264ToGenericTest, TooHighTemporalIndex) {
ConvertAndCheck(0, 0, VideoFrameType::kVideoFrameKey, kNoSync, {}, 480, 360);
EncodedImage encoded_image;
encoded_image._frameType = VideoFrameType::kVideoFrameDelta;
CodecSpecificInfo codec_info;
codec_info.codecType = kVideoCodecH264;
codec_info.codecSpecific.H264.temporal_idx =
RtpGenericFrameDescriptor::kMaxTemporalLayers;
codec_info.codecSpecific.H264.base_layer_sync = false;
RTPVideoHeader header =
params_.GetRtpVideoHeader(encoded_image, &codec_info, 1);
EXPECT_FALSE(header.generic);
}
TEST_F(RtpPayloadParamsH264ToGenericTest, LayerSync) {
// 02120212 pattern
ConvertAndCheck(0, 0, VideoFrameType::kVideoFrameKey, kNoSync, {}, 480, 360);
ConvertAndCheck(2, 1, VideoFrameType::kVideoFrameDelta, kNoSync, {0});
ConvertAndCheck(1, 2, VideoFrameType::kVideoFrameDelta, kNoSync, {0});
ConvertAndCheck(2, 3, VideoFrameType::kVideoFrameDelta, kNoSync, {0, 1, 2});
ConvertAndCheck(0, 4, VideoFrameType::kVideoFrameDelta, kNoSync, {0});
ConvertAndCheck(2, 5, VideoFrameType::kVideoFrameDelta, kNoSync, {2, 3, 4});
ConvertAndCheck(1, 6, VideoFrameType::kVideoFrameDelta, kSync,
{4}); // layer sync
ConvertAndCheck(2, 7, VideoFrameType::kVideoFrameDelta, kNoSync, {4, 5, 6});
}
TEST_F(RtpPayloadParamsH264ToGenericTest, FrameIdGaps) {
// 0101 pattern
ConvertAndCheck(0, 0, VideoFrameType::kVideoFrameKey, kNoSync, {}, 480, 360);
ConvertAndCheck(1, 1, VideoFrameType::kVideoFrameDelta, kNoSync, {0});
ConvertAndCheck(0, 5, VideoFrameType::kVideoFrameDelta, kNoSync, {0});
ConvertAndCheck(1, 10, VideoFrameType::kVideoFrameDelta, kNoSync, {1, 5});
ConvertAndCheck(0, 15, VideoFrameType::kVideoFrameDelta, kNoSync, {5});
ConvertAndCheck(1, 20, VideoFrameType::kVideoFrameDelta, kNoSync, {10, 15});
}
Reland "Move allocation and rtp conversion logic out of payload router." This reverts commit c2406e4eaf7703c6c64d21318186adda791e09fd. Reason for revert: Reland by removing the conflict with the broken CL. Original change's description: > Revert "Move allocation and rtp conversion logic out of payload router." > > This reverts commit 1da4d79ba3275b3fa48cad3b2c0949e0d3b7afe7. > > Reason for revert: Need to revert https://webrtc-review.googlesource.com/c/src/+/88220 > > This causes a merge conflict. So need to revert this first. > > Original change's description: > > 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} > > TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org > > Change-Id: I342c4bf483d975c87c706fe7f76f44e2dc60fe4c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:9517 > Reviewed-on: https://webrtc-review.googlesource.com/88821 > Reviewed-by: JT Teh <jtteh@webrtc.org> > Commit-Queue: JT Teh <jtteh@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#23991} TBR=sprang@webrtc.org,stefan@webrtc.org,srte@webrtc.org,lliuu@webrtc.org,jtteh@webrtc.org,tkchin@webrtc.org Change-Id: I154145cdbc668feee86dbe78860147a6954fee6c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: webrtc:9517 Reviewed-on: https://webrtc-review.googlesource.com/89020 Commit-Queue: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Stefan Holmer <stefan@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23996}
2018-07-17 10:16:41 +02:00
} // namespace webrtc