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/filters/gpu_video_decoder.h" | 5 #include "media/filters/gpu_video_decoder.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 DVLOG(1) << "Encrypted stream not supported."; | 180 DVLOG(1) << "Encrypted stream not supported."; |
181 bound_init_cb.Run(false); | 181 bound_init_cb.Run(false); |
182 return; | 182 return; |
183 } | 183 } |
184 #endif | 184 #endif |
185 | 185 |
186 bool previously_initialized = config_.IsValidConfig(); | 186 bool previously_initialized = config_.IsValidConfig(); |
187 DVLOG(1) << (previously_initialized ? "Reinitializing" : "Initializing") | 187 DVLOG(1) << (previously_initialized ? "Reinitializing" : "Initializing") |
188 << " GVD with config: " << config.AsHumanReadableString(); | 188 << " GVD with config: " << config.AsHumanReadableString(); |
189 | 189 |
190 // TODO(posciak): destroy and create a new VDA on codec/profile change | 190 // Disallow codec changes between configuration changes. |
191 // (http://crbug.com/260224). | 191 if (previously_initialized && config_.codec() != config.codec()) { |
192 if (previously_initialized && (config_.profile() != config.profile())) { | 192 DVLOG(1) << "Codec changed, cannot reinitialize."; |
193 DVLOG(1) << "Codec or profile changed, cannot reinitialize."; | |
194 bound_init_cb.Run(false); | 193 bound_init_cb.Run(false); |
195 return; | 194 return; |
196 } | 195 } |
197 | 196 |
198 // TODO(sandersd): This should be moved to capabilities if we ever have a | 197 // TODO(sandersd): This should be moved to capabilities if we ever have a |
199 // hardware decoder which supports alpha formats. | 198 // hardware decoder which supports alpha formats. |
200 if (config.format() == PIXEL_FORMAT_YV12A) { | 199 if (config.format() == PIXEL_FORMAT_YV12A) { |
201 DVLOG(1) << "Alpha transparency formats are not supported."; | 200 DVLOG(1) << "Alpha transparency formats are not supported."; |
202 bound_init_cb.Run(false); | 201 bound_init_cb.Run(false); |
203 return; | 202 return; |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
825 } | 824 } |
826 return false; | 825 return false; |
827 } | 826 } |
828 | 827 |
829 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 828 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
830 const { | 829 const { |
831 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 830 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
832 } | 831 } |
833 | 832 |
834 } // namespace media | 833 } // namespace media |
OLD | NEW |