1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
11 const char* TrackTypeToStr(TrackInfo::TrackType aTrack
) {
13 case TrackInfo::kUndefinedTrack
:
15 case TrackInfo::kAudioTrack
:
17 case TrackInfo::kVideoTrack
:
19 case TrackInfo::kTextTrack
:
26 bool TrackInfo::IsEqualTo(const TrackInfo
& rhs
) const {
28 mId
== rhs
.mId
&& mKind
== rhs
.mKind
&& mLabel
== rhs
.mLabel
&&
29 mLanguage
== rhs
.mLanguage
&& mEnabled
== rhs
.mEnabled
&&
30 mTrackId
== rhs
.mTrackId
&& mMimeType
== rhs
.mMimeType
&&
31 mDuration
== rhs
.mDuration
&& mMediaTime
== rhs
.mMediaTime
&&
32 mCrypto
.mCryptoScheme
== rhs
.mCrypto
.mCryptoScheme
&&
33 mCrypto
.mIVSize
== rhs
.mCrypto
.mIVSize
&&
34 mCrypto
.mKeyId
== rhs
.mCrypto
.mKeyId
&&
35 mCrypto
.mCryptByteBlock
== rhs
.mCrypto
.mCryptByteBlock
&&
36 mCrypto
.mSkipByteBlock
== rhs
.mCrypto
.mSkipByteBlock
&&
37 mCrypto
.mConstantIV
== rhs
.mCrypto
.mConstantIV
&& mTags
== rhs
.mTags
&&
38 mIsRenderedExternally
== rhs
.mIsRenderedExternally
&& mType
== rhs
.mType
);
41 bool VideoInfo::operator==(const VideoInfo
& rhs
) const {
42 return (TrackInfo::IsEqualTo(rhs
) && mDisplay
== rhs
.mDisplay
&&
43 mStereoMode
== rhs
.mStereoMode
&& mImage
== rhs
.mImage
&&
44 *mCodecSpecificConfig
== *rhs
.mCodecSpecificConfig
&&
45 *mExtraData
== *rhs
.mExtraData
&& mRotation
== rhs
.mRotation
&&
46 mColorDepth
== rhs
.mColorDepth
&& mImageRect
== rhs
.mImageRect
&&
47 mAlphaPresent
== rhs
.mAlphaPresent
);
50 bool AudioInfo::operator==(const AudioInfo
& rhs
) const {
51 return (TrackInfo::IsEqualTo(rhs
) && mRate
== rhs
.mRate
&&
52 mChannels
== rhs
.mChannels
&& mChannelMap
== rhs
.mChannelMap
&&
53 mBitDepth
== rhs
.mBitDepth
&& mProfile
== rhs
.mProfile
&&
54 mExtendedProfile
== rhs
.mExtendedProfile
&&
55 mCodecSpecificConfig
== rhs
.mCodecSpecificConfig
);
58 } // namespace mozilla