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

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

Issue 2262443003: Delete VideoFrameFactory, CapturedFrame, and related code. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Update apply_rotation_ comment. Created 4 years, 3 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/media/engine/webrtcvideoengine2.h ('k') | webrtc/media/engine/webrtcvideoframe.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) 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
11 #ifndef WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOFRAME_H_ 11 #ifndef WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOFRAME_H_
12 #define WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOFRAME_H_ 12 #define WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOFRAME_H_
13 13
14 #include <memory> 14 #include <memory>
15 15
16 #include "webrtc/base/buffer.h" 16 #include "webrtc/base/buffer.h"
17 #include "webrtc/base/refcount.h" 17 #include "webrtc/base/refcount.h"
18 #include "webrtc/base/scoped_ref_ptr.h" 18 #include "webrtc/base/scoped_ref_ptr.h"
19 #include "webrtc/common_types.h" 19 #include "webrtc/common_types.h"
20 #include "webrtc/common_video/include/video_frame_buffer.h" 20 #include "webrtc/common_video/include/video_frame_buffer.h"
21 #include "webrtc/media/base/videoframe.h" 21 #include "webrtc/media/base/videoframe.h"
22 22
23 namespace cricket { 23 namespace cricket {
24 24
25 struct CapturedFrame;
26
27 // TODO(nisse): This class will be deleted when the cricket::VideoFrame and 25 // TODO(nisse): This class will be deleted when the cricket::VideoFrame and
28 // webrtc::VideoFrame classes are merged. See 26 // webrtc::VideoFrame classes are merged. See
29 // https://bugs.chromium.org/p/webrtc/issues/detail?id=5682. Try to use only the 27 // https://bugs.chromium.org/p/webrtc/issues/detail?id=5682. Try to use only the
30 // preferred constructor, and the non-deprecated methods of the VideoFrame base 28 // preferred constructor, and the non-deprecated methods of the VideoFrame base
31 // class. 29 // class.
32 class WebRtcVideoFrame : public VideoFrame { 30 class WebRtcVideoFrame : public VideoFrame {
33 public: 31 public:
34 // TODO(nisse): Deprecated. Using the default constructor violates the 32 // TODO(nisse): Deprecated. Using the default constructor violates the
35 // reasonable assumption that video_frame_buffer() returns a valid buffer. 33 // reasonable assumption that video_frame_buffer() returns a valid buffer.
36 WebRtcVideoFrame(); 34 WebRtcVideoFrame();
(...skipping 11 matching lines...) Expand all
48 int64_t timestamp_us); 46 int64_t timestamp_us);
49 47
50 // TODO(nisse): Deprecated, delete as soon as all callers have switched to the 48 // TODO(nisse): Deprecated, delete as soon as all callers have switched to the
51 // above constructor with microsecond timestamp. 49 // above constructor with microsecond timestamp.
52 WebRtcVideoFrame(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer, 50 WebRtcVideoFrame(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer,
53 int64_t timestamp_ns, 51 int64_t timestamp_ns,
54 webrtc::VideoRotation rotation); 52 webrtc::VideoRotation rotation);
55 53
56 ~WebRtcVideoFrame(); 54 ~WebRtcVideoFrame();
57 55
56 // TODO(nisse): Init (and its helpers Reset and Validate) are used
57 // only by the LoadFrame function used in the VideoFrame unittests.
58 // Rewrite tests, and delete this function.
59
58 // Creates a frame from a raw sample with FourCC "format" and size "w" x "h". 60 // Creates a frame from a raw sample with FourCC "format" and size "w" x "h".
59 // "h" can be negative indicating a vertically flipped image. 61 // "h" can be negative indicating a vertically flipped image.
60 // "dh" is destination height if cropping is desired and is always positive. 62 // "dh" is destination height if cropping is desired and is always positive.
61 // Returns "true" if successful. 63 // Returns "true" if successful.
62 bool Init(uint32_t format, 64 bool Init(uint32_t format,
63 int w, 65 int w,
64 int h, 66 int h,
65 int dw, 67 int dw,
66 int dh, 68 int dh,
67 uint8_t* sample, 69 uint8_t* sample,
68 size_t sample_size, 70 size_t sample_size,
69 int64_t timestamp_ns, 71 int64_t timestamp_ns,
70 webrtc::VideoRotation rotation); 72 webrtc::VideoRotation rotation);
71 73
72 // TODO(nisse): We're moving to have all timestamps use the same
73 // time scale as rtc::TimeMicros. However, this method is used by
74 // WebRtcVideoFrameFactory::CreateAliasedFrame this code path
75 // currently does not conform to the new timestamp conventions and
76 // may use the camera's own clock instead. It's unclear if this
77 // should be fixed, or if instead all of the VideoFrameFactory
78 // abstraction should be eliminated.
79 bool Init(const CapturedFrame* frame, int dw, int dh, bool apply_rotation);
80
81 void InitToEmptyBuffer(int w, int h); 74 void InitToEmptyBuffer(int w, int h);
82 75
83 int width() const override; 76 int width() const override;
84 int height() const override; 77 int height() const override;
85 78
86 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& video_frame_buffer() 79 const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& video_frame_buffer()
87 const override; 80 const override;
88 81
89 uint32_t transport_frame_id() const override; 82 uint32_t transport_frame_id() const override;
90 83
(...skipping 30 matching lines...) Expand all
121 webrtc::VideoRotation rotation_; 114 webrtc::VideoRotation rotation_;
122 115
123 // This is mutable as the calculation is expensive but once calculated, it 116 // This is mutable as the calculation is expensive but once calculated, it
124 // remains const. 117 // remains const.
125 mutable std::unique_ptr<VideoFrame> rotated_frame_; 118 mutable std::unique_ptr<VideoFrame> rotated_frame_;
126 }; 119 };
127 120
128 } // namespace cricket 121 } // namespace cricket
129 122
130 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOFRAME_H_ 123 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOFRAME_H_
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.h ('k') | webrtc/media/engine/webrtcvideoframe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698