mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1334971: P2. Fix coding style. r=gerald
MozReview-Commit-ID: 1xMcYn354NT --HG-- extra : rebase_source : efa9bfd79cbcc5ea402fbc7e421d35e6168b84cb
This commit is contained in:
parent
c51aa799df
commit
b3e9c44871
@ -54,7 +54,8 @@ namespace mozilla {
|
||||
extern already_AddRefed<PlatformDecoderModule> CreateAgnosticDecoderModule();
|
||||
extern already_AddRefed<PlatformDecoderModule> CreateBlankDecoderModule();
|
||||
|
||||
class PDMFactoryImpl final {
|
||||
class PDMFactoryImpl final
|
||||
{
|
||||
public:
|
||||
PDMFactoryImpl()
|
||||
{
|
||||
@ -93,7 +94,8 @@ public:
|
||||
MediaResult aResult = MediaResult(NS_OK))
|
||||
: mReason(aReason),
|
||||
mMediaResult(mozilla::Move(aResult))
|
||||
{}
|
||||
{
|
||||
}
|
||||
CheckResult(const CheckResult& aOther) = default;
|
||||
CheckResult(CheckResult&& aOther) = default;
|
||||
CheckResult& operator=(const CheckResult& aOther) = default;
|
||||
@ -114,25 +116,24 @@ public:
|
||||
AddMediaFormatChecker(const TrackInfo& aTrackConfig)
|
||||
{
|
||||
if (aTrackConfig.IsVideo()) {
|
||||
auto mimeType = aTrackConfig.GetAsVideoInfo()->mMimeType;
|
||||
RefPtr<MediaByteBuffer> extraData = aTrackConfig.GetAsVideoInfo()->mExtraData;
|
||||
AddToCheckList(
|
||||
[mimeType, extraData]() {
|
||||
auto mimeType = aTrackConfig.GetAsVideoInfo()->mMimeType;
|
||||
RefPtr<MediaByteBuffer> extraData =
|
||||
aTrackConfig.GetAsVideoInfo()->mExtraData;
|
||||
AddToCheckList([mimeType, extraData]() {
|
||||
if (MP4Decoder::IsH264(mimeType)) {
|
||||
mp4_demuxer::SPSData spsdata;
|
||||
// WMF H.264 Video Decoder and Apple ATDecoder
|
||||
// do not support YUV444 format.
|
||||
// For consistency, all decoders should be checked.
|
||||
if (mp4_demuxer::H264::DecodeSPSFromExtraData(extraData, spsdata) &&
|
||||
(spsdata.profile_idc == 244 /* Hi444PP */ ||
|
||||
spsdata.chroma_format_idc == PDMFactory::kYUV444)) {
|
||||
if (mp4_demuxer::H264::DecodeSPSFromExtraData(extraData, spsdata)
|
||||
&& (spsdata.profile_idc == 244 /* Hi444PP */
|
||||
|| spsdata.chroma_format_idc == PDMFactory::kYUV444)) {
|
||||
return CheckResult(
|
||||
SupportChecker::Reason::kVideoFormatNotSupported,
|
||||
MediaResult(
|
||||
NS_ERROR_DOM_MEDIA_FATAL_ERR,
|
||||
RESULT_DETAIL("Decoder may not have the capability to handle"
|
||||
" the requested video format"
|
||||
" with YUV444 chroma subsampling.")));
|
||||
MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
|
||||
RESULT_DETAIL("Decoder may not have the capability "
|
||||
"to handle the requested video format "
|
||||
"with YUV444 chroma subsampling.")));
|
||||
}
|
||||
}
|
||||
return CheckResult(SupportChecker::Reason::kSupported);
|
||||
@ -257,14 +258,16 @@ PDMFactory::CreateDecoderWithPDM(PlatformDecoderModule* aPDM,
|
||||
auto checkResult = supportChecker.Check();
|
||||
if (checkResult.mReason != SupportChecker::Reason::kSupported) {
|
||||
DecoderDoctorDiagnostics* diagnostics = aParams.mDiagnostics;
|
||||
if (checkResult.mReason == SupportChecker::Reason::kVideoFormatNotSupported) {
|
||||
if (checkResult.mReason
|
||||
== SupportChecker::Reason::kVideoFormatNotSupported) {
|
||||
if (diagnostics) {
|
||||
diagnostics->SetVideoNotSupported();
|
||||
}
|
||||
if (result) {
|
||||
*result = checkResult.mMediaResult;
|
||||
}
|
||||
} else if (checkResult.mReason == SupportChecker::Reason::kAudioFormatNotSupported) {
|
||||
} else if (checkResult.mReason
|
||||
== SupportChecker::Reason::kAudioFormatNotSupported) {
|
||||
if (diagnostics) {
|
||||
diagnostics->SetAudioNotSupported();
|
||||
}
|
||||
@ -281,8 +284,9 @@ PDMFactory::CreateDecoderWithPDM(PlatformDecoderModule* aPDM,
|
||||
}
|
||||
|
||||
if (!config.IsVideo()) {
|
||||
*result = MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
|
||||
RESULT_DETAIL("Decoder configuration error, expected audio or video."));
|
||||
*result = MediaResult(
|
||||
NS_ERROR_DOM_MEDIA_FATAL_ERR,
|
||||
RESULT_DETAIL("Decoder configuration error, expected audio or video."));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -18,7 +18,8 @@ class DecoderDoctorDiagnostics;
|
||||
class PDMFactoryImpl;
|
||||
template<class T> class StaticAutoPtr;
|
||||
|
||||
class PDMFactory final {
|
||||
class PDMFactory final
|
||||
{
|
||||
public:
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(PDMFactory)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user