OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 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 REMOTING_CLIENT_FRAME_CONSUMER_H_ |
| 6 #define REMOTING_CLIENT_FRAME_CONSUMER_H_ |
| 7 |
| 8 namespace remoting { |
| 9 |
| 10 class FrameConsumer { |
| 11 public: |
| 12 FrameConsumer() {} |
| 13 virtual ~FrameConsumer() {} |
| 14 |
| 15 // Request a frame be allocated from the FrameConsumer. |
| 16 // |
| 17 // If a frame cannot be allocated to fit the format, and height/width |
| 18 // requirements, |frame_out| will be set to NULL. |
| 19 // |
| 20 // An allocated frame will have at least the width and height requested, but |
| 21 // may be bigger. Query the retrun frame for the actual frame size, stride, |
| 22 // etc. |
| 23 // |
| 24 // The AllocateFrame call is asynchronous. From invocation, until when the |
| 25 // |done| callback is invoked, |frame_out| should be considered to be locked |
| 26 // by the FrameConsumer, must remain a valid pointer, and should not be |
| 27 // examined or modified. After |done| is called, the |frame_out| will |
| 28 // contain a result of the allocation. If a frame could not be allocated, |
| 29 // |frame_out| will be NULL. |
| 30 // |
| 31 // All frames retrieved via the AllocateFrame call must be released by a |
| 32 // corresponding call ReleaseFrame(scoped_refptr<VideoFrame>* frame_out. |
| 33 virtual void AllocateFrame(media::VideoFrame::Format format, |
| 34 size_t width, |
| 35 size_t height, |
| 36 base::TimeDelta timestamp, |
| 37 base::TimeDelta duration, |
| 38 scoped_refptr<media::VideoFrame>* frame_out, |
| 39 Task* done) = 0; |
| 40 |
| 41 virtual void ReleaseFrame(media::VideoFrame* frame) = 0; |
| 42 |
| 43 // OnPartialFrameOutput() is called every time at least one rectangle of |
| 44 // output is produced. The |frame| is guaranteed to have valid data for |
| 45 // every region included in the |rects| list. |
| 46 // |
| 47 // Both |frame| and |rects| are guaranteed to be valid until the |done| |
| 48 // callback is invoked. |
| 49 virtual void OnPartialFrameOutput(media::VideoFrame* frame, |
| 50 UpdatedRects* rects, |
| 51 Task* done) = 0; |
| 52 |
| 53 private: |
| 54 DISALLOW_COPY_AND_ASSIGN(FrameConsumer); |
| 55 }; |
| 56 |
| 57 } // namespace remoting |
| 58 |
| 59 #endif // REMOTING_CLIENT_FRAME_CONSUMER_H_ |
OLD | NEW |