Bug 1317609 - support avc extra data. r=kinetik
authorAlfredo.Yang <ayang@mozilla.com>
Thu, 24 Nov 2016 16:36:08 +0800
changeset 324230 a79e0f500e85dd0da9aeca1801ccee6ed258b884
parent 324229 836a645d53513265a5bfc171047dfffddfb57406
child 324231 e61a652b3f585b4e0993fea48b109fbc38d8df9e
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewerskinetik
bugs1317609
milestone53.0a1
Bug 1317609 - support avc extra data. r=kinetik MozReview-Commit-ID: Kza7utcIpFP
media/libstagefright/binding/DecoderData.cpp
media/libstagefright/binding/MP4Metadata.cpp
--- a/media/libstagefright/binding/DecoderData.cpp
+++ b/media/libstagefright/binding/DecoderData.cpp
@@ -199,16 +199,19 @@ MP4VideoInfo::Update(const mp4parse_trac
   }
   mTrackId = track->track_id;
   mDuration = track->duration;
   mMediaTime = track->media_time;
   mDisplay.width = video->display_width;
   mDisplay.height = video->display_height;
   mImage.width = video->image_width;
   mImage.height = video->image_height;
+  if (video->extra_data.data) {
+    mExtraData->AppendElements(video->extra_data.data, video->extra_data.length);
+  }
 }
 #endif
 
 bool
 MP4VideoInfo::IsValid() const
 {
   return (mDisplay.width > 0 && mDisplay.height > 0) ||
     (mImage.width > 0 && mImage.height > 0);
--- a/media/libstagefright/binding/MP4Metadata.cpp
+++ b/media/libstagefright/binding/MP4Metadata.cpp
@@ -304,16 +304,20 @@ MP4Metadata::GetTrackInfo(mozilla::Track
       //MOZ_DIAGNOSTIC_ASSERT(audioRust->mProfile != audio->mProfile);
       //MOZ_DIAGNOSTIC_ASSERT(audioRust->mExtendedProfile != audio->mExtendedProfile);
       break;
     }
     case mozilla::TrackInfo::kVideoTrack: {
       VideoInfo *videoRust = infoRust->GetAsVideoInfo(), *video = info->GetAsVideoInfo();
       MOZ_DIAGNOSTIC_ASSERT(videoRust->mDisplay == video->mDisplay);
       MOZ_DIAGNOSTIC_ASSERT(videoRust->mImage == video->mImage);
+      MOZ_DIAGNOSTIC_ASSERT(*videoRust->mExtraData == *video->mExtraData);
+      // mCodecSpecificConfig is for video/mp4-es, not video/avc. Since video/mp4-es
+      // is supported on b2g only, it could be removed from TrackInfo.
+      MOZ_DIAGNOSTIC_ASSERT(*videoRust->mCodecSpecificConfig == *video->mCodecSpecificConfig);
       break;
     }
     default:
       break;
     }
   }
 #endif