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

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

Issue 1134643002: Add distinction between RGB and RGBA native texture video frames and resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit test breakage from bad merge Created 5 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 unified diff | Download patch
« no previous file with comments | « media/base/video_frame.cc ('k') | media/filters/gpu_video_decoder.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 // 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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/memory/aligned_memory.h" 10 #include "base/memory/aligned_memory.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 uint32 called_sync_point = 1; 251 uint32 called_sync_point = 1;
252 252
253 { 253 {
254 scoped_refptr<VideoFrame> frame = VideoFrame::WrapNativeTexture( 254 scoped_refptr<VideoFrame> frame = VideoFrame::WrapNativeTexture(
255 gpu::MailboxHolder(gpu::Mailbox(), 5, 0 /* sync_point */), 255 gpu::MailboxHolder(gpu::Mailbox(), 5, 0 /* sync_point */),
256 base::Bind(&TextureCallback, &called_sync_point), 256 base::Bind(&TextureCallback, &called_sync_point),
257 gfx::Size(10, 10), // coded_size 257 gfx::Size(10, 10), // coded_size
258 gfx::Rect(10, 10), // visible_rect 258 gfx::Rect(10, 10), // visible_rect
259 gfx::Size(10, 10), // natural_size 259 gfx::Size(10, 10), // natural_size
260 base::TimeDelta(), // timestamp 260 base::TimeDelta(), // timestamp
261 false); // allow_overlay 261 false, // allow_overlay
262 true); // has_alpha
262 EXPECT_EQ(VideoFrame::TEXTURE_RGBA, frame->texture_format()); 263 EXPECT_EQ(VideoFrame::TEXTURE_RGBA, frame->texture_format());
263 } 264 }
264 // Nobody set a sync point to |frame|, so |frame| set |called_sync_point| to 0 265 // Nobody set a sync point to |frame|, so |frame| set |called_sync_point| to 0
265 // as default value. 266 // as default value.
266 EXPECT_EQ(0u, called_sync_point); 267 EXPECT_EQ(0u, called_sync_point);
267 } 268 }
268 269
269 namespace { 270 namespace {
270 271
271 class SyncPointClientImpl : public VideoFrame::SyncPointClient { 272 class SyncPointClientImpl : public VideoFrame::SyncPointClient {
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 412
412 for (int i = 0; i < VideoFrameMetadata::NUM_KEYS; ++i) { 413 for (int i = 0; i < VideoFrameMetadata::NUM_KEYS; ++i) {
413 const VideoFrameMetadata::Key key = static_cast<VideoFrameMetadata::Key>(i); 414 const VideoFrameMetadata::Key key = static_cast<VideoFrameMetadata::Key>(i);
414 int value = -1; 415 int value = -1;
415 EXPECT_TRUE(result.GetInteger(key, &value)); 416 EXPECT_TRUE(result.GetInteger(key, &value));
416 EXPECT_EQ(i, value); 417 EXPECT_EQ(i, value);
417 } 418 }
418 } 419 }
419 420
420 } // namespace media 421 } // namespace media
OLDNEW
« no previous file with comments | « media/base/video_frame.cc ('k') | media/filters/gpu_video_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698