| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // Note: It is not guaranteed that |video_frame| will actually be encoded and | 50 // Note: It is not guaranteed that |video_frame| will actually be encoded and |
| 51 // sent, if VideoSender detects too many frames in flight. Therefore, clients | 51 // sent, if VideoSender detects too many frames in flight. Therefore, clients |
| 52 // should be careful about the rate at which this method is called. | 52 // should be careful about the rate at which this method is called. |
| 53 // | 53 // |
| 54 // Note: It is invalid to call this method if InitializationResult() returns | 54 // Note: It is invalid to call this method if InitializationResult() returns |
| 55 // anything but STATUS_VIDEO_INITIALIZED. | 55 // anything but STATUS_VIDEO_INITIALIZED. |
| 56 void InsertRawVideoFrame(const scoped_refptr<media::VideoFrame>& video_frame, | 56 void InsertRawVideoFrame(const scoped_refptr<media::VideoFrame>& video_frame, |
| 57 const base::TimeTicks& capture_time); | 57 const base::TimeTicks& capture_time); |
| 58 | 58 |
| 59 protected: | 59 protected: |
| 60 virtual int GetNumberOfFramesInEncoder() const OVERRIDE; | 60 virtual int GetNumberOfFramesInEncoder() const override; |
| 61 virtual base::TimeDelta GetInFlightMediaDuration() const OVERRIDE; | 61 virtual base::TimeDelta GetInFlightMediaDuration() const override; |
| 62 virtual void OnAck(uint32 frame_id) OVERRIDE; | 62 virtual void OnAck(uint32 frame_id) override; |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 // Called when the encoder is initialized or has failed to initialize. | 65 // Called when the encoder is initialized or has failed to initialize. |
| 66 void OnEncoderInitialized( | 66 void OnEncoderInitialized( |
| 67 const CastInitializationCallback& initialization_cb, | 67 const CastInitializationCallback& initialization_cb, |
| 68 CastInitializationStatus status); | 68 CastInitializationStatus status); |
| 69 | 69 |
| 70 // Called by the |video_encoder_| with the next EncodedFrame to send. | 70 // Called by the |video_encoder_| with the next EncodedFrame to send. |
| 71 void OnEncodedVideoFrame(int encoder_bitrate, | 71 void OnEncodedVideoFrame(int encoder_bitrate, |
| 72 scoped_ptr<EncodedFrame> encoded_frame); | 72 scoped_ptr<EncodedFrame> encoded_frame); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 94 // NOTE: Weak pointers must be invalidated before all other member variables. | 94 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 95 base::WeakPtrFactory<VideoSender> weak_factory_; | 95 base::WeakPtrFactory<VideoSender> weak_factory_; |
| 96 | 96 |
| 97 DISALLOW_COPY_AND_ASSIGN(VideoSender); | 97 DISALLOW_COPY_AND_ASSIGN(VideoSender); |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 } // namespace cast | 100 } // namespace cast |
| 101 } // namespace media | 101 } // namespace media |
| 102 | 102 |
| 103 #endif // MEDIA_CAST_SENDER_VIDEO_SENDER_H_ | 103 #endif // MEDIA_CAST_SENDER_VIDEO_SENDER_H_ |
| OLD | NEW |