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 <string> |
8 #include <vector> | 9 #include <vector> |
9 | 10 |
10 #include "base/callback.h" | 11 #include "base/callback.h" |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/md5.h" | 13 #include "base/md5.h" |
13 #include "base/memory/shared_memory.h" | 14 #include "base/memory/shared_memory.h" |
14 #include "base/synchronization/lock.h" | 15 #include "base/synchronization/lock.h" |
15 #include "gpu/command_buffer/common/mailbox_holder.h" | 16 #include "gpu/command_buffer/common/mailbox_holder.h" |
16 #include "media/base/video_frame_metadata.h" | 17 #include "media/base/video_frame_metadata.h" |
17 #include "media/base/video_types.h" | 18 #include "media/base/video_types.h" |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 void set_timestamp(base::TimeDelta timestamp) { | 398 void set_timestamp(base::TimeDelta timestamp) { |
398 timestamp_ = timestamp; | 399 timestamp_ = timestamp; |
399 } | 400 } |
400 | 401 |
401 // It uses |client| to insert a new sync point and potentially waits on a | 402 // It uses |client| to insert a new sync point and potentially waits on a |
402 // older sync point. The final sync point will be used to release this | 403 // older sync point. The final sync point will be used to release this |
403 // VideoFrame. | 404 // VideoFrame. |
404 // This method is thread safe. Both blink and compositor threads can call it. | 405 // This method is thread safe. Both blink and compositor threads can call it. |
405 void UpdateReleaseSyncToken(SyncTokenClient* client); | 406 void UpdateReleaseSyncToken(SyncTokenClient* client); |
406 | 407 |
| 408 // Returns a human-readable string describing |*this|. |
| 409 std::string AsHumanReadableString(); |
| 410 |
407 private: | 411 private: |
408 friend class base::RefCountedThreadSafe<VideoFrame>; | 412 friend class base::RefCountedThreadSafe<VideoFrame>; |
409 | 413 |
410 static scoped_refptr<VideoFrame> WrapExternalStorage( | 414 static scoped_refptr<VideoFrame> WrapExternalStorage( |
411 VideoPixelFormat format, | 415 VideoPixelFormat format, |
412 StorageType storage_type, | 416 StorageType storage_type, |
413 const gfx::Size& coded_size, | 417 const gfx::Size& coded_size, |
414 const gfx::Rect& visible_rect, | 418 const gfx::Rect& visible_rect, |
415 const gfx::Size& natural_size, | 419 const gfx::Size& natural_size, |
416 uint8* data, | 420 uint8* data, |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 gpu::SyncToken release_sync_token_; | 520 gpu::SyncToken release_sync_token_; |
517 | 521 |
518 VideoFrameMetadata metadata_; | 522 VideoFrameMetadata metadata_; |
519 | 523 |
520 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); | 524 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); |
521 }; | 525 }; |
522 | 526 |
523 } // namespace media | 527 } // namespace media |
524 | 528 |
525 #endif // MEDIA_BASE_VIDEO_FRAME_H_ | 529 #endif // MEDIA_BASE_VIDEO_FRAME_H_ |
OLD | NEW |