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

Side by Side Diff: media/base/mac/video_frame_mac_unittests.cc

Issue 1737253002: Handle Alpha channel in Canvas capture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: mcasas@ comments. Created 4 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
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/mac/video_frame_mac.h" 5 #include "media/base/mac/video_frame_mac.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 } 87 }
88 88
89 TEST(VideoFrameMac, CheckLifetime) { 89 TEST(VideoFrameMac, CheckLifetime) {
90 gfx::Size size(kWidth, kHeight); 90 gfx::Size size(kWidth, kHeight);
91 auto frame = VideoFrame::CreateFrame(PIXEL_FORMAT_I420, size, gfx::Rect(size), 91 auto frame = VideoFrame::CreateFrame(PIXEL_FORMAT_I420, size, gfx::Rect(size),
92 size, kTimestamp); 92 size, kTimestamp);
93 ASSERT_TRUE(frame.get()); 93 ASSERT_TRUE(frame.get());
94 94
95 int instances_destroyed = 0; 95 int instances_destroyed = 0;
96 auto wrapper_frame = VideoFrame::WrapVideoFrame( 96 auto wrapper_frame = VideoFrame::WrapVideoFrame(
97 frame, frame->visible_rect(), frame->natural_size()); 97 frame, frame->format(), frame->visible_rect(), frame->natural_size());
98 wrapper_frame->AddDestructionObserver( 98 wrapper_frame->AddDestructionObserver(
99 base::Bind(&Increment, &instances_destroyed)); 99 base::Bind(&Increment, &instances_destroyed));
100 ASSERT_TRUE(wrapper_frame.get()); 100 ASSERT_TRUE(wrapper_frame.get());
101 101
102 auto pb = WrapVideoFrameInCVPixelBuffer(*wrapper_frame); 102 auto pb = WrapVideoFrameInCVPixelBuffer(*wrapper_frame);
103 ASSERT_TRUE(pb.get()); 103 ASSERT_TRUE(pb.get());
104 104
105 wrapper_frame = nullptr; 105 wrapper_frame = nullptr;
106 EXPECT_EQ(0, instances_destroyed); 106 EXPECT_EQ(0, instances_destroyed);
107 pb.reset(); 107 pb.reset();
(...skipping 18 matching lines...) Expand all
126 ASSERT_TRUE(frame.get()); 126 ASSERT_TRUE(frame.get());
127 EXPECT_EQ(pb.get(), frame->cv_pixel_buffer()); 127 EXPECT_EQ(pb.get(), frame->cv_pixel_buffer());
128 EXPECT_EQ(format_pair.chrome, frame->format()); 128 EXPECT_EQ(format_pair.chrome, frame->format());
129 129
130 frame = nullptr; 130 frame = nullptr;
131 EXPECT_EQ(1, CFGetRetainCount(pb.get())); 131 EXPECT_EQ(1, CFGetRetainCount(pb.get()));
132 } 132 }
133 } 133 }
134 134
135 } // namespace media 135 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698