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

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: Address danakj@'s concern Created 6 years, 6 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
Index: media/base/video_frame.h
diff --git a/media/base/video_frame.h b/media/base/video_frame.h
index 0696a554c8f8fc1ca38f237f4738e1d5014fd384..b05b4dc699c608c7fdf57d4b6f2a6c24f5bdf3ea 100644
--- a/media/base/video_frame.h
+++ b/media/base/video_frame.h
@@ -5,8 +5,6 @@
#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"
@@ -86,7 +84,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|,
@@ -254,12 +252,24 @@ class MEDIA_EXPORT VideoFrame : public base::RefCountedThreadSafe<VideoFrame> {
timestamp_ = timestamp;
}
- // Append |sync_point| into |release_sync_points_| which will be passed to
+ class SyncPointProvider {
dshwang 2014/06/19 10:28:17 I'm not good at naming. If you have better name, p
danakj 2014/06/19 15:56:26 Mmmh SyncPointClient if you like that better? This
dshwang 2014/06/23 18:33:20 I choose SyncPointClient :)
+ public:
+ SyncPointProvider() {}
+ virtual uint32 InsertSyncPoint() = 0;
+ virtual void WaitSyncPoint(uint32 sync_point) = 0;
+
+ protected:
+ virtual ~SyncPointProvider() {}
+
+ DISALLOW_COPY_AND_ASSIGN(SyncPointProvider);
+ };
+ // Set a new sync point to |release_sync_point_| 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.
+ // the video decoder waits for the sync point before reusing the mailbox.
+ // A client should provide a SyncPointProvider implementation to insert or
+ // wait a sync point.
// This method is thread safe. Both blink and compositor threads can call it.
- void AppendReleaseSyncPoint(uint32 sync_point);
+ void UpdateReleaseSyncPoint(SyncPointProvider&);
danakj 2014/06/19 15:56:26 this is a non-const ref which is not allowed. make
dshwang 2014/06/23 18:33:20 Done.
// 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.
@@ -328,7 +338,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_;

Powered by Google App Engine
This is Rietveld 408576698