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

Unified Diff: media/base/video_frame.h

Issue 312803002: Android media: VideoFrame should not store so many sync points. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix ios build Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/webmediaplayer_impl.cc ('k') | media/base/video_frame.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_frame.h
diff --git a/media/base/video_frame.h b/media/base/video_frame.h
index 2445dd1b400d20166232e095caf3ff291e52d0b3..5939c45211e16b939c69c96be2242968144c8385 100644
--- a/media/base/video_frame.h
+++ b/media/base/video_frame.h
@@ -86,7 +86,7 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
// CB to be called on the mailbox backing this frame when the frame is
// destroyed.
- typedef base::Callback<void(const std::vector<uint32>&)> ReleaseMailboxCB;
+ typedef base::Callback<void(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|,
@@ -261,12 +261,22 @@ 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 on one frame.
+ class SyncPointClient {
+ public:
+ SyncPointClient() {}
+ virtual uint32 InsertSyncPoint() = 0;
+ virtual void WaitSyncPoint(uint32 sync_point) = 0;
+
+ protected:
+ virtual ~SyncPointClient() {}
+
+ DISALLOW_COPY_AND_ASSIGN(SyncPointClient);
+ };
+ // It uses |client| to insert a new sync point and potentially waits on a
+ // older sync point. The final sync point will be used to release this
+ // VideoFrame.
// This method is thread safe. Both blink and compositor threads can call it.
- void AppendReleaseSyncPoint(uint32 sync_point);
+ void UpdateReleaseSyncPoint(SyncPointClient* client);
// 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.
@@ -335,7 +345,7 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
base::TimeDelta timestamp_;
base::Lock release_sync_point_lock_;
- std::vector<uint32> release_sync_points_;
+ uint32 release_sync_point_;
const bool end_of_stream_;
« no previous file with comments | « content/renderer/media/webmediaplayer_impl.cc ('k') | media/base/video_frame.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698