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

Unified Diff: media/cast/sender/video_frame_factory.h

Issue 688423003: [Cast] VideoFrameFactory interface to vend frames with encoder affinity. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 1 month 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/cast/sender/video_frame_factory.h
diff --git a/media/cast/sender/video_frame_factory.h b/media/cast/sender/video_frame_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..c17214bd272c77dec9beb0b2babea6c3278884fd
--- /dev/null
+++ b/media/cast/sender/video_frame_factory.h
@@ -0,0 +1,37 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MEDIA_CAST_SENDER_VIDEO_FRAME_FACTORY_H_
+#define MEDIA_CAST_SENDER_VIDEO_FRAME_FACTORY_H_
+
+#include "base/memory/ref_counted.h"
+
+namespace media {
+
+class VideoFrame;
+
+namespace cast {
+
+// Interface for an object capable of vending video frames. Not thread safe, but
+// must be usable from any thread. Implementations do not have to protect
+// themselves from concurrent access for performance reasons. Clients should
+// instead synchronize access themselves by design.
+class VideoFrameFactory : public base::RefCountedThreadSafe<VideoFrameFactory> {
Alpha Left Google 2014/11/17 20:23:14 I think it's unrealistic that this class is not th
jfroy 2014/11/17 21:23:06 Not at all. The default implementation I wrote as
Alpha Left Google 2014/11/18 02:57:58 This default implementation and the one you mentio
jfroy 2014/11/18 18:03:59 Sounds good!
+ public:
+ // Creates a |VideoFrame| suitable for input via |InsertRawVideoFrame|. Frames
+ // obtained in this manner may provide benefits such memory reuse and affinity
+ // with the encoder. The format is guaranteed to be I420 or NV12.
+ virtual scoped_refptr<VideoFrame> CreateFrame(base::TimeDelta timestamp) = 0;
+
+ protected:
+ virtual ~VideoFrameFactory() {}
+
+ private:
+ friend class base::RefCountedThreadSafe<VideoFrameFactory>;
+};
+
+} // namespace cast
+} // namespace media
+
+#endif // MEDIA_CAST_SENDER_VIDEO_FRAME_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698