android_media_MediaSync.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright 2015, 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. #ifndef _ANDROID_MEDIA_MEDIASYNC_H_
  17. #define _ANDROID_MEDIA_MEDIASYNC_H_
  18. #include <media/stagefright/foundation/ABase.h>
  19. #include <media/stagefright/MediaSync.h>
  20. #include <utils/Errors.h>
  21. #include <utils/RefBase.h>
  22. namespace android {
  23. struct AudioPlaybackRate;
  24. class AudioTrack;
  25. class IGraphicBufferProducer;
  26. struct MediaClock;
  27. class MediaSync;
  28. struct JMediaSync : public RefBase {
  29. JMediaSync();
  30. status_t setSurface(const sp<IGraphicBufferProducer> &bufferProducer);
  31. status_t setAudioTrack(const sp<AudioTrack> &audioTrack);
  32. status_t createInputSurface(sp<IGraphicBufferProducer>* bufferProducer);
  33. status_t updateQueuedAudioData(int sizeInBytes, int64_t presentationTimeUs);
  34. status_t getPlayTimeForPendingAudioFrames(int64_t *outTimeUs);
  35. status_t setPlaybackParams(const AudioPlaybackRate& rate);
  36. void getPlaybackParams(AudioPlaybackRate* rate /* nonnull */);
  37. status_t setSyncParams(const AVSyncSettings& syncParams);
  38. void getSyncParams(AVSyncSettings* syncParams /* nonnull */);
  39. status_t setVideoFrameRateHint(float rate);
  40. float getVideoFrameRate();
  41. void flush();
  42. sp<const MediaClock> getMediaClock();
  43. protected:
  44. virtual ~JMediaSync();
  45. private:
  46. sp<MediaSync> mSync;
  47. DISALLOW_EVIL_CONSTRUCTORS(JMediaSync);
  48. };
  49. } // namespace android
  50. #endif // _ANDROID_MEDIA_MEDIASYNC_H_