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

Side by Side Diff: content/common/gpu/media/dxva_video_decode_accelerator_win.h

Issue 1842523002: Fix the H.264 config detection code which lead to video playback errors. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | content/common/gpu/media/dxva_video_decode_accelerator_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ 5 #ifndef CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_
6 #define CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ 6 #define CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_
7 7
8 #include <d3d11.h> 8 #include <d3d11.h>
9 #include <d3d9.h> 9 #include <d3d9.h>
10 #include <stdint.h> 10 #include <stdint.h>
(...skipping 11 matching lines...) Expand all
22 22
23 #include "base/compiler_specific.h" 23 #include "base/compiler_specific.h"
24 #include "base/macros.h" 24 #include "base/macros.h"
25 #include "base/memory/linked_ptr.h" 25 #include "base/memory/linked_ptr.h"
26 #include "base/memory/weak_ptr.h" 26 #include "base/memory/weak_ptr.h"
27 #include "base/synchronization/lock.h" 27 #include "base/synchronization/lock.h"
28 #include "base/threading/non_thread_safe.h" 28 #include "base/threading/non_thread_safe.h"
29 #include "base/threading/thread.h" 29 #include "base/threading/thread.h"
30 #include "base/win/scoped_comptr.h" 30 #include "base/win/scoped_comptr.h"
31 #include "content/common/content_export.h" 31 #include "content/common/content_export.h"
32 #include "media/filters/h264_parser.h"
32 #include "media/video/video_decode_accelerator.h" 33 #include "media/video/video_decode_accelerator.h"
33 34
34 interface IMFSample; 35 interface IMFSample;
35 interface IDirect3DSurface9; 36 interface IDirect3DSurface9;
36 37
37 namespace gfx { 38 namespace gfx {
38 class GLContext; 39 class GLContext;
39 } 40 }
40 41
41 typedef HRESULT (WINAPI* CreateDXGIDeviceManager)( 42 typedef HRESULT (WINAPI* CreateDXGIDeviceManager)(
(...skipping 26 matching lines...) Expand all
68 std::vector<uint8_t> last_sps_; 69 std::vector<uint8_t> last_sps_;
69 int last_pps_id_; 70 int last_pps_id_;
70 std::vector<uint8_t> last_pps_; 71 std::vector<uint8_t> last_pps_;
71 // Set to true if we detect a stream configuration change. 72 // Set to true if we detect a stream configuration change.
72 bool config_changed_; 73 bool config_changed_;
73 // We want to indicate configuration changes only after we see IDR slices. 74 // We want to indicate configuration changes only after we see IDR slices.
74 // This flag tracks that we potentially have a configuration change which 75 // This flag tracks that we potentially have a configuration change which
75 // we want to honor after we see an IDR slice. 76 // we want to honor after we see an IDR slice.
76 bool pending_config_changed_; 77 bool pending_config_changed_;
77 78
79 scoped_ptr<media::H264Parser> parser_;
80
78 DISALLOW_COPY_AND_ASSIGN(H264ConfigChangeDetector); 81 DISALLOW_COPY_AND_ASSIGN(H264ConfigChangeDetector);
79 }; 82 };
80 83
81 84
82 // Class to provide a DXVA 2.0 based accelerator using the Microsoft Media 85 // Class to provide a DXVA 2.0 based accelerator using the Microsoft Media
83 // foundation APIs via the VideoDecodeAccelerator interface. 86 // foundation APIs via the VideoDecodeAccelerator interface.
84 // This class lives on a single thread and DCHECKs that it is never accessed 87 // This class lives on a single thread and DCHECKs that it is never accessed
85 // from any other. 88 // from any other.
86 class CONTENT_EXPORT DXVAVideoDecodeAccelerator 89 class CONTENT_EXPORT DXVAVideoDecodeAccelerator
87 : public media::VideoDecodeAccelerator { 90 : public media::VideoDecodeAccelerator {
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 bool using_angle_device_; 442 bool using_angle_device_;
440 443
441 // Enables experimental hardware acceleration for VP8/VP9 video decoding. 444 // Enables experimental hardware acceleration for VP8/VP9 video decoding.
442 const bool enable_accelerated_vpx_decode_; 445 const bool enable_accelerated_vpx_decode_;
443 446
444 // The media foundation H.264 decoder has problems handling changes like 447 // The media foundation H.264 decoder has problems handling changes like
445 // resolution change, bitrate change etc. If we reinitialize the decoder 448 // resolution change, bitrate change etc. If we reinitialize the decoder
446 // when these changes occur then, the decoder works fine. The 449 // when these changes occur then, the decoder works fine. The
447 // H264ConfigChangeDetector class provides functionality to check if the 450 // H264ConfigChangeDetector class provides functionality to check if the
448 // stream configuration changed. 451 // stream configuration changed.
449 H264ConfigChangeDetector config_change_detector_; 452 scoped_ptr<H264ConfigChangeDetector> config_change_detector_;
450 453
451 // Contains the initialization parameters for the video. 454 // Contains the initialization parameters for the video.
452 Config config_; 455 Config config_;
453 456
454 // WeakPtrFactory for posting tasks back to |this|. 457 // WeakPtrFactory for posting tasks back to |this|.
455 base::WeakPtrFactory<DXVAVideoDecodeAccelerator> weak_this_factory_; 458 base::WeakPtrFactory<DXVAVideoDecodeAccelerator> weak_this_factory_;
456 459
457 // Function pointer for the MFCreateDXGIDeviceManager API. 460 // Function pointer for the MFCreateDXGIDeviceManager API.
458 static CreateDXGIDeviceManager create_dxgi_device_manager_; 461 static CreateDXGIDeviceManager create_dxgi_device_manager_;
459 462
460 DISALLOW_COPY_AND_ASSIGN(DXVAVideoDecodeAccelerator); 463 DISALLOW_COPY_AND_ASSIGN(DXVAVideoDecodeAccelerator);
461 }; 464 };
462 465
463 } // namespace content 466 } // namespace content
464 467
465 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_ 468 #endif // CONTENT_COMMON_GPU_MEDIA_DXVA_VIDEO_DECODE_ACCELERATOR_H_
OLDNEW
« no previous file with comments | « no previous file | content/common/gpu/media/dxva_video_decode_accelerator_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698