Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1504)

Unified Diff: media/gpu/dxva_video_decode_accelerator_win.h

Issue 1882373004: Migrate content/common/gpu/media code to media/gpu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix several more bot-identified build issues Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 2d936ac99f928f8545ccca97c9974845688e1a37..f5519872a88e55e4380f2b31ed44d004a100ec8d 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>
@@ -12,7 +12,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>
@@ -29,9 +29,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;
@@ -41,11 +41,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)
@@ -59,9 +59,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
@@ -83,21 +81,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|.
@@ -123,7 +120,7 @@ class CONTENT_EXPORT DXVAVideoDecodeAccelerator
GLenum GetSurfaceInternalFormat() const override;
static media::VideoDecodeAccelerator::SupportedProfiles
- GetSupportedProfiles();
+ GetSupportedProfiles();
// Preload dlls required for decoding.
static void PreSandboxInitialization();
@@ -134,11 +131,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();
@@ -217,8 +214,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.
@@ -344,7 +340,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_;
@@ -485,6 +481,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_

Powered by Google App Engine
This is Rietveld 408576698