OLD | NEW |
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 #include <climits> | 8 #include <climits> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
11 #include "base/callback_helpers.h" | 11 #include "base/callback_helpers.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/macros.h" |
13 #include "base/memory/aligned_memory.h" | 14 #include "base/memory/aligned_memory.h" |
14 #include "base/strings/string_piece.h" | 15 #include "base/strings/string_piece.h" |
15 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
| 17 #include "build/build_config.h" |
16 #include "media/base/limits.h" | 18 #include "media/base/limits.h" |
17 #include "media/base/timestamp_constants.h" | 19 #include "media/base/timestamp_constants.h" |
18 #include "media/base/video_util.h" | 20 #include "media/base/video_util.h" |
19 #include "ui/gfx/geometry/point.h" | 21 #include "ui/gfx/geometry/point.h" |
20 | 22 |
21 namespace media { | 23 namespace media { |
22 | 24 |
23 static bool IsPowerOfTwo(size_t x) { | 25 static bool IsPowerOfTwo(size_t x) { |
24 return x != 0 && (x & (x - 1)) == 0; | 26 return x != 0 && (x & (x - 1)) == 0; |
25 } | 27 } |
(...skipping 987 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1013 if (zero_initialize_memory) | 1015 if (zero_initialize_memory) |
1014 memset(data, 0, data_size); | 1016 memset(data, 0, data_size); |
1015 | 1017 |
1016 for (size_t plane = 0; plane < NumPlanes(format_); ++plane) | 1018 for (size_t plane = 0; plane < NumPlanes(format_); ++plane) |
1017 data_[plane] = data + offset[plane]; | 1019 data_[plane] = data + offset[plane]; |
1018 | 1020 |
1019 AddDestructionObserver(base::Bind(&base::AlignedFree, data)); | 1021 AddDestructionObserver(base::Bind(&base::AlignedFree, data)); |
1020 } | 1022 } |
1021 | 1023 |
1022 } // namespace media | 1024 } // namespace media |
OLD | NEW |