[go: nahoru, domu]

blob: b8f8e3aff5c952b3f2c00c43ae563083e7c11142 [file] [log] [blame]
Avi Drissman09875652022-09-15 20:03:191// Copyright 2018 The Chromium Authors
Guido Urdaneta73a21d4be2018-07-17 06:31:092// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef SERVICES_AUDIO_LOG_ADAPTER_H_
6#define SERVICES_AUDIO_LOG_ADAPTER_H_
7
8#include <string>
9
10#include "media/audio/audio_logging.h"
Miyoung Shin25bb8c092019-08-03 00:56:5711#include "media/mojo/mojom/audio_logging.mojom.h"
Ken Rockot2aefba52019-04-25 17:16:2812#include "mojo/public/cpp/bindings/remote.h"
Guido Urdaneta73a21d4be2018-07-17 06:31:0913
14namespace media {
15class AudioParameters;
16}
17
18namespace audio {
19
Miyoung Shin4e4b5032019-10-24 13:54:0620// This class wraps a Remote<media::mojom::AudioLog> into a media::AudioLog.
Guido Urdaneta73a21d4be2018-07-17 06:31:0921class LogAdapter : public media::AudioLog {
22 public:
Ken Rockot2aefba52019-04-25 17:16:2823 explicit LogAdapter(mojo::PendingRemote<media::mojom::AudioLog> audio_log);
Peter Boströmda683bf2021-09-22 17:22:0824
25 LogAdapter(const LogAdapter&) = delete;
26 LogAdapter& operator=(const LogAdapter&) = delete;
27
Guido Urdaneta73a21d4be2018-07-17 06:31:0928 ~LogAdapter() override;
29
30 // media::AudioLog implementation.
31 void OnCreated(const media::AudioParameters& params,
32 const std::string& device_id) override;
33 void OnStarted() override;
34 void OnStopped() override;
35 void OnClosed() override;
36 void OnError() override;
37 void OnSetVolume(double volume) override;
Max Morin86d4f132018-08-30 21:51:1338 void OnProcessingStateChanged(const std::string& message) override;
Guido Urdaneta73a21d4be2018-07-17 06:31:0939 void OnLogMessage(const std::string& message) override;
40
41 private:
Ken Rockot2aefba52019-04-25 17:16:2842 mojo::Remote<media::mojom::AudioLog> audio_log_;
Guido Urdaneta73a21d4be2018-07-17 06:31:0943};
44
45} // namespace audio
46
47#endif // SERVICES_AUDIO_LOG_ADAPTER_H_