| 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 "webkit/media/crypto/ppapi/clear_key_cdm.h" | 5 #include "webkit/media/crypto/ppapi/clear_key_cdm.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <sstream> | 8 #include <sstream> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 // be required after http://crbug.com/91970 because we'll be able to get rid of | 43 // be required after http://crbug.com/91970 because we'll be able to get rid of |
| 44 // InitializeFFmpegLibraries(). | 44 // InitializeFFmpegLibraries(). |
| 45 #if !defined COMPONENT_BUILD | 45 #if !defined COMPONENT_BUILD |
| 46 static base::AtExitManager g_at_exit_manager; | 46 static base::AtExitManager g_at_exit_manager; |
| 47 #endif | 47 #endif |
| 48 | 48 |
| 49 // TODO(tomfinegan): InitializeFFmpegLibraries() and |g_cdm_module_initialized| | 49 // TODO(tomfinegan): InitializeFFmpegLibraries() and |g_cdm_module_initialized| |
| 50 // are required for running in the sandbox, and should no longer be required | 50 // are required for running in the sandbox, and should no longer be required |
| 51 // after http://crbug.com/91970 is fixed. | 51 // after http://crbug.com/91970 is fixed. |
| 52 static bool InitializeFFmpegLibraries() { | 52 static bool InitializeFFmpegLibraries() { |
| 53 FilePath file_path; | 53 base::FilePath file_path; |
| 54 CHECK(PathService::Get(base::DIR_EXE, &file_path)); | 54 CHECK(PathService::Get(base::DIR_EXE, &file_path)); |
| 55 CHECK(media::InitializeMediaLibrary(file_path)); | 55 CHECK(media::InitializeMediaLibrary(file_path)); |
| 56 return true; | 56 return true; |
| 57 } | 57 } |
| 58 | 58 |
| 59 static bool g_ffmpeg_lib_initialized = InitializeFFmpegLibraries(); | 59 static bool g_ffmpeg_lib_initialized = InitializeFFmpegLibraries(); |
| 60 #endif // CLEAR_KEY_CDM_USE_FFMPEG_DECODER | 60 #endif // CLEAR_KEY_CDM_USE_FFMPEG_DECODER |
| 61 | 61 |
| 62 static const char kClearKeyCdmVersion[] = "0.1.0.1"; | 62 static const char kClearKeyCdmVersion[] = "0.1.0.1"; |
| 63 static const char kExternalClearKey[] = "org.chromium.externalclearkey"; | 63 static const char kExternalClearKey[] = "org.chromium.externalclearkey"; |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 int samples_generated = GenerateFakeAudioFramesFromDuration( | 557 int samples_generated = GenerateFakeAudioFramesFromDuration( |
| 558 timestamp_in_microseconds - CurrentTimeStampInMicroseconds(), | 558 timestamp_in_microseconds - CurrentTimeStampInMicroseconds(), |
| 559 audio_frames); | 559 audio_frames); |
| 560 total_samples_generated_ += samples_generated; | 560 total_samples_generated_ += samples_generated; |
| 561 | 561 |
| 562 return samples_generated == 0 ? cdm::kNeedMoreData : cdm::kSuccess; | 562 return samples_generated == 0 ? cdm::kNeedMoreData : cdm::kSuccess; |
| 563 } | 563 } |
| 564 #endif // CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER | 564 #endif // CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER |
| 565 | 565 |
| 566 } // namespace webkit_media | 566 } // namespace webkit_media |
| OLD | NEW |