OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef MEDIA_CAST_SENDER_VIDEO_FRAME_FACTORY_H_ | |
6 #define MEDIA_CAST_SENDER_VIDEO_FRAME_FACTORY_H_ | |
7 | |
8 #include "base/memory/ref_counted.h" | |
9 | |
10 namespace media { | |
11 | |
12 class VideoFrame; | |
13 | |
14 namespace cast { | |
15 | |
16 // Interface for an object capable of vending video frames. Not thread safe, but | |
17 // must be usable from any thread. Implementations do not have to protect | |
18 // themselves from concurrent access for performance reasons. Clients should | |
19 // instead synchronize access themselves by design. | |
20 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!
| |
21 public: | |
22 // Creates a |VideoFrame| suitable for input via |InsertRawVideoFrame|. Frames | |
23 // obtained in this manner may provide benefits such memory reuse and affinity | |
24 // with the encoder. The format is guaranteed to be I420 or NV12. | |
25 virtual scoped_refptr<VideoFrame> CreateFrame(base::TimeDelta timestamp) = 0; | |
26 | |
27 protected: | |
28 virtual ~VideoFrameFactory() {} | |
29 | |
30 private: | |
31 friend class base::RefCountedThreadSafe<VideoFrameFactory>; | |
32 }; | |
33 | |
34 } // namespace cast | |
35 } // namespace media | |
36 | |
37 #endif // MEDIA_CAST_SENDER_VIDEO_FRAME_FACTORY_H_ | |
OLD | NEW |