| Index: media/gpu/dxva_video_decode_accelerator_win.h
|
| diff --git a/content/common/gpu/media/dxva_video_decode_accelerator_win.h b/media/gpu/dxva_video_decode_accelerator_win.h
|
| similarity index 93%
|
| rename from content/common/gpu/media/dxva_video_decode_accelerator_win.h
|
| rename to media/gpu/dxva_video_decode_accelerator_win.h
|
| index 10ad585bb746a28b4511cfd0e0f11639aa47ba22..3f672021b717da0d070ef56fc8a379d30cf46e33 100644
|
| --- a/content/common/gpu/media/dxva_video_decode_accelerator_win.h
|
| +++ b/media/gpu/dxva_video_decode_accelerator_win.h
|
| @@ -2,8 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_
|
| -#define CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_
|
| +#ifndef MEDIA_GPU_DXVA_VIDEO_DECODE_ACCELERATOR_H_
|
| +#define MEDIA_GPU_DXVA_VIDEO_DECODE_ACCELERATOR_H_
|
|
|
| #include <d3d11.h>
|
| #include <d3d9.h>
|
| @@ -13,7 +13,7 @@
|
| // Work around bug in this header by disabling the relevant warning for it.
|
| // https://connect.microsoft.com/VisualStudio/feedback/details/911260/dxva2api-h-in-win8-sdk-triggers-c4201-with-w4
|
| #pragma warning(push)
|
| -#pragma warning(disable:4201)
|
| +#pragma warning(disable : 4201)
|
| #include <dxva2api.h>
|
| #pragma warning(pop)
|
| #include <mfidl.h>
|
| @@ -31,9 +31,9 @@
|
| #include "base/threading/non_thread_safe.h"
|
| #include "base/threading/thread.h"
|
| #include "base/win/scoped_comptr.h"
|
| -#include "content/common/content_export.h"
|
| -#include "content/common/gpu/media/gpu_video_decode_accelerator_helpers.h"
|
| #include "media/filters/h264_parser.h"
|
| +#include "media/gpu/gpu_video_decode_accelerator_helpers.h"
|
| +#include "media/gpu/media_gpu_export.h"
|
| #include "media/video/video_decode_accelerator.h"
|
|
|
| interface IMFSample;
|
| @@ -43,11 +43,11 @@ namespace gfx {
|
| class GLContext;
|
| }
|
|
|
| -typedef HRESULT (WINAPI* CreateDXGIDeviceManager)(
|
| +typedef HRESULT(WINAPI* CreateDXGIDeviceManager)(
|
| UINT* reset_token,
|
| IMFDXGIDeviceManager** device_manager);
|
|
|
| -namespace content {
|
| +namespace media {
|
|
|
| // Provides functionality to detect H.264 stream configuration changes.
|
| // TODO(ananta)
|
| @@ -61,9 +61,7 @@ class H264ConfigChangeDetector {
|
| // Returns false on failure.
|
| bool DetectConfig(const uint8_t* stream, unsigned int size);
|
|
|
| - bool config_changed() const {
|
| - return config_changed_;
|
| - }
|
| + bool config_changed() const { return config_changed_; }
|
|
|
| private:
|
| // These fields are used to track the SPS/PPS in the H.264 bitstream and
|
| @@ -85,21 +83,20 @@ class H264ConfigChangeDetector {
|
| DISALLOW_COPY_AND_ASSIGN(H264ConfigChangeDetector);
|
| };
|
|
|
| -
|
| // Class to provide a DXVA 2.0 based accelerator using the Microsoft Media
|
| // foundation APIs via the VideoDecodeAccelerator interface.
|
| // This class lives on a single thread and DCHECKs that it is never accessed
|
| // from any other.
|
| -class CONTENT_EXPORT DXVAVideoDecodeAccelerator
|
| +class MEDIA_GPU_EXPORT DXVAVideoDecodeAccelerator
|
| : public media::VideoDecodeAccelerator {
|
| public:
|
| enum State {
|
| - kUninitialized, // un-initialized.
|
| - kNormal, // normal playing state.
|
| - kResetting, // upon received Reset(), before ResetDone()
|
| - kStopped, // upon output EOS received.
|
| - kFlushing, // upon flush request received.
|
| - kConfigChange, // stream configuration change detected.
|
| + kUninitialized, // un-initialized.
|
| + kNormal, // normal playing state.
|
| + kResetting, // upon received Reset(), before ResetDone()
|
| + kStopped, // upon output EOS received.
|
| + kFlushing, // upon flush request received.
|
| + kConfigChange, // stream configuration change detected.
|
| };
|
|
|
| // Does not take ownership of |client| which must outlive |*this|.
|
| @@ -125,7 +122,7 @@ class CONTENT_EXPORT DXVAVideoDecodeAccelerator
|
| GLenum GetSurfaceInternalFormat() const override;
|
|
|
| static media::VideoDecodeAccelerator::SupportedProfiles
|
| - GetSupportedProfiles();
|
| + GetSupportedProfiles();
|
|
|
| // Preload dlls required for decoding.
|
| static void PreSandboxInitialization();
|
| @@ -136,11 +133,11 @@ class CONTENT_EXPORT DXVAVideoDecodeAccelerator
|
|
|
| // Returns the minimum resolution for the |profile| passed in.
|
| static std::pair<int, int> GetMinResolution(
|
| - const media::VideoCodecProfile profile);
|
| + const media::VideoCodecProfile profile);
|
|
|
| // Returns the maximum resolution for the |profile| passed in.
|
| static std::pair<int, int> GetMaxResolution(
|
| - const media::VideoCodecProfile profile);
|
| + const media::VideoCodecProfile profile);
|
|
|
| // Returns the maximum resolution for H264 video.
|
| static std::pair<int, int> GetMaxH264Resolution();
|
| @@ -219,8 +216,7 @@ class CONTENT_EXPORT DXVAVideoDecodeAccelerator
|
| void RequestPictureBuffers(int width, int height);
|
|
|
| // Notifies the client about the availability of a picture.
|
| - void NotifyPictureReady(int picture_buffer_id,
|
| - int input_buffer_id);
|
| + void NotifyPictureReady(int picture_buffer_id, int input_buffer_id);
|
|
|
| // Sends pending input buffer processed acks to the client if we don't have
|
| // output samples waiting to be processed.
|
| @@ -346,7 +342,7 @@ class CONTENT_EXPORT DXVAVideoDecodeAccelerator
|
| base::win::ScopedComPtr<IDirect3DDeviceManager9> device_manager_;
|
| base::win::ScopedComPtr<IDirect3DQuery9> query_;
|
|
|
| - base::win::ScopedComPtr<ID3D11Device > d3d11_device_;
|
| + base::win::ScopedComPtr<ID3D11Device> d3d11_device_;
|
| base::win::ScopedComPtr<IMFDXGIDeviceManager> d3d11_device_manager_;
|
| base::win::ScopedComPtr<ID3D10Multithread> multi_threaded_;
|
| base::win::ScopedComPtr<ID3D11DeviceContext> d3d11_device_context_;
|
| @@ -487,6 +483,6 @@ class CONTENT_EXPORT DXVAVideoDecodeAccelerator
|
| DISALLOW_COPY_AND_ASSIGN(DXVAVideoDecodeAccelerator);
|
| };
|
|
|
| -} // namespace content
|
| +} // namespace media
|
|
|
| -#endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_
|
| +#endif // MEDIA_GPU_DXVA_VIDEO_DECODE_ACCELERATOR_H_
|
|
|