• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright 2016 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #define LOG_TAG "AAudioStreamRequest"
18 //#define LOG_NDEBUG 0
19 #include <utils/Log.h>
20 
21 #include <stdint.h>
22 
23 #include <sys/mman.h>
24 
25 #include <aaudio/AAudio.h>
26 
27 #include "binding/AAudioStreamConfiguration.h"
28 #include "binding/AAudioStreamRequest.h"
29 
30 using namespace aaudio;
31 
AAudioStreamRequest(const StreamRequest & parcelable)32 AAudioStreamRequest::AAudioStreamRequest(const StreamRequest& parcelable) :
33         mConfiguration(parcelable.params),
34         mAttributionSource(parcelable.attributionSource),
35         mSharingModeMatchRequired(parcelable.sharingModeMatchRequired),
36         mInService(parcelable.inService) {
37 }
38 
parcelable() const39 StreamRequest AAudioStreamRequest::parcelable() const {
40     StreamRequest result;
41     result.params = mConfiguration.parcelable();
42     result.attributionSource = mAttributionSource;
43     result.sharingModeMatchRequired = mSharingModeMatchRequired;
44     result.inService = mInService;
45     return result;
46 }
47 
validate() const48 aaudio_result_t AAudioStreamRequest::validate() const {
49     return mConfiguration.validate();
50 }
51 
dump() const52 void AAudioStreamRequest::dump() const {
53     ALOGD("mAttributionSource  = %s", mAttributionSource.toString().c_str());
54     ALOGD("mSharingModeMatchRequired = %d", mSharingModeMatchRequired);
55     ALOGD("mInService = %d", mInService);
56     mConfiguration.dump();
57 }
58