2011-07-07 08:21:25 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2011 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/rtp_rtcp/source/rtp_format_vp8.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2018-10-23 12:03:01 +02:00
|
|
|
#include <stdint.h>
|
2011-12-06 15:56:18 +00:00
|
|
|
#include <string.h> // memcpy
|
2019-07-05 19:08:33 +02:00
|
|
|
|
2012-01-18 08:21:15 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
|
2018-10-23 12:03:01 +02:00
|
|
|
#include "modules/video_coding/codecs/interface/common_constants.h"
|
2017-10-06 19:12:54 +02:00
|
|
|
#include "rtc_base/checks.h"
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "rtc_base/logging.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
2014-09-17 11:58:20 +00:00
|
|
|
namespace {
|
2018-08-30 11:14:05 +02:00
|
|
|
|
2018-09-04 16:11:58 +02:00
|
|
|
constexpr int kXBit = 0x80;
|
|
|
|
|
constexpr int kNBit = 0x20;
|
|
|
|
|
constexpr int kSBit = 0x10;
|
|
|
|
|
constexpr int kKeyIdxField = 0x1F;
|
|
|
|
|
constexpr int kIBit = 0x80;
|
|
|
|
|
constexpr int kLBit = 0x40;
|
|
|
|
|
constexpr int kTBit = 0x20;
|
|
|
|
|
constexpr int kKBit = 0x10;
|
|
|
|
|
constexpr int kYBit = 0x20;
|
2018-08-30 11:14:05 +02:00
|
|
|
|
2014-09-17 11:58:20 +00:00
|
|
|
int ParseVP8PictureID(RTPVideoHeaderVP8* vp8,
|
|
|
|
|
const uint8_t** data,
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
size_t* data_length,
|
|
|
|
|
size_t* parsed_bytes) {
|
|
|
|
|
if (*data_length == 0)
|
2014-09-17 11:58:20 +00:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
vp8->pictureId = (**data & 0x7F);
|
|
|
|
|
if (**data & 0x80) {
|
|
|
|
|
(*data)++;
|
|
|
|
|
(*parsed_bytes)++;
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
if (--(*data_length) == 0)
|
2014-09-17 11:58:20 +00:00
|
|
|
return -1;
|
|
|
|
|
// PictureId is 15 bits
|
|
|
|
|
vp8->pictureId = (vp8->pictureId << 8) + **data;
|
|
|
|
|
}
|
|
|
|
|
(*data)++;
|
|
|
|
|
(*parsed_bytes)++;
|
|
|
|
|
(*data_length)--;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int ParseVP8Tl0PicIdx(RTPVideoHeaderVP8* vp8,
|
|
|
|
|
const uint8_t** data,
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
size_t* data_length,
|
|
|
|
|
size_t* parsed_bytes) {
|
|
|
|
|
if (*data_length == 0)
|
2014-09-17 11:58:20 +00:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
vp8->tl0PicIdx = **data;
|
|
|
|
|
(*data)++;
|
|
|
|
|
(*parsed_bytes)++;
|
|
|
|
|
(*data_length)--;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int ParseVP8TIDAndKeyIdx(RTPVideoHeaderVP8* vp8,
|
|
|
|
|
const uint8_t** data,
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
size_t* data_length,
|
|
|
|
|
size_t* parsed_bytes,
|
2014-09-17 11:58:20 +00:00
|
|
|
bool has_tid,
|
|
|
|
|
bool has_key_idx) {
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
if (*data_length == 0)
|
2014-09-17 11:58:20 +00:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
if (has_tid) {
|
|
|
|
|
vp8->temporalIdx = ((**data >> 6) & 0x03);
|
|
|
|
|
vp8->layerSync = (**data & 0x20) ? true : false; // Y bit
|
|
|
|
|
}
|
|
|
|
|
if (has_key_idx) {
|
|
|
|
|
vp8->keyIdx = (**data & 0x1F);
|
|
|
|
|
}
|
|
|
|
|
(*data)++;
|
|
|
|
|
(*parsed_bytes)++;
|
|
|
|
|
(*data_length)--;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int ParseVP8Extension(RTPVideoHeaderVP8* vp8,
|
|
|
|
|
const uint8_t* data,
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
size_t data_length) {
|
2017-10-06 19:12:54 +02:00
|
|
|
RTC_DCHECK_GT(data_length, 0);
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
size_t parsed_bytes = 0;
|
2014-09-17 11:58:20 +00:00
|
|
|
// Optional X field is present.
|
|
|
|
|
bool has_picture_id = (*data & 0x80) ? true : false; // I bit
|
|
|
|
|
bool has_tl0_pic_idx = (*data & 0x40) ? true : false; // L bit
|
|
|
|
|
bool has_tid = (*data & 0x20) ? true : false; // T bit
|
|
|
|
|
bool has_key_idx = (*data & 0x10) ? true : false; // K bit
|
|
|
|
|
|
|
|
|
|
// Advance data and decrease remaining payload size.
|
|
|
|
|
data++;
|
|
|
|
|
parsed_bytes++;
|
|
|
|
|
data_length--;
|
|
|
|
|
|
|
|
|
|
if (has_picture_id) {
|
|
|
|
|
if (ParseVP8PictureID(vp8, &data, &data_length, &parsed_bytes) != 0) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (has_tl0_pic_idx) {
|
|
|
|
|
if (ParseVP8Tl0PicIdx(vp8, &data, &data_length, &parsed_bytes) != 0) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (has_tid || has_key_idx) {
|
|
|
|
|
if (ParseVP8TIDAndKeyIdx(vp8, &data, &data_length, &parsed_bytes, has_tid,
|
|
|
|
|
has_key_idx) != 0) {
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
return static_cast<int>(parsed_bytes);
|
2014-09-17 11:58:20 +00:00
|
|
|
}
|
|
|
|
|
|
2014-11-07 11:02:12 +00:00
|
|
|
int ParseVP8FrameSize(RtpDepacketizer::ParsedPayload* parsed_payload,
|
2014-09-17 11:58:20 +00:00
|
|
|
const uint8_t* data,
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
size_t data_length) {
|
2019-04-24 09:41:16 +02:00
|
|
|
if (parsed_payload->video_header().frame_type !=
|
|
|
|
|
VideoFrameType::kVideoFrameKey) {
|
2014-09-17 11:58:20 +00:00
|
|
|
// Included in payload header for I-frames.
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
if (data_length < 10) {
|
|
|
|
|
// For an I-frame we should always have the uncompressed VP8 header
|
|
|
|
|
// in the beginning of the partition.
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
2018-07-02 14:41:58 +02:00
|
|
|
parsed_payload->video_header().width = ((data[7] << 8) + data[6]) & 0x3FFF;
|
|
|
|
|
parsed_payload->video_header().height = ((data[9] << 8) + data[8]) & 0x3FFF;
|
2014-09-17 11:58:20 +00:00
|
|
|
return 0;
|
|
|
|
|
}
|
2017-10-06 19:12:54 +02:00
|
|
|
|
|
|
|
|
bool ValidateHeader(const RTPVideoHeaderVP8& hdr_info) {
|
|
|
|
|
if (hdr_info.pictureId != kNoPictureId) {
|
|
|
|
|
RTC_DCHECK_GE(hdr_info.pictureId, 0);
|
|
|
|
|
RTC_DCHECK_LE(hdr_info.pictureId, 0x7FFF);
|
|
|
|
|
}
|
|
|
|
|
if (hdr_info.tl0PicIdx != kNoTl0PicIdx) {
|
|
|
|
|
RTC_DCHECK_GE(hdr_info.tl0PicIdx, 0);
|
|
|
|
|
RTC_DCHECK_LE(hdr_info.tl0PicIdx, 0xFF);
|
|
|
|
|
}
|
|
|
|
|
if (hdr_info.temporalIdx != kNoTemporalIdx) {
|
|
|
|
|
RTC_DCHECK_GE(hdr_info.temporalIdx, 0);
|
|
|
|
|
RTC_DCHECK_LE(hdr_info.temporalIdx, 3);
|
|
|
|
|
} else {
|
|
|
|
|
RTC_DCHECK(!hdr_info.layerSync);
|
|
|
|
|
}
|
|
|
|
|
if (hdr_info.keyIdx != kNoKeyIdx) {
|
|
|
|
|
RTC_DCHECK_GE(hdr_info.keyIdx, 0);
|
|
|
|
|
RTC_DCHECK_LE(hdr_info.keyIdx, 0x1F);
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-17 11:58:20 +00:00
|
|
|
} // namespace
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2018-08-30 11:14:05 +02:00
|
|
|
RtpPacketizerVp8::RtpPacketizerVp8(rtc::ArrayView<const uint8_t> payload,
|
|
|
|
|
PayloadSizeLimits limits,
|
|
|
|
|
const RTPVideoHeaderVP8& hdr_info)
|
2018-09-04 16:11:58 +02:00
|
|
|
: hdr_(BuildHeader(hdr_info)), remaining_payload_(payload) {
|
|
|
|
|
limits.max_payload_len -= hdr_.size();
|
|
|
|
|
payload_sizes_ = SplitAboutEqually(payload.size(), limits);
|
|
|
|
|
current_packet_ = payload_sizes_.begin();
|
2017-10-06 19:12:54 +02:00
|
|
|
}
|
2014-07-31 14:59:24 +00:00
|
|
|
|
2018-08-30 11:14:05 +02:00
|
|
|
RtpPacketizerVp8::~RtpPacketizerVp8() = default;
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2018-08-28 19:45:31 +02:00
|
|
|
size_t RtpPacketizerVp8::NumPackets() const {
|
2018-09-04 16:11:58 +02:00
|
|
|
return payload_sizes_.end() - current_packet_;
|
2018-08-28 19:45:31 +02:00
|
|
|
}
|
|
|
|
|
|
2017-05-23 09:34:21 -07:00
|
|
|
bool RtpPacketizerVp8::NextPacket(RtpPacketToSend* packet) {
|
2016-12-05 02:26:44 -08:00
|
|
|
RTC_DCHECK(packet);
|
2018-09-04 16:11:58 +02:00
|
|
|
if (current_packet_ == payload_sizes_.end()) {
|
2014-07-31 14:59:24 +00:00
|
|
|
return false;
|
2012-01-18 08:21:15 +00:00
|
|
|
}
|
|
|
|
|
|
2018-09-04 16:11:58 +02:00
|
|
|
size_t packet_payload_len = *current_packet_;
|
|
|
|
|
++current_packet_;
|
2017-05-23 09:34:21 -07:00
|
|
|
|
2018-09-04 16:11:58 +02:00
|
|
|
uint8_t* buffer = packet->AllocatePayload(hdr_.size() + packet_payload_len);
|
|
|
|
|
RTC_CHECK(buffer);
|
2011-08-29 15:37:12 +00:00
|
|
|
|
2018-09-04 16:11:58 +02:00
|
|
|
memcpy(buffer, hdr_.data(), hdr_.size());
|
|
|
|
|
memcpy(buffer + hdr_.size(), remaining_payload_.data(), packet_payload_len);
|
2011-08-29 15:37:12 +00:00
|
|
|
|
2018-09-04 16:11:58 +02:00
|
|
|
remaining_payload_ = remaining_payload_.subview(packet_payload_len);
|
|
|
|
|
hdr_[0] &= (~kSBit); // Clear 'Start of partition' bit.
|
|
|
|
|
packet->SetMarker(current_packet_ == payload_sizes_.end());
|
|
|
|
|
return true;
|
2011-08-29 15:37:12 +00:00
|
|
|
}
|
2011-07-07 09:40:48 +00:00
|
|
|
|
2018-09-04 16:11:58 +02:00
|
|
|
// Write the VP8 payload descriptor.
|
|
|
|
|
// 0
|
|
|
|
|
// 0 1 2 3 4 5 6 7 8
|
|
|
|
|
// +-+-+-+-+-+-+-+-+-+
|
|
|
|
|
// |X| |N|S| PART_ID |
|
|
|
|
|
// +-+-+-+-+-+-+-+-+-+
|
|
|
|
|
// X: |I|L|T|K| | (mandatory if any of the below are used)
|
|
|
|
|
// +-+-+-+-+-+-+-+-+-+
|
|
|
|
|
// I: |PictureID (16b)| (optional)
|
|
|
|
|
// +-+-+-+-+-+-+-+-+-+
|
|
|
|
|
// L: | TL0PIC_IDX | (optional)
|
|
|
|
|
// +-+-+-+-+-+-+-+-+-+
|
|
|
|
|
// T/K: |TID:Y| KEYIDX | (optional)
|
|
|
|
|
// +-+-+-+-+-+-+-+-+-+
|
|
|
|
|
RtpPacketizerVp8::RawHeader RtpPacketizerVp8::BuildHeader(
|
|
|
|
|
const RTPVideoHeaderVP8& header) {
|
|
|
|
|
RTC_DCHECK(ValidateHeader(header));
|
|
|
|
|
|
|
|
|
|
RawHeader result;
|
|
|
|
|
bool tid_present = header.temporalIdx != kNoTemporalIdx;
|
|
|
|
|
bool keyid_present = header.keyIdx != kNoKeyIdx;
|
|
|
|
|
bool tl0_pid_present = header.tl0PicIdx != kNoTl0PicIdx;
|
|
|
|
|
bool pid_present = header.pictureId != kNoPictureId;
|
|
|
|
|
uint8_t x_field = 0;
|
|
|
|
|
if (pid_present)
|
|
|
|
|
x_field |= kIBit;
|
|
|
|
|
if (tl0_pid_present)
|
|
|
|
|
x_field |= kLBit;
|
|
|
|
|
if (tid_present)
|
|
|
|
|
x_field |= kTBit;
|
|
|
|
|
if (keyid_present)
|
|
|
|
|
x_field |= kKBit;
|
|
|
|
|
|
|
|
|
|
uint8_t flags = 0;
|
|
|
|
|
if (x_field != 0)
|
|
|
|
|
flags |= kXBit;
|
|
|
|
|
if (header.nonReference)
|
|
|
|
|
flags |= kNBit;
|
|
|
|
|
// Create header as first packet in the frame. NextPacket() will clear it
|
|
|
|
|
// after first use.
|
|
|
|
|
flags |= kSBit;
|
|
|
|
|
result.push_back(flags);
|
|
|
|
|
if (x_field == 0) {
|
|
|
|
|
return result;
|
2011-12-06 15:56:18 +00:00
|
|
|
}
|
2018-09-04 16:11:58 +02:00
|
|
|
result.push_back(x_field);
|
|
|
|
|
if (pid_present) {
|
|
|
|
|
const uint16_t pic_id = static_cast<uint16_t>(header.pictureId);
|
|
|
|
|
result.push_back(0x80 | ((pic_id >> 8) & 0x7F));
|
|
|
|
|
result.push_back(pic_id & 0xFF);
|
2011-12-06 15:56:18 +00:00
|
|
|
}
|
2018-09-04 16:11:58 +02:00
|
|
|
if (tl0_pid_present) {
|
|
|
|
|
result.push_back(header.tl0PicIdx);
|
2011-12-06 15:56:18 +00:00
|
|
|
}
|
2018-09-04 16:11:58 +02:00
|
|
|
if (tid_present || keyid_present) {
|
|
|
|
|
uint8_t data_field = 0;
|
|
|
|
|
if (tid_present) {
|
|
|
|
|
data_field |= header.temporalIdx << 6;
|
|
|
|
|
if (header.layerSync)
|
|
|
|
|
data_field |= kYBit;
|
|
|
|
|
}
|
|
|
|
|
if (keyid_present) {
|
|
|
|
|
data_field |= (header.keyIdx & kKeyIdxField);
|
|
|
|
|
}
|
|
|
|
|
result.push_back(data_field);
|
2011-12-06 15:56:18 +00:00
|
|
|
}
|
2018-09-04 16:11:58 +02:00
|
|
|
return result;
|
2011-08-01 21:47:46 +00:00
|
|
|
}
|
2014-09-12 11:05:55 +00:00
|
|
|
|
2014-09-29 08:00:22 +00:00
|
|
|
//
|
|
|
|
|
// VP8 format:
|
|
|
|
|
//
|
|
|
|
|
// Payload descriptor
|
|
|
|
|
// 0 1 2 3 4 5 6 7
|
|
|
|
|
// +-+-+-+-+-+-+-+-+
|
|
|
|
|
// |X|R|N|S|PartID | (REQUIRED)
|
|
|
|
|
// +-+-+-+-+-+-+-+-+
|
|
|
|
|
// X: |I|L|T|K| RSV | (OPTIONAL)
|
|
|
|
|
// +-+-+-+-+-+-+-+-+
|
|
|
|
|
// I: | PictureID | (OPTIONAL)
|
|
|
|
|
// +-+-+-+-+-+-+-+-+
|
|
|
|
|
// L: | TL0PICIDX | (OPTIONAL)
|
|
|
|
|
// +-+-+-+-+-+-+-+-+
|
|
|
|
|
// T/K: |TID:Y| KEYIDX | (OPTIONAL)
|
|
|
|
|
// +-+-+-+-+-+-+-+-+
|
|
|
|
|
//
|
|
|
|
|
// Payload header (considered part of the actual payload, sent to decoder)
|
|
|
|
|
// 0 1 2 3 4 5 6 7
|
|
|
|
|
// +-+-+-+-+-+-+-+-+
|
|
|
|
|
// |Size0|H| VER |P|
|
|
|
|
|
// +-+-+-+-+-+-+-+-+
|
|
|
|
|
// | ... |
|
|
|
|
|
// + +
|
|
|
|
|
bool RtpDepacketizerVp8::Parse(ParsedPayload* parsed_payload,
|
2014-09-12 11:05:55 +00:00
|
|
|
const uint8_t* payload_data,
|
|
|
|
|
size_t payload_data_length) {
|
2017-10-06 19:12:54 +02:00
|
|
|
RTC_DCHECK(parsed_payload);
|
2015-06-30 02:12:03 -07:00
|
|
|
if (payload_data_length == 0) {
|
2017-11-09 11:09:25 +01:00
|
|
|
RTC_LOG(LS_ERROR) << "Empty payload.";
|
2015-06-30 02:12:03 -07:00
|
|
|
return false;
|
|
|
|
|
}
|
2014-09-29 08:00:22 +00:00
|
|
|
|
|
|
|
|
// Parse mandatory first byte of payload descriptor.
|
|
|
|
|
bool extension = (*payload_data & 0x80) ? true : false; // X bit
|
|
|
|
|
bool beginning_of_partition = (*payload_data & 0x10) ? true : false; // S bit
|
|
|
|
|
int partition_id = (*payload_data & 0x0F); // PartID field
|
|
|
|
|
|
2018-07-02 14:41:58 +02:00
|
|
|
parsed_payload->video_header().width = 0;
|
|
|
|
|
parsed_payload->video_header().height = 0;
|
|
|
|
|
parsed_payload->video_header().is_first_packet_in_frame =
|
2014-09-29 08:00:22 +00:00
|
|
|
beginning_of_partition && (partition_id == 0);
|
2018-07-02 14:41:58 +02:00
|
|
|
parsed_payload->video_header().simulcastIdx = 0;
|
|
|
|
|
parsed_payload->video_header().codec = 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
|
|
|
auto& vp8_header = parsed_payload->video_header()
|
|
|
|
|
.video_type_header.emplace<RTPVideoHeaderVP8>();
|
|
|
|
|
vp8_header.nonReference = (*payload_data & 0x20) ? true : false; // N bit
|
|
|
|
|
vp8_header.partitionId = partition_id;
|
|
|
|
|
vp8_header.beginningOfPartition = beginning_of_partition;
|
|
|
|
|
vp8_header.pictureId = kNoPictureId;
|
|
|
|
|
vp8_header.tl0PicIdx = kNoTl0PicIdx;
|
|
|
|
|
vp8_header.temporalIdx = kNoTemporalIdx;
|
|
|
|
|
vp8_header.layerSync = false;
|
|
|
|
|
vp8_header.keyIdx = kNoKeyIdx;
|
2014-09-29 08:00:22 +00:00
|
|
|
|
|
|
|
|
if (partition_id > 8) {
|
|
|
|
|
// Weak check for corrupt payload_data: PartID MUST NOT be larger than 8.
|
2014-09-12 11:05:55 +00:00
|
|
|
return false;
|
2014-09-29 08:00:22 +00:00
|
|
|
}
|
2014-09-12 11:05:55 +00:00
|
|
|
|
2014-09-29 08:00:22 +00:00
|
|
|
// Advance payload_data and decrease remaining payload size.
|
|
|
|
|
payload_data++;
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
if (payload_data_length <= 1) {
|
2017-11-09 11:09:25 +01:00
|
|
|
RTC_LOG(LS_ERROR) << "Error parsing VP8 payload descriptor!";
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
return false;
|
|
|
|
|
}
|
2014-09-29 08:00:22 +00:00
|
|
|
payload_data_length--;
|
2014-09-12 11:05:55 +00:00
|
|
|
|
2014-09-29 08:00:22 +00:00
|
|
|
if (extension) {
|
|
|
|
|
const int parsed_bytes =
|
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
|
|
|
ParseVP8Extension(&vp8_header, payload_data, payload_data_length);
|
2014-09-29 08:00:22 +00:00
|
|
|
if (parsed_bytes < 0)
|
|
|
|
|
return false;
|
|
|
|
|
payload_data += parsed_bytes;
|
|
|
|
|
payload_data_length -= parsed_bytes;
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
if (payload_data_length == 0) {
|
2017-11-09 11:09:25 +01:00
|
|
|
RTC_LOG(LS_ERROR) << "Error parsing VP8 payload descriptor!";
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
return false;
|
|
|
|
|
}
|
2014-09-12 11:05:55 +00:00
|
|
|
}
|
2014-09-29 08:00:22 +00:00
|
|
|
|
|
|
|
|
// Read P bit from payload header (only at beginning of first partition).
|
Use size_t more consistently for packet/payload lengths.
See design doc at https://docs.google.com/a/chromium.org/document/d/1I6nmE9D_BmCY-IoV6MDPY2V6WYpEI-dg2apWXTfZyUI/edit?usp=sharing for more information.
This CL was reviewed and approved in pieces in the following CLs:
https://webrtc-codereview.appspot.com/24209004/
https://webrtc-codereview.appspot.com/24229004/
https://webrtc-codereview.appspot.com/24259004/
https://webrtc-codereview.appspot.com/25109004/
https://webrtc-codereview.appspot.com/26099004/
https://webrtc-codereview.appspot.com/27069004/
https://webrtc-codereview.appspot.com/27969004/
https://webrtc-codereview.appspot.com/27989004/
https://webrtc-codereview.appspot.com/29009004/
https://webrtc-codereview.appspot.com/30929004/
https://webrtc-codereview.appspot.com/30939004/
https://webrtc-codereview.appspot.com/31999004/
Committing as TBR to the original reviewers.
BUG=chromium:81439
TEST=none
TBR=pthatcher,henrik.lundin,tina.legrand,stefan,tkchin,glaznev,kjellander,perkj,mflodman,henrika,asapersson,niklas.enbom
Review URL: https://webrtc-codereview.appspot.com/23129004
git-svn-id: http://webrtc.googlecode.com/svn/trunk@7726 4adac7df-926f-26a2-2b94-8c16560cd09d
2014-11-20 22:28:14 +00:00
|
|
|
if (beginning_of_partition && partition_id == 0) {
|
2019-04-24 09:41:16 +02:00
|
|
|
parsed_payload->video_header().frame_type =
|
|
|
|
|
(*payload_data & 0x01) ? VideoFrameType::kVideoFrameDelta
|
|
|
|
|
: VideoFrameType::kVideoFrameKey;
|
2014-09-29 08:00:22 +00:00
|
|
|
} else {
|
2019-04-24 09:41:16 +02:00
|
|
|
parsed_payload->video_header().frame_type =
|
|
|
|
|
VideoFrameType::kVideoFrameDelta;
|
2014-09-29 08:00:22 +00:00
|
|
|
}
|
|
|
|
|
|
2014-11-07 11:02:12 +00:00
|
|
|
if (ParseVP8FrameSize(parsed_payload, payload_data, payload_data_length) !=
|
|
|
|
|
0) {
|
2014-09-29 08:00:22 +00:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
parsed_payload->payload = payload_data;
|
|
|
|
|
parsed_payload->payload_length = payload_data_length;
|
2014-09-12 11:05:55 +00:00
|
|
|
return true;
|
|
|
|
|
}
|
2011-12-06 15:56:18 +00:00
|
|
|
} // namespace webrtc
|