1f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi/*
2f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi * Copyright (C) 2010 The Android Open Source Project
3f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi *
4f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi * Licensed under the Apache License, Version 2.0 (the "License");
5f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi * you may not use this file except in compliance with the License.
6f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi * You may obtain a copy of the License at
7f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi *
8f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi *      http://www.apache.org/licenses/LICENSE-2.0
9f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi *
10f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi * Unless required by applicable law or agreed to in writing, software
11f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi * distributed under the License is distributed on an "AS IS" BASIS,
12f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi * See the License for the specific language governing permissions and
14f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi * limitations under the License.
15f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi */
16f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi
17f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi
18f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi/**
194ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi * Used to define the mapping from an OpenSL ES or OpenMAX AL object to an Android
20f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi * media framework object
21f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi */
22b05ea38e5131001884aa226f90fd50cf594a23f3Jean-Michel Trivienum AndroidObjectType {
23b05ea38e5131001884aa226f90fd50cf594a23f3Jean-Michel Trivi    INVALID_TYPE                                =-1,
244ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi    // audio player, playing from a URI or FD data source
25b05ea38e5131001884aa226f90fd50cf594a23f3Jean-Michel Trivi    AUDIOPLAYER_FROM_URIFD                      = 0,
264ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi    // audio player, playing PCM buffers in a buffer queue data source
27b05ea38e5131001884aa226f90fd50cf594a23f3Jean-Michel Trivi    AUDIOPLAYER_FROM_PCM_BUFFERQUEUE            = 1,
284ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi    // audio player, playing transport stream packets in an Android buffer queue data source
29b05ea38e5131001884aa226f90fd50cf594a23f3Jean-Michel Trivi    AUDIOPLAYER_FROM_TS_ANDROIDBUFFERQUEUE      = 2,
304ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi    // audio player, decoding from a URI or FD data source to a buffer queue data sink in PCM format
31b05ea38e5131001884aa226f90fd50cf594a23f3Jean-Michel Trivi    AUDIOPLAYER_FROM_URIFD_TO_PCM_BUFFERQUEUE   = 3,
32b05ea38e5131001884aa226f90fd50cf594a23f3Jean-Michel Trivi    // audio video player, playing transport stream packets in an Android buffer queue data source
33b05ea38e5131001884aa226f90fd50cf594a23f3Jean-Michel Trivi    AUDIOVIDEOPLAYER_FROM_TS_ANDROIDBUFFERQUEUE = 4,
34b05ea38e5131001884aa226f90fd50cf594a23f3Jean-Michel Trivi    // audio video player, playing from a URI or FD data source
35b05ea38e5131001884aa226f90fd50cf594a23f3Jean-Michel Trivi    AUDIOVIDEOPLAYER_FROM_URIFD                 = 5,
36b05ea38e5131001884aa226f90fd50cf594a23f3Jean-Michel Trivi    // audio recorder, recording from an input device data source, streamed into a
37b05ea38e5131001884aa226f90fd50cf594a23f3Jean-Michel Trivi    //   PCM buffer queue data sink
38b05ea38e5131001884aa226f90fd50cf594a23f3Jean-Michel Trivi    AUDIORECORDER_FROM_MIC_TO_PCM_BUFFERQUEUE   = 6,
39bb832e853d4afb11b0a3287b2eb0cad87696d631Jean-Michel Trivi    // audio player, decoding from an Android buffer queue with ADTS data,
40bb832e853d4afb11b0a3287b2eb0cad87696d631Jean-Michel Trivi    //   to a buffer queue data sink in PCM format
41bb832e853d4afb11b0a3287b2eb0cad87696d631Jean-Michel Trivi    AUDIOPLAYER_FROM_ADTS_ABQ_TO_PCM_BUFFERQUEUE = 7,
42f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi    NUM_AUDIOPLAYER_MAP_TYPES
43f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi};
44f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi
45f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi
46f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi/**
47f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi * Used to define the states of the OpenSL ES / OpenMAX AL object initialization and preparation
4864621eac543d714d4d3f7cb9c24205f2ddc59201Glenn Kasten * with regards to the Android-side of the data, in particular as affected by the play state.
49f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi */
50b05ea38e5131001884aa226f90fd50cf594a23f3Jean-Michel Trivienum AndroidObjectState {
5164621eac543d714d4d3f7cb9c24205f2ddc59201Glenn Kasten    ANDROID_UNINITIALIZED = -1, // never called SetPlayState(PAUSED or PLAYING)
5264621eac543d714d4d3f7cb9c24205f2ddc59201Glenn Kasten    ANDROID_PREPARING,          // currently preparing due to first SetPlayState(PAUSED or PLAYING)
5364621eac543d714d4d3f7cb9c24205f2ddc59201Glenn Kasten    ANDROID_READY,              // preparation has completed, and will not be attempted again
5464621eac543d714d4d3f7cb9c24205f2ddc59201Glenn Kasten    // NUM_ANDROID_STATES       // unused
55f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi};
56f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi
57f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi
58ca39f4b4dbeb920a5b97bd65be73f2f7cac77431Dima Zavin#define ANDROID_DEFAULT_OUTPUT_STREAM_TYPE AUDIO_STREAM_MUSIC
59f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi
60e878c470cf58c8654d613ab2449468b44a90d6e5Glenn Kasten#define PLAYER_FAILURE ((int32_t) android::UNKNOWN_ERROR)
61e878c470cf58c8654d613ab2449468b44a90d6e5Glenn Kasten#define PLAYER_SUCCESS ((int32_t) android::NO_ERROR)
62581a0f550f15f6fc22199cb85775a220f668b480Jean-Michel Trivi
6397876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivi#define PLAYER_FD_FIND_FILE_SIZE ((int64_t)0xFFFFFFFFFFFFFFFFll)
6497876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivi
65682f9be91e641e80739c21d6ff124379a806182aGlenn Kasten#define MPEG2_TS_PACKET_SIZE 188
66682f9be91e641e80739c21d6ff124379a806182aGlenn Kasten#define MPEG2_TS_PACKET_SYNC 0x47
6770c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivi
68167a2af67dcc0d20e6e3e995a23a0567715e0ee1Glenn Kastenstruct AudioPlayback_Parameters {
690bfed90f3b312f7c8f2b744efcf62f1992661d6cGlenn Kasten    audio_stream_type_t streamType;
704ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi    int sessionId;
71167a2af67dcc0d20e6e3e995a23a0567715e0ee1Glenn Kasten};
72f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi
7313837cf3f7be0eb8b1a9552bd99a89f98c987720Jean-Michel Trivi/**
74f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi * Structure to maintain the set of audio levels about a player
75f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi */
76167a2af67dcc0d20e6e3e995a23a0567715e0ee1Glenn Kastenstruct AndroidAudioLevels {
77f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi    /**
7837dc2fccf3f122b79ebd554de209d0a3c94ae161Jean-Michel Trivi     * Send level to aux effect, there's a single aux bus, so there's a single level
79f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi     */
8037dc2fccf3f122b79ebd554de209d0a3c94ae161Jean-Michel Trivi    // FIXME not used yet, will be used when supporting effects in OpenMAX AL
8137dc2fccf3f122b79ebd554de209d0a3c94ae161Jean-Michel Trivi    //SLmillibel mAuxSendLevel;
82f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi    /**
83f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi     * Attenuation factor derived from direct level
84f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi     */
8537dc2fccf3f122b79ebd554de209d0a3c94ae161Jean-Michel Trivi    // FIXME not used yet, will be used when supporting effects in OpenMAX AL
8637dc2fccf3f122b79ebd554de209d0a3c94ae161Jean-Michel Trivi    //float mAmplFromDirectLevel;
8737dc2fccf3f122b79ebd554de209d0a3c94ae161Jean-Michel Trivi    /**
8837dc2fccf3f122b79ebd554de209d0a3c94ae161Jean-Michel Trivi     * Android Left/Right volume
8937dc2fccf3f122b79ebd554de209d0a3c94ae161Jean-Michel Trivi     * The final volume of an Android AudioTrack or MediaPlayer is a stereo amplification
9037dc2fccf3f122b79ebd554de209d0a3c94ae161Jean-Michel Trivi     * (or attenuation) represented as a float from 0.0f to 1.0f
9137dc2fccf3f122b79ebd554de209d0a3c94ae161Jean-Michel Trivi     */
9237dc2fccf3f122b79ebd554de209d0a3c94ae161Jean-Michel Trivi    float mFinalVolume[STEREO_CHANNELS];
93167a2af67dcc0d20e6e3e995a23a0567715e0ee1Glenn Kasten};
94f271eea20f9fff6c101213b34652399f457bcd50Jean-Michel Trivi
95581a0f550f15f6fc22199cb85775a220f668b480Jean-Michel Trivi
9613837cf3f7be0eb8b1a9552bd99a89f98c987720Jean-Michel Trivi/**
9713837cf3f7be0eb8b1a9552bd99a89f98c987720Jean-Michel Trivi * Event notification callback from Android to SL ES framework
9813837cf3f7be0eb8b1a9552bd99a89f98c987720Jean-Michel Trivi */
9937dc2fccf3f122b79ebd554de209d0a3c94ae161Jean-Michel Trivitypedef void (*notif_cbf_t)(int event, int data1, int data2, void* notifUser);
10013837cf3f7be0eb8b1a9552bd99a89f98c987720Jean-Michel Trivi
10113837cf3f7be0eb8b1a9552bd99a89f98c987720Jean-Michel Trivi/**
10213837cf3f7be0eb8b1a9552bd99a89f98c987720Jean-Michel Trivi * Audio data push callback from Android objects to SL ES framework
10313837cf3f7be0eb8b1a9552bd99a89f98c987720Jean-Michel Trivi */
104f4b45a37248899ae2d27bb172f8387fbf1edff8eGlenn Kastentypedef size_t (*data_push_cbf_t)(const uint8_t *data, size_t size, CAudioPlayer* ap);
105581a0f550f15f6fc22199cb85775a220f668b480Jean-Michel Trivi
106581a0f550f15f6fc22199cb85775a220f668b480Jean-Michel Trivi
107581a0f550f15f6fc22199cb85775a220f668b480Jean-Michel Trivi/**
10813837cf3f7be0eb8b1a9552bd99a89f98c987720Jean-Michel Trivi * Events sent to mNotifyClient during prepare, prefetch, and playback
10913837cf3f7be0eb8b1a9552bd99a89f98c987720Jean-Michel Trivi * used in APlayer::notify() and AMessage::findxxx()
110581a0f550f15f6fc22199cb85775a220f668b480Jean-Michel Trivi */
111581a0f550f15f6fc22199cb85775a220f668b480Jean-Michel Trivi#define PLAYEREVENT_PREPARED                "prep"
112581a0f550f15f6fc22199cb85775a220f668b480Jean-Michel Trivi#define PLAYEREVENT_PREFETCHSTATUSCHANGE    "prsc"
113581a0f550f15f6fc22199cb85775a220f668b480Jean-Michel Trivi#define PLAYEREVENT_PREFETCHFILLLEVELUPDATE "pflu"
114581a0f550f15f6fc22199cb85775a220f668b480Jean-Michel Trivi#define PLAYEREVENT_ENDOFSTREAM             "eos"
11537dc2fccf3f122b79ebd554de209d0a3c94ae161Jean-Michel Trivi#define PLAYEREVENT_VIDEO_SIZE_UPDATE       "vsiz"
116fa2bd93c3a9852a1f879663eeff598d13cf8fa81Glenn Kasten#define PLAYEREVENT_CHANNEL_COUNT           "ccnt"  // channel count is now known
1175933f3d5e532aaac31ce0e6551c59f0197c0ae3cGlenn Kasten#define PLAYEREVENT_PLAY                    "play"  // SL_PLAYEVENT_*
1185e4d65e369f28746767aba11b618dee314bb8197Glenn Kasten#define PLAYEREVENT_ERRORAFTERPREPARE       "easp"  // error after successful prepare
11997876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivi
12097876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivi
12113837cf3f7be0eb8b1a9552bd99a89f98c987720Jean-Michel Trivi/**
1224ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi * Time value when time is unknown. Used for instance for duration or playback position
12313837cf3f7be0eb8b1a9552bd99a89f98c987720Jean-Michel Trivi */
1244ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi#define ANDROID_UNKNOWN_TIME -1
12513837cf3f7be0eb8b1a9552bd99a89f98c987720Jean-Michel Trivi
12670c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivi/**
12770c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivi * Event mask for MPEG-2 TS events associated with TS data
12870c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivi */
12970c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivi#define ANDROID_MP2TSEVENT_NONE          ((SLuint32) 0x0)
13070c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivi// buffer is at End Of Stream
13170c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivi#define ANDROID_MP2TSEVENT_EOS           ((SLuint32) 0x1)
13270c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivi// buffer marks a discontinuity with previous TS data, resume display as soon as possible
13370c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivi#define ANDROID_MP2TSEVENT_DISCONTINUITY ((SLuint32) 0x1 << 1)
13470c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivi// buffer marks a discontinuity with previous TS data, resume display upon reaching the
13570c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivi// associated presentation time stamp
13670c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivi#define ANDROID_MP2TSEVENT_DISCON_NEWPTS ((SLuint32) 0x1 << 2)
1376f0f5640d190b0187c356eb53bd96d9f9e49da60Jean-Michel Trivi// buffer marks a format change with previous TS data, resume display as soon as possible
138af9b87de97356722370d11d2c5797d75cb43969eJean-Michel Trivi#define ANDROID_MP2TSEVENT_FORMAT_CHANGE_FULL  ((SLuint32) 0x1 << 3)
139af9b87de97356722370d11d2c5797d75cb43969eJean-Michel Trivi#define ANDROID_MP2TSEVENT_FORMAT_CHANGE_VIDEO ((SLuint32) 0x1 << 4)
14070c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivi
141bb832e853d4afb11b0a3287b2eb0cad87696d631Jean-Michel Trivi/**
142bb832e853d4afb11b0a3287b2eb0cad87696d631Jean-Michel Trivi * Event mask for AAC ADTS events associated with ADTS data
143bb832e853d4afb11b0a3287b2eb0cad87696d631Jean-Michel Trivi */
144bb832e853d4afb11b0a3287b2eb0cad87696d631Jean-Michel Trivi#define ANDROID_ADTSEVENT_NONE           ANDROID_MP2TSEVENT_NONE
145bb832e853d4afb11b0a3287b2eb0cad87696d631Jean-Michel Trivi// buffer is at End Of Stream
146bb832e853d4afb11b0a3287b2eb0cad87696d631Jean-Michel Trivi#define ANDROID_ADTSEVENT_EOS            ANDROID_MP2TSEVENT_EOS
1477f5cc1afe49395fefaad9b2bbd728a45d1bfda6aJean-Michel Trivi
1487f5cc1afe49395fefaad9b2bbd728a45d1bfda6aJean-Michel Trivi/**
14970c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivi * Types of buffers stored in Android Buffer Queues, see IAndroidBufferQueue.mBufferType
15070c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivi */
15170c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivienum AndroidBufferType_type {
15270c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivi    kAndroidBufferTypeInvalid = ((SLuint16) 0x0),
15370c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivi    kAndroidBufferTypeMpeg2Ts = ((SLuint16) 0x1),
154bb832e853d4afb11b0a3287b2eb0cad87696d631Jean-Michel Trivi    kAndroidBufferTypeAacadts = ((SLuint16) 0x2),
15570c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivi};
15670c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivi
1574ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi/**
158bb832e853d4afb11b0a3287b2eb0cad87696d631Jean-Michel Trivi * MIME types required for data in Android Buffer Queues
159bb832e853d4afb11b0a3287b2eb0cad87696d631Jean-Michel Trivi */
160c3b82a293ed06001ba6d50f111608160c6065ef2Glenn Kasten// The preferred MIME types for new applications are in ../../include/*/OpenMAXAL_Android.h
161c3b82a293ed06001ba6d50f111608160c6065ef2Glenn Kasten// The legacy MIME type used elsewhere in the Android framework for AAC ADTS is below:
162bb832e853d4afb11b0a3287b2eb0cad87696d631Jean-Michel Trivi#define ANDROID_MIME_AACADTS_ANDROID_FRAMEWORK "audio/aac-adts"
163bb832e853d4afb11b0a3287b2eb0cad87696d631Jean-Michel Trivi
164bb832e853d4afb11b0a3287b2eb0cad87696d631Jean-Michel Trivi/**
1654ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi * Notification thresholds relative to content duration in the cache
1664ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi */
1674ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi#define DURATION_CACHED_HIGH_MS  30000 // 30s
1684ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi#define DURATION_CACHED_MED_MS   10000 // 10s
1694ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi#define DURATION_CACHED_LOW_MS    2000 //  2s
1704ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi
1714ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi
17297876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivinamespace android {
17397876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivi
1744ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi/**
1754ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi * Prefetch cache status
1764ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi */
1774ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivienum CacheStatus_t {
1784ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi        kStatusUnknown = -1,
1794ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi        kStatusEmpty   = 0,
1804ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi        kStatusLow,
1814ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi        kStatusIntermediate,
1824ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi        kStatusEnough,
1834ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi        kStatusHigh
1844ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi};
1854ee246c55533bdab8ab5fa0f0581744fe58e7c91Jean-Michel Trivi
18697876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivienum {
18797876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivi    kDataLocatorNone = 'none',
18897876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivi    kDataLocatorUri  = 'uri',
18997876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivi    kDataLocatorFd   = 'fd',
19070c49ae2867094072a4365423417ea452bf82231Jean-Michel Trivi};
19197876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivi
19297876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivistruct FdInfo {
19397876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivi    int fd;
19497876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivi    int64_t offset;
19597876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivi    int64_t length;
196833251ab9e5e59a6ea5ac325122cf3abdf7cd944Glenn Kasten    bool mCloseAfterUse;    // whether to close fd after last reference to fd
19797876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivi};
19897876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivi
19913837cf3f7be0eb8b1a9552bd99a89f98c987720Jean-Michel Trivi// TODO currently used by SfPlayer, to replace by DataLocator2
20097876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Triviunion DataLocator {
20197876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivi    char* uri;
20297876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivi    FdInfo fdi;
20397876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivi};
20497876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivi
20513837cf3f7be0eb8b1a9552bd99a89f98c987720Jean-Michel Triviunion DataLocator2 {
20613837cf3f7be0eb8b1a9552bd99a89f98c987720Jean-Michel Trivi    const char* uriRef;
20713837cf3f7be0eb8b1a9552bd99a89f98c987720Jean-Michel Trivi    FdInfo fdi;
20813837cf3f7be0eb8b1a9552bd99a89f98c987720Jean-Michel Trivi};
20913837cf3f7be0eb8b1a9552bd99a89f98c987720Jean-Michel Trivi
21097876858aa17c7f24c6a1d60be09a57bc1824ba3Jean-Michel Trivi} // namespace android
211