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

Unified Diff: media/base/video_frame_impl.cc

Issue 113611: Handle end of stream for media... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: media/base/video_frame_impl.cc
===================================================================
--- media/base/video_frame_impl.cc (revision 17376)
+++ media/base/video_frame_impl.cc (working copy)
@@ -47,6 +47,11 @@
*frame_out = alloc_worked ? frame : NULL;
}
+// static
+void VideoFrameImpl::CreateEmptyFrame(scoped_refptr<VideoFrame>* frame_out) {
+ *frame_out = new VideoFrameImpl(VideoSurface::EMPTY, 0, 0);
+}
+
static inline size_t RoundUp(size_t value, size_t alignment) {
// Check that |alignment| is a power of 2.
DCHECK((alignment + (alignment - 1)) == (alignment | (alignment - 1)));
@@ -122,6 +127,7 @@
bool VideoFrameImpl::Lock(VideoSurface* surface) {
DCHECK(!locked_);
+ DCHECK_NE(surface_.format, VideoSurface::EMPTY);
if (locked_) {
memset(surface, 0, sizeof(*surface));
return false;
@@ -134,7 +140,12 @@
void VideoFrameImpl::Unlock() {
DCHECK(locked_);
+ DCHECK_NE(surface_.format, VideoSurface::EMPTY);
locked_ = false;
}
+bool VideoFrameImpl::IsEndOfStream() const {
+ return surface_.format == VideoSurface::EMPTY;
+}
+
} // namespace media

Powered by Google App Engine
This is Rietveld 408576698