| 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 "ui/gfx/video_decode_acceleration_support_mac.h" | 5 #include "ui/gfx/video_decode_acceleration_support_mac.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 VDADecoderDecodeFunc g_VDADecoderDecode; | 50 VDADecoderDecodeFunc g_VDADecoderDecode; |
| 51 VDADecoderFlushFunc g_VDADecoderFlush; | 51 VDADecoderFlushFunc g_VDADecoderFlush; |
| 52 VDADecoderDestroyFunc g_VDADecoderDestroy; | 52 VDADecoderDestroyFunc g_VDADecoderDestroy; |
| 53 | 53 |
| 54 NSString* const kFrameIdKey = @"frame_id"; | 54 NSString* const kFrameIdKey = @"frame_id"; |
| 55 | 55 |
| 56 bool InitializeVdaApis() { | 56 bool InitializeVdaApis() { |
| 57 static bool should_initialize = true; | 57 static bool should_initialize = true; |
| 58 if (should_initialize) { | 58 if (should_initialize) { |
| 59 should_initialize = false; | 59 should_initialize = false; |
| 60 FilePath path; | 60 base::FilePath path; |
| 61 if (!base::mac::GetSearchPathDirectory( | 61 if (!base::mac::GetSearchPathDirectory( |
| 62 NSLibraryDirectory, NSSystemDomainMask, &path)) { | 62 NSLibraryDirectory, NSSystemDomainMask, &path)) { |
| 63 return false; | 63 return false; |
| 64 } | 64 } |
| 65 | 65 |
| 66 path = path.AppendASCII("Frameworks") | 66 path = path.AppendASCII("Frameworks") |
| 67 .AppendASCII("VideoDecodeAcceleration.framework") | 67 .AppendASCII("VideoDecodeAcceleration.framework") |
| 68 .AppendASCII("VideoDecodeAcceleration"); | 68 .AppendASCII("VideoDecodeAcceleration"); |
| 69 base::NativeLibrary vda_library = base::LoadNativeLibrary(path, NULL); | 69 base::NativeLibrary vda_library = base::LoadNativeLibrary(path, NULL); |
| 70 if (!vda_library) | 70 if (!vda_library) |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 OSStatus status, | 215 OSStatus status, |
| 216 int frame_id) { | 216 int frame_id) { |
| 217 frame_ready_callbacks_[frame_id].Run(image_buffer, status); | 217 frame_ready_callbacks_[frame_id].Run(image_buffer, status); |
| 218 // Match the retain in OnFrameReadyCallback. | 218 // Match the retain in OnFrameReadyCallback. |
| 219 if (image_buffer) | 219 if (image_buffer) |
| 220 CFRelease(image_buffer); | 220 CFRelease(image_buffer); |
| 221 frame_ready_callbacks_.erase(frame_id); | 221 frame_ready_callbacks_.erase(frame_id); |
| 222 } | 222 } |
| 223 | 223 |
| 224 } // namespace | 224 } // namespace |
| OLD | NEW |