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

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

Issue 25544003: Fix code style and gyp files in cast to build cast_unittest (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed gyp files Created 7 years, 2 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 | « build/all.gyp ('k') | media/cast/audio_receiver/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 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_DECODER_H_ 5 #ifndef MEDIA_CAST_AUDIO_RECEIVER_AUDIO_DECODER_H_
6 #define MEDIA_CAST_AUDIO_RECEIVER_AUDIO_DECODER_H_ 6 #define MEDIA_CAST_AUDIO_RECEIVER_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 "media/cast/cast_config.h" 10 #include "media/cast/cast_config.h"
11 #include "media/cast/cast_thread.h" 11 #include "media/cast/cast_thread.h"
12 #include "media/cast/rtp_common/rtp_defines.h" 12 #include "media/cast/rtp_common/rtp_defines.h"
13 13
14 namespace webrtc { 14 namespace webrtc {
15 class AudioCodingModule; 15 class AudioCodingModule;
16 } 16 }
17 17
18 namespace media { 18 namespace media {
19 namespace cast { 19 namespace cast {
20 20
21 // Thread safe class. 21 // Thread safe class.
22 // It should be called from the main cast thread; however that is not required. 22 // It should be called from the main cast thread; however that is not required.
23 class AudioDecoder : public base::RefCountedThreadSafe<AudioDecoder> { 23 class AudioDecoder : public base::RefCountedThreadSafe<AudioDecoder> {
24 public: 24 public:
25 explicit AudioDecoder(scoped_refptr<CastThread> cast_thread, 25 explicit AudioDecoder(scoped_refptr<CastThread> cast_thread,
26 const AudioReceiverConfig& audio_config); 26 const AudioReceiverConfig& audio_config);
27 27
28 virtual ~AudioDecoder();
29
30 // Extract a raw audio frame from the decoder. 28 // Extract a raw audio frame from the decoder.
31 // Set the number of desired 10ms blocks and frequency. 29 // Set the number of desired 10ms blocks and frequency.
32 bool GetRawAudioFrame(int number_of_10ms_blocks, 30 bool GetRawAudioFrame(int number_of_10ms_blocks,
33 int desired_frequency, 31 int desired_frequency,
34 PcmAudioFrame* audio_frame, 32 PcmAudioFrame* audio_frame,
35 uint32* rtp_timestamp); 33 uint32* rtp_timestamp);
36 34
37 // Insert an RTP packet to the decoder. 35 // Insert an RTP packet to the decoder.
38 void IncomingParsedRtpPacket(const uint8* payload_data, 36 void IncomingParsedRtpPacket(const uint8* payload_data,
39 int payload_size, 37 int payload_size,
40 const RtpCastHeader& rtp_header); 38 const RtpCastHeader& rtp_header);
41 39
40 protected:
41 virtual ~AudioDecoder();
42
42 private: 43 private:
43 // Can't use scoped_ptr due to protected constructor within webrtc. 44 friend class base::RefCountedThreadSafe<AudioDecoder>;
44 webrtc::AudioCodingModule* audio_decoder_; 45
46 scoped_ptr<webrtc::AudioCodingModule> audio_decoder_;
45 bool have_received_packets_; 47 bool have_received_packets_;
46 scoped_refptr<CastThread> cast_thread_; 48 scoped_refptr<CastThread> cast_thread_;
47 49
48 DISALLOW_COPY_AND_ASSIGN(AudioDecoder); 50 DISALLOW_COPY_AND_ASSIGN(AudioDecoder);
49 }; 51 };
50 52
51 } // namespace cast 53 } // namespace cast
52 } // namespace media 54 } // namespace media
53 55
54 #endif // MEDIA_CAST_AUDIO_RECEIVER_AUDIO_DECODER_H_ 56 #endif // MEDIA_CAST_AUDIO_RECEIVER_AUDIO_DECODER_H_
OLDNEW
« no previous file with comments | « build/all.gyp ('k') | media/cast/audio_receiver/audio_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698