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

Side by Side Diff: media/mojo/clients/mojo_audio_decoder.h

Issue 2330273002: media: Use associated interface for mojo AudioDecoderClient (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | media/mojo/clients/mojo_audio_decoder.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_MOJO_CLIENTS_MOJO_AUDIO_DECODER_H_ 5 #ifndef MEDIA_MOJO_CLIENTS_MOJO_AUDIO_DECODER_H_
6 #define MEDIA_MOJO_CLIENTS_MOJO_AUDIO_DECODER_H_ 6 #define MEDIA_MOJO_CLIENTS_MOJO_AUDIO_DECODER_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 "media/base/audio_decoder.h" 12 #include "media/base/audio_decoder.h"
13 #include "media/mojo/interfaces/audio_decoder.mojom.h" 13 #include "media/mojo/interfaces/audio_decoder.mojom.h"
14 #include "media/mojo/interfaces/media_types.mojom.h" 14 #include "media/mojo/interfaces/media_types.mojom.h"
15 #include "mojo/public/cpp/bindings/associated_binding.h"
15 #include "mojo/public/cpp/bindings/binding.h" 16 #include "mojo/public/cpp/bindings/binding.h"
16 17
17 namespace base { 18 namespace base {
18 class SingleThreadTaskRunner; 19 class SingleThreadTaskRunner;
19 } 20 }
20 21
21 namespace media { 22 namespace media {
22 23
23 class MojoDecoderBufferWriter; 24 class MojoDecoderBufferWriter;
24 25
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 // thread. This member is used to safely pass the AudioDecoderPtr from one 63 // thread. This member is used to safely pass the AudioDecoderPtr from one
63 // thread to another. It is set in the constructor and is consumed in 64 // thread to another. It is set in the constructor and is consumed in
64 // Initialize(). 65 // Initialize().
65 mojom::AudioDecoderPtrInfo remote_decoder_info_; 66 mojom::AudioDecoderPtrInfo remote_decoder_info_;
66 67
67 mojom::AudioDecoderPtr remote_decoder_; 68 mojom::AudioDecoderPtr remote_decoder_;
68 69
69 std::unique_ptr<MojoDecoderBufferWriter> mojo_decoder_buffer_writer_; 70 std::unique_ptr<MojoDecoderBufferWriter> mojo_decoder_buffer_writer_;
70 71
71 // Binding for AudioDecoderClient, bound to the |task_runner_|. 72 // Binding for AudioDecoderClient, bound to the |task_runner_|.
72 mojo::Binding<AudioDecoderClient> binding_; 73 mojo::AssociatedBinding<AudioDecoderClient> client_binding_;
73 74
74 // We call the following callbacks to pass the information to the pipeline. 75 // We call the following callbacks to pass the information to the pipeline.
75 // |output_cb_| is permanent while other three are called only once, 76 // |output_cb_| is permanent while other three are called only once,
76 // |decode_cb_| and |reset_cb_| are replaced by every by Decode() and Reset(). 77 // |decode_cb_| and |reset_cb_| are replaced by every by Decode() and Reset().
77 InitCB init_cb_; 78 InitCB init_cb_;
78 OutputCB output_cb_; 79 OutputCB output_cb_;
79 DecodeCB decode_cb_; 80 DecodeCB decode_cb_;
80 base::Closure reset_cb_; 81 base::Closure reset_cb_;
81 82
82 // Flag that is set if we got connection error. Never cleared. 83 // Flag that is set if we got connection error. Never cleared.
83 bool has_connection_error_; 84 bool has_connection_error_;
84 85
85 // Flag telling whether this decoder requires bitstream conversion. 86 // Flag telling whether this decoder requires bitstream conversion.
86 // Passed from |remote_decoder_| as a result of its initialization. 87 // Passed from |remote_decoder_| as a result of its initialization.
87 bool needs_bitstream_conversion_; 88 bool needs_bitstream_conversion_;
88 89
89 DISALLOW_COPY_AND_ASSIGN(MojoAudioDecoder); 90 DISALLOW_COPY_AND_ASSIGN(MojoAudioDecoder);
90 }; 91 };
91 92
92 } // namespace media 93 } // namespace media
93 94
94 #endif // MEDIA_MOJO_CLIENTS_MOJO_AUDIO_DECODER_H_ 95 #endif // MEDIA_MOJO_CLIENTS_MOJO_AUDIO_DECODER_H_
OLDNEW
« no previous file with comments | « no previous file | media/mojo/clients/mojo_audio_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698