michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=8 sts=2 et sw=2 tw=80: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: #if !defined(MediaInfo_h) michael@0: #define MediaInfo_h michael@0: michael@0: #include "nsSize.h" michael@0: #include "nsRect.h" michael@0: #include "ImageTypes.h" michael@0: michael@0: namespace mozilla { michael@0: michael@0: // Stores info relevant to presenting media frames. michael@0: class VideoInfo { michael@0: public: michael@0: VideoInfo() michael@0: : mDisplay(0,0) michael@0: , mStereoMode(StereoMode::MONO) michael@0: , mHasVideo(false) michael@0: {} michael@0: michael@0: // Size in pixels at which the video is rendered. This is after it has michael@0: // been scaled by its aspect ratio. michael@0: nsIntSize mDisplay; michael@0: michael@0: // Indicates the frame layout for single track stereo videos. michael@0: StereoMode mStereoMode; michael@0: michael@0: // True if we have an active video bitstream. michael@0: bool mHasVideo; michael@0: }; michael@0: michael@0: class AudioInfo { michael@0: public: michael@0: AudioInfo() michael@0: : mRate(44100) michael@0: , mChannels(2) michael@0: , mHasAudio(false) michael@0: {} michael@0: michael@0: // Sample rate. michael@0: uint32_t mRate; michael@0: michael@0: // Number of audio channels. michael@0: uint32_t mChannels; michael@0: michael@0: // True if we have an active audio bitstream. michael@0: bool mHasAudio; michael@0: }; michael@0: michael@0: class MediaInfo { michael@0: public: michael@0: bool HasVideo() const michael@0: { michael@0: return mVideo.mHasVideo; michael@0: } michael@0: michael@0: bool HasAudio() const michael@0: { michael@0: return mAudio.mHasAudio; michael@0: } michael@0: michael@0: bool HasValidMedia() const michael@0: { michael@0: return HasVideo() || HasAudio(); michael@0: } michael@0: michael@0: VideoInfo mVideo; michael@0: AudioInfo mAudio; michael@0: }; michael@0: michael@0: } // namespace mozilla michael@0: michael@0: #endif // MediaInfo_h