2013-11-20 21:04:33 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim:set ts=2 sw=2 sts=2 et cindent: */
|
|
|
|
/* 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/. */
|
|
|
|
|
2014-07-09 21:25:10 +00:00
|
|
|
#if !defined(WMFVideoMFTManager_h_)
|
|
|
|
#define WMFVideoMFTManager_h_
|
2013-11-20 21:04:33 +00:00
|
|
|
|
2013-12-02 11:12:35 +00:00
|
|
|
#include "WMF.h"
|
2013-11-20 21:04:33 +00:00
|
|
|
#include "MP4Reader.h"
|
|
|
|
#include "MFTDecoder.h"
|
|
|
|
#include "nsRect.h"
|
2014-02-05 01:29:31 +00:00
|
|
|
#include "WMFMediaDataDecoder.h"
|
2013-11-20 21:04:33 +00:00
|
|
|
#include "mozilla/RefPtr.h"
|
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
|
|
|
|
class DXVA2Manager;
|
|
|
|
|
2014-07-09 21:25:10 +00:00
|
|
|
class WMFVideoMFTManager : public MFTManager {
|
2013-11-20 21:04:33 +00:00
|
|
|
public:
|
2014-07-09 21:25:10 +00:00
|
|
|
WMFVideoMFTManager(const mp4_demuxer::VideoDecoderConfig& aConfig,
|
|
|
|
mozilla::layers::LayersBackend aLayersBackend,
|
|
|
|
mozilla::layers::ImageContainer* aImageContainer,
|
|
|
|
bool aDXVAEnabled);
|
|
|
|
~WMFVideoMFTManager();
|
2013-11-20 21:04:33 +00:00
|
|
|
|
2014-02-05 01:29:31 +00:00
|
|
|
virtual TemporaryRef<MFTDecoder> Init() MOZ_OVERRIDE;
|
2013-11-20 21:04:33 +00:00
|
|
|
|
2014-06-19 22:59:00 +00:00
|
|
|
virtual HRESULT Input(mp4_demuxer::MP4Sample* aSample) MOZ_OVERRIDE;
|
|
|
|
|
2014-02-05 01:29:31 +00:00
|
|
|
virtual HRESULT Output(int64_t aStreamOffset,
|
2014-11-19 21:01:10 +00:00
|
|
|
nsRefPtr<MediaData>& aOutput) MOZ_OVERRIDE;
|
2013-11-20 21:04:33 +00:00
|
|
|
|
2014-09-19 03:44:27 +00:00
|
|
|
virtual void Shutdown() MOZ_OVERRIDE;
|
|
|
|
|
2013-11-20 21:04:33 +00:00
|
|
|
private:
|
|
|
|
|
2014-01-15 03:14:15 +00:00
|
|
|
bool InitializeDXVA();
|
2013-11-20 21:04:33 +00:00
|
|
|
|
|
|
|
HRESULT ConfigureVideoFrameGeometry();
|
|
|
|
|
|
|
|
HRESULT CreateBasicVideoFrame(IMFSample* aSample,
|
2014-02-05 01:29:31 +00:00
|
|
|
int64_t aStreamOffset,
|
2013-11-20 21:04:33 +00:00
|
|
|
VideoData** aOutVideoData);
|
|
|
|
|
|
|
|
HRESULT CreateD3DVideoFrame(IMFSample* aSample,
|
2014-02-05 01:29:31 +00:00
|
|
|
int64_t aStreamOffset,
|
2013-11-20 21:04:33 +00:00
|
|
|
VideoData** aOutVideoData);
|
2014-02-05 01:29:31 +00:00
|
|
|
|
2013-11-20 21:04:33 +00:00
|
|
|
// Video frame geometry.
|
|
|
|
VideoInfo mVideoInfo;
|
|
|
|
uint32_t mVideoStride;
|
|
|
|
uint32_t mVideoWidth;
|
|
|
|
uint32_t mVideoHeight;
|
|
|
|
nsIntRect mPictureRegion;
|
|
|
|
|
2014-02-05 01:29:31 +00:00
|
|
|
RefPtr<MFTDecoder> mDecoder;
|
2013-11-20 21:04:33 +00:00
|
|
|
RefPtr<layers::ImageContainer> mImageContainer;
|
|
|
|
nsAutoPtr<DXVA2Manager> mDXVA2Manager;
|
2014-02-05 01:29:31 +00:00
|
|
|
RefPtr<MediaTaskQueue> mTaskQueue;
|
|
|
|
MediaDataDecoderCallback* mCallback;
|
2013-11-20 21:04:33 +00:00
|
|
|
|
|
|
|
const bool mDXVAEnabled;
|
2014-01-15 03:14:15 +00:00
|
|
|
const layers::LayersBackend mLayersBackend;
|
2013-11-20 21:04:33 +00:00
|
|
|
bool mUseHwAccel;
|
2014-11-11 03:30:52 +00:00
|
|
|
|
|
|
|
enum StreamType {
|
|
|
|
Unknown,
|
|
|
|
H264,
|
|
|
|
VP8,
|
|
|
|
VP9
|
|
|
|
};
|
|
|
|
|
|
|
|
StreamType mStreamType;
|
|
|
|
|
|
|
|
const GUID& GetMFTGUID();
|
|
|
|
const GUID& GetMediaSubtypeGUID();
|
2013-11-20 21:04:33 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2014-07-09 21:25:10 +00:00
|
|
|
#endif // WMFVideoMFTManager_h_
|