Bug 1334971: P2. Fix coding style. r=gerald

MozReview-Commit-ID: 1xMcYn354NT

--HG--
extra : rebase_source : efa9bfd79cbcc5ea402fbc7e421d35e6168b84cb
This commit is contained in:
Jean-Yves Avenard 2017-02-07 07:57:04 +01:00
parent c51aa799df
commit b3e9c44871
2 changed files with 24 additions and 19 deletions

View File

@ -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;
@ -115,23 +117,22 @@ public:
{
if (aTrackConfig.IsVideo()) {
auto mimeType = aTrackConfig.GetAsVideoInfo()->mMimeType;
RefPtr<MediaByteBuffer> extraData = aTrackConfig.GetAsVideoInfo()->mExtraData;
AddToCheckList(
[mimeType, extraData]() {
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"
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.")));
}
}
@ -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,7 +284,8 @@ PDMFactory::CreateDecoderWithPDM(PlatformDecoderModule* aPDM,
}
if (!config.IsVideo()) {
*result = MediaResult(NS_ERROR_DOM_MEDIA_FATAL_ERR,
*result = MediaResult(
NS_ERROR_DOM_MEDIA_FATAL_ERR,
RESULT_DETAIL("Decoder configuration error, expected audio or video."));
return nullptr;
}

View File

@ -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)