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 #ifndef MEDIA_AUDIO_ANDROID_OPENSLES_UTIL_H_ | 5 #ifndef MEDIA_AUDIO_ANDROID_OPENSLES_UTIL_H_ |
6 #define MEDIA_AUDIO_ANDROID_OPENSLES_UTIL_H_ | 6 #define MEDIA_AUDIO_ANDROID_OPENSLES_UTIL_H_ |
7 | 7 |
8 #include <SLES/OpenSLES.h> | |
9 | |
8 #include "base/logging.h" | 10 #include "base/logging.h" |
9 #include <SLES/OpenSLES.h> | 11 |
12 #define LOG_ON_FAILURE_AND_RETURN(op, ...) \ | |
Ami GONE FROM CHROMIUM
2013/03/23 20:07:21
This can't live in a header.
http://google-stylegu
| |
13 do { \ | |
14 SLresult err = (op); \ | |
15 if (err != SL_RESULT_SUCCESS) { \ | |
16 DLOG(ERROR) << #op << " failed: " << err; \ | |
17 return __VA_ARGS__; \ | |
18 } \ | |
19 } while (0) | |
10 | 20 |
11 namespace media { | 21 namespace media { |
12 | 22 |
13 template <typename SLType, typename SLDerefType> | 23 template <typename SLType, typename SLDerefType> |
14 class ScopedSLObject { | 24 class ScopedSLObject { |
15 public: | 25 public: |
16 ScopedSLObject() : obj_(NULL) {} | 26 ScopedSLObject() : obj_(NULL) {} |
17 | 27 |
18 ~ScopedSLObject() { Reset(); } | 28 ~ScopedSLObject() { Reset(); } |
19 | 29 |
(...skipping 15 matching lines...) Expand all Loading... | |
35 | 45 |
36 private: | 46 private: |
37 SLType obj_; | 47 SLType obj_; |
38 }; | 48 }; |
39 | 49 |
40 typedef ScopedSLObject<SLObjectItf, const SLObjectItf_*> ScopedSLObjectItf; | 50 typedef ScopedSLObject<SLObjectItf, const SLObjectItf_*> ScopedSLObjectItf; |
41 | 51 |
42 } // namespace media | 52 } // namespace media |
43 | 53 |
44 #endif // MEDIA_AUDIO_ANDROID_OPENSLES_UTIL_H_ | 54 #endif // MEDIA_AUDIO_ANDROID_OPENSLES_UTIL_H_ |
OLD | NEW |