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

Side by Side Diff: webrtc/video_frame.h

Issue 1602523004: Added EncodedImage::GetBufferPaddingBytes. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Moved constant, reverted dependency, function name indicating unit is bytes Created 4 years, 11 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
« no previous file with comments | « webrtc/modules/video_coding/frame_buffer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 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 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 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
11 #ifndef WEBRTC_VIDEO_FRAME_H_ 11 #ifndef WEBRTC_VIDEO_FRAME_H_
12 #define WEBRTC_VIDEO_FRAME_H_ 12 #define WEBRTC_VIDEO_FRAME_H_
13 13
14 #include "webrtc/base/scoped_ref_ptr.h" 14 #include "webrtc/base/scoped_ref_ptr.h"
15 #include "webrtc/common_types.h" 15 #include "webrtc/common_types.h"
16 #include "webrtc/common_video/include/video_frame_buffer.h" 16 #include "webrtc/common_video/include/video_frame_buffer.h"
17 #include "webrtc/common_video/rotation.h" 17 #include "webrtc/common_video/rotation.h"
18 #include "webrtc/typedefs.h" 18 #include "webrtc/typedefs.h"
19 19
20 namespace webrtc { 20 namespace webrtc {
21 21
22 extern const size_t kEncodedImagePaddingH264;
mflodman 2016/01/21 13:02:45 Maybe this should be part of class EncodedImage, w
23
22 class VideoFrame { 24 class VideoFrame {
23 public: 25 public:
24 VideoFrame(); 26 VideoFrame();
25 VideoFrame(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer, 27 VideoFrame(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer,
26 uint32_t timestamp, 28 uint32_t timestamp,
27 int64_t render_time_ms, 29 int64_t render_time_ms,
28 VideoRotation rotation); 30 VideoRotation rotation);
29 31
30 // TODO(pbos): Make all create/copy functions void, they should not be able to 32 // TODO(pbos): Make all create/copy functions void, they should not be able to
31 // fail (which should be RTC_DCHECK/CHECKed instead). 33 // fail (which should be RTC_DCHECK/CHECKed instead).
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 uint32_t timestamp_; 168 uint32_t timestamp_;
167 int64_t ntp_time_ms_; 169 int64_t ntp_time_ms_;
168 int64_t render_time_ms_; 170 int64_t render_time_ms_;
169 VideoRotation rotation_; 171 VideoRotation rotation_;
170 }; 172 };
171 173
172 174
173 // TODO(pbos): Rename EncodedFrame and reformat this class' members. 175 // TODO(pbos): Rename EncodedFrame and reformat this class' members.
174 class EncodedImage { 176 class EncodedImage {
175 public: 177 public:
178 // Some decoders require encoded image buffers to be padded with a small
179 // number of additional bytes (due to over-reading byte readers).
180 static size_t GetBufferPaddingBytes(VideoCodecType codec_type);
181
176 EncodedImage() : EncodedImage(nullptr, 0, 0) {} 182 EncodedImage() : EncodedImage(nullptr, 0, 0) {}
177 EncodedImage(uint8_t* buffer, size_t length, size_t size) 183 EncodedImage(uint8_t* buffer, size_t length, size_t size)
178 : _buffer(buffer), _length(length), _size(size) {} 184 : _buffer(buffer), _length(length), _size(size) {}
179 185
180 struct AdaptReason { 186 struct AdaptReason {
181 AdaptReason() 187 AdaptReason()
182 : quality_resolution_downscales(-1), 188 : quality_resolution_downscales(-1),
183 bw_resolutions_disabled(-1) {} 189 bw_resolutions_disabled(-1) {}
184 190
185 int quality_resolution_downscales; // Number of times this frame is down 191 int quality_resolution_downscales; // Number of times this frame is down
(...skipping 13 matching lines...) Expand all
199 uint8_t* _buffer; 205 uint8_t* _buffer;
200 size_t _length; 206 size_t _length;
201 size_t _size; 207 size_t _size;
202 bool _completeFrame = false; 208 bool _completeFrame = false;
203 AdaptReason adapt_reason_; 209 AdaptReason adapt_reason_;
204 int qp_ = -1; // Quantizer value. 210 int qp_ = -1; // Quantizer value.
205 }; 211 };
206 212
207 } // namespace webrtc 213 } // namespace webrtc
208 #endif // WEBRTC_VIDEO_FRAME_H_ 214 #endif // WEBRTC_VIDEO_FRAME_H_
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/frame_buffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698