| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // This is the main interface for the cast sender. | 5 // This is the main interface for the cast sender. |
| 6 // | 6 // |
| 7 // The AudioFrameInput, VideoFrameInput and PacketReciever interfaces should | 7 // The AudioFrameInput, VideoFrameInput and PacketReciever interfaces should |
| 8 // be accessed from the main thread. | 8 // be accessed from the main thread. |
| 9 | 9 |
| 10 #ifndef MEDIA_CAST_CAST_SENDER_H_ | 10 #ifndef MEDIA_CAST_CAST_SENDER_H_ |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 class VideoSender; | 29 class VideoSender; |
| 30 | 30 |
| 31 class VideoFrameInput : public base::RefCountedThreadSafe<VideoFrameInput> { | 31 class VideoFrameInput : public base::RefCountedThreadSafe<VideoFrameInput> { |
| 32 public: | 32 public: |
| 33 // Insert video frames into Cast sender. Frames will be encoded, packetized | 33 // Insert video frames into Cast sender. Frames will be encoded, packetized |
| 34 // and sent to the network. | 34 // and sent to the network. |
| 35 virtual void InsertRawVideoFrame( | 35 virtual void InsertRawVideoFrame( |
| 36 const scoped_refptr<media::VideoFrame>& video_frame, | 36 const scoped_refptr<media::VideoFrame>& video_frame, |
| 37 const base::TimeTicks& capture_time) = 0; | 37 const base::TimeTicks& capture_time) = 0; |
| 38 | 38 |
| 39 // Creates a |VideoFrame| optimized for the encoder. When available, these |
| 40 // frames offer performance benefits, such as memory copy elimination. The |
| 41 // format is guaranteed to be I420 or NV12. |
| 42 // |
| 43 // Not every encoder supports this method. Use |ShouldCreateOptimizedFrame| |
| 44 // to determine if you can and should use this method. Calling |
| 45 // this method when |ShouldCreateOptimizedFrame| is false will CHECK. |
| 46 virtual scoped_refptr<VideoFrame> CreateOptimizedFrame( |
| 47 base::TimeDelta timestamp) = 0; |
| 48 |
| 49 // Returns true if the encoder supports creating optimized frames. |
| 50 virtual bool SupportsCreateOptimizedFrame() const = 0; |
| 51 |
| 39 protected: | 52 protected: |
| 40 virtual ~VideoFrameInput() {} | 53 virtual ~VideoFrameInput() {} |
| 41 | 54 |
| 42 private: | 55 private: |
| 43 friend class base::RefCountedThreadSafe<VideoFrameInput>; | 56 friend class base::RefCountedThreadSafe<VideoFrameInput>; |
| 44 }; | 57 }; |
| 45 | 58 |
| 46 class AudioFrameInput : public base::RefCountedThreadSafe<AudioFrameInput> { | 59 class AudioFrameInput : public base::RefCountedThreadSafe<AudioFrameInput> { |
| 47 public: | 60 public: |
| 48 // Insert audio frames into Cast sender. Frames will be encoded, packetized | 61 // Insert audio frames into Cast sender. Frames will be encoded, packetized |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // Change the target delay. This is only valid if the receiver | 103 // Change the target delay. This is only valid if the receiver |
| 91 // supports the "adaptive_target_delay" rtp extension. | 104 // supports the "adaptive_target_delay" rtp extension. |
| 92 virtual void SetTargetPlayoutDelay( | 105 virtual void SetTargetPlayoutDelay( |
| 93 base::TimeDelta new_target_playout_delay) = 0; | 106 base::TimeDelta new_target_playout_delay) = 0; |
| 94 }; | 107 }; |
| 95 | 108 |
| 96 } // namespace cast | 109 } // namespace cast |
| 97 } // namespace media | 110 } // namespace media |
| 98 | 111 |
| 99 #endif // MEDIA_CAST_CAST_SENDER_H_ | 112 #endif // MEDIA_CAST_CAST_SENDER_H_ |
| OLD | NEW |