OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/cdm/cdm_adapter.h" | 5 #include "media/cdm/cdm_adapter.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 // Always update this DCHECK when updating this function. | 300 // Always update this DCHECK when updating this function. |
301 // If this check fails, update this function and DCHECK or update | 301 // If this check fails, update this function and DCHECK or update |
302 // IsSupportedCdmHostVersion. | 302 // IsSupportedCdmHostVersion. |
303 | 303 |
304 DCHECK( | 304 DCHECK( |
305 // Future version is not supported. | 305 // Future version is not supported. |
306 !IsSupportedCdmHostVersion(cdm::Host_8::kVersion + 1) && | 306 !IsSupportedCdmHostVersion(cdm::Host_8::kVersion + 1) && |
307 // Current version is supported. | 307 // Current version is supported. |
308 IsSupportedCdmHostVersion(cdm::Host_8::kVersion) && | 308 IsSupportedCdmHostVersion(cdm::Host_8::kVersion) && |
309 // Include all previous supported versions (if any) here. | 309 // Include all previous supported versions (if any) here. |
310 IsSupportedCdmHostVersion(cdm::Host_7::kVersion) && | |
311 // One older than the oldest supported version is not supported. | 310 // One older than the oldest supported version is not supported. |
312 !IsSupportedCdmHostVersion(cdm::Host_7::kVersion - 1)); | 311 !IsSupportedCdmHostVersion(cdm::Host_8::kVersion - 1)); |
313 DCHECK(IsSupportedCdmHostVersion(host_interface_version)); | 312 DCHECK(IsSupportedCdmHostVersion(host_interface_version)); |
314 | 313 |
315 CdmAdapter* cdm_adapter = static_cast<CdmAdapter*>(user_data); | 314 CdmAdapter* cdm_adapter = static_cast<CdmAdapter*>(user_data); |
316 DVLOG(1) << "Create CDM Host with version " << host_interface_version; | 315 DVLOG(1) << "Create CDM Host with version " << host_interface_version; |
317 switch (host_interface_version) { | 316 switch (host_interface_version) { |
318 case cdm::Host_8::kVersion: | 317 case cdm::Host_8::kVersion: |
319 return static_cast<cdm::Host_8*>(cdm_adapter); | 318 return static_cast<cdm::Host_8*>(cdm_adapter); |
320 case cdm::Host_7::kVersion: | |
321 return static_cast<cdm::Host_7*>(cdm_adapter); | |
322 default: | 319 default: |
323 NOTREACHED() << "Unexpected host interface version " | 320 NOTREACHED() << "Unexpected host interface version " |
324 << host_interface_version; | 321 << host_interface_version; |
325 return nullptr; | 322 return nullptr; |
326 } | 323 } |
327 } | 324 } |
328 | 325 |
329 } // namespace | 326 } // namespace |
330 | 327 |
331 // static | 328 // static |
(...skipping 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
942 result_frames->push_back(frame); | 939 result_frames->push_back(frame); |
943 | 940 |
944 data += frame_size; | 941 data += frame_size; |
945 bytes_left -= frame_size; | 942 bytes_left -= frame_size; |
946 } while (bytes_left > 0); | 943 } while (bytes_left > 0); |
947 | 944 |
948 return true; | 945 return true; |
949 } | 946 } |
950 | 947 |
951 } // namespace media | 948 } // namespace media |
OLD | NEW |