Home | History | Annotate | Download | only in media
      1 /*
      2  * Copyright (C) 2012 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 STATIC_AUDIO_TRACK_STATE_H
     18 #define STATIC_AUDIO_TRACK_STATE_H
     19 
     20 namespace android {
     21 
     22 // Represents a single state of an AudioTrack that was created in static mode (shared memory buffer
     23 // supplied by the client).  This state needs to be communicated from the client to server.  As this
     24 // state is too large to be updated atomically without a mutex, and mutexes aren't allowed here, the
     25 // state is wrapped by a SingleStateQueue.
     26 struct StaticAudioTrackState {
     27     // do not define constructors, destructors, or virtual methods
     28 
     29     // These fields should both be size_t, but since they are located in shared memory we
     30     // force to 32-bit.  The client and server may have different typedefs for size_t.
     31     uint32_t    mLoopStart;
     32     uint32_t    mLoopEnd;
     33 
     34     int         mLoopCount;
     35 };
     36 
     37 }   // namespace android
     38 
     39 #endif  // STATIC_AUDIO_TRACK_STATE_H
     40