Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(693)

Unified Diff: webrtc/media/engine/simulcast_encoder_adapter.h

Issue 3007643002: Clean up ownership of webrtc::VideoEncoder (Closed)
Patch Set: Fix Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/media/engine/scopedvideoencoder.cc ('k') | webrtc/media/engine/simulcast_encoder_adapter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/media/engine/simulcast_encoder_adapter.h
diff --git a/webrtc/media/engine/simulcast_encoder_adapter.h b/webrtc/media/engine/simulcast_encoder_adapter.h
index 68af74a5a347bcc60114cf2ea43c94fb3ede791e..03576f65878abd3ae6a3e14f66e673d04651771f 100644
--- a/webrtc/media/engine/simulcast_encoder_adapter.h
+++ b/webrtc/media/engine/simulcast_encoder_adapter.h
@@ -65,19 +65,18 @@ class SimulcastEncoderAdapter : public VP8Encoder {
private:
struct StreamInfo {
- StreamInfo(VideoEncoder* encoder,
+ StreamInfo(std::unique_ptr<VideoEncoder> encoder,
std::unique_ptr<EncodedImageCallback> callback,
uint16_t width,
uint16_t height,
bool send_stream)
- : encoder(encoder),
+ : encoder(std::move(encoder)),
callback(std::move(callback)),
width(width),
height(height),
key_frame_request(false),
send_stream(send_stream) {}
- // Deleted by SimulcastEncoderAdapter::DestroyStoredEncoders().
- VideoEncoder* encoder;
+ std::unique_ptr<VideoEncoder> encoder;
std::unique_ptr<EncodedImageCallback> callback;
uint16_t width;
uint16_t height;
@@ -108,7 +107,7 @@ class SimulcastEncoderAdapter : public VP8Encoder {
// Store encoders in between calls to Release and InitEncode, so they don't
// have to be recreated. Remaining encoders are destroyed by the destructor.
- std::stack<VideoEncoder*> stored_encoders_;
+ std::stack<std::unique_ptr<VideoEncoder>> stored_encoders_;
};
} // namespace webrtc
« no previous file with comments | « webrtc/media/engine/scopedvideoencoder.cc ('k') | webrtc/media/engine/simulcast_encoder_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698