media_foundation_audio_stream.h 1.5 KB

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