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

Side by Side Diff: media/cast/sender/audio_encoder.h

Issue 1905763002: Convert //media/cast from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
« no previous file with comments | « media/cast/receiver/video_decoder_unittest.cc ('k') | media/cast/sender/audio_encoder.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_SENDER_AUDIO_ENCODER_H_ 5 #ifndef MEDIA_CAST_SENDER_AUDIO_ENCODER_H_
6 #define MEDIA_CAST_SENDER_AUDIO_ENCODER_H_ 6 #define MEDIA_CAST_SENDER_AUDIO_ENCODER_H_
7 7
8 #include <memory>
9
8 #include "base/macros.h" 10 #include "base/macros.h"
9 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h"
11 #include "base/threading/thread_checker.h" 12 #include "base/threading/thread_checker.h"
12 #include "media/base/audio_bus.h" 13 #include "media/base/audio_bus.h"
13 #include "media/cast/cast_environment.h" 14 #include "media/cast/cast_environment.h"
14 #include "media/cast/constants.h" 15 #include "media/cast/constants.h"
15 #include "media/cast/sender/sender_encoded_frame.h" 16 #include "media/cast/sender/sender_encoded_frame.h"
16 17
17 namespace base { 18 namespace base {
18 class TimeTicks; 19 class TimeTicks;
19 } 20 }
20 21
21 namespace media { 22 namespace media {
22 namespace cast { 23 namespace cast {
23 24
24 class AudioEncoder { 25 class AudioEncoder {
25 public: 26 public:
26 // Callback to deliver each SenderEncodedFrame, plus the number of audio 27 // Callback to deliver each SenderEncodedFrame, plus the number of audio
27 // samples skipped since the last frame. 28 // samples skipped since the last frame.
28 using FrameEncodedCallback = 29 using FrameEncodedCallback =
29 base::Callback<void(scoped_ptr<SenderEncodedFrame>, int)>; 30 base::Callback<void(std::unique_ptr<SenderEncodedFrame>, int)>;
30 31
31 AudioEncoder(const scoped_refptr<CastEnvironment>& cast_environment, 32 AudioEncoder(const scoped_refptr<CastEnvironment>& cast_environment,
32 int num_channels, 33 int num_channels,
33 int sampling_rate, 34 int sampling_rate,
34 int bitrate, 35 int bitrate,
35 Codec codec, 36 Codec codec,
36 const FrameEncodedCallback& frame_encoded_callback); 37 const FrameEncodedCallback& frame_encoded_callback);
37 virtual ~AudioEncoder(); 38 virtual ~AudioEncoder();
38 39
39 OperationalStatus InitializationResult() const; 40 OperationalStatus InitializationResult() const;
40 41
41 int GetSamplesPerFrame() const; 42 int GetSamplesPerFrame() const;
42 base::TimeDelta GetFrameDuration() const; 43 base::TimeDelta GetFrameDuration() const;
43 44
44 void InsertAudio(scoped_ptr<AudioBus> audio_bus, 45 void InsertAudio(std::unique_ptr<AudioBus> audio_bus,
45 const base::TimeTicks& recorded_time); 46 const base::TimeTicks& recorded_time);
46 47
47 private: 48 private:
48 class ImplBase; 49 class ImplBase;
49 class OpusImpl; 50 class OpusImpl;
50 class Pcm16Impl; 51 class Pcm16Impl;
51 class AppleAacImpl; 52 class AppleAacImpl;
52 53
53 const scoped_refptr<CastEnvironment> cast_environment_; 54 const scoped_refptr<CastEnvironment> cast_environment_;
54 scoped_refptr<ImplBase> impl_; 55 scoped_refptr<ImplBase> impl_;
55 56
56 // Used to ensure only one thread invokes InsertAudio(). 57 // Used to ensure only one thread invokes InsertAudio().
57 base::ThreadChecker insert_thread_checker_; 58 base::ThreadChecker insert_thread_checker_;
58 59
59 DISALLOW_COPY_AND_ASSIGN(AudioEncoder); 60 DISALLOW_COPY_AND_ASSIGN(AudioEncoder);
60 }; 61 };
61 62
62 } // namespace cast 63 } // namespace cast
63 } // namespace media 64 } // namespace media
64 65
65 #endif // MEDIA_CAST_SENDER_AUDIO_ENCODER_H_ 66 #endif // MEDIA_CAST_SENDER_AUDIO_ENCODER_H_
OLDNEW
« no previous file with comments | « media/cast/receiver/video_decoder_unittest.cc ('k') | media/cast/sender/audio_encoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698