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

Side by Side 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: Final patch cleanup. 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 unified diff | Download patch
« no previous file with comments | « media/cast/sender/video_encoder.cc ('k') | media/cast/sender/video_sender.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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/scoped_ptr.h"
9 #include "base/time/time.h"
10
11 namespace media {
12
13 class VideoFrame;
14
15 namespace cast {
16
17 // Interface for an object capable of vending video frames. There is no
18 // requirement for a |VideoFrameFactory| to be concurrent but it must not be
19 // pinned to a specific thread. Indeed, |VideoFrameFactory| implementations are
20 // created by cast on the main cast thread then used by unknown client threads
21 // via the |VideoFrameInput| interface.
22 //
23 // Clients are responsible for serialzing access to a |VideoFrameFactory|.
24 // Generally speaking, it is expected that a client will be using these objects
25 // from a rendering thread or callback (which may execute on different threads
26 // but never concurrently with itself). Forcing every implementation to take a
27 // lock, even with no contention, is an unnecessary cost, especially on mobile
28 // platforms.
29 class VideoFrameFactory {
30 public:
31 virtual ~VideoFrameFactory() {}
32
33 // Creates a |VideoFrame| suitable for input via |InsertRawVideoFrame|. Frames
34 // obtained in this manner may provide benefits such memory reuse and affinity
35 // with the encoder. The format is guaranteed to be I420 or NV12.
36 virtual scoped_refptr<VideoFrame> CreateFrame(base::TimeDelta timestamp) = 0;
37 };
38
39 } // namespace cast
40 } // namespace media
41
42 #endif // MEDIA_CAST_SENDER_VIDEO_FRAME_FACTORY_H_
OLDNEW
« no previous file with comments | « media/cast/sender/video_encoder.cc ('k') | media/cast/sender/video_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698