2011-07-07 08:21:25 +00:00
|
|
|
/*
|
2012-04-23 14:52:15 +00:00
|
|
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
2011-07-07 08:21:25 +00:00
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/video_coding/encoded_frame.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2018-11-28 16:47:49 +01:00
|
|
|
#include <string.h>
|
|
|
|
|
|
|
|
|
|
#include "absl/types/variant.h"
|
|
|
|
|
#include "api/video/video_timing.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"
|
|
|
|
|
|
2011-07-07 08:21:25 +00:00
|
|
|
namespace webrtc {
|
|
|
|
|
|
|
|
|
|
VCMEncodedFrame::VCMEncodedFrame()
|
2015-03-17 21:54:50 +00:00
|
|
|
: webrtc::EncodedImage(),
|
|
|
|
|
_renderTimeMs(-1),
|
|
|
|
|
_payloadType(0),
|
|
|
|
|
_missingFrame(false),
|
2019-09-26 10:59:41 +02:00
|
|
|
_codec(kVideoCodecGeneric) {
|
2018-08-16 14:35:26 +02:00
|
|
|
_codecSpecificInfo.codecType = kVideoCodecGeneric;
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2019-06-20 11:13:03 +02:00
|
|
|
VCMEncodedFrame::VCMEncodedFrame(const VCMEncodedFrame&) = default;
|
|
|
|
|
|
2015-12-21 04:12:39 -08:00
|
|
|
VCMEncodedFrame::~VCMEncodedFrame() {
|
|
|
|
|
Reset();
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2015-12-21 04:12:39 -08:00
|
|
|
void VCMEncodedFrame::Reset() {
|
2018-08-16 10:24:12 +02:00
|
|
|
SetTimestamp(0);
|
2018-12-20 14:32:14 +01:00
|
|
|
SetSpatialIndex(absl::nullopt);
|
2015-12-21 04:12:39 -08:00
|
|
|
_renderTimeMs = -1;
|
|
|
|
|
_payloadType = 0;
|
2019-03-21 15:43:58 +01:00
|
|
|
_frameType = VideoFrameType::kVideoFrameDelta;
|
2015-12-21 04:12:39 -08:00
|
|
|
_encodedWidth = 0;
|
|
|
|
|
_encodedHeight = 0;
|
|
|
|
|
_missingFrame = false;
|
2019-01-15 08:50:01 +01:00
|
|
|
set_size(0);
|
2018-08-16 14:35:26 +02:00
|
|
|
_codecSpecificInfo.codecType = kVideoCodecGeneric;
|
|
|
|
|
_codec = kVideoCodecGeneric;
|
2016-07-04 01:45:23 -07:00
|
|
|
rotation_ = kVideoRotation_0;
|
2017-04-11 10:34:31 -07:00
|
|
|
content_type_ = VideoContentType::UNSPECIFIED;
|
2018-06-05 15:21:32 +02:00
|
|
|
timing_.flags = VideoSendTiming::kInvalid;
|
2011-07-07 08:21:25 +00:00
|
|
|
}
|
|
|
|
|
|
2015-12-21 04:12:39 -08:00
|
|
|
void VCMEncodedFrame::CopyCodecSpecific(const RTPVideoHeader* header) {
|
2014-07-31 14:59:24 +00:00
|
|
|
if (header) {
|
|
|
|
|
switch (header->codec) {
|
2018-06-04 11:14:38 +02:00
|
|
|
case kVideoCodecVP8: {
|
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);
|
2014-07-31 14:59:24 +00:00
|
|
|
if (_codecSpecificInfo.codecType != kVideoCodecVP8) {
|
|
|
|
|
// This is the first packet for this frame.
|
|
|
|
|
_codecSpecificInfo.codecSpecific.VP8.temporalIdx = 0;
|
|
|
|
|
_codecSpecificInfo.codecSpecific.VP8.layerSync = false;
|
|
|
|
|
_codecSpecificInfo.codecSpecific.VP8.keyIdx = -1;
|
|
|
|
|
_codecSpecificInfo.codecType = kVideoCodecVP8;
|
|
|
|
|
}
|
|
|
|
|
_codecSpecificInfo.codecSpecific.VP8.nonReference =
|
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
|
|
|
vp8_header.nonReference;
|
|
|
|
|
if (vp8_header.temporalIdx != kNoTemporalIdx) {
|
2014-07-31 14:59:24 +00:00
|
|
|
_codecSpecificInfo.codecSpecific.VP8.temporalIdx =
|
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
|
|
|
vp8_header.temporalIdx;
|
|
|
|
|
_codecSpecificInfo.codecSpecific.VP8.layerSync = vp8_header.layerSync;
|
2014-07-31 14:59:24 +00:00
|
|
|
}
|
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
|
|
|
if (vp8_header.keyIdx != kNoKeyIdx) {
|
|
|
|
|
_codecSpecificInfo.codecSpecific.VP8.keyIdx = vp8_header.keyIdx;
|
2014-07-31 14:59:24 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
2018-06-04 11:14:38 +02:00
|
|
|
case kVideoCodecVP9: {
|
2018-08-08 14:26:00 +02:00
|
|
|
const auto& vp9_header =
|
|
|
|
|
absl::get<RTPVideoHeaderVP9>(header->video_type_header);
|
2015-07-31 06:10:09 -07:00
|
|
|
if (_codecSpecificInfo.codecType != kVideoCodecVP9) {
|
|
|
|
|
// This is the first packet for this frame.
|
|
|
|
|
_codecSpecificInfo.codecSpecific.VP9.temporal_idx = 0;
|
|
|
|
|
_codecSpecificInfo.codecSpecific.VP9.gof_idx = 0;
|
|
|
|
|
_codecSpecificInfo.codecSpecific.VP9.inter_layer_predicted = false;
|
|
|
|
|
_codecSpecificInfo.codecType = kVideoCodecVP9;
|
|
|
|
|
}
|
|
|
|
|
_codecSpecificInfo.codecSpecific.VP9.inter_pic_predicted =
|
2018-08-08 14:26:00 +02:00
|
|
|
vp9_header.inter_pic_predicted;
|
2015-07-31 06:10:09 -07:00
|
|
|
_codecSpecificInfo.codecSpecific.VP9.flexible_mode =
|
2018-08-08 14:26:00 +02:00
|
|
|
vp9_header.flexible_mode;
|
Reland of Work on flexible mode and screen sharing. (patchset #1 id:1 of https://codereview.webrtc.org/1438543002/ )
Reason for revert:
Failed test not related to this CL (test fails on
master at an earlier date), re-landing original CL..
(This time from my @webrtc account.)
Original issue's description:
> Revert of Work on flexible mode and screen sharing. (patchset #28 id:520001 of https://codereview.webrtc.org/1328113004/ )
>
> Reason for revert:
> Seems to break VideoSendStreamTest.ReconfigureBitratesSetsEncoderBitratesCorrectly on Linux Memcheck buildbot.
>
> Original issue's description:
> > Work on flexible mode and screen sharing.
> >
> > Implement VP8 style screensharing but with spatial layers.
> > Implement flexible mode.
> >
> > Files from other patches:
> > generic_encoder.cc
> > layer_filtering_transport.cc
> >
> > BUG=webrtc:4914
> >
> > Committed: https://crrev.com/77ccfb4d16c148e61a316746bb5d9705e8b39f4a
> > Cr-Commit-Position: refs/heads/master@{#10572}
>
> TBR=sprang@webrtc.org,stefan@webrtc.org,philipel@google.com,asapersson@webrtc.org,mflodman@webrtc.org,philipel@webrtc.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4914
>
> Committed: https://crrev.com/0be8f1d347bdb171462df89c2a4c69b3f3eb7519
> Cr-Commit-Position: refs/heads/master@{#10578}
TBR=sprang@webrtc.org,stefan@webrtc.org,philipel@google.com,asapersson@webrtc.org,mflodman@webrtc.org,terelius@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:4914
Review URL: https://codereview.webrtc.org/1431283002
Cr-Commit-Position: refs/heads/master@{#10581}
2015-11-10 07:17:23 -08:00
|
|
|
_codecSpecificInfo.codecSpecific.VP9.num_ref_pics =
|
2018-08-08 14:26:00 +02:00
|
|
|
vp9_header.num_ref_pics;
|
|
|
|
|
for (uint8_t r = 0; r < vp9_header.num_ref_pics; ++r) {
|
Reland of Work on flexible mode and screen sharing. (patchset #1 id:1 of https://codereview.webrtc.org/1438543002/ )
Reason for revert:
Failed test not related to this CL (test fails on
master at an earlier date), re-landing original CL..
(This time from my @webrtc account.)
Original issue's description:
> Revert of Work on flexible mode and screen sharing. (patchset #28 id:520001 of https://codereview.webrtc.org/1328113004/ )
>
> Reason for revert:
> Seems to break VideoSendStreamTest.ReconfigureBitratesSetsEncoderBitratesCorrectly on Linux Memcheck buildbot.
>
> Original issue's description:
> > Work on flexible mode and screen sharing.
> >
> > Implement VP8 style screensharing but with spatial layers.
> > Implement flexible mode.
> >
> > Files from other patches:
> > generic_encoder.cc
> > layer_filtering_transport.cc
> >
> > BUG=webrtc:4914
> >
> > Committed: https://crrev.com/77ccfb4d16c148e61a316746bb5d9705e8b39f4a
> > Cr-Commit-Position: refs/heads/master@{#10572}
>
> TBR=sprang@webrtc.org,stefan@webrtc.org,philipel@google.com,asapersson@webrtc.org,mflodman@webrtc.org,philipel@webrtc.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4914
>
> Committed: https://crrev.com/0be8f1d347bdb171462df89c2a4c69b3f3eb7519
> Cr-Commit-Position: refs/heads/master@{#10578}
TBR=sprang@webrtc.org,stefan@webrtc.org,philipel@google.com,asapersson@webrtc.org,mflodman@webrtc.org,terelius@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:4914
Review URL: https://codereview.webrtc.org/1431283002
Cr-Commit-Position: refs/heads/master@{#10581}
2015-11-10 07:17:23 -08:00
|
|
|
_codecSpecificInfo.codecSpecific.VP9.p_diff[r] =
|
2018-08-08 14:26:00 +02:00
|
|
|
vp9_header.pid_diff[r];
|
Reland of Work on flexible mode and screen sharing. (patchset #1 id:1 of https://codereview.webrtc.org/1438543002/ )
Reason for revert:
Failed test not related to this CL (test fails on
master at an earlier date), re-landing original CL..
(This time from my @webrtc account.)
Original issue's description:
> Revert of Work on flexible mode and screen sharing. (patchset #28 id:520001 of https://codereview.webrtc.org/1328113004/ )
>
> Reason for revert:
> Seems to break VideoSendStreamTest.ReconfigureBitratesSetsEncoderBitratesCorrectly on Linux Memcheck buildbot.
>
> Original issue's description:
> > Work on flexible mode and screen sharing.
> >
> > Implement VP8 style screensharing but with spatial layers.
> > Implement flexible mode.
> >
> > Files from other patches:
> > generic_encoder.cc
> > layer_filtering_transport.cc
> >
> > BUG=webrtc:4914
> >
> > Committed: https://crrev.com/77ccfb4d16c148e61a316746bb5d9705e8b39f4a
> > Cr-Commit-Position: refs/heads/master@{#10572}
>
> TBR=sprang@webrtc.org,stefan@webrtc.org,philipel@google.com,asapersson@webrtc.org,mflodman@webrtc.org,philipel@webrtc.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:4914
>
> Committed: https://crrev.com/0be8f1d347bdb171462df89c2a4c69b3f3eb7519
> Cr-Commit-Position: refs/heads/master@{#10578}
TBR=sprang@webrtc.org,stefan@webrtc.org,philipel@google.com,asapersson@webrtc.org,mflodman@webrtc.org,terelius@webrtc.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:4914
Review URL: https://codereview.webrtc.org/1431283002
Cr-Commit-Position: refs/heads/master@{#10581}
2015-11-10 07:17:23 -08:00
|
|
|
}
|
2015-07-31 06:10:09 -07:00
|
|
|
_codecSpecificInfo.codecSpecific.VP9.ss_data_available =
|
2018-08-08 14:26:00 +02:00
|
|
|
vp9_header.ss_data_available;
|
|
|
|
|
if (vp9_header.temporal_idx != kNoTemporalIdx) {
|
2015-07-31 06:10:09 -07:00
|
|
|
_codecSpecificInfo.codecSpecific.VP9.temporal_idx =
|
2018-08-08 14:26:00 +02:00
|
|
|
vp9_header.temporal_idx;
|
2015-07-31 06:10:09 -07:00
|
|
|
_codecSpecificInfo.codecSpecific.VP9.temporal_up_switch =
|
2018-08-08 14:26:00 +02:00
|
|
|
vp9_header.temporal_up_switch;
|
2015-07-31 06:10:09 -07:00
|
|
|
}
|
2018-08-08 14:26:00 +02:00
|
|
|
if (vp9_header.spatial_idx != kNoSpatialIdx) {
|
2015-07-31 06:10:09 -07:00
|
|
|
_codecSpecificInfo.codecSpecific.VP9.inter_layer_predicted =
|
2018-08-08 14:26:00 +02:00
|
|
|
vp9_header.inter_layer_predicted;
|
2018-12-20 14:32:14 +01:00
|
|
|
SetSpatialIndex(vp9_header.spatial_idx);
|
2015-07-31 06:10:09 -07:00
|
|
|
}
|
2018-08-08 14:26:00 +02:00
|
|
|
if (vp9_header.gof_idx != kNoGofIdx) {
|
|
|
|
|
_codecSpecificInfo.codecSpecific.VP9.gof_idx = vp9_header.gof_idx;
|
2015-07-31 06:10:09 -07:00
|
|
|
}
|
2018-08-08 14:26:00 +02:00
|
|
|
if (vp9_header.ss_data_available) {
|
2015-07-31 06:10:09 -07:00
|
|
|
_codecSpecificInfo.codecSpecific.VP9.num_spatial_layers =
|
2018-08-08 14:26:00 +02:00
|
|
|
vp9_header.num_spatial_layers;
|
2015-07-31 06:10:09 -07:00
|
|
|
_codecSpecificInfo.codecSpecific.VP9
|
|
|
|
|
.spatial_layer_resolution_present =
|
2018-08-08 14:26:00 +02:00
|
|
|
vp9_header.spatial_layer_resolution_present;
|
|
|
|
|
if (vp9_header.spatial_layer_resolution_present) {
|
|
|
|
|
for (size_t i = 0; i < vp9_header.num_spatial_layers; ++i) {
|
2015-07-31 06:10:09 -07:00
|
|
|
_codecSpecificInfo.codecSpecific.VP9.width[i] =
|
2018-08-08 14:26:00 +02:00
|
|
|
vp9_header.width[i];
|
2015-07-31 06:10:09 -07:00
|
|
|
_codecSpecificInfo.codecSpecific.VP9.height[i] =
|
2018-08-08 14:26:00 +02:00
|
|
|
vp9_header.height[i];
|
2015-07-31 06:10:09 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
_codecSpecificInfo.codecSpecific.VP9.gof.CopyGofInfoVP9(
|
2018-08-08 14:26:00 +02:00
|
|
|
vp9_header.gof);
|
2015-07-31 06:10:09 -07:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
2018-06-04 11:14:38 +02:00
|
|
|
case kVideoCodecH264: {
|
2014-07-31 14:59:24 +00:00
|
|
|
_codecSpecificInfo.codecType = kVideoCodecH264;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2021-03-29 17:54:35 +02:00
|
|
|
case kVideoCodecAV1: {
|
|
|
|
|
_codecSpecificInfo.codecType = kVideoCodecAV1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2018-06-04 11:14:38 +02:00
|
|
|
default: {
|
2018-08-16 14:35:26 +02:00
|
|
|
_codecSpecificInfo.codecType = kVideoCodecGeneric;
|
2014-07-31 14:59:24 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2011-08-17 09:47:33 +00:00
|
|
|
}
|
2014-07-31 14:59:24 +00:00
|
|
|
}
|
2011-08-17 09:47:33 +00:00
|
|
|
}
|
|
|
|
|
|
2015-10-19 02:39:06 -07:00
|
|
|
} // namespace webrtc
|