blob: 0fd28baf4721083e26a179cef9e426b25548b65c [file] [log] [blame]
Phil Burk828bea52017-01-03 17:22:09 -08001/*
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
Phil Burk5ed503c2017-02-01 09:38:15 -080017#ifndef BINDING_AAUDIO_STREAM_REQUEST_H
18#define BINDING_AAUDIO_STREAM_REQUEST_H
Phil Burk828bea52017-01-03 17:22:09 -080019
20#include <stdint.h>
21
22#include <binder/Parcel.h>
23#include <binder/Parcelable.h>
Phil Burk5ed503c2017-02-01 09:38:15 -080024#include <aaudio/AAudioDefinitions.h>
Phil Burk828bea52017-01-03 17:22:09 -080025
Phil Burk5ed503c2017-02-01 09:38:15 -080026#include "binding/AAudioStreamConfiguration.h"
Phil Burk828bea52017-01-03 17:22:09 -080027
28using android::status_t;
29using android::Parcel;
30using android::Parcelable;
31
Phil Burk5ed503c2017-02-01 09:38:15 -080032namespace aaudio {
Phil Burk828bea52017-01-03 17:22:09 -080033
Phil Burk5ed503c2017-02-01 09:38:15 -080034class AAudioStreamRequest : public Parcelable {
Phil Burk828bea52017-01-03 17:22:09 -080035public:
Phil Burk5ed503c2017-02-01 09:38:15 -080036 AAudioStreamRequest();
37 virtual ~AAudioStreamRequest();
Phil Burk828bea52017-01-03 17:22:09 -080038
39 uid_t getUserId() const {
40 return mUserId;
41 }
42
43 void setUserId(uid_t userId) {
44 mUserId = userId;
45 }
46
47 pid_t getProcessId() const {
48 return mProcessId;
49 }
50
51 void setProcessId(pid_t processId) {
52 mProcessId = processId;
53 }
54
Phil Burk5ed503c2017-02-01 09:38:15 -080055 AAudioStreamConfiguration &getConfiguration() {
Phil Burk828bea52017-01-03 17:22:09 -080056 return mConfiguration;
57 }
58
59 virtual status_t writeToParcel(Parcel* parcel) const override;
60
61 virtual status_t readFromParcel(const Parcel* parcel) override;
62
Phil Burk5ed503c2017-02-01 09:38:15 -080063 aaudio_result_t validate();
Phil Burk828bea52017-01-03 17:22:09 -080064
65 void dump();
66
67protected:
Phil Burk5ed503c2017-02-01 09:38:15 -080068 AAudioStreamConfiguration mConfiguration;
Phil Burk828bea52017-01-03 17:22:09 -080069 uid_t mUserId;
70 pid_t mProcessId;
71};
72
Phil Burk5ed503c2017-02-01 09:38:15 -080073} /* namespace aaudio */
Phil Burk828bea52017-01-03 17:22:09 -080074
Phil Burk5ed503c2017-02-01 09:38:15 -080075#endif //BINDING_AAUDIO_STREAM_REQUEST_H