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

Side by Side Diff: remoting/codec/audio_encoder_opus.h

Issue 11189047: Add opus audio codec support in remoting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | « remoting/codec/audio_decoder_opus.cc ('k') | remoting/codec/audio_encoder_opus.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef REMOTING_CODEC_AUDIO_ENCODER_OPUS_H_
6 #define REMOTING_CODEC_AUDIO_ENCODER_OPUS_H_
7
8 #include "remoting/codec/audio_encoder.h"
9
10 #include "remoting/proto/audio.pb.h"
11
12 struct OpusEncoder;
13
14 namespace media {
15 class AudioBus;
16 class MultiChannelResampler;
17 } // namespace media
18
19 namespace remoting {
20
21 class AudioPacket;
22
23 class AudioEncoderOpus : public AudioEncoder {
24 public:
25 AudioEncoderOpus();
26 virtual ~AudioEncoderOpus();
27
28 // AudioEncoder interface.
29 virtual scoped_ptr<AudioPacket> Encode(
30 scoped_ptr<AudioPacket> packet) OVERRIDE;
31
32 private:
33 void InitEncoder();
34 void DestroyEncoder();
35 bool ResetForPacket(AudioPacket* packet);
36
37 void FetchBytesToResample(media::AudioBus* audio_bus);
38
39 int sampling_rate_;
40 AudioPacket::Channels channels_;
41 OpusEncoder* encoder_;
42
43 int frame_size_;
44 scoped_ptr<media::MultiChannelResampler> resampler_;
45 scoped_array<char> resample_buffer_;
46 scoped_ptr<media::AudioBus> resampler_bus_;
47
48 // Used to pass packet to the FetchBytesToResampler() callback.
49 const char* resampling_data_;
50 int resampling_data_size_;
51 int resampling_data_pos_;
52
53 // Left-over unencoded samples from the previous AudioPacket.
54 scoped_array<int16> leftover_buffer_;
55 int leftover_buffer_size_;
56 int leftover_samples_;
57
58 DISALLOW_COPY_AND_ASSIGN(AudioEncoderOpus);
59 };
60
61 } // namespace remoting
62
63 #endif // REMOTING_CODEC_AUDIO_ENCODER_OPUS_H_
OLDNEW
« no previous file with comments | « remoting/codec/audio_decoder_opus.cc ('k') | remoting/codec/audio_encoder_opus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698