summaryrefslogtreecommitdiff
path: root/media/cast/audio_receiver/audio_decoder.h
diff options
context:
space:
mode:
Diffstat (limited to 'media/cast/audio_receiver/audio_decoder.h')
-rw-r--r--media/cast/audio_receiver/audio_decoder.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/media/cast/audio_receiver/audio_decoder.h b/media/cast/audio_receiver/audio_decoder.h
index d7c6a792c1..78bb623a01 100644
--- a/media/cast/audio_receiver/audio_decoder.h
+++ b/media/cast/audio_receiver/audio_decoder.h
@@ -6,7 +6,7 @@
#define MEDIA_CAST_AUDIO_RECEIVER_AUDIO_DECODER_H_
#include "base/callback.h"
-#include "base/memory/ref_counted.h"
+#include "base/synchronization/lock.h"
#include "media/cast/cast_config.h"
#include "media/cast/rtp_common/rtp_defines.h"
@@ -18,9 +18,10 @@ namespace media {
namespace cast {
// Thread safe class.
-class AudioDecoder : public base::RefCountedThreadSafe<AudioDecoder> {
+class AudioDecoder {
public:
explicit AudioDecoder(const AudioReceiverConfig& audio_config);
+ virtual ~AudioDecoder();
// Extract a raw audio frame from the decoder.
// Set the number of desired 10ms blocks and frequency.
@@ -37,13 +38,12 @@ class AudioDecoder : public base::RefCountedThreadSafe<AudioDecoder> {
size_t payload_size,
const RtpCastHeader& rtp_header);
- protected:
- virtual ~AudioDecoder();
-
private:
- friend class base::RefCountedThreadSafe<AudioDecoder>;
-
+ // The webrtc AudioCodingModule is threadsafe.
scoped_ptr<webrtc::AudioCodingModule> audio_decoder_;
+ // TODO(pwestin): Refactor to avoid this. Call IncomingParsedRtpPacket from
+ // audio decoder thread that way this class does not have to be thread safe.
+ base::Lock lock_;
bool have_received_packets_;
DISALLOW_COPY_AND_ASSIGN(AudioDecoder);