Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 // Deprecated, replace by cricket::VideoFrame by webrtc::VideoFrame | |
|
perkj_webrtc
2016/10/04 15:36:23
replace ....
pthatcher1
2016/10/04 15:41:54
"replace by X by Y" => "replace X with Y"
Probabl
nisse-webrtc
2016/10/06 07:49:44
Done.
| |
| 12 // 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 #include "webrtc/video_frame.h" |
| 15 #include "webrtc/base/stream.h" | |
| 16 #include "webrtc/common_video/include/video_frame_buffer.h" | |
| 17 #include "webrtc/common_video/rotation.h" | |
| 18 | 19 |
| 19 namespace cricket { | 20 namespace cricket { |
| 20 | 21 |
| 21 // Represents a YUV420 (a.k.a. I420) video frame. | 22 class VideoFrame : public webrtc::VideoFrame { |
| 22 | 23 protected: |
| 23 // TODO(nisse): This class duplicates webrtc::VideoFrame. There's | 24 VideoFrame() : webrtc::VideoFrame() {} |
| 24 // ongoing work to merge the classes. See | 25 VideoFrame(const rtc::scoped_refptr<webrtc::VideoFrameBuffer>& buffer, |
| 25 // https://bugs.chromium.org/p/webrtc/issues/detail?id=5682. | 26 webrtc::VideoRotation rotation, |
|
perkj_webrtc
2016/10/04 15:36:23
git cl format ?
nisse-webrtc
2016/10/06 07:49:44
Done.
| |
| 26 class VideoFrame { | 27 int64_t timestamp_us) |
| 27 public: | 28 : webrtc::VideoFrame(buffer, rotation, timestamp_us) {} |
| 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 }; | 29 }; |
| 63 | 30 |
| 64 } // namespace cricket | 31 } // namespace cricket |
| 65 | 32 |
| 66 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_H_ | 33 #endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_H_ |
| OLD | NEW |