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

Side by Side Diff: media/base/video_frame.cc

Issue 12255032: Implement "hole" video frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 9 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 | « media/base/video_frame.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/base/video_frame.h" 5 #include "media/base/video_frame.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 } 128 }
129 129
130 // static 130 // static
131 scoped_refptr<VideoFrame> VideoFrame::CreateBlackFrame(const gfx::Size& size) { 131 scoped_refptr<VideoFrame> VideoFrame::CreateBlackFrame(const gfx::Size& size) {
132 const uint8 kBlackY = 0x00; 132 const uint8 kBlackY = 0x00;
133 const uint8 kBlackUV = 0x80; 133 const uint8 kBlackUV = 0x80;
134 const base::TimeDelta kZero; 134 const base::TimeDelta kZero;
135 return CreateColorFrame(size, kBlackY, kBlackUV, kBlackUV, kZero); 135 return CreateColorFrame(size, kBlackY, kBlackUV, kBlackUV, kZero);
136 } 136 }
137 137
138 #if defined(GOOGLE_TV)
139 // static
140 scoped_refptr<VideoFrame> VideoFrame::CreateHoleFrame(
141 const gfx::Size& size) {
142 DCHECK(IsValidConfig(VideoFrame::HOLE, size, gfx::Rect(size), size));
143 scoped_refptr<VideoFrame> frame(new VideoFrame(
144 VideoFrame::HOLE, size, gfx::Rect(size), size, base::TimeDelta()));
145 return frame;
146 }
147 #endif
148
138 static inline size_t RoundUp(size_t value, size_t alignment) { 149 static inline size_t RoundUp(size_t value, size_t alignment) {
139 // Check that |alignment| is a power of 2. 150 // Check that |alignment| is a power of 2.
140 DCHECK((alignment + (alignment - 1)) == (alignment | (alignment - 1))); 151 DCHECK((alignment + (alignment - 1)) == (alignment | (alignment - 1)));
141 return ((value + (alignment - 1)) & ~(alignment-1)); 152 return ((value + (alignment - 1)) & ~(alignment-1));
142 } 153 }
143 154
144 // Release data allocated by AllocateRGB() or AllocateYUV(). 155 // Release data allocated by AllocateRGB() or AllocateYUV().
145 static void ReleaseData(uint8* data) { 156 static void ReleaseData(uint8* data) {
146 DCHECK(data); 157 DCHECK(data);
147 base::AlignedFree(data); 158 base::AlignedFree(data);
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 break; 333 break;
323 for (int row = 0; row < rows(plane); ++row) { 334 for (int row = 0; row < rows(plane); ++row) {
324 base::MD5Update(context, base::StringPiece( 335 base::MD5Update(context, base::StringPiece(
325 reinterpret_cast<char*>(data(plane) + stride(plane) * row), 336 reinterpret_cast<char*>(data(plane) + stride(plane) * row),
326 row_bytes(plane))); 337 row_bytes(plane)));
327 } 338 }
328 } 339 }
329 } 340 }
330 341
331 } // namespace media 342 } // namespace media
OLDNEW
« no previous file with comments | « media/base/video_frame.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698