blob: f31609691dc6bf564e2799836908297191ddc017 [file] [log] [blame]
Andreas Huberf9334412010-12-15 15:17:42 -08001/*
2 * Copyright (C) 2010 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 NU_PLAYER_H_
18
19#define NU_PLAYER_H_
20
Lajos Molnar3a474aa2015-04-24 17:10:07 -070021#include <media/AudioResamplerPublic.h>
Marco Nelissen13aa1a42019-09-27 10:21:55 -070022#include <mediadrm/ICrypto.h>
Andreas Huberf9334412010-12-15 15:17:42 -080023#include <media/MediaPlayerInterface.h>
24#include <media/stagefright/foundation/AHandler.h>
25
Andreas Huberf9334412010-12-15 15:17:42 -080026namespace android {
27
Chong Zhang404fced2014-06-11 14:45:31 -070028struct ABuffer;
Lajos Molnar87603c02014-08-20 19:25:30 -070029struct AMessage;
Lajos Molnar3a474aa2015-04-24 17:10:07 -070030struct AVSyncSettings;
Lajos Molnaree4e1b12015-04-17 13:46:19 -070031class IDataSource;
Wei Jia0a68f662017-08-30 18:01:26 -070032struct MediaClock;
Bernhard Rosenkränzer86a58ca2014-11-17 20:14:08 +010033class MetaData;
Andreas Huber43c3e6c2011-01-05 12:17:08 -080034struct NuPlayerDriver;
Andreas Huberf9334412010-12-15 15:17:42 -080035
36struct NuPlayer : public AHandler {
Wei Jia0a68f662017-08-30 18:01:26 -070037 explicit NuPlayer(pid_t pid, const sp<MediaClock> &mediaClock);
Andreas Huberf9334412010-12-15 15:17:42 -080038
Andreas Huber9b80c2b2011-06-30 15:47:02 -070039 void setUID(uid_t uid);
40
Dongwon Kang47afe0a2018-03-27 15:15:30 -070041 void init(const wp<NuPlayerDriver> &driver);
Andreas Huberf9334412010-12-15 15:17:42 -080042
Andreas Huber9575c962013-02-05 13:59:56 -080043 void setDataSourceAsync(const sp<IStreamSource> &source);
Andreas Huber5bc087c2010-12-23 10:27:40 -080044
Andreas Huber9575c962013-02-05 13:59:56 -080045 void setDataSourceAsync(
Andreas Huber1b86fe02014-01-29 11:13:26 -080046 const sp<IMediaHTTPService> &httpService,
47 const char *url,
48 const KeyedVector<String8, String8> *headers);
Andreas Huber5bc087c2010-12-23 10:27:40 -080049
Andreas Huber9575c962013-02-05 13:59:56 -080050 void setDataSourceAsync(int fd, int64_t offset, int64_t length);
51
Chris Watkins99f31602015-03-20 13:06:33 -070052 void setDataSourceAsync(const sp<DataSource> &source);
53
Byeongjo Park28225ab2019-01-24 20:31:19 +090054 void setDataSourceAsync(const String8& rtpParams);
55
Wei Jia9bb38032017-03-23 18:00:38 -070056 status_t getBufferingSettings(BufferingSettings* buffering /* nonnull */);
Wei Jia48fa06d2016-12-20 15:30:49 -080057 status_t setBufferingSettings(const BufferingSettings& buffering);
58
Andreas Huber9575c962013-02-05 13:59:56 -080059 void prepareAsync();
Andreas Huberafed0e12011-09-20 15:39:58 -070060
Andreas Huber57a339c2012-12-03 11:18:00 -080061 void setVideoSurfaceTextureAsync(
Andy McFadden8ba01022012-12-18 09:46:54 -080062 const sp<IGraphicBufferProducer> &bufferProducer);
Andreas Huber57a339c2012-12-03 11:18:00 -080063
Andreas Huberf9334412010-12-15 15:17:42 -080064 void setAudioSink(const sp<MediaPlayerBase::AudioSink> &sink);
Lajos Molnar3a474aa2015-04-24 17:10:07 -070065 status_t setPlaybackSettings(const AudioPlaybackRate &rate);
66 status_t getPlaybackSettings(AudioPlaybackRate *rate /* nonnull */);
67 status_t setSyncSettings(const AVSyncSettings &sync, float videoFpsHint);
68 status_t getSyncSettings(AVSyncSettings *sync /* nonnull */, float *videoFps /* nonnull */);
69
Andreas Huberf9334412010-12-15 15:17:42 -080070 void start();
71
Andreas Huber43c3e6c2011-01-05 12:17:08 -080072 void pause();
Andreas Huber43c3e6c2011-01-05 12:17:08 -080073
74 // Will notify the driver through "notifyResetComplete" once finished.
Andreas Huber1aef2112011-01-04 14:01:29 -080075 void resetAsync();
76
Wei Jia52c28512017-09-13 18:17:51 -070077 // Request a notification when specified media time is reached.
78 status_t notifyAt(int64_t mediaTimeUs);
79
Wei Jiae427abf2014-09-22 15:21:11 -070080 // Will notify the driver through "notifySeekComplete" once finished
81 // and needNotify is true.
Wei Jiac5de0912016-11-18 10:22:14 -080082 void seekToAsync(
83 int64_t seekTimeUs,
84 MediaPlayerSeekMode mode = MediaPlayerSeekMode::SEEK_PREVIOUS_SYNC,
85 bool needNotify = false);
Andreas Huber43c3e6c2011-01-05 12:17:08 -080086
James Dong0d268a32012-08-31 12:18:27 -070087 status_t setVideoScalingMode(int32_t mode);
Chong Zhangdcb89b32013-08-06 09:44:47 -070088 status_t getTrackInfo(Parcel* reply) const;
Robert Shih7c4f0d72014-07-09 18:53:31 -070089 status_t getSelectedTrack(int32_t type, Parcel* reply) const;
Robert Shih6ffb1fd2014-10-29 16:24:32 -070090 status_t selectTrack(size_t trackIndex, bool select, int64_t timeUs);
Ronghua Wua73d9e02014-10-08 15:13:29 -070091 status_t getCurrentPosition(int64_t *mediaUs);
Ray Essickffc941f2018-05-18 11:08:37 -070092 void getStats(Vector<sp<AMessage> > *trackStats);
James Dong0d268a32012-08-31 12:18:27 -070093
Marco Nelissenf0b72b52014-09-16 15:43:44 -070094 sp<MetaData> getFileMeta();
Ronghua Wuc8a70d32015-04-29 16:26:34 -070095 float getFrameRate();
Marco Nelissenf0b72b52014-09-16 15:43:44 -070096
Hassan Shojaniacefac142017-02-06 21:02:02 -080097 // Modular DRM
98 status_t prepareDrm(const uint8_t uuid[16], const Vector<uint8_t> &drmSessionId);
99 status_t releaseDrm();
100
Hassan Shojaniaff63de72017-04-26 15:10:42 -0700101 const char *getDataSourceType();
102
Ray Essickeda32522018-02-28 12:08:28 -0800103 void updateInternalTimers();
104
Andreas Huberf9334412010-12-15 15:17:42 -0800105protected:
106 virtual ~NuPlayer();
107
108 virtual void onMessageReceived(const sp<AMessage> &msg);
109
Andreas Huber84066782011-08-16 09:34:26 -0700110public:
111 struct NuPlayerStreamListener;
112 struct Source;
113
Andreas Huberf9334412010-12-15 15:17:42 -0800114private:
Andreas Huberf9334412010-12-15 15:17:42 -0800115 struct Decoder;
Chong Zhang7137ec72014-11-12 16:41:05 -0800116 struct DecoderBase;
Wei Jiabc2fb722014-07-08 16:37:57 -0700117 struct DecoderPassThrough;
Chong Zhanga7fa1d92014-06-11 14:49:23 -0700118 struct CCDecoder;
Andreas Huberafed0e12011-09-20 15:39:58 -0700119 struct GenericSource;
Andreas Huber5bc087c2010-12-23 10:27:40 -0800120 struct HTTPLiveSource;
Andreas Huber5bc087c2010-12-23 10:27:40 -0800121 struct Renderer;
Byeongjo Park28225ab2019-01-24 20:31:19 +0900122 struct RTPSource;
Andreas Huberafed0e12011-09-20 15:39:58 -0700123 struct RTSPSource;
Andreas Huber5bc087c2010-12-23 10:27:40 -0800124 struct StreamingSource;
Andreas Hubera1f8ab02012-11-30 10:53:22 -0800125 struct Action;
126 struct SeekAction;
Andreas Huber57a339c2012-12-03 11:18:00 -0800127 struct SetSurfaceAction;
Chong Zhangf8d71772014-11-26 15:08:34 -0800128 struct ResumeDecoderAction;
Wei Jiafef808d2014-10-31 17:57:05 -0700129 struct FlushDecoderAction;
Andreas Huber14f76722013-01-15 09:04:18 -0800130 struct PostMessageAction;
Andreas Hubera1f8ab02012-11-30 10:53:22 -0800131 struct SimpleAction;
Andreas Huberf9334412010-12-15 15:17:42 -0800132
133 enum {
Andreas Huber078cfcf2011-09-15 12:25:04 -0700134 kWhatSetDataSource = '=DaS',
Andreas Huber9575c962013-02-05 13:59:56 -0800135 kWhatPrepare = 'prep',
Lajos Molnar1de1e252015-04-30 18:18:34 -0700136 kWhatSetVideoSurface = '=VSu',
Andreas Huber078cfcf2011-09-15 12:25:04 -0700137 kWhatSetAudioSink = '=AuS',
138 kWhatMoreDataQueued = 'more',
Lajos Molnar3a474aa2015-04-24 17:10:07 -0700139 kWhatConfigPlayback = 'cfPB',
140 kWhatConfigSync = 'cfSy',
141 kWhatGetPlaybackSettings = 'gPbS',
142 kWhatGetSyncSettings = 'gSyS',
Andreas Huber078cfcf2011-09-15 12:25:04 -0700143 kWhatStart = 'strt',
144 kWhatScanSources = 'scan',
145 kWhatVideoNotify = 'vidN',
146 kWhatAudioNotify = 'audN',
Chong Zhanga7fa1d92014-06-11 14:49:23 -0700147 kWhatClosedCaptionNotify = 'capN',
Andreas Huber078cfcf2011-09-15 12:25:04 -0700148 kWhatRendererNotify = 'renN',
149 kWhatReset = 'rset',
Wei Jia52c28512017-09-13 18:17:51 -0700150 kWhatNotifyTime = 'nfyT',
Andreas Huber078cfcf2011-09-15 12:25:04 -0700151 kWhatSeek = 'seek',
152 kWhatPause = 'paus',
153 kWhatResume = 'rsme',
Andreas Huberb7c8e912012-11-27 15:02:53 -0800154 kWhatPollDuration = 'polD',
Andreas Huberb5f25f02013-02-05 10:14:26 -0800155 kWhatSourceNotify = 'srcN',
Chong Zhangdcb89b32013-08-06 09:44:47 -0700156 kWhatGetTrackInfo = 'gTrI',
Robert Shih7c4f0d72014-07-09 18:53:31 -0700157 kWhatGetSelectedTrack = 'gSel',
Chong Zhangdcb89b32013-08-06 09:44:47 -0700158 kWhatSelectTrack = 'selT',
Wei Jia9bb38032017-03-23 18:00:38 -0700159 kWhatGetBufferingSettings = 'gBus',
Wei Jia48fa06d2016-12-20 15:30:49 -0800160 kWhatSetBufferingSettings = 'sBuS',
Hassan Shojaniacefac142017-02-06 21:02:02 -0800161 kWhatPrepareDrm = 'pDrm',
162 kWhatReleaseDrm = 'rDrm',
Dongwon Kang47afe0a2018-03-27 15:15:30 -0700163 kWhatMediaClockNotify = 'mckN',
Andreas Huberf9334412010-12-15 15:17:42 -0800164 };
165
Andreas Huber43c3e6c2011-01-05 12:17:08 -0800166 wp<NuPlayerDriver> mDriver;
Andreas Huber9b80c2b2011-06-30 15:47:02 -0700167 bool mUIDValid;
168 uid_t mUID;
Ronghua Wu68845c12015-07-21 09:50:48 -0700169 pid_t mPID;
Wei Jia0a68f662017-08-30 18:01:26 -0700170 const sp<MediaClock> mMediaClock;
Wei Jiac45a4b22016-04-15 15:30:23 -0700171 Mutex mSourceLock; // guard |mSource|.
Andreas Huber5bc087c2010-12-23 10:27:40 -0800172 sp<Source> mSource;
Andreas Huber9575c962013-02-05 13:59:56 -0800173 uint32_t mSourceFlags;
Lajos Molnar1de1e252015-04-30 18:18:34 -0700174 sp<Surface> mSurface;
Andreas Huberf9334412010-12-15 15:17:42 -0800175 sp<MediaPlayerBase::AudioSink> mAudioSink;
Chong Zhang7137ec72014-11-12 16:41:05 -0800176 sp<DecoderBase> mVideoDecoder;
Wei Jiabc2fb722014-07-08 16:37:57 -0700177 bool mOffloadAudio;
Chong Zhang7137ec72014-11-12 16:41:05 -0800178 sp<DecoderBase> mAudioDecoder;
Ray Essickfcb8fd32018-08-07 09:39:38 -0700179 Mutex mDecoderLock; // guard |mAudioDecoder| and |mVideoDecoder|.
Chong Zhanga7fa1d92014-06-11 14:49:23 -0700180 sp<CCDecoder> mCCDecoder;
Andreas Huberf9334412010-12-15 15:17:42 -0800181 sp<Renderer> mRenderer;
Lajos Molnar09524832014-07-17 14:29:51 -0700182 sp<ALooper> mRendererLooper;
Wei Jia88703c32014-08-06 11:24:07 -0700183 int32_t mAudioDecoderGeneration;
184 int32_t mVideoDecoderGeneration;
Wei Jia57568df2014-09-22 10:16:29 -0700185 int32_t mRendererGeneration;
Andreas Huberf9334412010-12-15 15:17:42 -0800186
Ray Essick0d98c182017-11-09 13:42:42 -0800187 Mutex mPlayingTimeLock;
Ray Essickd4d00612017-01-03 09:36:27 -0800188 int64_t mLastStartedPlayingTimeNs;
Ray Essickeda32522018-02-28 12:08:28 -0800189 void updatePlaybackTimer(bool stopping, const char *where);
Ray Essick0d98c182017-11-09 13:42:42 -0800190 void startPlaybackTimer(const char *where);
Ray Essickd4d00612017-01-03 09:36:27 -0800191
Ray Essick58e0f7a2017-11-21 10:59:38 -0800192 int64_t mLastStartedRebufferingTimeNs;
193 void startRebufferingTimer();
Ray Essickeda32522018-02-28 12:08:28 -0800194 void updateRebufferingTimer(bool stopping, bool exitingPlayback);
Ray Essick58e0f7a2017-11-21 10:59:38 -0800195
Robert Shih1a5c8592015-08-04 18:07:44 -0700196 int64_t mPreviousSeekTimeUs;
197
Andreas Hubera1f8ab02012-11-30 10:53:22 -0800198 List<sp<Action> > mDeferredActions;
199
Andreas Huberf9334412010-12-15 15:17:42 -0800200 bool mAudioEOS;
201 bool mVideoEOS;
202
Andreas Huber5bc087c2010-12-23 10:27:40 -0800203 bool mScanSourcesPending;
Andreas Huber1aef2112011-01-04 14:01:29 -0800204 int32_t mScanSourcesGeneration;
Andreas Huber5bc087c2010-12-23 10:27:40 -0800205
Andreas Huberb7c8e912012-11-27 15:02:53 -0800206 int32_t mPollDurationGeneration;
Robert Shihd3b0bbb2014-07-23 15:00:25 -0700207 int32_t mTimedTextGeneration;
Andreas Huberb7c8e912012-11-27 15:02:53 -0800208
Andreas Huberf9334412010-12-15 15:17:42 -0800209 enum FlushStatus {
210 NONE,
Andreas Huberf9334412010-12-15 15:17:42 -0800211 FLUSHING_DECODER,
Andreas Huber1aef2112011-01-04 14:01:29 -0800212 FLUSHING_DECODER_SHUTDOWN,
Andreas Huber3831a062010-12-21 10:22:33 -0800213 SHUTTING_DOWN_DECODER,
214 FLUSHED,
215 SHUT_DOWN,
Andreas Huberf9334412010-12-15 15:17:42 -0800216 };
217
Wei Jiafef808d2014-10-31 17:57:05 -0700218 enum FlushCommand {
219 FLUSH_CMD_NONE,
220 FLUSH_CMD_FLUSH,
221 FLUSH_CMD_SHUTDOWN,
222 };
223
Andy Hung8d121d42014-10-03 09:53:53 -0700224 // Status of flush responses from the decoder and renderer.
225 bool mFlushComplete[2][2];
226
Andreas Huberf9334412010-12-15 15:17:42 -0800227 FlushStatus mFlushingAudio;
228 FlushStatus mFlushingVideo;
229
Chong Zhangf8d71772014-11-26 15:08:34 -0800230 // Status of flush responses from the decoder and renderer.
231 bool mResumePending;
232
James Dong0d268a32012-08-31 12:18:27 -0700233 int32_t mVideoScalingMode;
234
Lajos Molnar3a474aa2015-04-24 17:10:07 -0700235 AudioPlaybackRate mPlaybackSettings;
236 AVSyncSettings mSyncSettings;
237 float mVideoFpsHint;
Andreas Huber57a339c2012-12-03 11:18:00 -0800238 bool mStarted;
Wei Jia8a092d32016-06-03 14:57:24 -0700239 bool mPrepared;
Ronghua Wu64c2d172015-10-07 16:52:19 -0700240 bool mResetting;
Robert Shih0c61a0d2015-07-06 15:09:10 -0700241 bool mSourceStarted;
Wei Jia686e8e52017-04-03 14:08:01 -0700242 bool mAudioDecoderError;
243 bool mVideoDecoderError;
Andreas Huber57a339c2012-12-03 11:18:00 -0800244
Chong Zhangefbb6192015-01-30 17:13:27 -0800245 // Actual pause state, either as requested by client or due to buffering.
246 bool mPaused;
247
248 // Pause state as requested by client. Note that if mPausedByClient is
249 // true, mPaused is always true; if mPausedByClient is false, mPaused could
250 // still become true, when we pause internally due to buffering.
251 bool mPausedByClient;
252
Chong Zhang8a048332015-05-06 15:16:28 -0700253 // Pause state as requested by source (internally) due to buffering
254 bool mPausedForBuffering;
255
Hassan Shojaniacefac142017-02-06 21:02:02 -0800256 // Modular DRM
257 sp<ICrypto> mCrypto;
258 bool mIsDrmProtected;
259
Hassan Shojaniaff63de72017-04-26 15:10:42 -0700260 typedef enum {
261 DATA_SOURCE_TYPE_NONE,
262 DATA_SOURCE_TYPE_HTTP_LIVE,
263 DATA_SOURCE_TYPE_RTSP,
264 DATA_SOURCE_TYPE_GENERIC_URL,
265 DATA_SOURCE_TYPE_GENERIC_FD,
266 DATA_SOURCE_TYPE_MEDIA,
267 DATA_SOURCE_TYPE_STREAM,
268 } DATA_SOURCE_TYPE;
269
270 std::atomic<DATA_SOURCE_TYPE> mDataSourceType;
271
Chong Zhang7137ec72014-11-12 16:41:05 -0800272 inline const sp<DecoderBase> &getDecoder(bool audio) {
Lajos Molnar87603c02014-08-20 19:25:30 -0700273 return audio ? mAudioDecoder : mVideoDecoder;
274 }
275
Andy Hung8d121d42014-10-03 09:53:53 -0700276 inline void clearFlushComplete() {
277 mFlushComplete[0][0] = false;
278 mFlushComplete[0][1] = false;
279 mFlushComplete[1][0] = false;
280 mFlushComplete[1][1] = false;
281 }
282
Wei Jia41cd4632016-05-13 10:53:30 -0700283 void tryOpenAudioSinkForOffload(
284 const sp<AMessage> &format, const sp<MetaData> &audioMeta, bool hasVideo);
Andy Hung282a7e32014-08-14 15:56:34 -0700285 void closeAudioSink();
Wei Jia5031b2f2016-02-25 11:19:31 -0800286 void restartAudio(
Wei Jiaa05f1e32016-03-25 16:31:22 -0700287 int64_t currentPositionUs, bool forceNonOffload, bool needsToCreateAudioDecoder);
Wei Jia41cd4632016-05-13 10:53:30 -0700288 void determineAudioModeChange(const sp<AMessage> &audioFormat);
Andy Hung282a7e32014-08-14 15:56:34 -0700289
Wei Jiaa05f1e32016-03-25 16:31:22 -0700290 status_t instantiateDecoder(
291 bool audio, sp<DecoderBase> *decoder, bool checkAudioModeChange = true);
Andreas Huberf9334412010-12-15 15:17:42 -0800292
Lajos Molnarfcd3e942015-03-31 10:06:48 -0700293 status_t onInstantiateSecureDecoders();
294
Chong Zhangced1c2f2014-08-08 15:22:35 -0700295 void updateVideoSize(
296 const sp<AMessage> &inputFormat,
297 const sp<AMessage> &outputFormat = NULL);
298
Chong Zhangdcb89b32013-08-06 09:44:47 -0700299 void notifyListener(int msg, int ext1, int ext2, const Parcel *in = NULL);
Andreas Huberf9334412010-12-15 15:17:42 -0800300
Andy Hung8d121d42014-10-03 09:53:53 -0700301 void handleFlushComplete(bool audio, bool isDecoder);
Andreas Huber3831a062010-12-21 10:22:33 -0800302 void finishFlushIfPossible();
303
Wei Jiac5de0912016-11-18 10:22:14 -0800304 void onStart(
305 int64_t startPositionUs = -1,
306 MediaPlayerSeekMode mode = MediaPlayerSeekMode::SEEK_PREVIOUS_SYNC);
Wei Jia94211742014-10-28 17:09:06 -0700307 void onResume();
Chong Zhangefbb6192015-01-30 17:13:27 -0800308 void onPause();
Wei Jia94211742014-10-28 17:09:06 -0700309
Ronghua Wud7988b12014-10-03 15:19:10 -0700310 bool audioDecoderStillNeeded();
311
Chong Zhang7137ec72014-11-12 16:41:05 -0800312 void flushDecoder(bool audio, bool needShutdown);
Andreas Huber1aef2112011-01-04 14:01:29 -0800313
Chong Zhangf8d71772014-11-26 15:08:34 -0800314 void finishResume();
Wei Jia1061c9c2015-05-19 16:02:17 -0700315 void notifyDriverSeekComplete();
Chong Zhangf8d71772014-11-26 15:08:34 -0800316
Andreas Huber1aef2112011-01-04 14:01:29 -0800317 void postScanSources();
Andreas Huber53df1a42010-12-22 10:03:04 -0800318
Andreas Huberb7c8e912012-11-27 15:02:53 -0800319 void schedulePollDuration();
320 void cancelPollDuration();
321
Andreas Hubera1f8ab02012-11-30 10:53:22 -0800322 void processDeferredActions();
323
Wei Jiac5de0912016-11-18 10:22:14 -0800324 void performSeek(int64_t seekTimeUs, MediaPlayerSeekMode mode);
Wei Jiafef808d2014-10-31 17:57:05 -0700325 void performDecoderFlush(FlushCommand audio, FlushCommand video);
Andreas Hubera1f8ab02012-11-30 10:53:22 -0800326 void performReset();
327 void performScanSources();
Lajos Molnar1de1e252015-04-30 18:18:34 -0700328 void performSetSurface(const sp<Surface> &wrapper);
Chong Zhangf8d71772014-11-26 15:08:34 -0800329 void performResumeDecoders(bool needNotify);
Andreas Hubera1f8ab02012-11-30 10:53:22 -0800330
Andreas Huber9575c962013-02-05 13:59:56 -0800331 void onSourceNotify(const sp<AMessage> &msg);
Chong Zhanga7fa1d92014-06-11 14:49:23 -0700332 void onClosedCaptionNotify(const sp<AMessage> &msg);
Andreas Huber9575c962013-02-05 13:59:56 -0800333
Andreas Huber14f76722013-01-15 09:04:18 -0800334 void queueDecoderShutdown(
335 bool audio, bool video, const sp<AMessage> &reply);
336
Chong Zhang404fced2014-06-11 14:45:31 -0700337 void sendSubtitleData(const sp<ABuffer> &buffer, int32_t baseIndex);
Robert Shih08528432015-04-08 09:06:54 -0700338 void sendTimedMetaData(const sp<ABuffer> &buffer);
Robert Shihd3b0bbb2014-07-23 15:00:25 -0700339 void sendTimedTextData(const sp<ABuffer> &buffer);
Chong Zhang404fced2014-06-11 14:45:31 -0700340
Chih-Hung Hsiehe964d4e2016-08-09 14:31:32 -0700341 void writeTrackInfo(Parcel* reply, const sp<AMessage>& format) const;
Chong Zhang404fced2014-06-11 14:45:31 -0700342
Hassan Shojaniacefac142017-02-06 21:02:02 -0800343 status_t onPrepareDrm(const sp<AMessage> &msg);
344 status_t onReleaseDrm();
345
Andreas Huberf9334412010-12-15 15:17:42 -0800346 DISALLOW_EVIL_CONSTRUCTORS(NuPlayer);
347};
348
349} // namespace android
350
351#endif // NU_PLAYER_H_