Bug 1341967 - remove MOZ_RUST_MP4PARSE. r=kinetik

MozReview-Commit-ID: SgTlIo8wEi

--HG--
extra : rebase_source : 263a6cfcf50ee3582f3dc1bfc43d4fa0dcc00800
This commit is contained in:
Alfredo.Yang 2017-03-01 14:44:42 +08:00
Родитель 3f87d6f0d5
Коммит 69731f92d5
8 изменённых файлов: 8 добавлений и 47 удалений

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

@ -56,7 +56,6 @@ ACCEPTED_MAR_CHANNEL_IDS=firefox-mozilla-central
MAR_CHANNEL_ID=firefox-mozilla-central
MOZ_PROFILE_MIGRATOR=1
MOZ_JSDOWNLOADS=1
MOZ_RUST_MP4PARSE=1
# Enable checking that add-ons are signed by the trusted root
MOZ_ADDON_SIGNING=1

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

@ -165,7 +165,7 @@ private:
DECL_MEDIA_PREF("media.ogg.flac.enabled", FlacInOgg, bool, false);
DECL_MEDIA_PREF("media.flac.enabled", FlacEnabled, bool, true);
#if defined(MOZ_RUST_MP4PARSE) && !defined(RELEASE_OR_BETA)
#if !defined(RELEASE_OR_BETA)
DECL_MEDIA_PREF("media.rust.test_mode", RustTestMode, bool, false);
#endif

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

@ -13,11 +13,9 @@
#include "mozilla/ArrayUtils.h"
#include "include/ESDS.h"
#ifdef MOZ_RUST_MP4PARSE
// OpusDecoder header is really needed only by MP4 in rust
#include "OpusDecoder.h"
#include "mp4parse.h"
#endif
using namespace stagefright;
@ -189,7 +187,6 @@ MP4VideoInfo::Update(const MetaData* aMetaData, const char* aMimeType)
}
#ifdef MOZ_RUST_MP4PARSE
static void
UpdateTrackProtectedInfo(mozilla::TrackInfo& aConfig,
const mp4parse_sinf_info& aSinf)
@ -269,7 +266,6 @@ MP4VideoInfo::Update(const mp4parse_track_info* track,
mExtraData->AppendElements(video->extra_data.data, video->extra_data.length);
}
}
#endif
bool
MP4VideoInfo::IsValid() const

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

@ -19,16 +19,14 @@
#include "mp4_demuxer/MP4Metadata.h"
#include "mp4_demuxer/Stream.h"
#include "MediaPrefs.h"
#include "mp4parse.h"
#include <limits>
#include <stdint.h>
#include <vector>
#ifdef MOZ_RUST_MP4PARSE
#include "mp4parse.h"
struct FreeMP4Parser { void operator()(mp4parse_parser* aPtr) { mp4parse_free(aPtr); } };
#endif
using namespace stagefright;
@ -103,8 +101,6 @@ private:
bool mCanSeek;
};
#ifdef MOZ_RUST_MP4PARSE
// Wrap an mp4_demuxer::Stream to remember the read offset.
class RustStreamAdaptor {
@ -149,11 +145,9 @@ private:
RustStreamAdaptor mRustSource;
mozilla::UniquePtr<mp4parse_parser, FreeMP4Parser> mRustParser;
};
#endif
MP4Metadata::MP4Metadata(Stream* aSource)
: mStagefright(MakeUnique<MP4MetadataStagefright>(aSource))
#ifdef MOZ_RUST_MP4PARSE
, mRust(MakeUnique<MP4MetadataRust>(aSource))
, mPreferRust(false)
, mReportedAudioTrackTelemetry(false)
@ -161,7 +155,6 @@ MP4Metadata::MP4Metadata(Stream* aSource)
#ifndef RELEASE_OR_BETA
, mRustTestMode(MediaPrefs::RustTestMode())
#endif
#endif
{
}
@ -193,7 +186,6 @@ MP4Metadata::GetNumberTracks(mozilla::TrackInfo::TrackType aType) const
{
uint32_t numTracks = mStagefright->GetNumberTracks(aType);
#ifdef MOZ_RUST_MP4PARSE
if (!mRust) {
return numTracks;
}
@ -219,12 +211,10 @@ MP4Metadata::GetNumberTracks(mozilla::TrackInfo::TrackType aType) const
mPreferRust = true;
return numTracksRust;
}
#endif // MOZ_RUST_MP4PARSE
return numTracks;
}
#ifdef MOZ_RUST_MP4PARSE
bool MP4Metadata::ShouldPreferRust() const {
if (!mRust) {
return false;
@ -255,7 +245,6 @@ bool MP4Metadata::ShouldPreferRust() const {
// Otherwise, fall back.
return false;
}
#endif // MOZ_RUST_MP4PARSE
mozilla::UniquePtr<mozilla::TrackInfo>
MP4Metadata::GetTrackInfo(mozilla::TrackInfo::TrackType aType,
@ -264,7 +253,6 @@ MP4Metadata::GetTrackInfo(mozilla::TrackInfo::TrackType aType,
mozilla::UniquePtr<mozilla::TrackInfo> info =
mStagefright->GetTrackInfo(aType, aTrackNumber);
#ifdef MOZ_RUST_MP4PARSE
if (!mRust) {
return info;
}
@ -314,12 +302,9 @@ MP4Metadata::GetTrackInfo(mozilla::TrackInfo::TrackType aType,
}
#endif
if (!mPreferRust) {
return info;
if (mPreferRust) {
return infoRust;
}
MOZ_ASSERT(infoRust);
return infoRust;
#endif
return info;
}
@ -334,8 +319,6 @@ const CryptoFile&
MP4Metadata::Crypto() const
{
const CryptoFile& crypto = mStagefright->Crypto();
#ifdef MOZ_RUST_MP4PARSE
const CryptoFile& rustCrypto = mRust->Crypto();
#ifndef RELEASE_OR_BETA
@ -347,7 +330,6 @@ MP4Metadata::Crypto() const
if (mPreferRust) {
return rustCrypto;
}
#endif
return crypto;
}
@ -612,7 +594,6 @@ MP4MetadataStagefright::Metadata(Stream* aSource)
return parser->Metadata();
}
#ifdef MOZ_RUST_MP4PARSE
bool
RustStreamAdaptor::Read(uint8_t* buffer, uintptr_t size, size_t* bytes_read)
{
@ -878,6 +859,5 @@ MP4MetadataRust::Metadata(Stream* aSource)
MOZ_ASSERT(false, "Not yet implemented");
return nullptr;
}
#endif
} // namespace mp4_demuxer

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

@ -19,13 +19,11 @@ namespace stagefright
class MetaData;
}
#ifdef MOZ_RUST_MP4PARSE
extern "C" {
typedef struct mp4parse_track_info mp4parse_track_info;
typedef struct mp4parse_track_audio_info mp4parse_track_audio_info;
typedef struct mp4parse_track_video_info mp4parse_track_video_info;
}
#endif
namespace mp4_demuxer
{
@ -73,10 +71,8 @@ public:
void Update(const stagefright::MetaData* aMetaData,
const char* aMimeType);
#ifdef MOZ_RUST_MP4PARSE
void Update(const mp4parse_track_info* track,
const mp4parse_track_audio_info* audio);
#endif
virtual bool IsValid() const override;
};
@ -89,10 +85,8 @@ public:
void Update(const stagefright::MetaData* aMetaData,
const char* aMimeType);
#ifdef MOZ_RUST_MP4PARSE
void Update(const mp4parse_track_info* track,
const mp4parse_track_video_info* video);
#endif
virtual bool IsValid() const override;
};

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

