OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 const uint8_t* GetYPlane() const override; | 59 const uint8_t* GetYPlane() const override; |
60 const uint8_t* GetUPlane() const override; | 60 const uint8_t* GetUPlane() const override; |
61 const uint8_t* GetVPlane() const override; | 61 const uint8_t* GetVPlane() const override; |
62 uint8_t* GetYPlane() override; | 62 uint8_t* GetYPlane() override; |
63 uint8_t* GetUPlane() override; | 63 uint8_t* GetUPlane() override; |
64 uint8_t* GetVPlane() override; | 64 uint8_t* GetVPlane() override; |
65 int32_t GetYPitch() const override; | 65 int32_t GetYPitch() const override; |
66 int32_t GetUPitch() const override; | 66 int32_t GetUPitch() const override; |
67 int32_t GetVPitch() const override; | 67 int32_t GetVPitch() const override; |
68 void* GetNativeHandle() const override; | 68 void* GetNativeHandle() const override; |
69 rtc::scoped_refptr<webrtc::VideoFrameBuffer> GetVideoFrameBuffer() | 69 rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer() |
70 const override; | 70 const override; |
71 | 71 |
72 int64_t GetTimeStamp() const override { return time_stamp_ns_; } | 72 int64_t GetTimeStamp() const override { return time_stamp_ns_; } |
73 void SetTimeStamp(int64_t time_stamp_ns) override { | 73 void SetTimeStamp(int64_t time_stamp_ns) override { |
74 time_stamp_ns_ = time_stamp_ns; | 74 time_stamp_ns_ = time_stamp_ns; |
75 } | 75 } |
76 | 76 |
77 webrtc::VideoRotation GetVideoRotation() const override { | 77 webrtc::VideoRotation rotation() const override { return rotation_; } |
78 return rotation_; | |
79 } | |
80 | 78 |
81 VideoFrame* Copy() const override; | 79 VideoFrame* Copy() const override; |
82 bool IsExclusive() const override; | 80 bool IsExclusive() const override; |
83 size_t ConvertToRgbBuffer(uint32_t to_fourcc, | 81 size_t ConvertToRgbBuffer(uint32_t to_fourcc, |
84 uint8_t* buffer, | 82 uint8_t* buffer, |
85 size_t size, | 83 size_t size, |
86 int stride_rgb) const override; | 84 int stride_rgb) const override; |
87 | 85 |
88 const VideoFrame* GetCopyWithRotationApplied() const override; | 86 const VideoFrame* GetCopyWithRotationApplied() const override; |
89 | 87 |
90 protected: | 88 protected: |
91 void SetRotation(webrtc::VideoRotation rotation) override { | 89 void set_rotation(webrtc::VideoRotation rotation) override { |
92 rotation_ = rotation; | 90 rotation_ = rotation; |
93 } | 91 } |
94 // Creates a frame from a raw sample with FourCC |format| and size |w| x |h|. | 92 // Creates a frame from a raw sample with FourCC |format| and size |w| x |h|. |
95 // |h| can be negative indicating a vertically flipped image. | 93 // |h| can be negative indicating a vertically flipped image. |
96 // |dw| is destination width; can be less than |w| if cropping is desired. | 94 // |dw| is destination width; can be less than |w| if cropping is desired. |
97 // |dh| is destination height, like |dw|, but must be a positive number. | 95 // |dh| is destination height, like |dw|, but must be a positive number. |
98 // Returns whether the function succeeded or failed. | 96 // Returns whether the function succeeded or failed. |
99 bool Reset(uint32_t format, | 97 bool Reset(uint32_t format, |
100 int w, | 98 int w, |
101 int h, | 99 int h, |
(...skipping 15 matching lines...) Expand all Loading... |
117 webrtc::VideoRotation rotation_; | 115 webrtc::VideoRotation rotation_; |
118 | 116 |
119 // This is mutable as the calculation is expensive but once calculated, it | 117 // This is mutable as the calculation is expensive but once calculated, it |
120 // remains const. | 118 // remains const. |
121 mutable std::unique_ptr<VideoFrame> rotated_frame_; | 119 mutable std::unique_ptr<VideoFrame> rotated_frame_; |
122 }; | 120 }; |
123 | 121 |
124 } // namespace cricket | 122 } // namespace cricket |
125 | 123 |
126 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOFRAME_H_ | 124 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOFRAME_H_ |
OLD | NEW |