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

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 TestVideoFrame.ReuseAllocation, CreateEmptyFrame no longer does that. 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
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 59 // Create a new frame with a given buffer and meta data.
60 // be shared, this function can be used to check exclusive ownership. 60 // TODO(nisse): Needed by VideoFactory. Must be deleted for merge of
61 virtual bool IsExclusive() const = 0; 61 // cricket::VideoFrame and webrtc::VideoFrame.
62 virtual VideoFrame* CreateWithBuffer(
63 const rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer,
tommi 2016/05/25 12:14:25 const &?
nisse-webrtc 2016/05/25 12:38:02 Done.
64 webrtc::VideoRotation rotation,
65 int64_t timestamp_us) const = 0;
62 66
63 // Return a copy of frame which has its pending rotation applied. The 67 // Return a copy of frame which has its pending rotation applied. The
64 // ownership of the returned frame is held by this frame. 68 // ownership of the returned frame is held by this frame.
65 virtual const VideoFrame* GetCopyWithRotationApplied() const = 0; 69 virtual const VideoFrame* GetCopyWithRotationApplied() const = 0;
66 70
67 // Converts the I420 data to RGB of a certain type such as ARGB and ABGR. 71 // 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 72 // 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. 73 // not (like snprintf). Parameters size and stride_rgb are in units of bytes.
70 // If there is insufficient space, nothing is written. 74 // If there is insufficient space, nothing is written.
71 virtual size_t ConvertToRgbBuffer(uint32_t to_fourcc, 75 virtual size_t ConvertToRgbBuffer(uint32_t to_fourcc,
(...skipping 16 matching lines...) Expand all
88 bool interpolate, 92 bool interpolate,
89 bool crop) const; 93 bool crop) const;
90 94
91 // Writes the frame into the target VideoFrame, stretched to the size of that 95 // Writes the frame into the target VideoFrame, stretched to the size of that
92 // frame. The parameter "interpolate" controls whether to interpolate or just 96 // frame. The parameter "interpolate" controls whether to interpolate or just
93 // take the nearest-point. The parameter "crop" controls whether to crop this 97 // take the nearest-point. The parameter "crop" controls whether to crop this
94 // frame to the aspect ratio of the target frame before stretching. 98 // frame to the aspect ratio of the target frame before stretching.
95 virtual void StretchToFrame(VideoFrame *target, bool interpolate, 99 virtual void StretchToFrame(VideoFrame *target, bool interpolate,
96 bool crop) const; 100 bool crop) const;
97 101
102 #if 0
tommi 2016/05/25 12:14:25 delete this method?
nisse-webrtc 2016/05/25 12:38:02 Sorry for this left-over. It is no longer used, an
98 // Stretches the frame to the given size, creating a new VideoFrame object to 103 // Stretches the frame to the given size, creating a new VideoFrame object to
99 // hold it. The parameter "interpolate" controls whether to interpolate or 104 // hold it. The parameter "interpolate" controls whether to interpolate or
100 // just take the nearest-point. The parameter "crop" controls whether to crop 105 // 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. 106 // this frame to the aspect ratio of the given dimensions before stretching.
102 virtual VideoFrame *Stretch(size_t w, size_t h, bool interpolate, 107 virtual VideoFrame *Stretch(size_t w, size_t h, bool interpolate,
103 bool crop) const; 108 bool crop) const;
109 #endif
104 110
105 // Sets the video frame to black. 111 // Sets the video frame to black.
106 virtual bool SetToBlack(); 112 virtual bool SetToBlack();
107 113
108 // Tests if sample is valid. Returns true if valid. 114 // Tests if sample is valid. Returns true if valid.
109 static bool Validate(uint32_t fourcc, 115 static bool Validate(uint32_t fourcc,
110 int w, 116 int w,
111 int h, 117 int h,
112 const uint8_t* sample, 118 const uint8_t* sample,
113 size_t sample_size); 119 size_t sample_size);
114 120
115 protected: 121 protected:
116 // Writes the frame into the given planes, stretched to the given width and 122 // Writes the frame into the given planes, stretched to the given width and
117 // height. The parameter "interpolate" controls whether to interpolate or just 123 // height. The parameter "interpolate" controls whether to interpolate or just
118 // take the nearest-point. The parameter "crop" controls whether to crop this 124 // take the nearest-point. The parameter "crop" controls whether to crop this
119 // frame to the aspect ratio of the given dimensions before stretching. 125 // frame to the aspect ratio of the given dimensions before stretching.
120 virtual bool CopyToPlanes(uint8_t* dst_y, 126 virtual bool CopyToPlanes(uint8_t* dst_y,
121 uint8_t* dst_u, 127 uint8_t* dst_u,
122 uint8_t* dst_v, 128 uint8_t* dst_v,
123 int32_t dst_pitch_y, 129 int32_t dst_pitch_y,
124 int32_t dst_pitch_u, 130 int32_t dst_pitch_u,
125 int32_t dst_pitch_v) const; 131 int32_t dst_pitch_v) const;
126 132
127 // Creates an empty frame. 133 // Creates an empty frame.
128 virtual VideoFrame* CreateEmptyFrame(int w, 134 virtual VideoFrame* CreateEmptyFrame(int w,
129 int h, 135 int h,
130 int64_t timestamp_us) const = 0; 136 int64_t timestamp_us) const = 0;
137
131 virtual void set_rotation(webrtc::VideoRotation rotation) = 0; 138 virtual void set_rotation(webrtc::VideoRotation rotation) = 0;
132 }; 139 };
133 140
134 } // namespace cricket 141 } // namespace cricket
135 142
136 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_H_ 143 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698