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

Side by Side Diff: media/filters/opus_audio_decoder.h

Issue 2543633006: To M56: Use ffmpeg for opus decoding, no need to maintain our decoder. (Closed)
Patch Set: Created 4 years 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/filters/ffmpeg_audio_decoder.cc ('k') | media/filters/opus_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
(Empty)
1 // Copyright (c) 2012 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 MEDIA_FILTERS_OPUS_AUDIO_DECODER_H_
6 #define MEDIA_FILTERS_OPUS_AUDIO_DECODER_H_
7
8 #include "base/callback.h"
9 #include "base/macros.h"
10 #include "base/time/time.h"
11 #include "media/base/audio_decoder.h"
12 #include "media/base/demuxer_stream.h"
13 #include "media/base/sample_format.h"
14
15 struct OpusMSDecoder;
16
17 namespace base {
18 class SingleThreadTaskRunner;
19 }
20
21 namespace media {
22
23 class AudioBuffer;
24 class AudioDiscardHelper;
25 class DecoderBuffer;
26 struct QueuedAudioBuffer;
27
28 class MEDIA_EXPORT OpusAudioDecoder : public AudioDecoder {
29 public:
30 explicit OpusAudioDecoder(
31 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
32 ~OpusAudioDecoder() override;
33
34 // AudioDecoder implementation.
35 std::string GetDisplayName() const override;
36 void Initialize(const AudioDecoderConfig& config,
37 CdmContext* cdm_context,
38 const InitCB& init_cb,
39 const OutputCB& output_cb) override;
40 void Decode(const scoped_refptr<DecoderBuffer>& buffer,
41 const DecodeCB& decode_cb) override;
42 void Reset(const base::Closure& closure) override;
43
44 private:
45 // Reads from the demuxer stream with corresponding callback method.
46 void ReadFromDemuxerStream();
47 void DecodeBuffer(const scoped_refptr<DecoderBuffer>& input,
48 const DecodeCB& decode_cb);
49
50 bool ConfigureDecoder();
51 void CloseDecoder();
52 void ResetTimestampState();
53 bool Decode(const scoped_refptr<DecoderBuffer>& input,
54 scoped_refptr<AudioBuffer>* output_buffer);
55
56 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
57
58 AudioDecoderConfig config_;
59 OutputCB output_cb_;
60 OpusMSDecoder* opus_decoder_;
61 std::unique_ptr<AudioDiscardHelper> discard_helper_;
62
63 DISALLOW_IMPLICIT_CONSTRUCTORS(OpusAudioDecoder);
64 };
65
66 } // namespace media
67
68 #endif // MEDIA_FILTERS_OPUS_AUDIO_DECODER_H_
OLDNEW
« no previous file with comments | « media/filters/ffmpeg_audio_decoder.cc ('k') | media/filters/opus_audio_decoder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698