| Index: media/base/video_frame.h
|
| diff --git a/media/base/video_frame.h b/media/base/video_frame.h
|
| index 0ff6f9856ead06c2eeaa6380549e3ac05b116156..991c6f098dbb7b9d13af5aaafc4d9dab7b97019a 100644
|
| --- a/media/base/video_frame.h
|
| +++ b/media/base/video_frame.h
|
| @@ -5,9 +5,12 @@
|
| #ifndef MEDIA_BASE_VIDEO_FRAME_H_
|
| #define MEDIA_BASE_VIDEO_FRAME_H_
|
|
|
| +#include <vector>
|
| +
|
| #include "base/callback.h"
|
| #include "base/md5.h"
|
| #include "base/memory/shared_memory.h"
|
| +#include "base/synchronization/lock.h"
|
| #include "media/base/buffers.h"
|
| #include "ui/gfx/rect.h"
|
| #include "ui/gfx/size.h"
|
| @@ -81,11 +84,13 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
|
|
|
| // CB to write pixels from the texture backing this frame into the
|
| // |const SkBitmap&| parameter.
|
| - typedef base::Callback<void(const SkBitmap&)> ReadPixelsCB;
|
| + typedef base::Callback<
|
| + void(const scoped_refptr<VideoFrame>&, const SkBitmap&)> ReadPixelsCB;
|
|
|
| // CB to be called on the mailbox backing this frame when the frame is
|
| // destroyed.
|
| - typedef base::Callback<void(scoped_ptr<gpu::MailboxHolder>)> ReleaseMailboxCB;
|
| + typedef base::Callback<void(scoped_ptr<gpu::MailboxHolder>,
|
| + const std::vector<uint32>&)> ReleaseMailboxCB;
|
|
|
| // Wraps a native texture of the given parameters with a VideoFrame. The
|
| // backing of the VideoFrame is held in the mailbox held by |mailbox_holder|,
|
| @@ -222,6 +227,13 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
|
| timestamp_ = timestamp;
|
| }
|
|
|
| + // Append |sync_point| into |release_sync_points_| which will be passed to
|
| + // the video decoder when |mailbox_holder_release_cb_| is called so that
|
| + // the video decoder waits for the sync points before reusing the mailbox.
|
| + // Multiple clients can append multiple sync points in one frame.
|
| + // This method is thread safe. Both blink and compositor threads can call it.
|
| + void AppendReleaseSyncPoint(uint32 sync_point);
|
| +
|
| // Used to keep a running hash of seen frames. Expects an initialized MD5
|
| // context. Calls MD5Update with the context and the contents of the frame.
|
| void HashFrameForTesting(base::MD5Context* context);
|
| @@ -265,6 +277,9 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
|
|
|
| // Native texture mailbox, if this is a NATIVE_TEXTURE frame.
|
| scoped_ptr<gpu::MailboxHolder> mailbox_holder_;
|
| +#ifndef NDEBUG
|
| + uint32 debug_initial_sync_point_;
|
| +#endif
|
| ReleaseMailboxCB mailbox_holder_release_cb_;
|
| ReadPixelsCB read_pixels_cb_;
|
|
|
| @@ -275,6 +290,9 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
|
|
|
| base::TimeDelta timestamp_;
|
|
|
| + base::Lock release_sync_point_lock_;
|
| + std::vector<uint32> release_sync_points_;
|
| +
|
| const bool end_of_stream_;
|
|
|
| DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame);
|
|
|