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

Side by Side Diff: webrtc/media/base/videoframe.h

Issue 2009193002: Delete IsMutable and IsExclusive methods. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Delete redundant RefCountedObject wrapping. Created 4 years, 6 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/common_video/video_frame_buffer.cc ('k') | webrtc/media/base/videoframe.cc » ('j') | 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) 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 } 49 }
50 50
51 // Indicates the rotation angle in degrees. 51 // Indicates the rotation angle in degrees.
52 virtual webrtc::VideoRotation rotation() const = 0; 52 virtual webrtc::VideoRotation rotation() const = 0;
53 53
54 // Make a shallow copy of the frame. The frame buffer itself is not copied. 54 // Make a shallow copy of the frame. The frame buffer itself is not copied.
55 // Both the current and new VideoFrame will share a single reference-counted 55 // Both the current and new VideoFrame will share a single reference-counted
56 // frame buffer. 56 // frame buffer.
57 virtual VideoFrame *Copy() const = 0; 57 virtual VideoFrame *Copy() const = 0;
58 58
59 // Since VideoFrame supports shallow copy and the internal frame buffer might
60 // be shared, this function can be used to check exclusive ownership.
61 virtual bool IsExclusive() const = 0;
62
63 // Return a copy of frame which has its pending rotation applied. The 59 // Return a copy of frame which has its pending rotation applied. The
64 // ownership of the returned frame is held by this frame. 60 // ownership of the returned frame is held by this frame.
65 virtual const VideoFrame* GetCopyWithRotationApplied() const = 0; 61 virtual const VideoFrame* GetCopyWithRotationApplied() const = 0;
66 62
67 // Converts the I420 data to RGB of a certain type such as ARGB and ABGR. 63 // Converts the I420 data to RGB of a certain type such as ARGB and ABGR.
68 // Returns the frame's actual size, regardless of whether it was written or 64 // Returns the frame's actual size, regardless of whether it was written or
69 // not (like snprintf). Parameters size and stride_rgb are in units of bytes. 65 // not (like snprintf). Parameters size and stride_rgb are in units of bytes.
70 // If there is insufficient space, nothing is written. 66 // If there is insufficient space, nothing is written.
71 virtual size_t ConvertToRgbBuffer(uint32_t to_fourcc, 67 virtual size_t ConvertToRgbBuffer(uint32_t to_fourcc,
72 uint8_t* buffer, 68 uint8_t* buffer,
(...skipping 15 matching lines...) Expand all
88 bool interpolate, 84 bool interpolate,
89 bool crop) const; 85 bool crop) const;
90 86
91 // 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
92 // frame. The parameter "interpolate" controls whether to interpolate or just 88 // frame. The parameter "interpolate" controls whether to interpolate or just
93 // 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
94 // frame to the aspect ratio of the target frame before stretching. 90 // frame to the aspect ratio of the target frame before stretching.
95 virtual void StretchToFrame(VideoFrame *target, bool interpolate, 91 virtual void StretchToFrame(VideoFrame *target, bool interpolate,
96 bool crop) const; 92 bool crop) const;
97 93
98 // Stretches the frame to the given size, creating a new VideoFrame object to
99 // hold it. The parameter "interpolate" controls whether to interpolate or
100 // just take the nearest-point. The parameter "crop" controls whether to crop
101 // this frame to the aspect ratio of the given dimensions before stretching.
102 virtual VideoFrame *Stretch(size_t w, size_t h, bool interpolate,
103 bool crop) const;
104
105 // Sets the video frame to black. 94 // Sets the video frame to black.
106 virtual bool SetToBlack(); 95 virtual bool SetToBlack();
107 96
108 // Tests if sample is valid. Returns true if valid. 97 // Tests if sample is valid. Returns true if valid.
109 static bool Validate(uint32_t fourcc, 98 static bool Validate(uint32_t fourcc,
110 int w, 99 int w,
111 int h, 100 int h,
112 const uint8_t* sample, 101 const uint8_t* sample,
113 size_t sample_size); 102 size_t sample_size);
114 103
115 protected: 104 protected:
116 // 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
117 // height. The parameter "interpolate" controls whether to interpolate or just 106 // height. The parameter "interpolate" controls whether to interpolate or just
118 // take the nearest-point. The parameter "crop" controls whether to crop this 107 // take the nearest-point. The parameter "crop" controls whether to crop this
119 // frame to the aspect ratio of the given dimensions before stretching. 108 // frame to the aspect ratio of the given dimensions before stretching.
120 virtual bool CopyToPlanes(uint8_t* dst_y, 109 virtual bool CopyToPlanes(uint8_t* dst_y,
121 uint8_t* dst_u, 110 uint8_t* dst_u,
122 uint8_t* dst_v, 111 uint8_t* dst_v,
123 int32_t dst_pitch_y, 112 int32_t dst_pitch_y,
124 int32_t dst_pitch_u, 113 int32_t dst_pitch_u,
125 int32_t dst_pitch_v) const; 114 int32_t dst_pitch_v) const;
126 115
127 // Creates an empty frame. 116 // Creates an empty frame.
128 virtual VideoFrame* CreateEmptyFrame(int w, 117 virtual VideoFrame* CreateEmptyFrame(int w,
129 int h, 118 int h,
130 int64_t timestamp_us) const = 0; 119 int64_t timestamp_us) const = 0;
120
131 virtual void set_rotation(webrtc::VideoRotation rotation) = 0; 121 virtual void set_rotation(webrtc::VideoRotation rotation) = 0;
132 }; 122 };
133 123
134 } // namespace cricket 124 } // namespace cricket
135 125
136 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_H_ 126 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_H_
OLDNEW
« no previous file with comments | « webrtc/common_video/video_frame_buffer.cc ('k') | webrtc/media/base/videoframe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698