blob: 0e58ec2dbd54b91401b44d1b6538cccecd8aaff7 [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 AudioPlaybackRate;
31struct AVSyncSettings;
Lajos Molnaree4e1b12015-04-17 13:46:19 -070032class IDataSource;
Wei Jia0a68f662017-08-30 18:01:26 -070033struct MediaClock;
Bernhard Rosenkränzer86a58ca2014-11-17 20:14:08 +010034class MetaData;
Andreas Huber43c3e6c2011-01-05 12:17:08 -080035struct NuPlayerDriver;
Andreas Huberf9334412010-12-15 15:17:42 -080036
37struct NuPlayer : public AHandler {
Wei Jia0a68f662017-08-30 18:01:26 -070038 explicit NuPlayer(pid_t pid, const sp<MediaClock> &mediaClock);
Andreas Huberf9334412010-12-15 15:17:42 -080039
Andreas Huber9b80c2b2011-06-30 15:47:02 -070040 void setUID(uid_t uid);
41
Dongwon Kang47afe0a2018-03-27 15:15:30 -070042 void init(const wp<NuPlayerDriver> &driver);
Andreas Huberf9334412010-12-15 15:17:42 -080043
Andreas Huber9575c962013-02-05 13:59:56 -080044 void setDataSourceAsync(const sp<IStreamSource> &source);
Andreas Huber5bc087c2010-12-23 10:27:40 -080045
Andreas Huber9575c962013-02-05 13:59:56 -080046 void setDataSourceAsync(
Andreas Huber1b86fe02014-01-29 11:13:26 -080047 const sp<IMediaHTTPService> &httpService,
48 const char *url,
49 const KeyedVector<String8, String8> *headers);
Andreas Huber5bc087c2010-12-23 10:27:40 -080050
Andreas Huber9575c962013-02-05 13:59:56 -080051 void setDataSourceAsync(int fd, int64_t offset, int64_t length);
52
Chris Watkins99f31602015-03-20 13:06:33 -070053 void setDataSourceAsync(const sp<DataSource> &source);
54
Wei Jia9bb38032017-03-23 18:00:38 -070055 status_t getBufferingSettings(BufferingSettings* buffering /* nonnull */);
Wei Jia48fa06d2016-12-20 15:30:49 -080056 status_t setBufferingSettings(const BufferingSettings& buffering);
57
Andreas Huber9575c962013-02-05 13:59:56 -080058 void prepareAsync();
Andreas Huberafed0e12011-09-20 15:39:58 -070059
Andreas Huber57a339c2012-12-03 11:18:00 -080060 void setVideoSurfaceTextureAsync(
Andy McFadden8ba01022012-12-18 09:46:54 -080061 const sp<IGraphicBufferProducer> &bufferProducer);
Andreas Huber57a339c2012-12-03 11:18:00 -080062
Andreas Huberf9334412010-12-15 15:17:42 -080063 void setAudioSink(const sp<MediaPlayerBase::AudioSink> &sink);
Lajos Molnar3a474aa2015-04-24 17:10:07 -070064 status_t setPlaybackSettings(const AudioPlaybackRate &rate);
65 status_t getPlaybackSettings(AudioPlaybackRate *rate /* nonnull */);
66 status_t setSyncSettings(const AVSyncSettings &sync, float videoFpsHint);
67 status_t getSyncSettings(AVSyncSettings *sync /* nonnull */, float *videoFps /* nonnull */);
68
Andreas Huberf9334412010-12-15 15:17:42 -080069 void start();
70
Andreas Huber43c3e6c2011-01-05 12:17:08 -080071 void pause();
Andreas Huber43c3e6c2011-01-05 12:17:08 -080072
73 // Will notify the driver through "notifyResetComplete" once finished.
Andreas Huber1aef2112011-01-04 14:01:29 -080074 void resetAsync();
75
Wei Jia52c28512017-09-13 18:17:51 -070076 // Request a notification when specified media time is reached.
77 status_t notifyAt(int64_t mediaTimeUs);
78
Wei Jiae427abf2014-09-22 15:21:11 -070079 // Will notify the driver through "notifySeekComplete" once finished
80 // and needNotify is true.
Wei Jiac5de0912016-11-18 10:22:14 -080081 void seekToAsync(
82 int64_t seekTimeUs,
83 MediaPlayerSeekMode mode = MediaPlayerSeekMode::SEEK_PREVIOUS_SYNC,
84 bool needNotify = false);
Andreas Huber43c3e6c2011-01-05 12:17:08 -080085
James Dong0d268a32012-08-31 12:18:27 -070086 status_t setVideoScalingMode(int32_t mode);
Chong Zhangdcb89b32013-08-06 09:44:47 -070087 status_t getTrackInfo(Parcel* reply) const;
Robert Shih7c4f0d72014-07-09 18:53:31 -070088 status_t getSelectedTrack(int32_t type, Parcel* reply) const;
Robert Shih6ffb1fd2014-10-29 16:24:32 -070089 status_t selectTrack(size_t trackIndex, bool select, int64_t timeUs);
Ronghua Wua73d9e02014-10-08 15:13:29 -070090 status_t getCurrentPosition(int64_t *mediaUs);
Ray Essickffc941f2018-05-18 11:08:37 -070091 void getStats(Vector<sp<AMessage> > *trackStats);
James Dong0d268a32012-08-31 12:18:27 -070092
Marco Nelissenf0b72b52014-09-16 15:43:44 -070093 sp<MetaData> getFileMeta();
Ronghua Wuc8a70d32015-04-29 16:26:34 -070094 float getFrameRate();
Marco Nelissenf0b72b52014-09-16 15:43:44 -070095
Hassan Shojaniacefac142017-02-06 21:02:02 -080096 // Modular DRM
97 status_t prepareDrm(const uint8_t uuid[16], const Vector<uint8_t> &drmSessionId);
98 status_t releaseDrm();
99
Hassan Shojaniaff63de72017-04-26 15:10:42 -0700100 const char *getDataSourceType();
101
Ray Essickeda32522018-02-28 12:08:28 -0800102 void updateInternalTimers();
103
Andreas Huberf9334412010-12-15 15:17:42 -0800104protected:
105 virtual ~NuPlayer();
106
107 virtual void onMessageReceived(const sp<AMessage> &msg);
108
Andreas Huber84066782011-08-16 09:34:26 -0700109public:
110 struct NuPlayerStreamListener;
111 struct Source;
112
Andreas Huberf9334412010-12-15 15:17:42 -0800113private:
Andreas Huberf9334412010-12-15 15:17:42 -0800114 struct Decoder;
Chong Zhang7137ec72014-11-12 16:41:05 -0800115 struct DecoderBase;
Wei Jiabc2fb722014-07-08 16:37:57 -0700116 struct DecoderPassThrough;
Chong Zhanga7fa1d92014-06-11 14:49:23 -0700117 struct CCDecoder;
Andreas Huberafed0e12011-09-20 15:39:58 -0700118 struct GenericSource;
Andreas Huber5bc087c2010-12-23 10:27:40 -0800119 struct HTTPLiveSource;
Andreas Huber5bc087c2010-12-23 10:27:40 -0800120 struct Renderer;
Andreas Huberafed0e12011-09-20 15:39:58 -0700121 struct RTSPSource;
Andreas Huber5bc087c2010-12-23 10:27:40 -0800122 struct StreamingSource;
Andreas Hubera1f8ab02012-11-30 10:53:22 -0800123 struct Action;
124 struct SeekAction;
Andreas Huber57a339c2012-12-03 11:18:00 -0800125 struct SetSurfaceAction;
Chong Zhangf8d71772014-11-26 15:08:34 -0800126 struct ResumeDecoderAction;
Wei Jiafef808d2014-10-31 17:57:05 -0700127 struct FlushDecoderAction;
Andreas Huber14f76722013-01-15 09:04:18 -0800128 struct PostMessageAction;
Andreas Hubera1f8ab02012-11-30 10:53:22 -0800129 struct SimpleAction;
Andreas Huberf9334412010-12-15 15:17:42 -0800130
131 enum {
Andreas Huber078cfcf2011-09-15 12:25:04 -0700132 kWhatSetDataSource = '=DaS',
Andreas Huber9575c962013-02-05 13:59:56 -0800133 kWhatPrepare = 'prep',
Lajos Molnar1de1e252015-04-30 18:18:34 -0700134 kWhatSetVideoSurface = '=VSu',
Andreas Huber078cfcf2011-09-15 12:25:04 -0700135 kWhatSetAudioSink = '=AuS',
136 kWhatMoreDataQueued = 'more',
Lajos Molnar3a474aa2015-04-24 17:10:07 -0700137 kWhatConfigPlayback = 'cfPB',
138 kWhatConfigSync = 'cfSy',
139 kWhatGetPlaybackSettings = 'gPbS',
140 kWhatGetSyncSettings = 'gSyS',
Andreas Huber078cfcf2011-09-15 12:25:04 -0700141 kWhatStart = 'strt',
142 kWhatScanSources = 'scan',
143 kWhatVideoNotify = 'vidN',
144 kWhatAudioNotify = 'audN',
Chong Zhanga7fa1d92014-06-11 14:49:23 -0700145 kWhatClosedCaptionNotify = 'capN',
Andreas Huber078cfcf2011-09-15 12:25:04 -0700146 kWhatRendererNotify = 'renN',
147 kWhatReset = 'rset',
Wei Jia52c28512017-09-13 18:17:51 -0700148 kWhatNotifyTime = 'nfyT',
Andreas Huber078cfcf2011-09-15 12:25:04 -0700149 kWhatSeek = 'seek',
150 kWhatPause = 'paus',
151 kWhatResume = 'rsme',
Andreas Huberb7c8e912012-11-27 15:02:53 -0800152 kWhatPollDuration = 'polD',
Andreas Huberb5f25f02013-02-05 10:14:26 -0800153 kWhatSourceNotify = 'srcN',
Chong Zhangdcb89b32013-08-06 09:44:47 -0700154 kWhatGetTrackInfo = 'gTrI',
Robert Shih7c4f0d72014-07-09 18:53:31 -0700155 kWhatGetSelectedTrack = 'gSel',
Chong Zhangdcb89b32013-08-06 09:44:47 -0700156 kWhatSelectTrack = 'selT',
Wei Jia9bb38032017-03-23 18:00:38 -0700157 kWhatGetBufferingSettings = 'gBus',
Wei Jia48fa06d2016-12-20 15:30:49 -0800158 kWhatSetBufferingSettings = 'sBuS',
Hassan Shojaniacefac142017-02-06 21:02:02 -0800159 kWhatPrepareDrm = 'pDrm',
160 kWhatReleaseDrm = 'rDrm',
Dongwon Kang47afe0a2018-03-27 15:15:30 -0700161 kWhatMediaClockNotify = 'mckN',
Andreas Huberf9334412010-12-15 15:17:42 -0800162 };
163
Andreas Huber43c3e6c2011-01-05 12:17:08 -0800164 wp<NuPlayerDriver> mDriver;
Andreas Huber9b80c2b2011-06-30 15:47:02 -0700165 bool mUIDValid;
166 uid_t mUID;
Ronghua Wu68845c12015-07-21 09:50:48 -0700167 pid_t mPID;
Wei Jia0a68f662017-08-30 18:01:26 -0700168 const sp<MediaClock> mMediaClock;
Wei Jiac45a4b22016-04-15 15:30:23 -0700169 Mutex mSourceLock; // guard |mSource|.
Andreas Huber5bc087c2010-12-23 10:27:40 -0800170 sp<Source> mSource;
Andreas Huber9575c962013-02-05 13:59:56 -0800171 uint32_t mSourceFlags;
Lajos Molnar1de1e252015-04-30 18:18:34 -0700172 sp<Surface> mSurface;
Andreas Huberf9334412010-12-15 15:17:42 -0800173 sp<MediaPlayerBase::AudioSink> mAudioSink;
Chong Zhang7137ec72014-11-12 16:41:05 -0800174 sp<DecoderBase> mVideoDecoder;
Wei Jiabc2fb722014-07-08 16:37:57 -0700175 bool mOffloadAudio;
Chong Zhang7137ec72014-11-12 16:41:05 -0800176 sp<DecoderBase> mAudioDecoder;
Ray Essickfcb8fd32018-08-07 09:39:38 -0700177 Mutex mDecoderLock; // guard |mAudioDecoder| and |mVideoDecoder|.
Chong Zhanga7fa1d92014-06-11 14:49:23 -0700178 sp<CCDecoder> mCCDecoder;
Andreas Huberf9334412010-12-15 15:17:42 -0800179 sp<Renderer> mRenderer;
Lajos Molnar09524832014-07-17 14:29:51 -0700180 sp<ALooper> mRendererLooper;
Wei Jia88703c32014-08-06 11:24:07 -0700181 int32_t mAudioDecoderGeneration;
182 int32_t mVideoDecoderGeneration;
Wei Jia57568df2014-09-22 10:16:29 -0700183 int32_t mRendererGeneration;
Andreas Huberf9334412010-12-15 15:17:42 -0800184
Ray Essick0d98c182017-11-09 13:42:42 -0800185 Mutex mPlayingTimeLock;
Ray Essickd4d00612017-01-03 09:36:27 -0800186 int64_t mLastStartedPlayingTimeNs;
Ray Essickeda32522018-02-28 12:08:28 -0800187 void updatePlaybackTimer(bool stopping, const char *where);
Ray Essick0d98c182017-11-09 13:42:42 -0800188 void startPlaybackTimer(const char *where);
Ray Essickd4d00612017-01-03 09:36:27 -0800189
Ray Essick58e0f7a2017-11-21 10:59:38 -0800190 int64_t mLastStartedRebufferingTimeNs;
191 void startRebufferingTimer();
Ray Essickeda32522018-02-28 12:08:28 -0800192 void updateRebufferingTimer(bool stopping, bool exitingPlayback);
Ray Essick58e0f7a2017-11-21 10:59:38 -0800193
Robert Shih1a5c8592015-08-04 18:07:44 -0700194 int64_t mPreviousSeekTimeUs;
195
Andreas Hubera1f8ab02012-11-30 10:53:22 -0800196 List<sp<Action> > mDeferredActions;
197
Andreas Huberf9334412010-12-15 15:17:42 -0800198 bool mAudioEOS;
199 bool mVideoEOS;
200
Andreas Huber5bc087c2010-12-23 10:27:40 -0800201 bool mScanSourcesPending;
Andreas Huber1aef2112011-01-04 14:01:29 -0800202 int32_t mScanSourcesGeneration;
Andreas Huber5bc087c2010-12-23 10:27:40 -0800203
Andreas Huberb7c8e912012-11-27 15:02:53 -0800204 int32_t mPollDurationGeneration;
Robert Shihd3b0bbb2014-07-23 15:00:25 -0700205 int32_t mTimedTextGeneration;
Andreas Huberb7c8e912012-11-27 15:02:53 -0800206
Andreas Huberf9334412010-12-15 15:17:42 -0800207 enum FlushStatus {
208 NONE,
Andreas Huberf9334412010-12-15 15:17:42 -0800209 FLUSHING_DECODER,
Andreas Huber1aef2112011-01-04 14:01:29 -0800210 FLUSHING_DECODER_SHUTDOWN,
Andreas Huber3831a062010-12-21 10:22:33 -0800211 SHUTTING_DOWN_DECODER,
212 FLUSHED,
213 SHUT_DOWN,
Andreas Huberf9334412010-12-15 15:17:42 -0800214 };
215
Wei Jiafef808d2014-10-31 17:57:05 -0700216 enum FlushCommand {
217 FLUSH_CMD_NONE,
218 FLUSH_CMD_FLUSH,
219 FLUSH_CMD_SHUTDOWN,
220 };
221
Andy Hung8d121d42014-10-03 09:53:53 -0700222 // Status of flush responses from the decoder and renderer.
223 bool mFlushComplete[2][2];
224
Andreas Huberf9334412010-12-15 15:17:42 -0800225 FlushStatus mFlushingAudio;
226 FlushStatus mFlushingVideo;
227
Chong Zhangf8d71772014-11-26 15:08:34 -0800228 // Status of flush responses from the decoder and renderer.
229 bool mResumePending;
230
James Dong0d268a32012-08-31 12:18:27 -0700231 int32_t mVideoScalingMode;
232
Lajos Molnar3a474aa2015-04-24 17:10:07 -0700233 AudioPlaybackRate mPlaybackSettings;
234 AVSyncSettings mSyncSettings;
235 float mVideoFpsHint;
Andreas Huber57a339c2012-12-03 11:18:00 -0800236 bool mStarted;
Wei Jia8a092d32016-06-03 14:57:24 -0700237 bool mPrepared;
Ronghua Wu64c2d172015-10-07 16:52:19 -0700238 bool mResetting;
Robert Shih0c61a0d2015-07-06 15:09:10 -0700239 bool mSourceStarted;
Wei Jia686e8e52017-04-03 14:08:01 -0700240 bool mAudioDecoderError;
241 bool mVideoDecoderError;
Andreas Huber57a339c2012-12-03 11:18:00 -0800242
Chong Zhangefbb6192015-01-30 17:13:27 -0800243 // Actual pause state, either as requested by client or due to buffering.
244 bool mPaused;
245
246 // Pause state as requested by client. Note that if mPausedByClient is
247 // true, mPaused is always true; if mPausedByClient is false, mPaused could
248 // still become true, when we pause internally due to buffering.
249 bool mPausedByClient;
250
Chong Zhang8a048332015-05-06 15:16:28 -0700251 // Pause state as requested by source (internally) due to buffering
252 bool mPausedForBuffering;
253
Hassan Shojaniacefac142017-02-06 21:02:02 -0800254 // Modular DRM
255 sp<ICrypto> mCrypto;
256 bool mIsDrmProtected;
257
Hassan Shojaniaff63de72017-04-26 15:10:42 -0700258 typedef enum {
259 DATA_SOURCE_TYPE_NONE,
260 DATA_SOURCE_TYPE_HTTP_LIVE,
261 DATA_SOURCE_TYPE_RTSP,
262 DATA_SOURCE_TYPE_GENERIC_URL,
263 DATA_SOURCE_TYPE_GENERIC_FD,
264 DATA_SOURCE_TYPE_MEDIA,
265 DATA_SOURCE_TYPE_STREAM,
266 } DATA_SOURCE_TYPE;
267
268 std::atomic<DATA_SOURCE_TYPE> mDataSourceType;
269
Chong Zhang7137ec72014-11-12 16:41:05 -0800270 inline const sp<DecoderBase> &getDecoder(bool audio) {
Lajos Molnar87603c02014-08-20 19:25:30 -0700271 return audio ? mAudioDecoder : mVideoDecoder;
272 }
273
Andy Hung8d121d42014-10-03 09:53:53 -0700274 inline void clearFlushComplete() {
275 mFlushComplete[0][0] = false;
276 mFlushComplete[0][1] = false;
277 mFlushComplete[1][0] = false;
278 mFlushComplete[1][1] = false;
279 }
280
Wei Jia41cd4632016-05-13 10:53:30 -0700281 void tryOpenAudioSinkForOffload(
282 const sp<AMessage> &format, const sp<MetaData> &audioMeta, bool hasVideo);
Andy Hung282a7e32014-08-14 15:56:34 -0700283 void closeAudioSink();
Wei Jia5031b2f2016-02-25 11:19:31 -0800284 void restartAudio(
Wei Jiaa05f1e32016-03-25 16:31:22 -0700285 int64_t currentPositionUs, bool forceNonOffload, bool needsToCreateAudioDecoder);
Wei Jia41cd4632016-05-13 10:53:30 -0700286 void determineAudioModeChange(const sp<AMessage> &audioFormat);
Andy Hung282a7e32014-08-14 15:56:34 -0700287
Wei Jiaa05f1e32016-03-25 16:31:22 -0700288 status_t instantiateDecoder(
289 bool audio, sp<DecoderBase> *decoder, bool checkAudioModeChange = true);
Andreas Huberf9334412010-12-15 15:17:42 -0800290
Lajos Molnarfcd3e942015-03-31 10:06:48 -0700291 status_t onInstantiateSecureDecoders();
292
Chong Zhangced1c2f2014-08-08 15:22:35 -0700293 void updateVideoSize(
294 const sp<AMessage> &inputFormat,
295 const sp<AMessage> &outputFormat = NULL);
296
Chong Zhangdcb89b32013-08-06 09:44:47 -0700297 void notifyListener(int msg, int ext1, int ext2, const Parcel *in = NULL);
Andreas Huberf9334412010-12-15 15:17:42 -0800298
Andy Hung8d121d42014-10-03 09:53:53 -0700299 void handleFlushComplete(bool audio, bool isDecoder);
Andreas Huber3831a062010-12-21 10:22:33 -0800300 void finishFlushIfPossible();
301
Wei Jiac5de0912016-11-18 10:22:14 -0800302 void onStart(
303 int64_t startPositionUs = -1,
304 MediaPlayerSeekMode mode = MediaPlayerSeekMode::SEEK_PREVIOUS_SYNC);
Wei Jia94211742014-10-28 17:09:06 -0700305 void onResume();
Chong Zhangefbb6192015-01-30 17:13:27 -0800306 void onPause();
Wei Jia94211742014-10-28 17:09:06 -0700307
Ronghua Wud7988b12014-10-03 15:19:10 -0700308 bool audioDecoderStillNeeded();
309
Chong Zhang7137ec72014-11-12 16:41:05 -0800310 void flushDecoder(bool audio, bool needShutdown);
Andreas Huber1aef2112011-01-04 14:01:29 -0800311
Chong Zhangf8d71772014-11-26 15:08:34 -0800312 void finishResume();
Wei Jia1061c9c2015-05-19 16:02:17 -0700313 void notifyDriverSeekComplete();
Chong Zhangf8d71772014-11-26 15:08:34 -0800314
Andreas Huber1aef2112011-01-04 14:01:29 -0800315 void postScanSources();
Andreas Huber53df1a42010-12-22 10:03:04 -0800316
Andreas Huberb7c8e912012-11-27 15:02:53 -0800317 void schedulePollDuration();
318 void cancelPollDuration();
319
Andreas Hubera1f8ab02012-11-30 10:53:22 -0800320 void processDeferredActions();
321
Wei Jiac5de0912016-11-18 10:22:14 -0800322 void performSeek(int64_t seekTimeUs, MediaPlayerSeekMode mode);
Wei Jiafef808d2014-10-31 17:57:05 -0700323 void performDecoderFlush(FlushCommand audio, FlushCommand video);
Andreas Hubera1f8ab02012-11-30 10:53:22 -0800324 void performReset();
325 void performScanSources();
Lajos Molnar1de1e252015-04-30 18:18:34 -0700326 void performSetSurface(const sp<Surface> &wrapper);
Chong Zhangf8d71772014-11-26 15:08:34 -0800327 void performResumeDecoders(bool needNotify);
Andreas Hubera1f8ab02012-11-30 10:53:22 -0800328
Andreas Huber9575c962013-02-05 13:59:56 -0800329 void onSourceNotify(const sp<AMessage> &msg);
Chong Zhanga7fa1d92014-06-11 14:49:23 -0700330 void onClosedCaptionNotify(const sp<AMessage> &msg);
Andreas Huber9575c962013-02-05 13:59:56 -0800331
Andreas Huber14f76722013-01-15 09:04:18 -0800332 void queueDecoderShutdown(
333 bool audio, bool video, const sp<AMessage> &reply);
334
Chong Zhang404fced2014-06-11 14:45:31 -0700335 void sendSubtitleData(const sp<ABuffer> &buffer, int32_t baseIndex);
Robert Shih08528432015-04-08 09:06:54 -0700336 void sendTimedMetaData(const sp<ABuffer> &buffer);
Robert Shihd3b0bbb2014-07-23 15:00:25 -0700337 void sendTimedTextData(const sp<ABuffer> &buffer);
Chong Zhang404fced2014-06-11 14:45:31 -0700338
Chih-Hung Hsiehe964d4e2016-08-09 14:31:32 -0700339 void writeTrackInfo(Parcel* reply, const sp<AMessage>& format) const;
Chong Zhang404fced2014-06-11 14:45:31 -0700340
Hassan Shojaniacefac142017-02-06 21:02:02 -0800341 status_t onPrepareDrm(const sp<AMessage> &msg);
342 status_t onReleaseDrm();
343
Andreas Huberf9334412010-12-15 15:17:42 -0800344 DISALLOW_EVIL_CONSTRUCTORS(NuPlayer);
345};
346
347} // namespace android
348
349#endif // NU_PLAYER_H_