summaryrefslogtreecommitdiffstats
path: root/dom/media/MediaInfo.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /dom/media/MediaInfo.cpp
parentInitial commit. (diff)
downloadthunderbird-upstream.tar.xz
thunderbird-upstream.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--dom/media/MediaInfo.cpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/dom/media/MediaInfo.cpp b/dom/media/MediaInfo.cpp
new file mode 100644
index 0000000000..04599819f6
--- /dev/null
+++ b/dom/media/MediaInfo.cpp
@@ -0,0 +1,58 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* vim: set ts=8 sts=2 et sw=2 tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "MediaInfo.h"
+
+namespace mozilla {
+
+const char* TrackTypeToStr(TrackInfo::TrackType aTrack) {
+ switch (aTrack) {
+ case TrackInfo::kUndefinedTrack:
+ return "Undefined";
+ case TrackInfo::kAudioTrack:
+ return "Audio";
+ case TrackInfo::kVideoTrack:
+ return "Video";
+ case TrackInfo::kTextTrack:
+ return "Text";
+ default:
+ return "Unknown";
+ }
+}
+
+bool TrackInfo::IsEqualTo(const TrackInfo& rhs) const {
+ return (
+ mId == rhs.mId && mKind == rhs.mKind && mLabel == rhs.mLabel &&
+ mLanguage == rhs.mLanguage && mEnabled == rhs.mEnabled &&
+ mTrackId == rhs.mTrackId && mMimeType == rhs.mMimeType &&
+ mDuration == rhs.mDuration && mMediaTime == rhs.mMediaTime &&
+ mCrypto.mCryptoScheme == rhs.mCrypto.mCryptoScheme &&
+ mCrypto.mIVSize == rhs.mCrypto.mIVSize &&
+ mCrypto.mKeyId == rhs.mCrypto.mKeyId &&
+ mCrypto.mCryptByteBlock == rhs.mCrypto.mCryptByteBlock &&
+ mCrypto.mSkipByteBlock == rhs.mCrypto.mSkipByteBlock &&
+ mCrypto.mConstantIV == rhs.mCrypto.mConstantIV && mTags == rhs.mTags &&
+ mIsRenderedExternally == rhs.mIsRenderedExternally && mType == rhs.mType);
+}
+
+bool VideoInfo::operator==(const VideoInfo& rhs) const {
+ return (TrackInfo::IsEqualTo(rhs) && mDisplay == rhs.mDisplay &&
+ mStereoMode == rhs.mStereoMode && mImage == rhs.mImage &&
+ *mCodecSpecificConfig == *rhs.mCodecSpecificConfig &&
+ *mExtraData == *rhs.mExtraData && mRotation == rhs.mRotation &&
+ mColorDepth == rhs.mColorDepth && mImageRect == rhs.mImageRect &&
+ mAlphaPresent == rhs.mAlphaPresent);
+}
+
+bool AudioInfo::operator==(const AudioInfo& rhs) const {
+ return (TrackInfo::IsEqualTo(rhs) && mRate == rhs.mRate &&
+ mChannels == rhs.mChannels && mChannelMap == rhs.mChannelMap &&
+ mBitDepth == rhs.mBitDepth && mProfile == rhs.mProfile &&
+ mExtendedProfile == rhs.mExtendedProfile &&
+ mCodecSpecificConfig == rhs.mCodecSpecificConfig);
+}
+
+} // namespace mozilla