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

Side by Side Diff: media/base/video_frame.h

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, 6 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 unified diff | Download patch
« no previous file with comments | « media/base/null_video_sink_unittest.cc ('k') | media/base/video_frame.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef MEDIA_BASE_VIDEO_FRAME_H_ 5 #ifndef MEDIA_BASE_VIDEO_FRAME_H_
6 #define MEDIA_BASE_VIDEO_FRAME_H_ 6 #define MEDIA_BASE_VIDEO_FRAME_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 413
414 // It uses |client| to insert a new sync point and potentially waits on a 414 // It uses |client| to insert a new sync point and potentially waits on a
415 // older sync point. The final sync point will be used to release this 415 // older sync point. The final sync point will be used to release this
416 // VideoFrame. 416 // VideoFrame.
417 // This method is thread safe. Both blink and compositor threads can call it. 417 // This method is thread safe. Both blink and compositor threads can call it.
418 void UpdateReleaseSyncToken(SyncTokenClient* client); 418 void UpdateReleaseSyncToken(SyncTokenClient* client);
419 419
420 // Returns a human-readable string describing |*this|. 420 // Returns a human-readable string describing |*this|.
421 std::string AsHumanReadableString(); 421 std::string AsHumanReadableString();
422 422
423 // Unique identifier for this video frame; generated at construction time and
424 // guaranteed to be unique within a single process.
425 int unique_id() const { return unique_id_; }
426
423 protected: 427 protected:
424 friend class base::RefCountedThreadSafe<VideoFrame>; 428 friend class base::RefCountedThreadSafe<VideoFrame>;
425 429
426 // Clients must use the static factory/wrapping methods to create a new frame. 430 // Clients must use the static factory/wrapping methods to create a new frame.
427 // Derived classes should create their own factory/wrapping methods, and use 431 // Derived classes should create their own factory/wrapping methods, and use
428 // this constructor to do basic initialization. 432 // this constructor to do basic initialization.
429 VideoFrame(VideoPixelFormat format, 433 VideoFrame(VideoPixelFormat format,
430 StorageType storage_type, 434 StorageType storage_type,
431 const gfx::Size& coded_size, 435 const gfx::Size& coded_size,
432 const gfx::Rect& visible_rect, 436 const gfx::Rect& visible_rect,
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
562 566
563 std::vector<base::Closure> done_callbacks_; 567 std::vector<base::Closure> done_callbacks_;
564 568
565 base::TimeDelta timestamp_; 569 base::TimeDelta timestamp_;
566 570
567 base::Lock release_sync_token_lock_; 571 base::Lock release_sync_token_lock_;
568 gpu::SyncToken release_sync_token_; 572 gpu::SyncToken release_sync_token_;
569 573
570 VideoFrameMetadata metadata_; 574 VideoFrameMetadata metadata_;
571 575
576 // Generated at construction time.
577 const int unique_id_;
578
572 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); 579 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame);
573 }; 580 };
574 581
575 } // namespace media 582 } // namespace media
576 583
577 #endif // MEDIA_BASE_VIDEO_FRAME_H_ 584 #endif // MEDIA_BASE_VIDEO_FRAME_H_
OLDNEW
« no previous file with comments | « media/base/null_video_sink_unittest.cc ('k') | media/base/video_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698