Source code

Revision control

Other Tools

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/. */
6
7
#ifndef GFX_IMFYCBCRIMAGE_H
8
#define GFX_IMFYCBCRIMAGE_H
9
10
#include "mozilla/layers/TextureD3D11.h"
11
#include "mozilla/RefPtr.h"
12
#include "ImageContainer.h"
13
#include "mfidl.h"
14
15
namespace mozilla {
16
namespace layers {
17
18
class IMFYCbCrImage : public RecyclingPlanarYCbCrImage {
19
public:
20
IMFYCbCrImage(IMFMediaBuffer* aBuffer, IMF2DBuffer* a2DBuffer,
21
KnowsCompositor* aKnowsCompositor, ImageContainer* aContainer);
22
23
bool IsValid() const override { return true; }
24
25
TextureClient* GetTextureClient(KnowsCompositor* aKnowsCompositor) override;
26
27
protected:
28
TextureClient* GetD3D11TextureClient(KnowsCompositor* aKnowsCompositor);
29
static bool CopyDataToTexture(const Data& aData, ID3D11Device* aDevice,
30
DXGIYCbCrTextureData* aTextureData);
31
32
virtual ~IMFYCbCrImage();
33
34
RefPtr<IMFMediaBuffer> mBuffer;
35
RefPtr<IMF2DBuffer> m2DBuffer;
36
RefPtr<D3D11YCbCrRecycleAllocator> mAllocator;
37
RefPtr<TextureClient> mTextureClient;
38
};
39
40
} // namespace layers
41
} // namespace mozilla
42
43
#endif // GFX_D3DSURFACEIMAGE_H