OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> |
| 6 #include <stdint.h> |
| 7 |
5 #include "media/base/video_frame_pool.h" | 8 #include "media/base/video_frame_pool.h" |
6 #include "testing/gmock/include/gmock/gmock.h" | 9 #include "testing/gmock/include/gmock/gmock.h" |
7 | 10 |
8 namespace media { | 11 namespace media { |
9 | 12 |
10 class VideoFramePoolTest : public ::testing::Test { | 13 class VideoFramePoolTest : public ::testing::Test { |
11 public: | 14 public: |
12 VideoFramePoolTest() : pool_(new VideoFramePool()) {} | 15 VideoFramePoolTest() : pool_(new VideoFramePool()) {} |
13 | 16 |
14 scoped_refptr<VideoFrame> CreateFrame(VideoPixelFormat format, | 17 scoped_refptr<VideoFrame> CreateFrame(VideoPixelFormat format, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // Destroy the pool. | 85 // Destroy the pool. |
83 pool_.reset(); | 86 pool_.reset(); |
84 | 87 |
85 // Write to the Y plane. The memory tools should detect a | 88 // Write to the Y plane. The memory tools should detect a |
86 // use-after-free if the storage was actually removed by pool destruction. | 89 // use-after-free if the storage was actually removed by pool destruction. |
87 memset(frame->data(VideoFrame::kYPlane), 0xff, | 90 memset(frame->data(VideoFrame::kYPlane), 0xff, |
88 frame->rows(VideoFrame::kYPlane) * frame->stride(VideoFrame::kYPlane)); | 91 frame->rows(VideoFrame::kYPlane) * frame->stride(VideoFrame::kYPlane)); |
89 } | 92 } |
90 | 93 |
91 } // namespace media | 94 } // namespace media |
OLD | NEW |