Backed out changeset 47b318d87004 (bug 1331330) for bustage

This commit is contained in:
Iris Hsiao 2017-02-22 15:31:37 +08:00
Родитель 92c225d322
Коммит 28ba840815
1 изменённых файлов: 10 добавлений и 28 удалений

Просмотреть файл

@ -140,7 +140,7 @@ public:
const CryptoFile& Crypto() const;
bool ReadTrackIndice(mp4parse_byte_data* aIndices, mozilla::TrackID aTrackID);
bool ReadTrackIndex(FallibleTArray<Index::Indice>& aDest, mozilla::TrackID aTrackID);
private:
void UpdateCrypto();
@ -363,26 +363,13 @@ MP4Metadata::Crypto() const
bool
MP4Metadata::ReadTrackIndex(FallibleTArray<Index::Indice>& aDest, mozilla::TrackID aTrackID)
{
bool ret = mStagefright->ReadTrackIndex(aDest, aTrackID);
#ifndef RELEASE_OR_BETA
if (mRustTestMode && ret && mRust) {
mp4parse_byte_data data = {};
bool rustRet = mRust->ReadTrackIndice(&data, aTrackID);
MOZ_DIAGNOSTIC_ASSERT(rustRet);
MOZ_DIAGNOSTIC_ASSERT(data.length == aDest.Length());
for (uint32_t i = 0; i < data.length; i++) {
MOZ_DIAGNOSTIC_ASSERT(data.indices[i].start_offset == aDest[i].start_offset);
MOZ_DIAGNOSTIC_ASSERT(data.indices[i].end_offset == aDest[i].end_offset);
MOZ_DIAGNOSTIC_ASSERT(data.indices[i].start_composition == aDest[i].start_composition);
MOZ_DIAGNOSTIC_ASSERT(data.indices[i].end_composition == aDest[i].end_composition);
MOZ_DIAGNOSTIC_ASSERT(data.indices[i].start_decode == aDest[i].start_decode);
MOZ_DIAGNOSTIC_ASSERT(data.indices[i].sync == aDest[i].sync);
}
#ifdef MOZ_RUST_MP4PARSE
if (mRust && mPreferRust && mRust->ReadTrackIndex(aDest, aTrackID)) {
return true;
}
aDest.Clear();
#endif
return ret;
return mStagefright->ReadTrackIndex(aDest, aTrackID);
}
static inline bool
@ -404,9 +391,6 @@ ConvertIndex(FallibleTArray<Index::Indice>& aDest,
indice.sync = s_indice.sync;
// FIXME: Make this infallible after bug 968520 is done.
MOZ_ALWAYS_TRUE(aDest.AppendElement(indice, mozilla::fallible));
MOZ_LOG(sLog, LogLevel::Debug, ("s_o: %" PRIu64 ", e_o: %" PRIu64 ", s_c: %" PRIu64 ", e_c: %" PRIu64 ", s_d: %" PRIu64 ", sync: %d\n",
indice.start_offset, indice.end_offset, indice.start_composition, indice.end_composition,
indice.start_decode, indice.sync));
}
return true;
}
@ -867,7 +851,7 @@ MP4MetadataRust::Crypto() const
}
bool
MP4MetadataRust::ReadTrackIndice(mp4parse_byte_data* aIndices, mozilla::TrackID aTrackID)
MP4MetadataRust::ReadTrackIndex(FallibleTArray<Index::Indice>& aDest, mozilla::TrackID aTrackID)
{
uint8_t fragmented = false;
auto rv = mp4parse_is_fragmented(mRustParser.get(), aTrackID, &fragmented);
@ -879,12 +863,10 @@ MP4MetadataRust::ReadTrackIndice(mp4parse_byte_data* aIndices, mozilla::TrackID
return true;
}
rv = mp4parse_get_indice_table(mRustParser.get(), aTrackID, aIndices);
if (rv != MP4PARSE_OK) {
return false;
}
// For non-fragmented mp4.
NS_WARNING("Not yet implemented");
return true;
return false;
}
/*static*/ bool