| 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/renderer/pepper/content_decryptor_delegate.h" | 5 #include "content/renderer/pepper/content_decryptor_delegate.h" |
| 6 | 6 |
| 7 #include "base/callback_helpers.h" | 7 #include "base/callback_helpers.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/message_loop/message_loop_proxy.h" | 9 #include "base/message_loop/message_loop_proxy.h" |
| 10 #include "base/numerics/safe_conversions.h" | 10 #include "base/numerics/safe_conversions.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 case media::kCodecVP9: | 154 case media::kCodecVP9: |
| 155 return PP_VIDEOCODEC_VP9; | 155 return PP_VIDEOCODEC_VP9; |
| 156 default: | 156 default: |
| 157 return PP_VIDEOCODEC_UNKNOWN; | 157 return PP_VIDEOCODEC_UNKNOWN; |
| 158 } | 158 } |
| 159 } | 159 } |
| 160 | 160 |
| 161 PP_VideoCodecProfile MediaVideoCodecProfileToPpVideoCodecProfile( | 161 PP_VideoCodecProfile MediaVideoCodecProfileToPpVideoCodecProfile( |
| 162 media::VideoCodecProfile profile) { | 162 media::VideoCodecProfile profile) { |
| 163 switch (profile) { | 163 switch (profile) { |
| 164 // TODO(xhwang): VP8 and VP9 do not have profiles. Clean up | 164 case media::VP8PROFILE_ANY: |
| 165 // media::VideoCodecProfile and remove these two cases. | 165 case media::VP9PROFILE_ANY: |
| 166 case media::VP8PROFILE_MAIN: | |
| 167 case media::VP9PROFILE_MAIN: | |
| 168 return PP_VIDEOCODECPROFILE_NOT_NEEDED; | 166 return PP_VIDEOCODECPROFILE_NOT_NEEDED; |
| 169 case media::H264PROFILE_BASELINE: | 167 case media::H264PROFILE_BASELINE: |
| 170 return PP_VIDEOCODECPROFILE_H264_BASELINE; | 168 return PP_VIDEOCODECPROFILE_H264_BASELINE; |
| 171 case media::H264PROFILE_MAIN: | 169 case media::H264PROFILE_MAIN: |
| 172 return PP_VIDEOCODECPROFILE_H264_MAIN; | 170 return PP_VIDEOCODECPROFILE_H264_MAIN; |
| 173 case media::H264PROFILE_EXTENDED: | 171 case media::H264PROFILE_EXTENDED: |
| 174 return PP_VIDEOCODECPROFILE_H264_EXTENDED; | 172 return PP_VIDEOCODECPROFILE_H264_EXTENDED; |
| 175 case media::H264PROFILE_HIGH: | 173 case media::H264PROFILE_HIGH: |
| 176 return PP_VIDEOCODECPROFILE_H264_HIGH; | 174 return PP_VIDEOCODECPROFILE_H264_HIGH; |
| 177 case media::H264PROFILE_HIGH10PROFILE: | 175 case media::H264PROFILE_HIGH10PROFILE: |
| (...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1176 | 1174 |
| 1177 scoped_ptr<CdmPromise> ContentDecryptorDelegate::TakePromise( | 1175 scoped_ptr<CdmPromise> ContentDecryptorDelegate::TakePromise( |
| 1178 uint32_t promise_id) { | 1176 uint32_t promise_id) { |
| 1179 PromiseMap::iterator it = promises_.find(promise_id); | 1177 PromiseMap::iterator it = promises_.find(promise_id); |
| 1180 if (it == promises_.end()) | 1178 if (it == promises_.end()) |
| 1181 return scoped_ptr<CdmPromise>(); | 1179 return scoped_ptr<CdmPromise>(); |
| 1182 return promises_.take_and_erase(it); | 1180 return promises_.take_and_erase(it); |
| 1183 } | 1181 } |
| 1184 | 1182 |
| 1185 } // namespace content | 1183 } // namespace content |
| OLD | NEW |