decoder.cc 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // Copyright 2020 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. #include "media/base/decoder.h"
  5. #include "base/notreached.h"
  6. namespace media {
  7. Decoder::Decoder() = default;
  8. Decoder::~Decoder() = default;
  9. bool Decoder::IsPlatformDecoder() const {
  10. return false;
  11. }
  12. bool Decoder::SupportsDecryption() const {
  13. return false;
  14. }
  15. std::string GetDecoderName(VideoDecoderType type) {
  16. switch (type) {
  17. case VideoDecoderType::kUnknown:
  18. return "Unknown Video Decoder";
  19. case VideoDecoderType::kFFmpeg:
  20. return "FFmpegVideoDecoder";
  21. case VideoDecoderType::kVpx:
  22. return "VpxVideoDecoder";
  23. case VideoDecoderType::kAom:
  24. return "AomVideoDecoder";
  25. case VideoDecoderType::kMojo:
  26. return "MojoVideoDecoder";
  27. case VideoDecoderType::kDecrypting:
  28. return "DecryptingVideoDecoder";
  29. case VideoDecoderType::kDav1d:
  30. return "Dav1dVideoDecoder";
  31. case VideoDecoderType::kFuchsia:
  32. return "FuchsiaVideoDecoder";
  33. case VideoDecoderType::kMediaCodec:
  34. return "MediaCodecVideoDecoder";
  35. case VideoDecoderType::kGav1:
  36. return "Gav1VideoDecoder";
  37. case VideoDecoderType::kD3D11:
  38. return "D3D11VideoDecoder";
  39. case VideoDecoderType::kVaapi:
  40. return "VaapiVideoDecoder";
  41. case VideoDecoderType::kBroker:
  42. return "VideoDecoderBroker";
  43. case VideoDecoderType::kVda:
  44. return "VDAVideoDecoder";
  45. case VideoDecoderType::kV4L2:
  46. return "V4L2VideoDecoder";
  47. case VideoDecoderType::kTesting:
  48. return "Testing or Mock Video decoder";
  49. }
  50. }
  51. std::string GetDecoderName(AudioDecoderType type) {
  52. switch (type) {
  53. case AudioDecoderType::kUnknown:
  54. return "Unknown Audio Decoder";
  55. case AudioDecoderType::kFFmpeg:
  56. return "FFmpegAudioDecoder";
  57. case AudioDecoderType::kMojo:
  58. return "MojoAudioDecoder";
  59. case AudioDecoderType::kDecrypting:
  60. return "DecryptingAudioDecoder";
  61. case AudioDecoderType::kMediaCodec:
  62. return "MediaCodecAudioDecoder";
  63. case AudioDecoderType::kBroker:
  64. return "AudioDecoderBroker";
  65. case AudioDecoderType::kTesting:
  66. return "Testing or Mock Audio decoder";
  67. case AudioDecoderType::kAudioToolbox:
  68. return "AudioToolbox";
  69. case AudioDecoderType::kMediaFoundation:
  70. return "MediaFoundationAudioDecoder";
  71. }
  72. }
  73. std::ostream& operator<<(std::ostream& out, AudioDecoderType type) {
  74. return out << GetDecoderName(type);
  75. }
  76. std::ostream& operator<<(std::ostream& out, VideoDecoderType type) {
  77. return out << GetDecoderName(type);
  78. }
  79. } // namespace media