OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/media/android/proxy_media_keys.h" | 5 #include "content/renderer/media/android/proxy_media_keys.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 manager_->InitializeCDM(media_keys_id_, this, uuid, frame_url); | 45 manager_->InitializeCDM(media_keys_id_, this, uuid, frame_url); |
46 #endif | 46 #endif |
47 } | 47 } |
48 | 48 |
49 bool ProxyMediaKeys::CreateSession(uint32 session_id, | 49 bool ProxyMediaKeys::CreateSession(uint32 session_id, |
50 const std::string& content_type, | 50 const std::string& content_type, |
51 const uint8* init_data, | 51 const uint8* init_data, |
52 int init_data_length) { | 52 int init_data_length) { |
53 // TODO(xhwang): Move these checks up to blink and DCHECK here. | 53 // TODO(xhwang): Move these checks up to blink and DCHECK here. |
54 // See http://crbug.com/342510 | 54 // See http://crbug.com/342510 |
55 MediaKeysHostMsg_CreateSession_Type session_type; | 55 CdmHostMsg_CreateSession_Type session_type; |
56 if (content_type == "audio/mp4" || content_type == "video/mp4") { | 56 if (content_type == "audio/mp4" || content_type == "video/mp4") { |
57 session_type = CREATE_SESSION_TYPE_MP4; | 57 session_type = CREATE_SESSION_TYPE_MP4; |
58 } else if (content_type == "audio/webm" || content_type == "video/webm") { | 58 } else if (content_type == "audio/webm" || content_type == "video/webm") { |
59 session_type = CREATE_SESSION_TYPE_WEBM; | 59 session_type = CREATE_SESSION_TYPE_WEBM; |
60 } else { | 60 } else { |
61 DLOG(ERROR) << "Unsupported EME CreateSession content type of " | 61 DLOG(ERROR) << "Unsupported EME CreateSession content type of " |
62 << content_type; | 62 << content_type; |
63 return false; | 63 return false; |
64 } | 64 } |
65 | 65 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 session_closed_cb_.Run(session_id); | 111 session_closed_cb_.Run(session_id); |
112 } | 112 } |
113 | 113 |
114 void ProxyMediaKeys::OnSessionError(uint32 session_id, | 114 void ProxyMediaKeys::OnSessionError(uint32 session_id, |
115 media::MediaKeys::KeyError error_code, | 115 media::MediaKeys::KeyError error_code, |
116 int system_code) { | 116 int system_code) { |
117 session_error_cb_.Run(session_id, error_code, system_code); | 117 session_error_cb_.Run(session_id, error_code, system_code); |
118 } | 118 } |
119 | 119 |
120 } // namespace content | 120 } // namespace content |
OLD | NEW |