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

Side by Side Diff: webrtc/media/engine/webrtcvideoframe.h

Issue 1831523004: Move InitToBlack and Reset methods from cricket::VideoFrame to its subclass cricket::WebRtcVideoFra… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebase. Created 4 years, 8 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) 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 int dh, 44 int dh,
45 uint8_t* sample, 45 uint8_t* sample,
46 size_t sample_size, 46 size_t sample_size,
47 int64_t time_stamp_ns, 47 int64_t time_stamp_ns,
48 webrtc::VideoRotation rotation); 48 webrtc::VideoRotation rotation);
49 49
50 bool Init(const CapturedFrame* frame, int dw, int dh, bool apply_rotation); 50 bool Init(const CapturedFrame* frame, int dw, int dh, bool apply_rotation);
51 51
52 void InitToEmptyBuffer(int w, int h, int64_t time_stamp_ns); 52 void InitToEmptyBuffer(int w, int h, int64_t time_stamp_ns);
53 53
54 bool InitToBlack(int w, int h, int64_t time_stamp_ns) override; 54 bool InitToBlack(int w, int h, int64_t time_stamp_ns);
55
56 // From base class VideoFrame.
57 bool Reset(uint32_t format,
58 int w,
59 int h,
60 int dw,
61 int dh,
62 uint8_t* sample,
63 size_t sample_size,
64 int64_t time_stamp_ns,
65 webrtc::VideoRotation rotation,
66 bool apply_rotation) override;
67 55
68 int width() const override; 56 int width() const override;
69 int height() const override; 57 int height() const override;
70 58
71 const uint8_t* GetYPlane() const override; 59 const uint8_t* GetYPlane() const override;
72 const uint8_t* GetUPlane() const override; 60 const uint8_t* GetUPlane() const override;
73 const uint8_t* GetVPlane() const override; 61 const uint8_t* GetVPlane() const override;
74 uint8_t* GetYPlane() override; 62 uint8_t* GetYPlane() override;
75 uint8_t* GetUPlane() override; 63 uint8_t* GetUPlane() override;
76 uint8_t* GetVPlane() override; 64 uint8_t* GetVPlane() override;
(...skipping 19 matching lines...) Expand all
96 uint8_t* buffer, 84 uint8_t* buffer,
97 size_t size, 85 size_t size,
98 int stride_rgb) const override; 86 int stride_rgb) const override;
99 87
100 const VideoFrame* GetCopyWithRotationApplied() const override; 88 const VideoFrame* GetCopyWithRotationApplied() const override;
101 89
102 protected: 90 protected:
103 void SetRotation(webrtc::VideoRotation rotation) override { 91 void SetRotation(webrtc::VideoRotation rotation) override {
104 rotation_ = rotation; 92 rotation_ = rotation;
105 } 93 }
94 // 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.
96 // |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.
98 // Returns whether the function succeeded or failed.
99 bool Reset(uint32_t format,
100 int w,
101 int h,
102 int dw,
103 int dh,
104 uint8_t* sample,
105 size_t sample_size,
106 int64_t time_stamp_ns,
107 webrtc::VideoRotation rotation,
108 bool apply_rotation);
106 109
107 private: 110 private:
108 VideoFrame* CreateEmptyFrame(int w, int h, 111 VideoFrame* CreateEmptyFrame(int w, int h,
109 int64_t time_stamp_ns) const override; 112 int64_t time_stamp_ns) const override;
110 113
111 // An opaque reference counted handle that stores the pixel data. 114 // An opaque reference counted handle that stores the pixel data.
112 rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer_; 115 rtc::scoped_refptr<webrtc::VideoFrameBuffer> video_frame_buffer_;
113 int64_t time_stamp_ns_; 116 int64_t time_stamp_ns_;
114 webrtc::VideoRotation rotation_; 117 webrtc::VideoRotation rotation_;
115 118
116 // This is mutable as the calculation is expensive but once calculated, it 119 // This is mutable as the calculation is expensive but once calculated, it
117 // remains const. 120 // remains const.
118 mutable std::unique_ptr<VideoFrame> rotated_frame_; 121 mutable std::unique_ptr<VideoFrame> rotated_frame_;
119 }; 122 };
120 123
121 } // namespace cricket 124 } // namespace cricket
122 125
123 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOFRAME_H_ 126 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOFRAME_H_
OLDNEW
« no previous file with comments | « webrtc/media/base/videoframe_unittest.h ('k') | webrtc/media/engine/webrtcvideoframe_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698