Commit 824a4faf authored by servolk's avatar servolk Committed by Commit bot

[Chromecast] Introduce a MediaCapabilitiesShlib::IsSupportedAudioConfig

This new API is similar to IsSupportedVideoConfig and is strictly-typed
unlike the old MediaCodecSupportShlib::IsSupported, which is going to
be deprecated.

Review-Url: https://codereview.chromium.org/2677143003
Cr-Commit-Position: refs/heads/master@{#460576}
parent 94161a50
......@@ -40,5 +40,10 @@ bool MediaCapabilitiesShlib::IsSupportedVideoConfig(VideoCodec codec,
return (codec == kCodecH264 || codec == kCodecVP8 || codec == kCodecVP9);
}
bool MediaCapabilitiesShlib::IsSupportedAudioConfig(const AudioConfig& config) {
return config.codec == kCodecAAC || config.codec == kCodecMP3 ||
config.codec == kCodecPCM;
}
} // namespace media
} // namespace chromecast
......@@ -57,5 +57,12 @@ bool MediaCapabilitiesShlib::IsSupportedVideoConfig(VideoCodec codec,
return false;
}
bool MediaCapabilitiesShlib::IsSupportedAudioConfig(const AudioConfig& config) {
// This should not be called directly.
NOTREACHED() << "Unexpected call to "
<< "MediaCapabilitiesShlib::IsSupportedAudioConfig on Android";
return false;
}
} // namespace media
} // namespace chromecast
......@@ -111,5 +111,10 @@ bool MediaCapabilitiesShlib::IsSupportedVideoConfig(VideoCodec codec,
return (codec == kCodecH264 || codec == kCodecVP8);
}
bool MediaCapabilitiesShlib::IsSupportedAudioConfig(const AudioConfig& config) {
return config.codec == kCodecAAC || config.codec == kCodecMP3 ||
config.codec == kCodecPCM;
}
} // namespace media
} // namespace chromecast
......@@ -52,5 +52,10 @@ bool MediaCapabilitiesShlib::IsSupportedVideoConfig(VideoCodec codec,
return (codec == kCodecH264 || codec == kCodecVP8);
}
bool MediaCapabilitiesShlib::IsSupportedAudioConfig(const AudioConfig& config) {
return config.codec == kCodecAAC || config.codec == kCodecMP3 ||
config.codec == kCodecPCM;
}
} // namespace media
} // namespace chromecast
......@@ -25,6 +25,9 @@ class CHROMECAST_EXPORT MediaCapabilitiesShlib {
static bool IsSupportedVideoConfig(VideoCodec codec,
VideoProfile profile,
int level);
// Return true if the platform supports the given audio |config|.
static bool IsSupportedAudioConfig(const AudioConfig& config);
};
} // namespace media
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment