OLD | NEW |
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 // TODO(nisse): This header file should eventually be deleted. For | 14 // TODO(nisse): Delete this wrapper file, as soon as downstream |
15 // declarations of classes related to unencoded video frame, use the | 15 // projects are updated. |
16 // headers under api/video instead. The EncodedImage class stays in | |
17 // this file until we have figured out how to refactor and clean up | |
18 // related interfaces. | |
19 | 16 |
20 #include "webrtc/common_types.h" | 17 #include "webrtc/common_video/include/video_frame.h" |
21 #include "webrtc/typedefs.h" | |
22 | 18 |
23 namespace webrtc { | |
24 | |
25 // TODO(pbos): Rename EncodedFrame and reformat this class' members. | |
26 class EncodedImage { | |
27 public: | |
28 static const size_t kBufferPaddingBytesH264; | |
29 | |
30 // Some decoders require encoded image buffers to be padded with a small | |
31 // number of additional bytes (due to over-reading byte readers). | |
32 static size_t GetBufferPaddingBytes(VideoCodecType codec_type); | |
33 | |
34 EncodedImage() : EncodedImage(nullptr, 0, 0) {} | |
35 | |
36 EncodedImage(uint8_t* buffer, size_t length, size_t size) | |
37 : _buffer(buffer), _length(length), _size(size) {} | |
38 | |
39 // TODO(kthelgason): get rid of this struct as it only has a single member | |
40 // remaining. | |
41 struct AdaptReason { | |
42 AdaptReason() : bw_resolutions_disabled(-1) {} | |
43 int bw_resolutions_disabled; // Number of resolutions that are not sent | |
44 // due to bandwidth for this frame. | |
45 // Or -1 if information is not provided. | |
46 }; | |
47 uint32_t _encodedWidth = 0; | |
48 uint32_t _encodedHeight = 0; | |
49 uint32_t _timeStamp = 0; | |
50 // NTP time of the capture time in local timebase in milliseconds. | |
51 int64_t ntp_time_ms_ = 0; | |
52 int64_t capture_time_ms_ = 0; | |
53 FrameType _frameType = kVideoFrameDelta; | |
54 uint8_t* _buffer; | |
55 size_t _length; | |
56 size_t _size; | |
57 VideoRotation rotation_ = kVideoRotation_0; | |
58 VideoContentType content_type_ = VideoContentType::UNSPECIFIED; | |
59 bool _completeFrame = false; | |
60 AdaptReason adapt_reason_; | |
61 int qp_ = -1; // Quantizer value. | |
62 | |
63 // When an application indicates non-zero values here, it is taken as an | |
64 // indication that all future frames will be constrained with those limits | |
65 // until the application indicates a change again. | |
66 PlayoutDelay playout_delay_ = {-1, -1}; | |
67 }; | |
68 | |
69 } // namespace webrtc | |
70 #endif // WEBRTC_VIDEO_FRAME_H_ | 19 #endif // WEBRTC_VIDEO_FRAME_H_ |
OLD | NEW |