| 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 | |
| 97 // Tests if sample is valid. Returns true if valid. | 94 // Tests if sample is valid. Returns true if valid. |
| 98 static bool Validate(uint32_t fourcc, | 95 static bool Validate(uint32_t fourcc, |
| 99 int w, | 96 int w, |
| 100 int h, | 97 int h, |
| 101 const uint8_t* sample, | 98 const uint8_t* sample, |
| 102 size_t sample_size); | 99 size_t sample_size); |
| 103 | 100 |
| 104 protected: | 101 protected: |
| 105 // Writes the frame into the given planes, stretched to the given width and | 102 // Writes the frame into the given planes, stretched to the given width and |
| 106 // height. The parameter "interpolate" controls whether to interpolate or just | 103 // height. The parameter "interpolate" controls whether to interpolate or just |
| (...skipping 10 matching lines...) Expand all Loading... |
| 117 virtual VideoFrame* CreateEmptyFrame(int w, | 114 virtual VideoFrame* CreateEmptyFrame(int w, |
| 118 int h, | 115 int h, |
| 119 int64_t timestamp_us) const = 0; | 116 int64_t timestamp_us) const = 0; |
| 120 | 117 |
| 121 virtual void set_rotation(webrtc::VideoRotation rotation) = 0; | 118 virtual void set_rotation(webrtc::VideoRotation rotation) = 0; |
| 122 }; | 119 }; |
| 123 | 120 |
| 124 } // namespace cricket | 121 } // namespace cricket |
| 125 | 122 |
| 126 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_H_ | 123 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_H_ |
| OLD | NEW |