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

Side by Side Diff: media/cast/sender/video_encoder_impl.cc

Issue 1074963003: Clean up potentially leaky use of base::DeletePointer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed another probleb Created 5 years, 8 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 unified diff | Download patch
OLDNEW
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 #include "media/cast/sender/video_encoder_impl.h" 5 #include "media/cast/sender/video_encoder_impl.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 STATUS_UNSUPPORTED_CODEC)); 96 STATUS_UNSUPPORTED_CODEC));
97 } 97 }
98 98
99 VideoEncoderImpl::~VideoEncoderImpl() { 99 VideoEncoderImpl::~VideoEncoderImpl() {
100 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); 100 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
101 if (encoder_) { 101 if (encoder_) {
102 cast_environment_->PostTask( 102 cast_environment_->PostTask(
103 CastEnvironment::VIDEO, 103 CastEnvironment::VIDEO,
104 FROM_HERE, 104 FROM_HERE,
105 base::Bind(&base::DeletePointer<SoftwareVideoEncoder>, 105 base::Bind(&base::DeletePointer<SoftwareVideoEncoder>,
106 encoder_.release())); 106 base::Passed(&encoder_)));
107 } 107 }
108 } 108 }
109 109
110 bool VideoEncoderImpl::EncodeVideoFrame( 110 bool VideoEncoderImpl::EncodeVideoFrame(
111 const scoped_refptr<media::VideoFrame>& video_frame, 111 const scoped_refptr<media::VideoFrame>& video_frame,
112 const base::TimeTicks& reference_time, 112 const base::TimeTicks& reference_time,
113 const FrameEncodedCallback& frame_encoded_callback) { 113 const FrameEncodedCallback& frame_encoded_callback) {
114 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN)); 114 DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
115 DCHECK(!video_frame->visible_rect().IsEmpty()); 115 DCHECK(!video_frame->visible_rect().IsEmpty());
116 DCHECK(!frame_encoded_callback.is_null()); 116 DCHECK(!frame_encoded_callback.is_null());
(...skipping 22 matching lines...) Expand all
139 dynamic_config_.key_frame_requested = true; 139 dynamic_config_.key_frame_requested = true;
140 } 140 }
141 141
142 // Inform the encoder to only reference frames older or equal to frame_id; 142 // Inform the encoder to only reference frames older or equal to frame_id;
143 void VideoEncoderImpl::LatestFrameIdToReference(uint32 frame_id) { 143 void VideoEncoderImpl::LatestFrameIdToReference(uint32 frame_id) {
144 dynamic_config_.latest_frame_id_to_reference = frame_id; 144 dynamic_config_.latest_frame_id_to_reference = frame_id;
145 } 145 }
146 146
147 } // namespace cast 147 } // namespace cast
148 } // namespace media 148 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/virtual_audio_output_stream_unittest.cc ('k') | ui/events/devices/device_data_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698