webrtc_m130/webrtc/media/base/videoframe.h
nisse 306d52b0fd Reland of Delete cricket::VideoFrame::GetTimeStamp. (patchset #1 id:1 of https://codereview.webrtc.org/2315703002/ )
Reason for revert:
Chrome has now been updated (cl https://codereview.chromium.org/2317673002/).

Original issue's description:
> Revert of Delete cricket::VideoFrame::GetTimeStamp. (patchset #2 id:150001 of https://codereview.webrtc.org/2310043002/ )
>
> Reason for revert:
> Broke Chrome fyi bots. See, e.g.,
>
> https://build.chromium.org/p/chromium.webrtc.fyi/builders/Win%20Builder/builds/6730/steps/compile/logs/stdio
>
> Use of GetTimeStamp must be eliminated in Chrome before relanding.
>
> Original issue's description:
> > Reland of Delete cricket::VideoFrame::GetTimeStamp. (patchset #1 id:1 of https://codereview.webrtc.org/2306953002/ )
> >
> > Reason for revert:
> > Will reland after downstream projects are updated.
> >
> > Original issue's description:
> > > Revert of Delete cricket::VideoFrame::GetTimeStamp. (patchset #1 id:1 of https://codereview.webrtc.org/2305623002/ )
> > >
> > > Reason for revert:
> > > Broke downstream project.
> > >
> > > Original issue's description:
> > > > Delete cricket::VideoFrame::GetTimeStamp.
> > > >
> > > > TBR=tkchin@webrtc.org  # Trivial change to VideoRendererAdapter
> > > > BUG=webrtc:5682
> > > >
> > > > Committed: https://crrev.com/fd6c99e43137d01fa6c120f7160f7c2999d1d8a3
> > > > Cr-Commit-Position: refs/heads/master@{#14037}
> > >
> > > TBR=perkj@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:5682
> > >
> > > Committed: https://crrev.com/bca69e87de5df290f728833a4b3d8af3ae5d88e6
> > > Cr-Commit-Position: refs/heads/master@{#14038}
> >
> > TBR=perkj@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:5682
> >
> > Committed: https://crrev.com/fa1ba19c5c7c57c8d16fae1a5da51877770fd53e
> > Cr-Commit-Position: refs/heads/master@{#14089}
>
> TBR=perkj@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:5682
>
> Committed: https://crrev.com/92b2e0852fcbe7765926755ccee884db965b6231
> Cr-Commit-Position: refs/heads/master@{#14090}

TBR=perkj@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:5682

Review-Url: https://codereview.webrtc.org/2316493003
Cr-Commit-Position: refs/heads/master@{#14093}
2016-09-06 14:52:47 +00:00

67 lines
2.3 KiB
C++

/*
* Copyright (c) 2004 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_MEDIA_BASE_VIDEOFRAME_H_
#define WEBRTC_MEDIA_BASE_VIDEOFRAME_H_
#include "webrtc/base/basictypes.h"
#include "webrtc/base/stream.h"
#include "webrtc/common_video/include/video_frame_buffer.h"
#include "webrtc/common_video/rotation.h"
namespace cricket {
// Represents a YUV420 (a.k.a. I420) video frame.
// TODO(nisse): This class duplicates webrtc::VideoFrame. There's
// ongoing work to merge the classes. See
// https://bugs.chromium.org/p/webrtc/issues/detail?id=5682.
class VideoFrame {
public:
VideoFrame() {}
virtual ~VideoFrame() {}
// Basic accessors.
// Note this is the width and height without rotation applied.
virtual int width() const = 0;
virtual int height() const = 0;
// Returns the underlying video frame buffer. This function is ok to call
// multiple times, but the returned object will refer to the same memory.
virtual const rtc::scoped_refptr<webrtc::VideoFrameBuffer>&
video_frame_buffer() const = 0;
// Frame ID. Normally RTP timestamp when the frame was received using RTP.
virtual uint32_t transport_frame_id() const = 0;
// System monotonic clock, same timebase as rtc::TimeMicros().
virtual int64_t timestamp_us() const = 0;
virtual void set_timestamp_us(int64_t time_us) = 0;
// Indicates the rotation angle in degrees.
virtual webrtc::VideoRotation rotation() const = 0;
// Tests if sample is valid. Returns true if valid.
// TODO(nisse): Deprecated. Should be deleted in the cricket::VideoFrame and
// webrtc::VideoFrame merge. Validation of sample_size possibly moved to
// libyuv::ConvertToI420. As an initial step, demote this method to protected
// status. Used only by WebRtcVideoFrame::Reset.
static bool Validate(uint32_t fourcc,
int w,
int h,
const uint8_t* sample,
size_t sample_size);
};
} // namespace cricket
#endif // WEBRTC_MEDIA_BASE_VIDEOFRAME_H_