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

Side by Side Diff: media/cast/audio_receiver/audio_receiver.h

Issue 193303002: WeakPtr destruction order cleanup: media edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « media/base/user_input_monitor_win.cc ('k') | media/cast/audio_sender/audio_encoder.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_AUDIO_RECEIVER_AUDIO_RECEIVER_H_ 5 #ifndef MEDIA_CAST_AUDIO_RECEIVER_AUDIO_RECEIVER_H_
6 #define MEDIA_CAST_AUDIO_RECEIVER_AUDIO_RECEIVER_H_ 6 #define MEDIA_CAST_AUDIO_RECEIVER_AUDIO_RECEIVER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 // Actually send the next cast message. 117 // Actually send the next cast message.
118 void SendNextCastMessage(); 118 void SendNextCastMessage();
119 119
120 scoped_refptr<CastEnvironment> cast_environment_; 120 scoped_refptr<CastEnvironment> cast_environment_;
121 121
122 // Subscribes to raw events. 122 // Subscribes to raw events.
123 // Processes raw audio events to be sent over to the cast sender via RTCP. 123 // Processes raw audio events to be sent over to the cast sender via RTCP.
124 ReceiverRtcpEventSubscriber event_subscriber_; 124 ReceiverRtcpEventSubscriber event_subscriber_;
125 125
126 base::WeakPtrFactory<AudioReceiver> weak_factory_;
127
128 const transport::AudioCodec codec_; 126 const transport::AudioCodec codec_;
129 const int frequency_; 127 const int frequency_;
130 base::TimeDelta target_delay_delta_; 128 base::TimeDelta target_delay_delta_;
131 scoped_ptr<Framer> audio_buffer_; 129 scoped_ptr<Framer> audio_buffer_;
132 scoped_ptr<AudioDecoder> audio_decoder_; 130 scoped_ptr<AudioDecoder> audio_decoder_;
133 scoped_ptr<LocalRtpAudioData> incoming_payload_callback_; 131 scoped_ptr<LocalRtpAudioData> incoming_payload_callback_;
134 scoped_ptr<LocalRtpAudioFeedback> incoming_payload_feedback_; 132 scoped_ptr<LocalRtpAudioFeedback> incoming_payload_feedback_;
135 scoped_ptr<RtpReceiver> rtp_receiver_; 133 scoped_ptr<RtpReceiver> rtp_receiver_;
136 scoped_ptr<Rtcp> rtcp_; 134 scoped_ptr<Rtcp> rtcp_;
137 scoped_ptr<RtpReceiverStatistics> rtp_audio_receiver_statistics_; 135 scoped_ptr<RtpReceiverStatistics> rtp_audio_receiver_statistics_;
138 base::TimeDelta time_offset_; 136 base::TimeDelta time_offset_;
139 base::TimeTicks time_first_incoming_packet_; 137 base::TimeTicks time_first_incoming_packet_;
140 uint32 first_incoming_rtp_timestamp_; 138 uint32 first_incoming_rtp_timestamp_;
141 transport::TransportEncryptionHandler decryptor_; 139 transport::TransportEncryptionHandler decryptor_;
142 base::TimeTicks last_playout_time_; 140 base::TimeTicks last_playout_time_;
143 141
144 std::list<AudioFrameEncodedCallback> queued_encoded_callbacks_; 142 std::list<AudioFrameEncodedCallback> queued_encoded_callbacks_;
145 std::list<DecodedAudioCallbackData> queued_decoded_callbacks_; 143 std::list<DecodedAudioCallbackData> queued_decoded_callbacks_;
146 144
147 // This mapping allows us to log kAudioAckSent as a frame event. In addition 145 // This mapping allows us to log kAudioAckSent as a frame event. In addition
148 // it allows the event to be transmitted via RTCP. 146 // it allows the event to be transmitted via RTCP.
149 RtpTimestamp frame_id_to_rtp_timestamp_[256]; 147 RtpTimestamp frame_id_to_rtp_timestamp_[256];
150 148
149 // NOTE: Weak pointers must be invalidated before all other member variables.
150 base::WeakPtrFactory<AudioReceiver> weak_factory_;
151
151 DISALLOW_COPY_AND_ASSIGN(AudioReceiver); 152 DISALLOW_COPY_AND_ASSIGN(AudioReceiver);
152 }; 153 };
153 154
154 } // namespace cast 155 } // namespace cast
155 } // namespace media 156 } // namespace media
156 157
157 #endif // MEDIA_CAST_AUDIO_RECEIVER_AUDIO_RECEIVER_H_ 158 #endif // MEDIA_CAST_AUDIO_RECEIVER_AUDIO_RECEIVER_H_
OLDNEW
« no previous file with comments | « media/base/user_input_monitor_win.cc ('k') | media/cast/audio_sender/audio_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698