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

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

Issue 14217008: Remove reference counting from media::DemuxerStream and friends. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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 | Annotate | Revision Log
« no previous file with comments | « media/filters/chunk_demuxer_unittest.cc ('k') | media/filters/decrypting_audio_decoder.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 (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_DECRYPTING_AUDIO_DECODER_H_ 5 #ifndef MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_
6 #define MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ 6 #define MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/weak_ptr.h" 10 #include "base/memory/weak_ptr.h"
(...skipping 22 matching lines...) Expand all
33 // format designated by kSupportedBitsPerChannel. 33 // format designated by kSupportedBitsPerChannel.
34 // TODO(xhwang): Remove this restriction after http://crbug.com/169105 fixed. 34 // TODO(xhwang): Remove this restriction after http://crbug.com/169105 fixed.
35 static const int kSupportedBitsPerChannel; 35 static const int kSupportedBitsPerChannel;
36 36
37 DecryptingAudioDecoder( 37 DecryptingAudioDecoder(
38 const scoped_refptr<base::MessageLoopProxy>& message_loop, 38 const scoped_refptr<base::MessageLoopProxy>& message_loop,
39 const SetDecryptorReadyCB& set_decryptor_ready_cb); 39 const SetDecryptorReadyCB& set_decryptor_ready_cb);
40 virtual ~DecryptingAudioDecoder(); 40 virtual ~DecryptingAudioDecoder();
41 41
42 // AudioDecoder implementation. 42 // AudioDecoder implementation.
43 virtual void Initialize(const scoped_refptr<DemuxerStream>& stream, 43 virtual void Initialize(DemuxerStream* stream,
44 const PipelineStatusCB& status_cb, 44 const PipelineStatusCB& status_cb,
45 const StatisticsCB& statistics_cb) OVERRIDE; 45 const StatisticsCB& statistics_cb) OVERRIDE;
46 virtual void Read(const ReadCB& read_cb) OVERRIDE; 46 virtual void Read(const ReadCB& read_cb) OVERRIDE;
47 virtual void Reset(const base::Closure& closure) OVERRIDE; 47 virtual void Reset(const base::Closure& closure) OVERRIDE;
48 virtual int bits_per_channel() OVERRIDE; 48 virtual int bits_per_channel() OVERRIDE;
49 virtual ChannelLayout channel_layout() OVERRIDE; 49 virtual ChannelLayout channel_layout() OVERRIDE;
50 virtual int samples_per_second() OVERRIDE; 50 virtual int samples_per_second() OVERRIDE;
51 51
52 private: 52 private:
53 // For a detailed state diagram please see this link: http://goo.gl/8jAok 53 // For a detailed state diagram please see this link: http://goo.gl/8jAok
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 base::WeakPtr<DecryptingAudioDecoder> weak_this_; 110 base::WeakPtr<DecryptingAudioDecoder> weak_this_;
111 111
112 State state_; 112 State state_;
113 113
114 PipelineStatusCB init_cb_; 114 PipelineStatusCB init_cb_;
115 StatisticsCB statistics_cb_; 115 StatisticsCB statistics_cb_;
116 ReadCB read_cb_; 116 ReadCB read_cb_;
117 base::Closure reset_cb_; 117 base::Closure reset_cb_;
118 118
119 // Pointer to the demuxer stream that will feed us compressed buffers. 119 // Pointer to the demuxer stream that will feed us compressed buffers.
120 scoped_refptr<DemuxerStream> demuxer_stream_; 120 DemuxerStream* demuxer_stream_;
121 121
122 // Callback to request/cancel decryptor creation notification. 122 // Callback to request/cancel decryptor creation notification.
123 SetDecryptorReadyCB set_decryptor_ready_cb_; 123 SetDecryptorReadyCB set_decryptor_ready_cb_;
124 124
125 Decryptor* decryptor_; 125 Decryptor* decryptor_;
126 126
127 // The buffer returned by the demuxer that needs decrypting/decoding. 127 // The buffer returned by the demuxer that needs decrypting/decoding.
128 scoped_refptr<media::DecoderBuffer> pending_buffer_to_decode_; 128 scoped_refptr<media::DecoderBuffer> pending_buffer_to_decode_;
129 129
130 // Indicates the situation where new key is added during pending decode 130 // Indicates the situation where new key is added during pending decode
(...skipping 14 matching lines...) Expand all
145 145
146 base::TimeDelta output_timestamp_base_; 146 base::TimeDelta output_timestamp_base_;
147 int total_samples_decoded_; 147 int total_samples_decoded_;
148 148
149 DISALLOW_COPY_AND_ASSIGN(DecryptingAudioDecoder); 149 DISALLOW_COPY_AND_ASSIGN(DecryptingAudioDecoder);
150 }; 150 };
151 151
152 } // namespace media 152 } // namespace media
153 153
154 #endif // MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_ 154 #endif // MEDIA_FILTERS_DECRYPTING_AUDIO_DECODER_H_
OLDNEW
« no previous file with comments | « media/filters/chunk_demuxer_unittest.cc ('k') | media/filters/decrypting_audio_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698