2 * Copyright 2015, The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 #ifndef _ANDROID_MEDIA_MEDIASYNC_H_
18 #define _ANDROID_MEDIA_MEDIASYNC_H_
20 #include <media/stagefright/foundation/ABase.h>
21 #include <media/stagefright/MediaSync.h>
22 #include <utils/Errors.h>
23 #include <utils/RefBase.h>
27 struct AudioPlaybackRate;
29 class IGraphicBufferProducer;
33 struct JMediaSync : public RefBase {
36 status_t setSurface(const sp<IGraphicBufferProducer> &bufferProducer);
37 status_t setAudioTrack(const sp<AudioTrack> &audioTrack);
39 status_t createInputSurface(sp<IGraphicBufferProducer>* bufferProducer);
41 status_t updateQueuedAudioData(int sizeInBytes, int64_t presentationTimeUs);
43 status_t getPlayTimeForPendingAudioFrames(int64_t *outTimeUs);
45 status_t setPlaybackParams(const AudioPlaybackRate& rate);
46 void getPlaybackParams(AudioPlaybackRate* rate /* nonnull */);
47 status_t setSyncParams(const AVSyncSettings& syncParams);
48 void getSyncParams(AVSyncSettings* syncParams /* nonnull */);
49 status_t setVideoFrameRateHint(float rate);
50 float getVideoFrameRate();
54 sp<const MediaClock> getMediaClock();
57 virtual ~JMediaSync();
62 DISALLOW_EVIL_CONSTRUCTORS(JMediaSync);
65 } // namespace android
67 #endif // _ANDROID_MEDIA_MEDIASYNC_H_