| Index: media/base/video_frame.cc
|
| diff --git a/media/base/video_frame.cc b/media/base/video_frame.cc
|
| index cf959021261b1b6c880fe4cd01e97e63880df318..66bbe38d5f5492bc55545252b5c6ad44f4637ae9 100644
|
| --- a/media/base/video_frame.cc
|
| +++ b/media/base/video_frame.cc
|
| @@ -7,6 +7,7 @@
|
| #include <algorithm>
|
| #include <climits>
|
|
|
| +#include "base/atomic_sequence_num.h"
|
| #include "base/bind.h"
|
| #include "base/callback_helpers.h"
|
| #include "base/logging.h"
|
| @@ -22,6 +23,9 @@
|
|
|
| namespace media {
|
|
|
| +// Static POD class for generating unique identifiers for each VideoFrame.
|
| +static base::StaticAtomicSequenceNumber g_unique_id_generator;
|
| +
|
| static bool IsPowerOfTwo(size_t x) {
|
| return x != 0 && (x & (x - 1)) == 0;
|
| }
|
| @@ -845,7 +849,8 @@ VideoFrame::VideoFrame(VideoPixelFormat format,
|
| natural_size_(natural_size),
|
| shared_memory_handle_(base::SharedMemory::NULLHandle()),
|
| shared_memory_offset_(0),
|
| - timestamp_(timestamp) {
|
| + timestamp_(timestamp),
|
| + unique_id_(g_unique_id_generator.GetNext()) {
|
| DCHECK(IsValidConfig(format_, storage_type, coded_size_, visible_rect_,
|
| natural_size_));
|
| memset(&mailbox_holders_, 0, sizeof(mailbox_holders_));
|
|
|