OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2004 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2004 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 bool interpolate, | 84 bool interpolate, |
85 bool crop) const; | 85 bool crop) const; |
86 | 86 |
87 // Writes the frame into the target VideoFrame, stretched to the size of that | 87 // Writes the frame into the target VideoFrame, stretched to the size of that |
88 // frame. The parameter "interpolate" controls whether to interpolate or just | 88 // frame. The parameter "interpolate" controls whether to interpolate or just |
89 // take the nearest-point. The parameter "crop" controls whether to crop this | 89 // take the nearest-point. The parameter "crop" controls whether to crop this |
90 // frame to the aspect ratio of the target frame before stretching. | 90 // frame to the aspect ratio of the target frame before stretching. |
91 virtual void StretchToFrame(VideoFrame *target, bool interpolate, | 91 virtual void StretchToFrame(VideoFrame *target, bool interpolate, |
92 bool crop) const; | 92 bool crop) const; |
93 | 93 |
| 94 // Sets the video frame to black. |
| 95 virtual bool SetToBlack(); |
| 96 |
94 // Tests if sample is valid. Returns true if valid. | 97 // Tests if sample is valid. Returns true if valid. |
95 static bool Validate(uint32_t fourcc, | 98 static bool Validate(uint32_t fourcc, |
96 int w, | 99 int w, |
97 int h, | 100 int h, |
98 const uint8_t* sample, | 101 const uint8_t* sample, |
99 size_t sample_size); | 102 size_t sample_size); |
100 | 103 |
101 protected: | 104 protected: |
102 // Writes the frame into the given planes, stretched to the given width and | 105 // Writes the frame into the given planes, stretched to the given width and |
103 // height. The parameter "interpolate" controls whether to interpolate or just | 106 // height. The parameter "interpolate" controls whether to interpolate or just |
(...skipping 10 matching lines...) Expand all Loading... |
114 virtual VideoFrame* CreateEmptyFrame(int w, | 117 virtual VideoFrame* CreateEmptyFrame(int w, |
115 int h, | 118 int h, |
116 int64_t timestamp_us) const = 0; | 119 int64_t timestamp_us) const = 0; |
117 | 120 |
118 virtual void set_rotation(webrtc::VideoRotation rotation) = 0; | 121 virtual void set_rotation(webrtc::VideoRotation rotation) = 0; |
119 }; | 122 }; |
120 | 123 |
121 } // namespace cricket | 124 } // namespace cricket |
122 | 125 |
123 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_H_ | 126 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_H_ |
OLD | NEW |