| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_SIZE_ADAPTABLE_VIDEO_ENCODER_BASE_H_ | 5 #ifndef MEDIA_CAST_SENDER_SIZE_ADAPTABLE_VIDEO_ENCODER_BASE_H_ |
| 6 #define MEDIA_CAST_SENDER_SIZE_ADAPTABLE_VIDEO_ENCODER_BASE_H_ | 6 #define MEDIA_CAST_SENDER_SIZE_ADAPTABLE_VIDEO_ENCODER_BASE_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 // Create and initialize a replacement video encoder, if this not already | 78 // Create and initialize a replacement video encoder, if this not already |
| 79 // in-progress. The replacement will call back to OnEncoderStatusChange() | 79 // in-progress. The replacement will call back to OnEncoderStatusChange() |
| 80 // with success/fail status. | 80 // with success/fail status. |
| 81 void TrySpawningReplacementEncoder(const gfx::Size& size_needed); | 81 void TrySpawningReplacementEncoder(const gfx::Size& size_needed); |
| 82 | 82 |
| 83 // Called when a status change is received from an encoder. | 83 // Called when a status change is received from an encoder. |
| 84 void OnEncoderStatusChange(OperationalStatus status); | 84 void OnEncoderStatusChange(OperationalStatus status); |
| 85 | 85 |
| 86 // Called by the |encoder_| with the next EncodedFrame. | 86 // Called by the |encoder_| with the next EncodedFrame. |
| 87 void OnEncodedVideoFrame(const FrameEncodedCallback& frame_encoded_callback, | 87 void OnEncodedVideoFrame(const FrameEncodedCallback& frame_encoded_callback, |
| 88 scoped_ptr<EncodedFrame> encoded_frame); | 88 scoped_ptr<SenderEncodedFrame> encoded_frame); |
| 89 | 89 |
| 90 const scoped_refptr<CastEnvironment> cast_environment_; | 90 const scoped_refptr<CastEnvironment> cast_environment_; |
| 91 | 91 |
| 92 // This is not const since |video_config_.starting_bitrate| is modified by | 92 // This is not const since |video_config_.starting_bitrate| is modified by |
| 93 // SetBitRate(), for when a replacement encoder is spawned. | 93 // SetBitRate(), for when a replacement encoder is spawned. |
| 94 VideoSenderConfig video_config_; | 94 VideoSenderConfig video_config_; |
| 95 | 95 |
| 96 // Run whenever the underlying encoder reports a status change. | 96 // Run whenever the underlying encoder reports a status change. |
| 97 const StatusChangeCallback status_change_cb_; | 97 const StatusChangeCallback status_change_cb_; |
| 98 | 98 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 111 // NOTE: Weak pointers must be invalidated before all other member variables. | 111 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 112 base::WeakPtrFactory<SizeAdaptableVideoEncoderBase> weak_factory_; | 112 base::WeakPtrFactory<SizeAdaptableVideoEncoderBase> weak_factory_; |
| 113 | 113 |
| 114 DISALLOW_COPY_AND_ASSIGN(SizeAdaptableVideoEncoderBase); | 114 DISALLOW_COPY_AND_ASSIGN(SizeAdaptableVideoEncoderBase); |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 } // namespace cast | 117 } // namespace cast |
| 118 } // namespace media | 118 } // namespace media |
| 119 | 119 |
| 120 #endif // MEDIA_CAST_SENDER_SIZE_ADAPTABLE_VIDEO_ENCODER_BASE_H_ | 120 #endif // MEDIA_CAST_SENDER_SIZE_ADAPTABLE_VIDEO_ENCODER_BASE_H_ |
| OLD | NEW |