| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef MEDIA_CAST_SENDER_VIDEO_SENDER_H_ | 5 #ifndef MEDIA_CAST_SENDER_VIDEO_SENDER_H_ |
| 6 #define MEDIA_CAST_SENDER_VIDEO_SENDER_H_ | 6 #define MEDIA_CAST_SENDER_VIDEO_SENDER_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // the encoder does not have any such capability, returns null. | 60 // the encoder does not have any such capability, returns null. |
| 61 scoped_ptr<VideoFrameFactory> CreateVideoFrameFactory(); | 61 scoped_ptr<VideoFrameFactory> CreateVideoFrameFactory(); |
| 62 | 62 |
| 63 protected: | 63 protected: |
| 64 int GetNumberOfFramesInEncoder() const final; | 64 int GetNumberOfFramesInEncoder() const final; |
| 65 base::TimeDelta GetInFlightMediaDuration() const final; | 65 base::TimeDelta GetInFlightMediaDuration() const final; |
| 66 void OnAck(uint32 frame_id) final; | 66 void OnAck(uint32 frame_id) final; |
| 67 | 67 |
| 68 private: | 68 private: |
| 69 // Called by the |video_encoder_| with the next EncodedFrame to send. | 69 // Called by the |video_encoder_| with the next EncodedFrame to send. |
| 70 void OnEncodedVideoFrame(int encoder_bitrate, | 70 void OnEncodedVideoFrame(const scoped_refptr<media::VideoFrame>& video_frame, |
| 71 int encoder_bitrate, |
| 71 scoped_ptr<SenderEncodedFrame> encoded_frame); | 72 scoped_ptr<SenderEncodedFrame> encoded_frame); |
| 72 | 73 |
| 73 // Encodes media::VideoFrame images into EncodedFrames. Per configuration, | 74 // Encodes media::VideoFrame images into EncodedFrames. Per configuration, |
| 74 // this will point to either the internal software-based encoder or a proxy to | 75 // this will point to either the internal software-based encoder or a proxy to |
| 75 // a hardware-based encoder. | 76 // a hardware-based encoder. |
| 76 scoped_ptr<VideoEncoder> video_encoder_; | 77 scoped_ptr<VideoEncoder> video_encoder_; |
| 77 | 78 |
| 78 // The number of frames queued for encoding, but not yet sent. | 79 // The number of frames queued for encoding, but not yet sent. |
| 79 int frames_in_encoder_; | 80 int frames_in_encoder_; |
| 80 | 81 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 100 // NOTE: Weak pointers must be invalidated before all other member variables. | 101 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 101 base::WeakPtrFactory<VideoSender> weak_factory_; | 102 base::WeakPtrFactory<VideoSender> weak_factory_; |
| 102 | 103 |
| 103 DISALLOW_COPY_AND_ASSIGN(VideoSender); | 104 DISALLOW_COPY_AND_ASSIGN(VideoSender); |
| 104 }; | 105 }; |
| 105 | 106 |
| 106 } // namespace cast | 107 } // namespace cast |
| 107 } // namespace media | 108 } // namespace media |
| 108 | 109 |
| 109 #endif // MEDIA_CAST_SENDER_VIDEO_SENDER_H_ | 110 #endif // MEDIA_CAST_SENDER_VIDEO_SENDER_H_ |
| OLD | NEW |