Index: media/gpu/dxva_video_decode_accelerator_win.h |
diff --git a/media/gpu/dxva_video_decode_accelerator_win.h b/media/gpu/dxva_video_decode_accelerator_win.h |
index f320ec967048a11320f9c11f93f654f76ad36785..a5aa130491e82522707b4bea86c0e622ae1a3c48 100644 |
--- a/media/gpu/dxva_video_decode_accelerator_win.h |
+++ b/media/gpu/dxva_video_decode_accelerator_win.h |
@@ -71,7 +71,6 @@ class H264ConfigChangeDetector { |
// Detects stream configuration changes. |
// Returns false on failure. |
bool DetectConfig(const uint8_t* stream, unsigned int size); |
- |
bool config_changed() const { return config_changed_; } |
gfx::ColorSpace current_color_space() const; |
@@ -169,6 +168,9 @@ class MEDIA_GPU_EXPORT DXVAVideoDecodeAccelerator |
// passed to the IMFTransform interface implemented by the decoder. |
bool CreateD3DDevManager(); |
+ // TODO(hubbe): COMMENT |
+ bool CreateVideoProcessor(); |
+ |
// Creates and initializes an instance of the DX11 device and the |
// corresponding device manager. The device manager instance is eventually |
// passed to the IMFTransform interface implemented by the decoder. |
@@ -282,7 +284,8 @@ class MEDIA_GPU_EXPORT DXVAVideoDecodeAccelerator |
void CopySurface(IDirect3DSurface9* src_surface, |
IDirect3DSurface9* dest_surface, |
int picture_buffer_id, |
- int input_buffer_id); |
+ int input_buffer_id, |
+ const gfx::ColorSpace& color_space); |
// This is a notification that the source surface |src_surface| was copied to |
// the destination |dest_surface|. Received on the main thread. |
@@ -302,7 +305,8 @@ class MEDIA_GPU_EXPORT DXVAVideoDecodeAccelerator |
base::win::ScopedComPtr<IDXGIKeyedMutex> dest_keyed_mutex, |
uint64_t keyed_mutex_value, |
int picture_buffer_id, |
- int input_buffer_id); |
+ int input_buffer_id, |
+ const gfx::ColorSpace& color_space); |
// Copies the |video_frame| to the destination |dest_texture|. |
void CopyTextureOnDecoderThread( |
@@ -328,7 +332,10 @@ class MEDIA_GPU_EXPORT DXVAVideoDecodeAccelerator |
// Initializes the DX11 Video format converter media types. |
// Returns true on success. |
- bool InitializeDX11VideoFormatConverterMediaType(int width, int height); |
+ bool InitializeDX11VideoFormatConverterMediaType( |
+ int width, |
+ int height, |
+ const gfx::ColorSpace& color_space); |
// Returns the output video frame dimensions (width, height). |
// |sample| :- This is the output sample containing the video frame. |
@@ -380,6 +387,11 @@ class MEDIA_GPU_EXPORT DXVAVideoDecodeAccelerator |
base::win::ScopedComPtr<ID3D11DeviceContext> d3d11_device_context_; |
base::win::ScopedComPtr<ID3D11Query> d3d11_query_; |
+ base::win::ScopedComPtr<IDirectXVideoProcessorService> |
+ video_processor_service_; |
+ base::win::ScopedComPtr<IDirectXVideoProcessor> processor_; |
+ DXVA2_ProcAmpValues default_procamp_values_; |
+ |
// Ideally the reset token would be a stack variable which is used while |
// creating the device manager. However it seems that the device manager |
// holds onto the token and attempts to access it if the underlying device |
@@ -492,6 +504,10 @@ class MEDIA_GPU_EXPORT DXVAVideoDecodeAccelerator |
// Copy NV12 texture to another NV12 texture. |
bool copy_nv12_textures_; |
+ // When converting YUV to RGB, make sure we tell the blitter about the input |
+ // color space so that it can convert it correctly. |
+ bool use_color_info_ = true; |
+ |
// Defaults to false. Indicates if we should use D3D or DX11 interfaces for |
// H/W decoding. |
bool use_dx11_; |
@@ -507,6 +523,9 @@ class MEDIA_GPU_EXPORT DXVAVideoDecodeAccelerator |
// be initialized. Defaults to true. |
bool dx11_video_format_converter_media_type_needs_init_; |
+ // Color spaced used when initializing the dx11 format converter. |
+ gfx::ColorSpace dx11_converter_color_space_; |
+ |
// Set to true if we are sharing ANGLE's device. |
bool using_angle_device_; |