blob: e91a9929500c8a2c92af61ea524029e93299db6d [file] [log] [blame]
Previr Rangroo9ee64f12017-11-28 17:55:36 +11001/*
2 * Copyright (C) 2018 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#ifndef AUDIO_PRESENTATION_INFO_H_
18#define AUDIO_PRESENTATION_INFO_H_
19
20#include <sstream>
21#include <stdint.h>
22
23#include <utils/KeyedVector.h>
24#include <utils/RefBase.h>
25#include <utils/String8.h>
26#include <utils/Vector.h>
27
28namespace android {
29
30enum mastering_indication {
31 MASTERING_NOT_INDICATED,
32 MASTERED_FOR_STEREO,
33 MASTERED_FOR_SURROUND,
34 MASTERED_FOR_3D,
35 MASTERED_FOR_HEADPHONE,
36};
37
38struct AudioPresentation : public RefBase {
39 int32_t mPresentationId;
40 int32_t mProgramId;
41 KeyedVector<String8, String8> mLabels;
42 String8 mLanguage;
43 int32_t mMasteringIndication;
44 bool mAudioDescriptionAvailable;
45 bool mSpokenSubtitlesAvailable;
46 bool mDialogueEnhancementAvailable;
47
48 AudioPresentation() {
49 mPresentationId = -1;
50 mProgramId = -1;
51 mLanguage = "";
52 mMasteringIndication = MASTERING_NOT_INDICATED;
53 mAudioDescriptionAvailable = false;
54 mSpokenSubtitlesAvailable = false;
55 mDialogueEnhancementAvailable = false;
56 }
57};
58
59typedef Vector<sp<AudioPresentation>> AudioPresentations;
60
61class AudioPresentationInfo : public RefBase {
62 public:
63 AudioPresentationInfo();
64
65 ~AudioPresentationInfo();
66
67 void addPresentation(sp<AudioPresentation> presentation);
68
69 size_t countPresentations() const;
70
71 const sp<AudioPresentation> getPresentation(size_t index) const;
72
73 private:
74 AudioPresentations mPresentations;
75};
76
77} // namespace android
78
79#endif // AUDIO_PRESENTATION_INFO_H_