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