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

Unified Diff: media/gpu/dxva_video_decode_accelerator_win.h

Issue 2503063002: media: Inform VideoBlit/MFTransform of video color information (Closed)
Patch Set: flag controlled, updated dx11 path Created 4 years, 1 month 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/media/gpu/dxva_video_decode_accelerator_win.h b/media/gpu/dxva_video_decode_accelerator_win.h
index fbcf804fac61c07a8a0e0c3143d885d3b9ae44c0..e2b94385c56bf35a0cd2bd491cecd7fc5a75b93c 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;
@@ -168,6 +167,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.
@@ -281,7 +283,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.
@@ -301,7 +304,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(
@@ -327,7 +331,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.
@@ -377,6 +384,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
@@ -488,6 +500,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_;

Powered by Google App Engine
This is Rietveld 408576698