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

Side by Side Diff: media/audio/android/opensles_util.h

Issue 9655023: Adding input and output audio backend to Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased && addressed qinmin's comments Created 8 years, 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_AUDIO_OPENSLES_UTIL_H_
qinmin 2012/04/02 13:28:54 missing ANDROID
no longer working on chromium 2012/04/02 15:17:38 Sorry, I missed this in the previous set. Done no
6 #define MEDIA_AUDIO_OPENSLES_UTIL_H_
qinmin 2012/04/02 13:28:54 this too
no longer working on chromium 2012/04/02 15:17:38 Done.
7
8 #include "base/logging.h"
9 #include <SLES/OpenSLES.h>
10
11 namespace media {
12
13 template <typename SLType, typename SLDerefType>
14 class ScopedSLObject {
15 public:
16 ScopedSLObject() : obj_(NULL) {}
17
18 ~ScopedSLObject() { Reset(); }
19
20 SLType* Receive() {
21 DCHECK(!obj_);
22 return &obj_;
23 }
24
25 SLDerefType operator->() { return *obj_; }
26
27 SLType Get() const { return obj_; }
28
29 void Reset() {
30 if (obj_) {
31 (*obj_)->Destroy(obj_);
32 obj_ = NULL;
33 }
34 }
35
36 private:
37 SLType obj_;
38 };
39
40 typedef ScopedSLObject<SLObjectItf, const SLObjectItf_*> ScopedSLObjectItf;
41
42 } // namespace media
43
44 #endif // MEDIA_AUDIO_OPENSLES_UTIL_H_
qinmin 2012/04/02 13:28:54 same here
no longer working on chromium 2012/04/02 15:17:38 Done.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698