Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(252)

Side by Side Diff: webrtc/modules/rtp_rtcp/source/h264/h264_common.h

Issue 1979443004: Add H264 bitstream rewriting to limit frame reordering marker in header (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rewriting on the receiver side as well Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
11 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_H264_H264_COMMON_H_
12 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_H264_H264_COMMON_H_
13
14 #include <memory>
15 #include <vector>
16
17 #include "webrtc/base/common.h"
18 #include "webrtc/base/bytebuffer.h"
19
20 namespace webrtc {
21
22 class H264Common {
23 public:
24 // The size of a NALU header {0 0 0 1}.
noahric 2016/05/18 01:35:06 Three byte start codes are also valid, but assumin
sprang_webrtc 2016/05/20 16:11:00 I think this has worked because the standard manda
25 static const size_t kNaluHeaderSize;
26
27 // The size of a NALU header plus the type byte.
28 static const size_t kNaluHeaderAndTypeSize;
29
30 enum NaluType : uint8_t { kSps = 0x7, kPps = 0x8, kIdr = 0x5 };
noahric 2016/05/18 01:35:07 While you are here, add Sei, in case someone needs
sprang_webrtc 2016/05/20 16:11:00 Done.
31 enum SliceType : uint8_t { P = 0, B = 1, I = 2, Sp = 3, Si = 4 };
32
33 // Returns a vector of the NALU start sequences (0 0 0 1) in the given buffer.
noahric 2016/05/18 01:35:06 My bad (it was my comment originally), but I'd rep
sprang_webrtc 2016/05/20 16:11:00 Changed this to contain both offset of nal header
34 static std::vector<size_t> FindNaluStartOffsets(const uint8_t* buffer,
35 size_t buffer_size);
36 static NaluType ParseNaluType(uint8_t data);
noahric 2016/05/18 01:35:07 Comments for these would help.
sprang_webrtc 2016/05/20 16:11:00 Done.
37 static std::unique_ptr<rtc::ByteBufferWriter> ParseRbsp(const uint8_t* data,
38 size_t length);
39 static void WriteRbsp(const uint8_t* bytes,
40 size_t length,
41 rtc::ByteBufferWriter* destination);
42 };
43
44 } // namespace webrtc
45
46 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_H264_H264_COMMON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698