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

Side by Side Diff: chromecast/media/cma/backend/alsa/stream_mixer_alsa_input.h

Issue 2701613006: [Chromecast] Process streams with different post-processing. (Closed)
Patch Set: Created 3 years, 10 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 CHROMECAST_MEDIA_CMA_BACKEND_ALSA_STREAM_MIXER_ALSA_INPUT_H_ 5 #ifndef CHROMECAST_MEDIA_CMA_BACKEND_ALSA_STREAM_MIXER_ALSA_INPUT_H_
6 #define CHROMECAST_MEDIA_CMA_BACKEND_ALSA_STREAM_MIXER_ALSA_INPUT_H_ 6 #define CHROMECAST_MEDIA_CMA_BACKEND_ALSA_STREAM_MIXER_ALSA_INPUT_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/threading/thread_checker.h" 12 #include "base/threading/thread_checker.h"
13 #include "chromecast/media/cma/backend/alsa/media_pipeline_backend_alsa.h" 13 #include "chromecast/media/cma/backend/alsa/media_pipeline_backend_alsa.h"
14 #include "chromecast/public/media/media_pipeline_device_params.h"
14 15
15 namespace chromecast { 16 namespace chromecast {
16 namespace media { 17 namespace media {
17 18
18 class DecoderBufferBase; 19 class DecoderBufferBase;
19 class StreamMixerAlsaInputImpl; 20 class StreamMixerAlsaInputImpl;
20 21
21 // Input handle to the mixer. All methods (including constructor and destructor) 22 // Input handle to the mixer. All methods (including constructor and destructor)
22 // must be called on the same thread. 23 // must be called on the same thread.
23 class StreamMixerAlsaInput { 24 class StreamMixerAlsaInput {
(...skipping 19 matching lines...) Expand all
43 virtual void OnMixerError(MixerError error) = 0; 44 virtual void OnMixerError(MixerError error) = 0;
44 45
45 protected: 46 protected:
46 virtual ~Delegate() {} 47 virtual ~Delegate() {}
47 }; 48 };
48 49
49 // Adds a new input to the mixer, creating the mixer if it does not already 50 // Adds a new input to the mixer, creating the mixer if it does not already
50 // exist. 51 // exist.
51 StreamMixerAlsaInput(Delegate* delegate, 52 StreamMixerAlsaInput(Delegate* delegate,
52 int samples_per_second, 53 int samples_per_second,
53 bool primary); 54 bool primary,
55 std::string name);
54 // Removes this input from the mixer, destroying the mixer if there are no 56 // Removes this input from the mixer, destroying the mixer if there are no
55 // remaining inputs. 57 // remaining inputs.
56 ~StreamMixerAlsaInput(); 58 ~StreamMixerAlsaInput();
57 59
58 // Writes some PCM data to be mixed. |data| must be in planar float format. 60 // Writes some PCM data to be mixed. |data| must be in planar float format.
59 // Once the data has been written, the delegate's OnWritePcmCompletion() 61 // Once the data has been written, the delegate's OnWritePcmCompletion()
60 // method will be called on the same thread that the StreamMixerAlsaInput was 62 // method will be called on the same thread that the StreamMixerAlsaInput was
61 // created on. Note that no further calls to WritePcm() should be made until 63 // created on. Note that no further calls to WritePcm() should be made until
62 // OnWritePcmCompletion() has been called. 64 // OnWritePcmCompletion() has been called.
63 void WritePcm(const scoped_refptr<DecoderBufferBase>& data); 65 void WritePcm(const scoped_refptr<DecoderBufferBase>& data);
(...skipping 10 matching lines...) Expand all
74 StreamMixerAlsaInputImpl* impl_; 76 StreamMixerAlsaInputImpl* impl_;
75 base::ThreadChecker thread_checker_; 77 base::ThreadChecker thread_checker_;
76 78
77 DISALLOW_COPY_AND_ASSIGN(StreamMixerAlsaInput); 79 DISALLOW_COPY_AND_ASSIGN(StreamMixerAlsaInput);
78 }; 80 };
79 81
80 } // namespace media 82 } // namespace media
81 } // namespace chromecast 83 } // namespace chromecast
82 84
83 #endif // CHROMECAST_MEDIA_CMA_BACKEND_ALSA_STREAM_MIXER_ALSA_INPUT_H_ 85 #endif // CHROMECAST_MEDIA_CMA_BACKEND_ALSA_STREAM_MIXER_ALSA_INPUT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698