1 // Copyright 2019 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_RENDERERS_WIN_MEDIA_FOUNDATION_AUDIO_STREAM_H_ 6 #define MEDIA_RENDERERS_WIN_MEDIA_FOUNDATION_AUDIO_STREAM_H_ 7 8 #include <mfapi.h> 9 #include <mfidl.h> 10 11 #include "media/renderers/win/media_foundation_stream_wrapper.h" 12 13 #include "media/media_buildflags.h" 14 15 namespace media { 16 17 // The common audio stream. 18 class MediaFoundationAudioStream : public MediaFoundationStreamWrapper { 19 public: 20 static HRESULT Create(int stream_id, 21 IMFMediaSource* parent_source, 22 DemuxerStream* demuxer_stream, 23 MediaFoundationStreamWrapper** stream_out); 24 bool IsEncrypted() const override; 25 HRESULT GetMediaType(IMFMediaType** media_type_out) override; 26 }; 27 28 #if BUILDFLAG(USE_PROPRIETARY_CODECS) 29 // The AAC specific audio stream. 30 class MediaFoundationAACAudioStream : public MediaFoundationAudioStream { 31 public: 32 HRESULT GetMediaType(IMFMediaType** media_type_out) override; 33 HRESULT TransformSample(Microsoft::WRL::ComPtr<IMFSample>& sample) override; 34 35 private: 36 bool enable_adts_header_removal_ = false; 37 }; 38 #endif // BUILDFLAG(USE_PROPRIETARY_CODECS) 39 40 } // namespace media 41 42 #endif // MEDIA_RENDERERS_WIN_MEDIA_FOUNDATION_AUDIO_STREAM_H_ 43