blob: adb707537d3c15719720538207b8fc7c3c12689c [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
Lajos Molnared809da2020-08-17 16:53:02 -0700105 void setTargetBitrate(int bitrate /* bps */);
Kim Sungyeon23b23932019-07-18 17:48:32 +0900106
Andreas Huberf9334412010-12-15 15:17:42 -0800107protected:
108 virtual ~NuPlayer();
109
110 virtual void onMessageReceived(const sp<AMessage> &msg);
111
Andreas Huber84066782011-08-16 09:34:26 -0700112public:
113 struct NuPlayerStreamListener;
114 struct Source;
115
Andreas Huberf9334412010-12-15 15:17:42 -0800116private:
Andreas Huberf9334412010-12-15 15:17:42 -0800117 struct Decoder;
Chong Zhang7137ec72014-11-12 16:41:05 -0800118 struct DecoderBase;
Wei Jiabc2fb722014-07-08 16:37:57 -0700119 struct DecoderPassThrough;
Chong Zhanga7fa1d92014-06-11 14:49:23 -0700120 struct CCDecoder;
Andreas Huberafed0e12011-09-20 15:39:58 -0700121 struct GenericSource;
Andreas Huber5bc087c2010-12-23 10:27:40 -0800122 struct HTTPLiveSource;
Andreas Huber5bc087c2010-12-23 10:27:40 -0800123 struct Renderer;
Byeongjo Park28225ab2019-01-24 20:31:19 +0900124 struct RTPSource;
Andreas Huberafed0e12011-09-20 15:39:58 -0700125 struct RTSPSource;
Andreas Huber5bc087c2010-12-23 10:27:40 -0800126 struct StreamingSource;
Andreas Hubera1f8ab02012-11-30 10:53:22 -0800127 struct Action;
128 struct SeekAction;
Andreas Huber57a339c2012-12-03 11:18:00 -0800129 struct SetSurfaceAction;
Chong Zhangf8d71772014-11-26 15:08:34 -0800130 struct ResumeDecoderAction;
Wei Jiafef808d2014-10-31 17:57:05 -0700131 struct FlushDecoderAction;
Andreas Huber14f76722013-01-15 09:04:18 -0800132 struct PostMessageAction;
Andreas Hubera1f8ab02012-11-30 10:53:22 -0800133 struct SimpleAction;
Andreas Huberf9334412010-12-15 15:17:42 -0800134
135 enum {
Andreas Huber078cfcf2011-09-15 12:25:04 -0700136 kWhatSetDataSource = '=DaS',
Andreas Huber9575c962013-02-05 13:59:56 -0800137 kWhatPrepare = 'prep',
Lajos Molnar1de1e252015-04-30 18:18:34 -0700138 kWhatSetVideoSurface = '=VSu',
Andreas Huber078cfcf2011-09-15 12:25:04 -0700139 kWhatSetAudioSink = '=AuS',
140 kWhatMoreDataQueued = 'more',
Lajos Molnar3a474aa2015-04-24 17:10:07 -0700141 kWhatConfigPlayback = 'cfPB',
142 kWhatConfigSync = 'cfSy',
143 kWhatGetPlaybackSettings = 'gPbS',
144 kWhatGetSyncSettings = 'gSyS',
Andreas Huber078cfcf2011-09-15 12:25:04 -0700145 kWhatStart = 'strt',
146 kWhatScanSources = 'scan',
147 kWhatVideoNotify = 'vidN',
148 kWhatAudioNotify = 'audN',
Chong Zhanga7fa1d92014-06-11 14:49:23 -0700149 kWhatClosedCaptionNotify = 'capN',
Andreas Huber078cfcf2011-09-15 12:25:04 -0700150 kWhatRendererNotify = 'renN',
151 kWhatReset = 'rset',
Wei Jia52c28512017-09-13 18:17:51 -0700152 kWhatNotifyTime = 'nfyT',
Andreas Huber078cfcf2011-09-15 12:25:04 -0700153 kWhatSeek = 'seek',
154 kWhatPause = 'paus',
155 kWhatResume = 'rsme',
Andreas Huberb7c8e912012-11-27 15:02:53 -0800156 kWhatPollDuration = 'polD',
Andreas Huberb5f25f02013-02-05 10:14:26 -0800157 kWhatSourceNotify = 'srcN',
Chong Zhangdcb89b32013-08-06 09:44:47 -0700158 kWhatGetTrackInfo = 'gTrI',
Robert Shih7c4f0d72014-07-09 18:53:31 -0700159 kWhatGetSelectedTrack = 'gSel',
Chong Zhangdcb89b32013-08-06 09:44:47 -0700160 kWhatSelectTrack = 'selT',
Wei Jia9bb38032017-03-23 18:00:38 -0700161 kWhatGetBufferingSettings = 'gBus',
Wei Jia48fa06d2016-12-20 15:30:49 -0800162 kWhatSetBufferingSettings = 'sBuS',
Hassan Shojaniacefac142017-02-06 21:02:02 -0800163 kWhatPrepareDrm = 'pDrm',
164 kWhatReleaseDrm = 'rDrm',
Dongwon Kang47afe0a2018-03-27 15:15:30 -0700165 kWhatMediaClockNotify = 'mckN',
Andreas Huberf9334412010-12-15 15:17:42 -0800166 };
167
Andreas Huber43c3e6c2011-01-05 12:17:08 -0800168 wp<NuPlayerDriver> mDriver;
Andreas Huber9b80c2b2011-06-30 15:47:02 -0700169 bool mUIDValid;
170 uid_t mUID;
Ronghua Wu68845c12015-07-21 09:50:48 -0700171 pid_t mPID;
Wei Jia0a68f662017-08-30 18:01:26 -0700172 const sp<MediaClock> mMediaClock;
Wei Jiac45a4b22016-04-15 15:30:23 -0700173 Mutex mSourceLock; // guard |mSource|.
Andreas Huber5bc087c2010-12-23 10:27:40 -0800174 sp<Source> mSource;
Andreas Huber9575c962013-02-05 13:59:56 -0800175 uint32_t mSourceFlags;
Lajos Molnar1de1e252015-04-30 18:18:34 -0700176 sp<Surface> mSurface;
Andreas Huberf9334412010-12-15 15:17:42 -0800177 sp<MediaPlayerBase::AudioSink> mAudioSink;
Chong Zhang7137ec72014-11-12 16:41:05 -0800178 sp<DecoderBase> mVideoDecoder;
Wei Jiabc2fb722014-07-08 16:37:57 -0700179 bool mOffloadAudio;
Chong Zhang7137ec72014-11-12 16:41:05 -0800180 sp<DecoderBase> mAudioDecoder;
Ray Essickfcb8fd32018-08-07 09:39:38 -0700181 Mutex mDecoderLock; // guard |mAudioDecoder| and |mVideoDecoder|.
Chong Zhanga7fa1d92014-06-11 14:49:23 -0700182 sp<CCDecoder> mCCDecoder;
Andreas Huberf9334412010-12-15 15:17:42 -0800183 sp<Renderer> mRenderer;
Lajos Molnar09524832014-07-17 14:29:51 -0700184 sp<ALooper> mRendererLooper;
Wei Jia88703c32014-08-06 11:24:07 -0700185 int32_t mAudioDecoderGeneration;
186 int32_t mVideoDecoderGeneration;
Wei Jia57568df2014-09-22 10:16:29 -0700187 int32_t mRendererGeneration;
Andreas Huberf9334412010-12-15 15:17:42 -0800188
Ray Essick0d98c182017-11-09 13:42:42 -0800189 Mutex mPlayingTimeLock;
Ray Essickd4d00612017-01-03 09:36:27 -0800190 int64_t mLastStartedPlayingTimeNs;
Ray Essickeda32522018-02-28 12:08:28 -0800191 void updatePlaybackTimer(bool stopping, const char *where);
Ray Essick0d98c182017-11-09 13:42:42 -0800192 void startPlaybackTimer(const char *where);
Ray Essickd4d00612017-01-03 09:36:27 -0800193
Ray Essick58e0f7a2017-11-21 10:59:38 -0800194 int64_t mLastStartedRebufferingTimeNs;
195 void startRebufferingTimer();
Ray Essickeda32522018-02-28 12:08:28 -0800196 void updateRebufferingTimer(bool stopping, bool exitingPlayback);
Ray Essick58e0f7a2017-11-21 10:59:38 -0800197
Robert Shih1a5c8592015-08-04 18:07:44 -0700198 int64_t mPreviousSeekTimeUs;
199
Andreas Hubera1f8ab02012-11-30 10:53:22 -0800200 List<sp<Action> > mDeferredActions;
201
Andreas Huberf9334412010-12-15 15:17:42 -0800202 bool mAudioEOS;
203 bool mVideoEOS;
204
Andreas Huber5bc087c2010-12-23 10:27:40 -0800205 bool mScanSourcesPending;
Andreas Huber1aef2112011-01-04 14:01:29 -0800206 int32_t mScanSourcesGeneration;
Andreas Huber5bc087c2010-12-23 10:27:40 -0800207
Andreas Huberb7c8e912012-11-27 15:02:53 -0800208 int32_t mPollDurationGeneration;
Robert Shihd3b0bbb2014-07-23 15:00:25 -0700209 int32_t mTimedTextGeneration;
Andreas Huberb7c8e912012-11-27 15:02:53 -0800210
Andreas Huberf9334412010-12-15 15:17:42 -0800211 enum FlushStatus {
212 NONE,
Andreas Huberf9334412010-12-15 15:17:42 -0800213 FLUSHING_DECODER,
Andreas Huber1aef2112011-01-04 14:01:29 -0800214 FLUSHING_DECODER_SHUTDOWN,
Andreas Huber3831a062010-12-21 10:22:33 -0800215 SHUTTING_DOWN_DECODER,
216 FLUSHED,
217 SHUT_DOWN,
Andreas Huberf9334412010-12-15 15:17:42 -0800218 };
219
Wei Jiafef808d2014-10-31 17:57:05 -0700220 enum FlushCommand {
221 FLUSH_CMD_NONE,
222 FLUSH_CMD_FLUSH,
223 FLUSH_CMD_SHUTDOWN,
224 };
225
Andy Hung8d121d42014-10-03 09:53:53 -0700226 // Status of flush responses from the decoder and renderer.
227 bool mFlushComplete[2][2];
228
Andreas Huberf9334412010-12-15 15:17:42 -0800229 FlushStatus mFlushingAudio;
230 FlushStatus mFlushingVideo;
231
Chong Zhangf8d71772014-11-26 15:08:34 -0800232 // Status of flush responses from the decoder and renderer.
233 bool mResumePending;
234
James Dong0d268a32012-08-31 12:18:27 -0700235 int32_t mVideoScalingMode;
236
Lajos Molnar3a474aa2015-04-24 17:10:07 -0700237 AudioPlaybackRate mPlaybackSettings;
238 AVSyncSettings mSyncSettings;
239 float mVideoFpsHint;
Andreas Huber57a339c2012-12-03 11:18:00 -0800240 bool mStarted;
Wei Jia8a092d32016-06-03 14:57:24 -0700241 bool mPrepared;
Ronghua Wu64c2d172015-10-07 16:52:19 -0700242 bool mResetting;
Robert Shih0c61a0d2015-07-06 15:09:10 -0700243 bool mSourceStarted;
Wei Jia686e8e52017-04-03 14:08:01 -0700244 bool mAudioDecoderError;
245 bool mVideoDecoderError;
Andreas Huber57a339c2012-12-03 11:18:00 -0800246
Chong Zhangefbb6192015-01-30 17:13:27 -0800247 // Actual pause state, either as requested by client or due to buffering.
248 bool mPaused;
249
250 // Pause state as requested by client. Note that if mPausedByClient is
251 // true, mPaused is always true; if mPausedByClient is false, mPaused could
252 // still become true, when we pause internally due to buffering.
253 bool mPausedByClient;
254
Chong Zhang8a048332015-05-06 15:16:28 -0700255 // Pause state as requested by source (internally) due to buffering
256 bool mPausedForBuffering;
257
Hassan Shojaniacefac142017-02-06 21:02:02 -0800258 // Modular DRM
259 sp<ICrypto> mCrypto;
260 bool mIsDrmProtected;
261
Hassan Shojaniaff63de72017-04-26 15:10:42 -0700262 typedef enum {
263 DATA_SOURCE_TYPE_NONE,
264 DATA_SOURCE_TYPE_HTTP_LIVE,
Byeongjo Park5e27b1b2018-07-12 15:36:03 +0900265 DATA_SOURCE_TYPE_RTP,
Hassan Shojaniaff63de72017-04-26 15:10:42 -0700266 DATA_SOURCE_TYPE_RTSP,
267 DATA_SOURCE_TYPE_GENERIC_URL,
268 DATA_SOURCE_TYPE_GENERIC_FD,
269 DATA_SOURCE_TYPE_MEDIA,
270 DATA_SOURCE_TYPE_STREAM,
271 } DATA_SOURCE_TYPE;
272
273 std::atomic<DATA_SOURCE_TYPE> mDataSourceType;
274
Chong Zhang7137ec72014-11-12 16:41:05 -0800275 inline const sp<DecoderBase> &getDecoder(bool audio) {
Lajos Molnar87603c02014-08-20 19:25:30 -0700276 return audio ? mAudioDecoder : mVideoDecoder;
277 }
278
Andy Hung8d121d42014-10-03 09:53:53 -0700279 inline void clearFlushComplete() {
280 mFlushComplete[0][0] = false;
281 mFlushComplete[0][1] = false;
282 mFlushComplete[1][0] = false;
283 mFlushComplete[1][1] = false;
284 }
285
Wei Jia41cd4632016-05-13 10:53:30 -0700286 void tryOpenAudioSinkForOffload(
287 const sp<AMessage> &format, const sp<MetaData> &audioMeta, bool hasVideo);
Andy Hung282a7e32014-08-14 15:56:34 -0700288 void closeAudioSink();
Wei Jia5031b2f2016-02-25 11:19:31 -0800289 void restartAudio(
Wei Jiaa05f1e32016-03-25 16:31:22 -0700290 int64_t currentPositionUs, bool forceNonOffload, bool needsToCreateAudioDecoder);
Wei Jia41cd4632016-05-13 10:53:30 -0700291 void determineAudioModeChange(const sp<AMessage> &audioFormat);
Andy Hung282a7e32014-08-14 15:56:34 -0700292
Wei Jiaa05f1e32016-03-25 16:31:22 -0700293 status_t instantiateDecoder(
294 bool audio, sp<DecoderBase> *decoder, bool checkAudioModeChange = true);
Andreas Huberf9334412010-12-15 15:17:42 -0800295
Lajos Molnarfcd3e942015-03-31 10:06:48 -0700296 status_t onInstantiateSecureDecoders();
297
Chong Zhangced1c2f2014-08-08 15:22:35 -0700298 void updateVideoSize(
299 const sp<AMessage> &inputFormat,
300 const sp<AMessage> &outputFormat = NULL);
301
Chong Zhangdcb89b32013-08-06 09:44:47 -0700302 void notifyListener(int msg, int ext1, int ext2, const Parcel *in = NULL);
Andreas Huberf9334412010-12-15 15:17:42 -0800303
Andy Hung8d121d42014-10-03 09:53:53 -0700304 void handleFlushComplete(bool audio, bool isDecoder);
Andreas Huber3831a062010-12-21 10:22:33 -0800305 void finishFlushIfPossible();
306
Wei Jiac5de0912016-11-18 10:22:14 -0800307 void onStart(
308 int64_t startPositionUs = -1,
309 MediaPlayerSeekMode mode = MediaPlayerSeekMode::SEEK_PREVIOUS_SYNC);
Wei Jia94211742014-10-28 17:09:06 -0700310 void onResume();
Chong Zhangefbb6192015-01-30 17:13:27 -0800311 void onPause();
Wei Jia94211742014-10-28 17:09:06 -0700312
Ronghua Wud7988b12014-10-03 15:19:10 -0700313 bool audioDecoderStillNeeded();
314
Chong Zhang7137ec72014-11-12 16:41:05 -0800315 void flushDecoder(bool audio, bool needShutdown);
Andreas Huber1aef2112011-01-04 14:01:29 -0800316
Chong Zhangf8d71772014-11-26 15:08:34 -0800317 void finishResume();
Wei Jia1061c9c2015-05-19 16:02:17 -0700318 void notifyDriverSeekComplete();
Chong Zhangf8d71772014-11-26 15:08:34 -0800319
Andreas Huber1aef2112011-01-04 14:01:29 -0800320 void postScanSources();
Andreas Huber53df1a42010-12-22 10:03:04 -0800321
Andreas Huberb7c8e912012-11-27 15:02:53 -0800322 void schedulePollDuration();
323 void cancelPollDuration();
324
Andreas Hubera1f8ab02012-11-30 10:53:22 -0800325 void processDeferredActions();
326
Wei Jiac5de0912016-11-18 10:22:14 -0800327 void performSeek(int64_t seekTimeUs, MediaPlayerSeekMode mode);
Wei Jiafef808d2014-10-31 17:57:05 -0700328 void performDecoderFlush(FlushCommand audio, FlushCommand video);
Andreas Hubera1f8ab02012-11-30 10:53:22 -0800329 void performReset();
330 void performScanSources();
Lajos Molnar1de1e252015-04-30 18:18:34 -0700331 void performSetSurface(const sp<Surface> &wrapper);
Chong Zhangf8d71772014-11-26 15:08:34 -0800332 void performResumeDecoders(bool needNotify);
Andreas Hubera1f8ab02012-11-30 10:53:22 -0800333
Andreas Huber9575c962013-02-05 13:59:56 -0800334 void onSourceNotify(const sp<AMessage> &msg);
Chong Zhanga7fa1d92014-06-11 14:49:23 -0700335 void onClosedCaptionNotify(const sp<AMessage> &msg);
Andreas Huber9575c962013-02-05 13:59:56 -0800336
Andreas Huber14f76722013-01-15 09:04:18 -0800337 void queueDecoderShutdown(
338 bool audio, bool video, const sp<AMessage> &reply);
339
Chong Zhang404fced2014-06-11 14:45:31 -0700340 void sendSubtitleData(const sp<ABuffer> &buffer, int32_t baseIndex);
Robert Shih08528432015-04-08 09:06:54 -0700341 void sendTimedMetaData(const sp<ABuffer> &buffer);
Robert Shihd3b0bbb2014-07-23 15:00:25 -0700342 void sendTimedTextData(const sp<ABuffer> &buffer);
Kim Sungyeond3c6b322018-03-02 14:41:19 +0900343 void sendIMSRxNotice(const sp<AMessage> &msg);
Chong Zhang404fced2014-06-11 14:45:31 -0700344
Chih-Hung Hsiehe964d4e2016-08-09 14:31:32 -0700345 void writeTrackInfo(Parcel* reply, const sp<AMessage>& format) const;
Chong Zhang404fced2014-06-11 14:45:31 -0700346
Hassan Shojaniacefac142017-02-06 21:02:02 -0800347 status_t onPrepareDrm(const sp<AMessage> &msg);
348 status_t onReleaseDrm();
349
Andreas Huberf9334412010-12-15 15:17:42 -0800350 DISALLOW_EVIL_CONSTRUCTORS(NuPlayer);
351};
352
353} // namespace android
354
355#endif // NU_PLAYER_H_