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

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

Issue 2411953002: Reland of Make cricket::VideoFrame inherit webrtc::VideoFrame. (Closed)
Patch Set: Fix for windows build. Created 4 years, 2 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/base/videocapturer.h ('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
11 // TODO(nisse): Deprecated, replace cricket::VideoFrame with
12 // webrtc::VideoFrame everywhere, then delete this file. See
13 // https://bugs.chromium.org/p/webrtc/issues/detail?id=5682.
14
11 #ifndef WEBRTC_MEDIA_BASE_VIDEOFRAME_H_ 15 #ifndef WEBRTC_MEDIA_BASE_VIDEOFRAME_H_
12 #define WEBRTC_MEDIA_BASE_VIDEOFRAME_H_ 16 #define WEBRTC_MEDIA_BASE_VIDEOFRAME_H_
13 17
14 #include "webrtc/base/basictypes.h" 18 // TODO(nisse): Some applications expect that including this file
15 #include "webrtc/base/stream.h" 19 // implies an include of logging.h. So keep for compatibility, until
16 #include "webrtc/common_video/include/video_frame_buffer.h" 20 // this file can be deleted.
17 #include "webrtc/common_video/rotation.h" 21 #include "webrtc/base/logging.h"
22
23 #include "webrtc/video_frame.h"
24
25 // TODO(nisse): Similarly, some applications expect that including this file
26 // implies a forward declaration of rtc::Thread.
27 namespace rtc {
28 class Thread;
29 } // namespace rtc
18 30
19 namespace cricket { 31 namespace cricket {
20 32
21 // Represents a YUV420 (a.k.a. I420) video frame. 33 using VideoFrame = webrtc::VideoFrame;
22
23 // TODO(nisse): This class duplicates webrtc::VideoFrame. There's
24 // ongoing work to merge the classes. See
25 // https://bugs.chromium.org/p/webrtc/issues/detail?id=5682.
26 class VideoFrame {
27 public:
28 VideoFrame() {}
29 virtual ~VideoFrame() {}
30
31 // Basic accessors.
32 // Note this is the width and height without rotation applied.
33 virtual int width() const = 0;
34 virtual int height() const = 0;
35
36 // Returns the underlying video frame buffer. This function is ok to call
37 // multiple times, but the returned object will refer to the same memory.
38 virtual const rtc::scoped_refptr<webrtc::VideoFrameBuffer>&
39 video_frame_buffer() const = 0;
40
41 // Frame ID. Normally RTP timestamp when the frame was received using RTP.
42 virtual uint32_t transport_frame_id() const = 0;
43
44 // System monotonic clock, same timebase as rtc::TimeMicros().
45 virtual int64_t timestamp_us() const = 0;
46 virtual void set_timestamp_us(int64_t time_us) = 0;
47
48 // Indicates the rotation angle in degrees.
49 virtual webrtc::VideoRotation rotation() const = 0;
50
51 // Tests if sample is valid. Returns true if valid.
52
53 // TODO(nisse): Deprecated. Should be deleted in the cricket::VideoFrame and
54 // webrtc::VideoFrame merge. Validation of sample_size possibly moved to
55 // libyuv::ConvertToI420. As an initial step, demote this method to protected
56 // status. Used only by WebRtcVideoFrame::Reset.
57 static bool Validate(uint32_t fourcc,
58 int w,
59 int h,
60 const uint8_t* sample,
61 size_t sample_size);
62 };
63 34
64 } // namespace cricket 35 } // namespace cricket
65 36
66 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_H_ 37 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_H_
OLDNEW
« no previous file with comments | « webrtc/media/base/videocapturer.h ('k') | webrtc/media/base/videoframe.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698