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/atomic_sequence_num.h" | 10 #include "base/atomic_sequence_num.h" |
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 if (frame->storage_type() == STORAGE_SHMEM) | 457 if (frame->storage_type() == STORAGE_SHMEM) |
458 wrapping_frame->AddSharedMemoryHandle(frame->shared_memory_handle_); | 458 wrapping_frame->AddSharedMemoryHandle(frame->shared_memory_handle_); |
459 | 459 |
460 return wrapping_frame; | 460 return wrapping_frame; |
461 } | 461 } |
462 | 462 |
463 // static | 463 // static |
464 scoped_refptr<VideoFrame> VideoFrame::CreateEOSFrame() { | 464 scoped_refptr<VideoFrame> VideoFrame::CreateEOSFrame() { |
465 scoped_refptr<VideoFrame> frame = | 465 scoped_refptr<VideoFrame> frame = |
466 new VideoFrame(PIXEL_FORMAT_UNKNOWN, STORAGE_UNKNOWN, gfx::Size(), | 466 new VideoFrame(PIXEL_FORMAT_UNKNOWN, STORAGE_UNKNOWN, gfx::Size(), |
467 gfx::Rect(), gfx::Size(), kNoTimestamp()); | 467 gfx::Rect(), gfx::Size(), kNoTimestamp); |
468 frame->metadata()->SetBoolean(VideoFrameMetadata::END_OF_STREAM, true); | 468 frame->metadata()->SetBoolean(VideoFrameMetadata::END_OF_STREAM, true); |
469 return frame; | 469 return frame; |
470 } | 470 } |
471 | 471 |
472 // static | 472 // static |
473 scoped_refptr<VideoFrame> VideoFrame::CreateColorFrame( | 473 scoped_refptr<VideoFrame> VideoFrame::CreateColorFrame( |
474 const gfx::Size& size, | 474 const gfx::Size& size, |
475 uint8_t y, | 475 uint8_t y, |
476 uint8_t u, | 476 uint8_t u, |
477 uint8_t v, | 477 uint8_t v, |
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 if (zero_initialize_memory) | 1130 if (zero_initialize_memory) |
1131 memset(data, 0, data_size); | 1131 memset(data, 0, data_size); |
1132 | 1132 |
1133 for (size_t plane = 0; plane < NumPlanes(format_); ++plane) | 1133 for (size_t plane = 0; plane < NumPlanes(format_); ++plane) |
1134 data_[plane] = data + offset[plane]; | 1134 data_[plane] = data + offset[plane]; |
1135 | 1135 |
1136 AddDestructionObserver(base::Bind(&base::AlignedFree, data)); | 1136 AddDestructionObserver(base::Bind(&base::AlignedFree, data)); |
1137 } | 1137 } |
1138 | 1138 |
1139 } // namespace media | 1139 } // namespace media |
OLD | NEW |