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

Side by Side Diff: media/filters/ffmpeg_audio_decoder.h

Issue 193303002: WeakPtr destruction order cleanup: media edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_FILTERS_FFMPEG_AUDIO_DECODER_H_ 5 #ifndef MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_
6 #define MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ 6 #define MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_
7 7
8 #include <list> 8 #include <list>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 void BufferReady(DemuxerStream::Status status, 61 void BufferReady(DemuxerStream::Status status,
62 const scoped_refptr<DecoderBuffer>& input); 62 const scoped_refptr<DecoderBuffer>& input);
63 63
64 bool ConfigureDecoder(); 64 bool ConfigureDecoder();
65 void ReleaseFFmpegResources(); 65 void ReleaseFFmpegResources();
66 void ResetTimestampState(); 66 void ResetTimestampState();
67 void RunDecodeLoop(const scoped_refptr<DecoderBuffer>& input, 67 void RunDecodeLoop(const scoped_refptr<DecoderBuffer>& input,
68 bool skip_eos_append); 68 bool skip_eos_append);
69 69
70 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 70 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
71 base::WeakPtrFactory<FFmpegAudioDecoder> weak_factory_;
72 base::WeakPtr<FFmpegAudioDecoder> weak_this_;
73 71
74 DemuxerStream* demuxer_stream_; 72 DemuxerStream* demuxer_stream_;
75 StatisticsCB statistics_cb_; 73 StatisticsCB statistics_cb_;
76 scoped_ptr_malloc<AVCodecContext, ScopedPtrAVFreeContext> codec_context_; 74 scoped_ptr_malloc<AVCodecContext, ScopedPtrAVFreeContext> codec_context_;
77 75
78 // Decoded audio format. 76 // Decoded audio format.
79 int bytes_per_channel_; 77 int bytes_per_channel_;
80 ChannelLayout channel_layout_; 78 ChannelLayout channel_layout_;
81 int channels_; 79 int channels_;
82 int samples_per_second_; 80 int samples_per_second_;
(...skipping 13 matching lines...) Expand all
96 scoped_ptr_malloc<AVFrame, ScopedPtrAVFreeFrame> av_frame_; 94 scoped_ptr_malloc<AVFrame, ScopedPtrAVFreeFrame> av_frame_;
97 95
98 ReadCB read_cb_; 96 ReadCB read_cb_;
99 base::Closure stop_cb_; 97 base::Closure stop_cb_;
100 base::Closure reset_cb_; 98 base::Closure reset_cb_;
101 99
102 // Since multiple frames may be decoded from the same packet we need to queue 100 // Since multiple frames may be decoded from the same packet we need to queue
103 // them up and hand them out as we receive Read() calls. 101 // them up and hand them out as we receive Read() calls.
104 std::list<QueuedAudioBuffer> queued_audio_; 102 std::list<QueuedAudioBuffer> queued_audio_;
105 103
104 // NOTE: These must always be last so they're invalidated before other member
105 // variables might be accessed.
106 base::WeakPtr<FFmpegAudioDecoder> weak_this_;
Ami GONE FROM CHROMIUM 2014/03/10 22:02:08 ditto
107 base::WeakPtrFactory<FFmpegAudioDecoder> weak_factory_;
108
106 DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder); 109 DISALLOW_IMPLICIT_CONSTRUCTORS(FFmpegAudioDecoder);
107 }; 110 };
108 111
109 } // namespace media 112 } // namespace media
110 113
111 #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_ 114 #endif // MEDIA_FILTERS_FFMPEG_AUDIO_DECODER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698