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

Unified Diff: media/base/video_frame.cc

Issue 2007463005: Paint first frame faster, don't crash with no frames during EOS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Whoops, fix comment. Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/video_frame.h ('k') | media/renderers/video_renderer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_));
« no previous file with comments | « media/base/video_frame.h ('k') | media/renderers/video_renderer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698