| OLD | NEW |
| 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 #include "media/gpu/dxva_video_decode_accelerator_win.h" | 5 #include "media/gpu/dxva_video_decode_accelerator_win.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #if !defined(OS_WIN) | 9 #if !defined(OS_WIN) |
| 10 #error This file should only be built on Windows. | 10 #error This file should only be built on Windows. |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 583 codec_(media::kUnknownVideoCodec), | 583 codec_(media::kUnknownVideoCodec), |
| 584 decoder_thread_("DXVAVideoDecoderThread"), | 584 decoder_thread_("DXVAVideoDecoderThread"), |
| 585 pending_flush_(false), | 585 pending_flush_(false), |
| 586 share_nv12_textures_(gpu_preferences.enable_zero_copy_dxgi_video), | 586 share_nv12_textures_(gpu_preferences.enable_zero_copy_dxgi_video), |
| 587 use_dx11_(false), | 587 use_dx11_(false), |
| 588 use_keyed_mutex_(false), | 588 use_keyed_mutex_(false), |
| 589 dx11_video_format_converter_media_type_needs_init_(true), | 589 dx11_video_format_converter_media_type_needs_init_(true), |
| 590 using_angle_device_(false), | 590 using_angle_device_(false), |
| 591 enable_accelerated_vpx_decode_( | 591 enable_accelerated_vpx_decode_( |
| 592 gpu_preferences.enable_accelerated_vpx_decode), | 592 gpu_preferences.enable_accelerated_vpx_decode), |
| 593 processing_config_changed_(false), |
| 593 weak_this_factory_(this) { | 594 weak_this_factory_(this) { |
| 594 weak_ptr_ = weak_this_factory_.GetWeakPtr(); | 595 weak_ptr_ = weak_this_factory_.GetWeakPtr(); |
| 595 memset(&input_stream_info_, 0, sizeof(input_stream_info_)); | 596 memset(&input_stream_info_, 0, sizeof(input_stream_info_)); |
| 596 memset(&output_stream_info_, 0, sizeof(output_stream_info_)); | 597 memset(&output_stream_info_, 0, sizeof(output_stream_info_)); |
| 597 } | 598 } |
| 598 | 599 |
| 599 DXVAVideoDecodeAccelerator::~DXVAVideoDecodeAccelerator() { | 600 DXVAVideoDecodeAccelerator::~DXVAVideoDecodeAccelerator() { |
| 600 client_ = NULL; | 601 client_ = NULL; |
| 601 } | 602 } |
| 602 | 603 |
| (...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 PLATFORM_FAILURE, ); | 921 PLATFORM_FAILURE, ); |
| 921 | 922 |
| 922 bool inserted = | 923 bool inserted = |
| 923 output_picture_buffers_ | 924 output_picture_buffers_ |
| 924 .insert(std::make_pair(buffers[buffer_index].id(), picture_buffer)) | 925 .insert(std::make_pair(buffers[buffer_index].id(), picture_buffer)) |
| 925 .second; | 926 .second; |
| 926 DCHECK(inserted); | 927 DCHECK(inserted); |
| 927 } | 928 } |
| 928 | 929 |
| 929 ProcessPendingSamples(); | 930 ProcessPendingSamples(); |
| 930 if (pending_flush_) { | 931 if (pending_flush_ || processing_config_changed_) { |
| 931 decoder_thread_task_runner_->PostTask( | 932 decoder_thread_task_runner_->PostTask( |
| 932 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::FlushInternal, | 933 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::FlushInternal, |
| 933 base::Unretained(this))); | 934 base::Unretained(this))); |
| 934 } | 935 } |
| 935 } | 936 } |
| 936 | 937 |
| 937 void DXVAVideoDecodeAccelerator::ReusePictureBuffer(int32_t picture_buffer_id) { | 938 void DXVAVideoDecodeAccelerator::ReusePictureBuffer(int32_t picture_buffer_id) { |
| 938 TRACE_EVENT0("media", "DXVAVideoDecodeAccelerator::ReusePictureBuffer"); | 939 TRACE_EVENT0("media", "DXVAVideoDecodeAccelerator::ReusePictureBuffer"); |
| 939 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); | 940 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); |
| 940 | 941 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 weak_this_factory_.GetWeakPtr(), | 1014 weak_this_factory_.GetWeakPtr(), |
| 1014 picture_buffer_id, count + 1), | 1015 picture_buffer_id, count + 1), |
| 1015 base::TimeDelta::FromMilliseconds(kFlushDecoderSurfaceTimeoutMs)); | 1016 base::TimeDelta::FromMilliseconds(kFlushDecoderSurfaceTimeoutMs)); |
| 1016 return; | 1017 return; |
| 1017 } | 1018 } |
| 1018 RETURN_AND_NOTIFY_ON_FAILURE(picture_buffer->ReusePictureBuffer(), | 1019 RETURN_AND_NOTIFY_ON_FAILURE(picture_buffer->ReusePictureBuffer(), |
| 1019 "Failed to reuse picture buffer", | 1020 "Failed to reuse picture buffer", |
| 1020 PLATFORM_FAILURE, ); | 1021 PLATFORM_FAILURE, ); |
| 1021 | 1022 |
| 1022 ProcessPendingSamples(); | 1023 ProcessPendingSamples(); |
| 1023 if (pending_flush_) { | 1024 if (pending_flush_ || processing_config_changed_) { |
| 1024 decoder_thread_task_runner_->PostTask( | 1025 decoder_thread_task_runner_->PostTask( |
| 1025 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::FlushInternal, | 1026 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::FlushInternal, |
| 1026 base::Unretained(this))); | 1027 base::Unretained(this))); |
| 1027 } | 1028 } |
| 1028 } | 1029 } |
| 1029 | 1030 |
| 1030 void DXVAVideoDecodeAccelerator::Flush() { | 1031 void DXVAVideoDecodeAccelerator::Flush() { |
| 1031 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); | 1032 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); |
| 1032 | 1033 |
| 1033 DVLOG(1) << "DXVAVideoDecodeAccelerator::Flush"; | 1034 DVLOG(1) << "DXVAVideoDecodeAccelerator::Flush"; |
| 1034 | 1035 |
| 1035 State state = GetState(); | 1036 State state = GetState(); |
| 1036 RETURN_AND_NOTIFY_ON_FAILURE((state == kNormal || state == kStopped), | 1037 RETURN_AND_NOTIFY_ON_FAILURE((state == kNormal || state == kStopped), |
| 1037 "Unexpected decoder state: " << state, | 1038 "Unexpected decoder state: " << state, |
| 1038 ILLEGAL_STATE, ); | 1039 ILLEGAL_STATE, ); |
| 1039 | 1040 |
| 1040 SetState(kFlushing); | 1041 SetState(kFlushing); |
| 1041 | 1042 |
| 1042 pending_flush_ = true; | 1043 pending_flush_ = true; |
| 1043 | 1044 |
| 1045 // If we receive a flush while processing a video stream config change, then |
| 1046 // we treat this as a regular flush, i.e we process queued decode packets, |
| 1047 // etc. |
| 1048 // We are resetting the processing_config_changed_ flag here which means that |
| 1049 // we won't be tearing down the decoder instance and recreating it to handle |
| 1050 // the changed configuration. The expectation here is that after the decoder |
| 1051 // is drained it should be able to handle a changed configuration. |
| 1052 // TODO(ananta) |
| 1053 // If a flush is sufficient to get the decoder to process video stream config |
| 1054 // changes correctly, then we don't need to tear down the decoder instance |
| 1055 // and recreate it. Check if this is indeed the case. |
| 1056 processing_config_changed_ = false; |
| 1057 |
| 1044 decoder_thread_task_runner_->PostTask( | 1058 decoder_thread_task_runner_->PostTask( |
| 1045 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::FlushInternal, | 1059 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::FlushInternal, |
| 1046 base::Unretained(this))); | 1060 base::Unretained(this))); |
| 1047 } | 1061 } |
| 1048 | 1062 |
| 1049 void DXVAVideoDecodeAccelerator::Reset() { | 1063 void DXVAVideoDecodeAccelerator::Reset() { |
| 1050 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); | 1064 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); |
| 1051 | 1065 |
| 1052 DVLOG(1) << "DXVAVideoDecodeAccelerator::Reset"; | 1066 DVLOG(1) << "DXVAVideoDecodeAccelerator::Reset"; |
| 1053 | 1067 |
| (...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1836 d3d11_device_manager_.Release(); | 1850 d3d11_device_manager_.Release(); |
| 1837 d3d11_query_.Release(); | 1851 d3d11_query_.Release(); |
| 1838 dx11_video_format_converter_media_type_needs_init_ = true; | 1852 dx11_video_format_converter_media_type_needs_init_ = true; |
| 1839 multi_threaded_.Release(); | 1853 multi_threaded_.Release(); |
| 1840 } else { | 1854 } else { |
| 1841 d3d9_.Release(); | 1855 d3d9_.Release(); |
| 1842 d3d9_device_ex_.Release(); | 1856 d3d9_device_ex_.Release(); |
| 1843 device_manager_.Release(); | 1857 device_manager_.Release(); |
| 1844 query_.Release(); | 1858 query_.Release(); |
| 1845 } | 1859 } |
| 1846 | 1860 sent_drain_message_ = false; |
| 1847 SetState(kUninitialized); | 1861 SetState(kUninitialized); |
| 1848 } | 1862 } |
| 1849 | 1863 |
| 1850 void DXVAVideoDecodeAccelerator::NotifyInputBufferRead(int input_buffer_id) { | 1864 void DXVAVideoDecodeAccelerator::NotifyInputBufferRead(int input_buffer_id) { |
| 1851 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); | 1865 DCHECK(main_thread_task_runner_->BelongsToCurrentThread()); |
| 1852 if (client_) | 1866 if (client_) |
| 1853 client_->NotifyEndOfBitstreamBuffer(input_buffer_id); | 1867 client_->NotifyEndOfBitstreamBuffer(input_buffer_id); |
| 1854 } | 1868 } |
| 1855 | 1869 |
| 1856 void DXVAVideoDecodeAccelerator::NotifyFlushDone() { | 1870 void DXVAVideoDecodeAccelerator::NotifyFlushDone() { |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1912 "Failed to get buffer id associated with sample", ); | 1926 "Failed to get buffer id associated with sample", ); |
| 1913 client_->NotifyEndOfBitstreamBuffer(input_buffer_id); | 1927 client_->NotifyEndOfBitstreamBuffer(input_buffer_id); |
| 1914 } | 1928 } |
| 1915 pending_input_buffers_.clear(); | 1929 pending_input_buffers_.clear(); |
| 1916 } | 1930 } |
| 1917 | 1931 |
| 1918 void DXVAVideoDecodeAccelerator::DecodePendingInputBuffers() { | 1932 void DXVAVideoDecodeAccelerator::DecodePendingInputBuffers() { |
| 1919 TRACE_EVENT0("media", | 1933 TRACE_EVENT0("media", |
| 1920 "DXVAVideoDecodeAccelerator::DecodePendingInputBuffers"); | 1934 "DXVAVideoDecodeAccelerator::DecodePendingInputBuffers"); |
| 1921 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); | 1935 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); |
| 1936 DCHECK(!processing_config_changed_); |
| 1937 |
| 1922 State state = GetState(); | 1938 State state = GetState(); |
| 1923 RETURN_AND_NOTIFY_ON_FAILURE((state != kUninitialized), | 1939 RETURN_AND_NOTIFY_ON_FAILURE((state != kUninitialized), |
| 1924 "Invalid state: " << state, ILLEGAL_STATE, ); | 1940 "Invalid state: " << state, ILLEGAL_STATE, ); |
| 1925 | 1941 |
| 1926 if (pending_input_buffers_.empty() || OutputSamplesPresent()) | 1942 if (pending_input_buffers_.empty() || OutputSamplesPresent()) |
| 1927 return; | 1943 return; |
| 1928 | 1944 |
| 1929 PendingInputs pending_input_buffers_copy; | 1945 PendingInputs pending_input_buffers_copy; |
| 1930 std::swap(pending_input_buffers_, pending_input_buffers_copy); | 1946 std::swap(pending_input_buffers_, pending_input_buffers_copy); |
| 1931 | 1947 |
| 1932 for (PendingInputs::iterator it = pending_input_buffers_copy.begin(); | 1948 for (PendingInputs::iterator it = pending_input_buffers_copy.begin(); |
| 1933 it != pending_input_buffers_copy.end(); ++it) { | 1949 it != pending_input_buffers_copy.end(); ++it) { |
| 1934 DecodeInternal(*it); | 1950 DecodeInternal(*it); |
| 1935 } | 1951 } |
| 1936 } | 1952 } |
| 1937 | 1953 |
| 1938 void DXVAVideoDecodeAccelerator::FlushInternal() { | 1954 void DXVAVideoDecodeAccelerator::FlushInternal() { |
| 1939 TRACE_EVENT0("media", "DXVAVideoDecodeAccelerator::FlushInternal"); | 1955 TRACE_EVENT0("media", "DXVAVideoDecodeAccelerator::FlushInternal"); |
| 1940 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); | 1956 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); |
| 1941 | 1957 |
| 1942 // We allow only one output frame to be present at any given time. If we have | 1958 // We allow only one output frame to be present at any given time. If we have |
| 1943 // an output frame, then we cannot complete the flush at this time. | 1959 // an output frame, then we cannot complete the flush at this time. |
| 1944 if (OutputSamplesPresent()) | 1960 if (OutputSamplesPresent()) |
| 1945 return; | 1961 return; |
| 1946 | 1962 |
| 1947 // First drain the pending input because once the drain message is sent below, | 1963 // First drain the pending input because once the drain message is sent below, |
| 1948 // the decoder will ignore further input until it's drained. | 1964 // the decoder will ignore further input until it's drained. |
| 1949 if (!pending_input_buffers_.empty()) { | 1965 // If we are processing a video configuration change, then we should just |
| 1966 // the drain the decoder. |
| 1967 if (!processing_config_changed_ && !pending_input_buffers_.empty()) { |
| 1950 decoder_thread_task_runner_->PostTask( | 1968 decoder_thread_task_runner_->PostTask( |
| 1951 FROM_HERE, | 1969 FROM_HERE, |
| 1952 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, | 1970 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, |
| 1953 base::Unretained(this))); | 1971 base::Unretained(this))); |
| 1954 decoder_thread_task_runner_->PostTask( | 1972 decoder_thread_task_runner_->PostTask( |
| 1955 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::FlushInternal, | 1973 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::FlushInternal, |
| 1956 base::Unretained(this))); | 1974 base::Unretained(this))); |
| 1957 return; | 1975 return; |
| 1958 } | 1976 } |
| 1959 | 1977 |
| 1960 { | 1978 { |
| 1961 base::AutoLock lock(decoder_lock_); | 1979 base::AutoLock lock(decoder_lock_); |
| 1962 if (!sent_drain_message_) { | 1980 if (!sent_drain_message_) { |
| 1963 RETURN_AND_NOTIFY_ON_FAILURE(SendMFTMessage(MFT_MESSAGE_COMMAND_DRAIN, 0), | 1981 RETURN_AND_NOTIFY_ON_FAILURE(SendMFTMessage(MFT_MESSAGE_COMMAND_DRAIN, 0), |
| 1964 "Failed to send drain message", | 1982 "Failed to send drain message", |
| 1965 PLATFORM_FAILURE, ); | 1983 PLATFORM_FAILURE, ); |
| 1966 sent_drain_message_ = true; | 1984 sent_drain_message_ = true; |
| 1967 } | 1985 } |
| 1968 } | 1986 } |
| 1969 | 1987 |
| 1970 // Attempt to retrieve an output frame from the decoder. If we have one, | 1988 // Attempt to retrieve an output frame from the decoder. If we have one, |
| 1971 // return and proceed when the output frame is processed. If we don't have a | 1989 // return and proceed when the output frame is processed. If we don't have a |
| 1972 // frame then we are done. | 1990 // frame then we are done. |
| 1973 DoDecode(); | 1991 DoDecode(); |
| 1974 if (OutputSamplesPresent()) | 1992 if (OutputSamplesPresent()) |
| 1975 return; | 1993 return; |
| 1976 | 1994 |
| 1977 SetState(kFlushing); | 1995 if (!processing_config_changed_) { |
| 1996 SetState(kFlushing); |
| 1978 | 1997 |
| 1979 main_thread_task_runner_->PostTask( | 1998 main_thread_task_runner_->PostTask( |
| 1980 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::NotifyFlushDone, | 1999 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::NotifyFlushDone, |
| 1981 weak_this_factory_.GetWeakPtr())); | 2000 weak_this_factory_.GetWeakPtr())); |
| 2001 } else { |
| 2002 processing_config_changed_ = false; |
| 2003 main_thread_task_runner_->PostTask( |
| 2004 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::ConfigChanged, |
| 2005 weak_this_factory_.GetWeakPtr(), config_)); |
| 2006 } |
| 1982 | 2007 |
| 1983 SetState(kNormal); | 2008 SetState(kNormal); |
| 1984 } | 2009 } |
| 1985 | 2010 |
| 1986 void DXVAVideoDecodeAccelerator::DecodeInternal( | 2011 void DXVAVideoDecodeAccelerator::DecodeInternal( |
| 1987 const base::win::ScopedComPtr<IMFSample>& sample) { | 2012 const base::win::ScopedComPtr<IMFSample>& sample) { |
| 1988 TRACE_EVENT0("media", "DXVAVideoDecodeAccelerator::DecodeInternal"); | 2013 TRACE_EVENT0("media", "DXVAVideoDecodeAccelerator::DecodeInternal"); |
| 1989 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); | 2014 DCHECK(decoder_thread_task_runner_->BelongsToCurrentThread()); |
| 1990 | 2015 |
| 1991 if (GetState() == kUninitialized) | 2016 if (GetState() == kUninitialized) |
| 1992 return; | 2017 return; |
| 1993 | 2018 |
| 1994 if (OutputSamplesPresent() || !pending_input_buffers_.empty()) { | 2019 if (OutputSamplesPresent() || !pending_input_buffers_.empty()) { |
| 1995 pending_input_buffers_.push_back(sample); | 2020 pending_input_buffers_.push_back(sample); |
| 1996 return; | 2021 return; |
| 1997 } | 2022 } |
| 1998 | 2023 |
| 1999 // Check if the resolution, bit rate, etc changed in the stream. If yes we | 2024 // Check if the resolution, bit rate, etc changed in the stream. If yes we |
| 2000 // reinitialize the decoder to ensure that the stream decodes correctly. | 2025 // reinitialize the decoder to ensure that the stream decodes correctly. |
| 2001 bool config_changed = false; | 2026 bool config_changed = false; |
| 2002 | 2027 |
| 2003 HRESULT hr = CheckConfigChanged(sample.get(), &config_changed); | 2028 HRESULT hr = CheckConfigChanged(sample.get(), &config_changed); |
| 2004 RETURN_AND_NOTIFY_ON_HR_FAILURE(hr, "Failed to check video stream config", | 2029 RETURN_AND_NOTIFY_ON_HR_FAILURE(hr, "Failed to check video stream config", |
| 2005 PLATFORM_FAILURE, ); | 2030 PLATFORM_FAILURE, ); |
| 2006 | 2031 |
| 2032 processing_config_changed_ = config_changed; |
| 2033 |
| 2007 if (config_changed) { | 2034 if (config_changed) { |
| 2008 pending_input_buffers_.push_back(sample); | 2035 pending_input_buffers_.push_back(sample); |
| 2009 main_thread_task_runner_->PostTask( | 2036 FlushInternal(); |
| 2010 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::ConfigChanged, | |
| 2011 weak_this_factory_.GetWeakPtr(), config_)); | |
| 2012 return; | 2037 return; |
| 2013 } | 2038 } |
| 2014 | 2039 |
| 2015 if (!inputs_before_decode_) { | 2040 if (!inputs_before_decode_) { |
| 2016 TRACE_EVENT_ASYNC_BEGIN0("gpu", "DXVAVideoDecodeAccelerator.Decoding", | 2041 TRACE_EVENT_ASYNC_BEGIN0("gpu", "DXVAVideoDecodeAccelerator.Decoding", |
| 2017 this); | 2042 this); |
| 2018 } | 2043 } |
| 2019 inputs_before_decode_++; | 2044 inputs_before_decode_++; |
| 2020 | 2045 |
| 2021 hr = decoder_->ProcessInput(0, sample.get(), 0); | 2046 hr = decoder_->ProcessInput(0, sample.get(), 0); |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2243 PLATFORM_FAILURE, ); | 2268 PLATFORM_FAILURE, ); |
| 2244 | 2269 |
| 2245 NotifyPictureReady(picture_buffer->id(), input_buffer_id); | 2270 NotifyPictureReady(picture_buffer->id(), input_buffer_id); |
| 2246 | 2271 |
| 2247 { | 2272 { |
| 2248 base::AutoLock lock(decoder_lock_); | 2273 base::AutoLock lock(decoder_lock_); |
| 2249 if (!pending_output_samples_.empty()) | 2274 if (!pending_output_samples_.empty()) |
| 2250 pending_output_samples_.pop_front(); | 2275 pending_output_samples_.pop_front(); |
| 2251 } | 2276 } |
| 2252 | 2277 |
| 2253 if (pending_flush_) { | 2278 if (pending_flush_ || processing_config_changed_) { |
| 2254 decoder_thread_task_runner_->PostTask( | 2279 decoder_thread_task_runner_->PostTask( |
| 2255 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::FlushInternal, | 2280 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::FlushInternal, |
| 2256 base::Unretained(this))); | 2281 base::Unretained(this))); |
| 2257 return; | 2282 return; |
| 2258 } | 2283 } |
| 2259 decoder_thread_task_runner_->PostTask( | 2284 decoder_thread_task_runner_->PostTask( |
| 2260 FROM_HERE, | 2285 FROM_HERE, |
| 2261 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, | 2286 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, |
| 2262 base::Unretained(this))); | 2287 base::Unretained(this))); |
| 2263 } | 2288 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2295 PLATFORM_FAILURE, ); | 2320 PLATFORM_FAILURE, ); |
| 2296 | 2321 |
| 2297 NotifyPictureReady(picture_buffer->id(), input_buffer_id); | 2322 NotifyPictureReady(picture_buffer->id(), input_buffer_id); |
| 2298 | 2323 |
| 2299 { | 2324 { |
| 2300 base::AutoLock lock(decoder_lock_); | 2325 base::AutoLock lock(decoder_lock_); |
| 2301 if (!pending_output_samples_.empty()) | 2326 if (!pending_output_samples_.empty()) |
| 2302 pending_output_samples_.pop_front(); | 2327 pending_output_samples_.pop_front(); |
| 2303 } | 2328 } |
| 2304 | 2329 |
| 2305 if (pending_flush_) { | 2330 if (pending_flush_ || processing_config_changed_) { |
| 2306 decoder_thread_task_runner_->PostTask( | 2331 decoder_thread_task_runner_->PostTask( |
| 2307 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::FlushInternal, | 2332 FROM_HERE, base::Bind(&DXVAVideoDecodeAccelerator::FlushInternal, |
| 2308 base::Unretained(this))); | 2333 base::Unretained(this))); |
| 2309 return; | 2334 return; |
| 2310 } | 2335 } |
| 2311 decoder_thread_task_runner_->PostTask( | 2336 decoder_thread_task_runner_->PostTask( |
| 2312 FROM_HERE, | 2337 FROM_HERE, |
| 2313 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, | 2338 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, |
| 2314 base::Unretained(this))); | 2339 base::Unretained(this))); |
| 2315 } | 2340 } |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2677 DismissStaleBuffers(true); | 2702 DismissStaleBuffers(true); |
| 2678 Invalidate(); | 2703 Invalidate(); |
| 2679 Initialize(config_, client_); | 2704 Initialize(config_, client_); |
| 2680 decoder_thread_task_runner_->PostTask( | 2705 decoder_thread_task_runner_->PostTask( |
| 2681 FROM_HERE, | 2706 FROM_HERE, |
| 2682 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, | 2707 base::Bind(&DXVAVideoDecodeAccelerator::DecodePendingInputBuffers, |
| 2683 base::Unretained(this))); | 2708 base::Unretained(this))); |
| 2684 } | 2709 } |
| 2685 | 2710 |
| 2686 } // namespace media | 2711 } // namespace media |
| OLD | NEW |