Bug 1334971 - Part 2: Fix coding style. r=gerald, a=gchang
authorJean-Yves Avenard <jyavenard@mozilla.com>
Tue, 07 Feb 2017 07:57:04 +0100
changeset 375996 fb6d519b22986ea8978f4bd74f34fb02220b0b0d
parent 375995 019dfad9dcb7d506076a4b6e7479608b26b62ab9
child 375997 e625fef0f4bbd0b8388b5bef32a7f1bb9a0875cc
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgerald, gchang
bugs1334971
milestone53.0a2
Bug 1334971 - Part 2: Fix coding style. r=gerald, a=gchang MozReview-Commit-ID: 1xMcYn354NT
dom/media/platforms/PDMFactory.cpp
dom/media/platforms/PDMFactory.h
--- a/dom/media/platforms/PDMFactory.cpp
+++ b/dom/media/platforms/PDMFactory.cpp
@@ -54,17 +54,18 @@
 
 #include <functional>
 
 namespace mozilla {
 
 extern already_AddRefed<PlatformDecoderModule> CreateAgnosticDecoderModule();
 extern already_AddRefed<PlatformDecoderModule> CreateBlankDecoderModule();
 
-class PDMFactoryImpl final {
+class PDMFactoryImpl final
+{
 public:
   PDMFactoryImpl()
   {
 #ifdef XP_WIN
     WMFDecoderModule::Init();
 #endif
 #ifdef MOZ_APPLEMEDIA
     AppleDecoderModule::Init();
@@ -93,17 +94,18 @@ public:
   };
 
   struct CheckResult
   {
     explicit CheckResult(Reason aReason,
                          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;
     CheckResult& operator=(CheckResult&& aOther) = default;
 
     Reason mReason;
     MediaResult mMediaResult;
   };
@@ -114,35 +116,34 @@ public:
   {
     mCheckerList.AppendElement(mozilla::Forward<Func>(aChecker));
   }
 
   void
   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);
       });
     }
   }
 
   SupportChecker::CheckResult
@@ -257,42 +258,45 @@ PDMFactory::CreateDecoderWithPDM(Platfor
 
   SupportChecker supportChecker;
   const TrackInfo& config = aParams.mConfig;
   supportChecker.AddMediaFormatChecker(config);
 
   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();
       }
       if (result) {
         *result = checkResult.mMediaResult;
       }
     }
     return nullptr;
   }
 
   if (config.IsAudio()) {
     m = aPDM->CreateAudioDecoder(aParams);
     return m.forget();
   }
 
   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;
   }
 
   MediaDataDecoderCallback* callback = aParams.mCallback;
   RefPtr<DecoderCallbackFuzzingWrapper> callbackWrapper;
   if (MediaPrefs::PDMFuzzingEnabled()) {
     callbackWrapper = new DecoderCallbackFuzzingWrapper(callback);
     callbackWrapper->SetVideoOutputMinimumInterval(
--- a/dom/media/platforms/PDMFactory.h
+++ b/dom/media/platforms/PDMFactory.h
@@ -13,17 +13,18 @@
 class CDMProxy;
 
 namespace mozilla {
 
 class DecoderDoctorDiagnostics;
 class PDMFactoryImpl;
 template<class T> class StaticAutoPtr;
 
-class PDMFactory final {
+class PDMFactory final
+{
 public:
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(PDMFactory)
 
   PDMFactory();
 
   // Factory method that creates the appropriate PlatformDecoderModule for
   // the platform we're running on. Caller is responsible for deleting this
   // instance. It's expected that there will be multiple