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 #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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
369 void set_timestamp(base::TimeDelta timestamp) { | 369 void set_timestamp(base::TimeDelta timestamp) { |
370 timestamp_ = timestamp; | 370 timestamp_ = timestamp; |
371 } | 371 } |
372 | 372 |
373 // It uses |client| to insert a new sync point and potentially waits on a | 373 // It uses |client| to insert a new sync point and potentially waits on a |
374 // older sync point. The final sync point will be used to release this | 374 // older sync point. The final sync point will be used to release this |
375 // VideoFrame. | 375 // VideoFrame. |
376 // This method is thread safe. Both blink and compositor threads can call it. | 376 // This method is thread safe. Both blink and compositor threads can call it. |
377 void UpdateReleaseSyncPoint(SyncPointClient* client); | 377 void UpdateReleaseSyncPoint(SyncPointClient* client); |
378 | 378 |
379 // Record the ideal time instant to render this frame. | |
DaleCurtis
2015/07/30 05:55:24
VideoFrame is already in a crufty situation so we
qiangchen
2015/07/30 17:40:26
I'll consider using VideoFrameMetadata. Should I a
DaleCurtis
2015/07/30 17:52:33
Before you go the metadata approach, I would see i
| |
380 base::TimeTicks render_time(); | |
381 void set_render_time(base::TimeTicks render_time); | |
382 | |
379 private: | 383 private: |
380 friend class base::RefCountedThreadSafe<VideoFrame>; | 384 friend class base::RefCountedThreadSafe<VideoFrame>; |
381 | 385 |
382 static scoped_refptr<VideoFrame> WrapExternalStorage( | 386 static scoped_refptr<VideoFrame> WrapExternalStorage( |
383 VideoPixelFormat format, | 387 VideoPixelFormat format, |
384 StorageType storage_type, | 388 StorageType storage_type, |
385 const gfx::Size& coded_size, | 389 const gfx::Size& coded_size, |
386 const gfx::Rect& visible_rect, | 390 const gfx::Rect& visible_rect, |
387 const gfx::Size& natural_size, | 391 const gfx::Size& natural_size, |
388 uint8* data, | 392 uint8* data, |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
471 | 475 |
472 std::vector<base::Closure> done_callbacks_; | 476 std::vector<base::Closure> done_callbacks_; |
473 | 477 |
474 base::TimeDelta timestamp_; | 478 base::TimeDelta timestamp_; |
475 | 479 |
476 base::Lock release_sync_point_lock_; | 480 base::Lock release_sync_point_lock_; |
477 uint32 release_sync_point_; | 481 uint32 release_sync_point_; |
478 | 482 |
479 VideoFrameMetadata metadata_; | 483 VideoFrameMetadata metadata_; |
480 | 484 |
485 base::TimeTicks render_time_; | |
486 | |
481 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); | 487 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); |
482 }; | 488 }; |
483 | 489 |
484 } // namespace media | 490 } // namespace media |
485 | 491 |
486 #endif // MEDIA_BASE_VIDEO_FRAME_H_ | 492 #endif // MEDIA_BASE_VIDEO_FRAME_H_ |
OLD | NEW |