Bug 1839170 - Refactor Snap pulling, Add Firefox Snap Core22 and GNOME 42 SDK symbols...
[gecko.git] / dom / media / MediaInfo.cpp
blob04599819f66be53b78888a99b72665143a6f5082
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/. */
7 #include "MediaInfo.h"
9 namespace mozilla {
11 const char* TrackTypeToStr(TrackInfo::TrackType aTrack) {
12 switch (aTrack) {
13 case TrackInfo::kUndefinedTrack:
14 return "Undefined";
15 case TrackInfo::kAudioTrack:
16 return "Audio";
17 case TrackInfo::kVideoTrack:
18 return "Video";
19 case TrackInfo::kTextTrack:
20 return "Text";
21 default:
22 return "Unknown";
26 bool TrackInfo::IsEqualTo(const TrackInfo& rhs) const {
27 return (
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