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 "content/common/gpu/media/dxva_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
6 | 6 |
7 #if !defined(OS_WIN) | 7 #if !defined(OS_WIN) |
8 #error This file should only be built on Windows. | 8 #error This file should only be built on Windows. |
9 #endif // !defined(OS_WIN) | 9 #endif // !defined(OS_WIN) |
10 | 10 |
(...skipping 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 | 829 |
830 MFT_OUTPUT_DATA_BUFFER output_data_buffer = {0}; | 830 MFT_OUTPUT_DATA_BUFFER output_data_buffer = {0}; |
831 DWORD status = 0; | 831 DWORD status = 0; |
832 | 832 |
833 HRESULT hr = decoder_->ProcessOutput(0, // No flags | 833 HRESULT hr = decoder_->ProcessOutput(0, // No flags |
834 1, // # of out streams to pull from | 834 1, // # of out streams to pull from |
835 &output_data_buffer, | 835 &output_data_buffer, |
836 &status); | 836 &status); |
837 IMFCollection* events = output_data_buffer.pEvents; | 837 IMFCollection* events = output_data_buffer.pEvents; |
838 if (events != NULL) { | 838 if (events != NULL) { |
839 VLOG(1) << "Got events from ProcessOuput, but discarding"; | 839 DVLOG(1) << "Got events from ProcessOuput, but discarding"; |
840 events->Release(); | 840 events->Release(); |
841 } | 841 } |
842 if (FAILED(hr)) { | 842 if (FAILED(hr)) { |
843 // A stream change needs further ProcessInput calls to get back decoder | 843 // A stream change needs further ProcessInput calls to get back decoder |
844 // output which is why we need to set the state to stopped. | 844 // output which is why we need to set the state to stopped. |
845 if (hr == MF_E_TRANSFORM_STREAM_CHANGE) { | 845 if (hr == MF_E_TRANSFORM_STREAM_CHANGE) { |
846 if (!SetDecoderOutputMediaType(MFVideoFormat_NV12)) { | 846 if (!SetDecoderOutputMediaType(MFVideoFormat_NV12)) { |
847 // Decoder didn't let us set NV12 output format. Not sure as to why | 847 // Decoder didn't let us set NV12 output format. Not sure as to why |
848 // this can happen. Give up in disgust. | 848 // this can happen. Give up in disgust. |
849 NOTREACHED() << "Failed to set decoder output media type to NV12"; | 849 NOTREACHED() << "Failed to set decoder output media type to NV12"; |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 int32 picture_buffer_id) { | 1251 int32 picture_buffer_id) { |
1252 OutputBuffers::iterator it = stale_output_picture_buffers_.find( | 1252 OutputBuffers::iterator it = stale_output_picture_buffers_.find( |
1253 picture_buffer_id); | 1253 picture_buffer_id); |
1254 DCHECK(it != stale_output_picture_buffers_.end()); | 1254 DCHECK(it != stale_output_picture_buffers_.end()); |
1255 DVLOG(1) << "Dismissing picture id: " << it->second->id(); | 1255 DVLOG(1) << "Dismissing picture id: " << it->second->id(); |
1256 client_->DismissPictureBuffer(it->second->id()); | 1256 client_->DismissPictureBuffer(it->second->id()); |
1257 stale_output_picture_buffers_.erase(it); | 1257 stale_output_picture_buffers_.erase(it); |
1258 } | 1258 } |
1259 | 1259 |
1260 } // namespace content | 1260 } // namespace content |
OLD | NEW |