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.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* This file contains the declaration of the VP8 packetizer class.
|
|
|
|
|
* A packetizer object is created for each encoded video frame. The
|
|
|
|
|
* constructor is called with the payload data and size,
|
|
|
|
|
* together with the fragmentation information and a packetizer mode
|
|
|
|
|
* of choice. Alternatively, if no fragmentation info is available, the
|
|
|
|
|
* second constructor can be used with only payload data and size; in that
|
2012-02-23 18:52:53 +00:00
|
|
|
* case the mode kEqualSize is used.
|
2011-07-07 08:21:25 +00:00
|
|
|
*
|
|
|
|
|
* After creating the packetizer, the method NextPacket is called
|
|
|
|
|
* repeatedly to get all packets for the frame. The method returns
|
|
|
|
|
* false as long as there are more packets left to fetch.
|
|
|
|
|
*/
|
|
|
|
|
|
2011-12-06 15:56:18 +00:00
|
|
|
#ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_FORMAT_VP8_H_
|
|
|
|
|
#define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_FORMAT_VP8_H_
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2012-01-18 08:21:15 +00:00
|
|
|
#include <queue>
|
2014-09-29 08:00:22 +00:00
|
|
|
#include <string>
|
2012-01-18 08:21:15 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
2015-11-04 08:31:52 +01:00
|
|
|
#include "webrtc/modules/include/module_common_types.h"
|
2014-07-31 14:59:24 +00:00
|
|
|
#include "webrtc/modules/rtp_rtcp/source/rtp_format.h"
|
2017-07-06 19:44:34 +02:00
|
|
|
#include "webrtc/rtc_base/constructormagic.h"
|
2013-05-29 14:27:38 +00:00
|
|
|
#include "webrtc/typedefs.h"
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-12-06 15:56:18 +00:00
|
|
|
namespace webrtc {
|
2011-07-07 08:21:25 +00:00
|
|
|
|
2011-12-06 15:56:18 +00:00
|
|
|
enum VP8PacketizerMode {
|
|
|
|
|
kStrict = 0, // Split partitions if too large;
|
|
|
|
|
// never aggregate, balance size.
|
|
|
|
|
kAggregate, // Split partitions if too large; aggregate whole partitions.
|
2012-02-23 18:52:53 +00:00
|
|
|
kEqualSize, // Split entire payload without considering partition limits.
|
|
|
|
|
// This will produce equal size packets for the whole frame.
|
2011-12-06 15:56:18 +00:00
|
|
|
kNumModes,
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Packetizer for VP8.
|
2014-07-31 14:59:24 +00:00
|
|
|
class RtpPacketizerVp8 : public RtpPacketizer {
|
2011-12-06 15:56:18 +00:00
|
|
|
public:
|
|
|
|
|
// Initialize with payload from encoder and fragmentation info.
|
|
|
|
|
// The payload_data must be exactly one encoded VP8 frame.
|
2014-07-31 14:59:24 +00:00
|
|
|
RtpPacketizerVp8(const RTPVideoHeaderVP8& hdr_info,
|
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 max_payload_len,
|
2017-05-23 09:34:21 -07:00
|
|
|
size_t last_packet_reduction_len,
|
2014-07-31 14:59:24 +00:00
|
|
|
VP8PacketizerMode mode);
|
2011-12-06 15:56:18 +00:00
|
|
|
|
2012-02-23 18:52:53 +00:00
|
|
|
// Initialize without fragmentation info. Mode kEqualSize will be used.
|
2011-12-06 15:56:18 +00:00
|
|
|
// The payload_data must be exactly one encoded VP8 frame.
|
2017-05-23 09:34:21 -07:00
|
|
|
RtpPacketizerVp8(const RTPVideoHeaderVP8& hdr_info,
|
|
|
|
|
size_t max_payload_len,
|
|
|
|
|
size_t last_packet_reduction_len);
|
2013-07-31 15:17:19 +00:00
|
|
|
|
2014-07-31 14:59:24 +00:00
|
|
|
virtual ~RtpPacketizerVp8();
|
|
|
|
|
|
2017-05-23 09:34:21 -07:00
|
|
|
size_t SetPayloadData(const uint8_t* payload_data,
|
|
|
|
|
size_t payload_size,
|
|
|
|
|
const RTPFragmentationHeader* fragmentation) override;
|
2011-12-06 15:56:18 +00:00
|
|
|
|
|
|
|
|
// Get the next payload with VP8 payload header.
|
2016-12-05 02:26:44 -08:00
|
|
|
// Write payload and set marker bit of the |packet|.
|
|
|
|
|
// Returns true on success, false otherwise.
|
2017-05-23 09:34:21 -07:00
|
|
|
bool NextPacket(RtpPacketToSend* packet) override;
|
2014-09-12 11:05:55 +00:00
|
|
|
|
2015-03-04 12:58:35 +00:00
|
|
|
std::string ToString() override;
|
2014-09-12 11:05:55 +00:00
|
|
|
|
2011-12-06 15:56:18 +00:00
|
|
|
private:
|
2012-01-18 08:21:15 +00:00
|
|
|
typedef struct {
|
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 payload_start_pos;
|
|
|
|
|
size_t size;
|
2012-01-18 08:21:15 +00:00
|
|
|
bool first_fragment;
|
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 first_partition_ix;
|
2012-01-18 08:21:15 +00:00
|
|
|
} InfoStruct;
|
|
|
|
|
typedef std::queue<InfoStruct> InfoQueue;
|
2017-05-23 09:34:21 -07:00
|
|
|
|
2014-09-12 11:05:55 +00:00
|
|
|
static const int kXBit = 0x80;
|
|
|
|
|
static const int kNBit = 0x20;
|
|
|
|
|
static const int kSBit = 0x10;
|
2011-12-06 15:56:18 +00:00
|
|
|
static const int kPartIdField = 0x0F;
|
|
|
|
|
static const int kKeyIdxField = 0x1F;
|
2014-09-12 11:05:55 +00:00
|
|
|
static const int kIBit = 0x80;
|
|
|
|
|
static const int kLBit = 0x40;
|
|
|
|
|
static const int kTBit = 0x20;
|
|
|
|
|
static const int kKBit = 0x10;
|
|
|
|
|
static const int kYBit = 0x20;
|
2011-12-06 15:56:18 +00:00
|
|
|
|
2012-01-18 08:21:15 +00:00
|
|
|
// Calculate all packet sizes and load to packet info queue.
|
|
|
|
|
int GeneratePackets();
|
|
|
|
|
|
2017-05-23 09:34:21 -07:00
|
|
|
// Splits given part of payload (one or more partitions)
|
|
|
|
|
// to packets with a given capacity. If |last_partition| flag is set then the
|
|
|
|
|
// last packet should be reduced by last_packet_reduction_len_.
|
|
|
|
|
void GeneratePacketsSplitPayloadBalanced(size_t payload_offset,
|
|
|
|
|
size_t payload_len,
|
|
|
|
|
size_t capacity,
|
|
|
|
|
bool last_partition,
|
|
|
|
|
size_t part_idx);
|
|
|
|
|
|
|
|
|
|
// Aggregates partitions starting at |part_idx| to packets of
|
|
|
|
|
// given |capacity|. Last packet, if containing last partition of the frame
|
|
|
|
|
// should be reduced by last_packet_reduction_len_.
|
|
|
|
|
// Returns the first unaggregated partition index.
|
|
|
|
|
size_t GeneratePacketsAggregatePartitions(size_t part_idx, size_t capacity);
|
2012-01-18 08:21:15 +00:00
|
|
|
|
|
|
|
|
// Insert packet into packet queue.
|
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
|
|
|
void QueuePacket(size_t start_pos,
|
|
|
|
|
size_t packet_size,
|
|
|
|
|
size_t first_partition_in_packet,
|
2012-01-18 08:21:15 +00:00
|
|
|
bool start_on_new_fragment);
|
|
|
|
|
|
2011-12-06 15:56:18 +00:00
|
|
|
// Write the payload header and copy the payload to the buffer.
|
2012-01-18 08:21:15 +00:00
|
|
|
// The info in packet_info determines which part of the payload is written
|
|
|
|
|
// and what to write in the header fields.
|
|
|
|
|
int WriteHeaderAndPayload(const InfoStruct& packet_info,
|
2013-04-08 11:08:41 +00:00
|
|
|
uint8_t* buffer,
|
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 buffer_length) const;
|
2011-12-06 15:56:18 +00:00
|
|
|
|
|
|
|
|
// Write the X field and the appropriate extension fields to buffer.
|
|
|
|
|
// The function returns the extension length (including X field), or -1
|
|
|
|
|
// on error.
|
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
|
|
|
int WriteExtensionFields(uint8_t* buffer, size_t buffer_length) const;
|
2011-12-06 15:56:18 +00:00
|
|
|
|
|
|
|
|
// Set the I bit in the x_field, and write PictureID to the appropriate
|
|
|
|
|
// position in buffer. The function returns 0 on success, -1 otherwise.
|
2014-09-12 11:05:55 +00:00
|
|
|
int WritePictureIDFields(uint8_t* x_field,
|
|
|
|
|
uint8_t* buffer,
|
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 buffer_length,
|
|
|
|
|
size_t* extension_length) const;
|
2011-12-06 15:56:18 +00:00
|
|
|
|
|
|
|
|
// Set the L bit in the x_field, and write Tl0PicIdx to the appropriate
|
|
|
|
|
// position in buffer. The function returns 0 on success, -1 otherwise.
|
2014-09-12 11:05:55 +00:00
|
|
|
int WriteTl0PicIdxFields(uint8_t* x_field,
|
|
|
|
|
uint8_t* buffer,
|
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 buffer_length,
|
|
|
|
|
size_t* extension_length) const;
|
2011-12-06 15:56:18 +00:00
|
|
|
|
2011-12-13 14:11:06 +00:00
|
|
|
// Set the T and K bits in the x_field, and write TID, Y and KeyIdx to the
|
2011-12-06 15:56:18 +00:00
|
|
|
// appropriate position in buffer. The function returns 0 on success,
|
|
|
|
|
// -1 otherwise.
|
2014-09-12 11:05:55 +00:00
|
|
|
int WriteTIDAndKeyIdxFields(uint8_t* x_field,
|
|
|
|
|
uint8_t* buffer,
|
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 buffer_length,
|
|
|
|
|
size_t* extension_length) const;
|
2011-12-06 15:56:18 +00:00
|
|
|
|
|
|
|
|
// Write the PictureID from codec_specific_info_ to buffer. One or two
|
|
|
|
|
// bytes are written, depending on magnitude of PictureID. The function
|
|
|
|
|
// returns the number of bytes written.
|
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
|
|
|
int WritePictureID(uint8_t* buffer, size_t buffer_length) const;
|
2011-12-06 15:56:18 +00:00
|
|
|
|
|
|
|
|
// Calculate and return length (octets) of the variable header fields in
|
|
|
|
|
// the next header (i.e., header length in addition to vp8_header_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
|
|
|
size_t PayloadDescriptorExtraLength() const;
|
2011-12-06 15:56:18 +00:00
|
|
|
|
|
|
|
|
// Calculate and return length (octets) of PictureID field in the next
|
|
|
|
|
// header. Can be 0, 1, or 2.
|
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 PictureIdLength() const;
|
2011-12-06 15:56:18 +00:00
|
|
|
|
|
|
|
|
// Check whether each of the optional fields will be included in the header.
|
|
|
|
|
bool XFieldPresent() const;
|
|
|
|
|
bool TIDFieldPresent() const;
|
|
|
|
|
bool KeyIdxFieldPresent() const;
|
|
|
|
|
bool TL0PicIdxFieldPresent() const;
|
|
|
|
|
bool PictureIdPresent() const { return (PictureIdLength() > 0); }
|
|
|
|
|
|
2013-04-08 11:08:41 +00:00
|
|
|
const uint8_t* 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
|
|
|
size_t payload_size_;
|
2011-12-06 15:56:18 +00:00
|
|
|
RTPFragmentationHeader part_info_;
|
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
|
|
|
const size_t vp8_fixed_payload_descriptor_bytes_; // Length of VP8 payload
|
|
|
|
|
// descriptors' fixed part.
|
2017-05-23 09:34:21 -07:00
|
|
|
const VP8PacketizerMode mode_;
|
2011-12-06 15:56:18 +00:00
|
|
|
const RTPVideoHeaderVP8 hdr_info_;
|
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 num_partitions_;
|
|
|
|
|
const size_t max_payload_len_;
|
2017-05-23 09:34:21 -07:00
|
|
|
const size_t last_packet_reduction_len_;
|
2012-01-18 08:21:15 +00:00
|
|
|
InfoQueue packets_;
|
|
|
|
|
|
2015-09-16 05:37:44 -07:00
|
|
|
RTC_DISALLOW_COPY_AND_ASSIGN(RtpPacketizerVp8);
|
2011-07-07 08:21:25 +00:00
|
|
|
};
|
2014-09-12 11:05:55 +00:00
|
|
|
|
|
|
|
|
// Depacketizer for VP8.
|
|
|
|
|
class RtpDepacketizerVp8 : public RtpDepacketizer {
|
|
|
|
|
public:
|
|
|
|
|
virtual ~RtpDepacketizerVp8() {}
|
|
|
|
|
|
2015-03-04 12:58:35 +00:00
|
|
|
bool Parse(ParsedPayload* parsed_payload,
|
|
|
|
|
const uint8_t* payload_data,
|
|
|
|
|
size_t payload_data_length) override;
|
2014-09-12 11:05:55 +00:00
|
|
|
};
|
|
|
|
|
} // namespace webrtc
|
2011-12-06 15:56:18 +00:00
|
|
|
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_FORMAT_VP8_H_
|