Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: media/cdm/ppapi/cdm_adapter.cc

Issue 1050823009: Handle all possible cdm::Status values before passing through Pepper (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "media/cdm/ppapi/cdm_adapter.h" 5 #include "media/cdm/ppapi/cdm_adapter.h"
6 6
7 #include "media/base/limits.h" 7 #include "media/base/limits.h"
8 #include "media/cdm/ppapi/cdm_file_io_impl.h" 8 #include "media/cdm/ppapi/cdm_file_io_impl.h"
9 #include "media/cdm/ppapi/cdm_helpers.h" 9 #include "media/cdm/ppapi/cdm_helpers.h"
10 #include "media/cdm/ppapi/cdm_logging.h" 10 #include "media/cdm/ppapi/cdm_logging.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 case cdm::kSuccess: 98 case cdm::kSuccess:
99 return PP_DECRYPTRESULT_SUCCESS; 99 return PP_DECRYPTRESULT_SUCCESS;
100 case cdm::kNoKey: 100 case cdm::kNoKey:
101 return PP_DECRYPTRESULT_DECRYPT_NOKEY; 101 return PP_DECRYPTRESULT_DECRYPT_NOKEY;
102 case cdm::kNeedMoreData: 102 case cdm::kNeedMoreData:
103 return PP_DECRYPTRESULT_NEEDMOREDATA; 103 return PP_DECRYPTRESULT_NEEDMOREDATA;
104 case cdm::kDecryptError: 104 case cdm::kDecryptError:
105 return PP_DECRYPTRESULT_DECRYPT_ERROR; 105 return PP_DECRYPTRESULT_DECRYPT_ERROR;
106 case cdm::kDecodeError: 106 case cdm::kDecodeError:
107 return PP_DECRYPTRESULT_DECODE_ERROR; 107 return PP_DECRYPTRESULT_DECODE_ERROR;
108 default: 108 case cdm::kSessionError:
109 PP_NOTREACHED(); 109 case cdm::kDeferredInitialization:
110 return PP_DECRYPTRESULT_DECODE_ERROR; 110 // kSessionError and kDeferredInitialization are only used by the
111 // Initialize* methods internally and never returned. Deliver*
112 // methods should never use these values.
113 break;
111 } 114 }
115
116 PP_NOTREACHED();
117 return PP_DECRYPTRESULT_DECRYPT_ERROR;
112 } 118 }
113 119
114 PP_DecryptedFrameFormat CdmVideoFormatToPpDecryptedFrameFormat( 120 PP_DecryptedFrameFormat CdmVideoFormatToPpDecryptedFrameFormat(
115 cdm::VideoFormat format) { 121 cdm::VideoFormat format) {
116 switch (format) { 122 switch (format) {
117 case cdm::kYv12: 123 case cdm::kYv12:
118 return PP_DECRYPTEDFRAMEFORMAT_YV12; 124 return PP_DECRYPTEDFRAMEFORMAT_YV12;
119 case cdm::kI420: 125 case cdm::kI420:
120 return PP_DECRYPTEDFRAMEFORMAT_I420; 126 return PP_DECRYPTEDFRAMEFORMAT_I420;
121 default: 127 default:
(...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1372 } // namespace media 1378 } // namespace media
1373 1379
1374 namespace pp { 1380 namespace pp {
1375 1381
1376 // Factory function for your specialization of the Module object. 1382 // Factory function for your specialization of the Module object.
1377 Module* CreateModule() { 1383 Module* CreateModule() {
1378 return new media::CdmAdapterModule(); 1384 return new media::CdmAdapterModule();
1379 } 1385 }
1380 1386
1381 } // namespace pp 1387 } // namespace pp
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698