@ -36,7 +36,6 @@ public:
private:
UniquePtr<MP4MetadataStagefright> mStagefright;
#ifdef MOZ_RUST_MP4PARSE
UniquePtr<MP4MetadataRust> mRust;
mutable bool mPreferRust;
mutable bool mReportedAudioTrackTelemetry;
@ -45,7 +44,6 @@ private:
mutable bool mRustTestMode;
#endif
bool ShouldPreferRust() const;
#endif
};
} // namespace mp4_demuxer

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

@ -30,8 +30,6 @@ MOZ_XULRUNNER=
MOZ_CAPTURE=1
MOZ_RAW=1
MOZ_RUST_MP4PARSE=1
# use custom widget for html:select
MOZ_USE_NATIVE_POPUP_WINDOWS=1

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

@ -6966,8 +6966,7 @@
"expires_in_version": "55",
"kind": "boolean",
"bug_numbers": [1220885],
"description": "(Bug 1220885) Whether the rust mp4 demuxer successfully parsed a stream segment.",
"cpp_guard": "MOZ_RUST_MP4PARSE"
"description": "(Bug 1220885) Whether the rust mp4 demuxer successfully parsed a stream segment."
},
"MEDIA_RUST_MP4PARSE_ERROR_CODE": {
"alert_emails": ["giles@mozilla.com", "kinetik@flim.org"],
@ -6975,24 +6974,21 @@
"kind": "enumerated",
"n_values": 32,
"bug_numbers": [1238420],
"description": "The error code reported when an MP4 parse attempt has failed.0 = OK, 1 = bad argument, 2 = invalid data, 3 = unsupported, 4 = unexpected end of file, 5 = read error.",
"cpp_guard": "MOZ_RUST_MP4PARSE"
"description": "The error code reported when an MP4 parse attempt has failed.0 = OK, 1 = bad argument, 2 = invalid data, 3 = unsupported, 4 = unexpected end of file, 5 = read error."
},
"MEDIA_RUST_MP4PARSE_TRACK_MATCH_AUDIO": {
"alert_emails": ["giles@mozilla.com", "kinetik@flim.org"],
"expires_in_version": "55",
"kind": "boolean",
"bug_numbers": [1231169],
"description": "Whether rust and stagefight mp4 parser audio track results match.",
"cpp_guard": "MOZ_RUST_MP4PARSE"
"description": "Whether rust and stagefight mp4 parser audio track results match."
},
"MEDIA_RUST_MP4PARSE_TRACK_MATCH_VIDEO": {
"alert_emails": ["giles@mozilla.com", "kinetik@flim.org"],
"expires_in_version": "55",
"kind": "boolean",
"bug_numbers": [1231169],
"description": "Whether rust and stagefight mp4 parser video track results match.",
"cpp_guard": "MOZ_RUST_MP4PARSE"
"description": "Whether rust and stagefight mp4 parser video track results match."
},
"MEDIA_WMF_DECODE_ERROR": {
"expires_in_version": "55",