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

Side by Side Diff: chromecast/media/audio/cast_audio_output_stream.h

Issue 1105803002: Exposes a shlib interface for media/audio path. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROMECAST_MEDIA_AUDIO_CAST_AUDIO_OUTPUT_STREAM_H_
6 #define CHROMECAST_MEDIA_AUDIO_CAST_AUDIO_OUTPUT_STREAM_H_
7
8 #include "chromecast/public/cast_audio_stream.h"
9 #include "media/audio/audio_io.h"
10 #include "media/audio/audio_manager.h"
11 #include "media/base/media_export.h"
12
13 namespace chromecast {
14 struct AudioParameters;
15 }
16
17 namespace media {
18
19 // This class translates between media:: and chromecast:: interfaces.
20 class CastAudioOutputStream
21 : public media::AudioOutputStream,
22 public chromecast::AudioOutputStream::AudioSourceCallback {
23 public:
24 CastAudioOutputStream(chromecast::AudioOutputStream* output_stream,
25 const chromecast::AudioParameters& params);
26 ~CastAudioOutputStream() override;
27
28 // media::AudioOutputStream overrides.
29 bool Open() override;
30 void Start(media::AudioOutputStream::AudioSourceCallback* callback) override;
31 void Stop() override;
32 void SetVolume(double volume) override;
33 void GetVolume(double* volume) override;
34 void Close() override;
35
36 // chromecast::AudioSourceCallback overrides.
37 int OnMoreData(void* dest,
38 uint32_t len,
39 int32_t frames,
40 uint32_t total_bytes_delay) override;
41 void OnError(chromecast::AudioOutputStream* stream) override;
42 void OnClose() override;
43
44 private:
45 // Calls to media::AudioOutputStream overrides will be forwarded here.
46 chromecast::AudioOutputStream* output_stream_;
47 chromecast::AudioParameters params_;
48
49 // Calls to chromecast::AudioSourceCallback overrides will be forwarded here.
50 media::AudioOutputStream::AudioSourceCallback* callback_;
51 };
52
53 } // namespace media
54
55 #endif // CHROMECAST_MEDIA_AUDIO_CAST_AUDIO_OUTPUT_STREAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698