3 * @brief the playback for elementary stream
4 * @interfacetype Module
5 * @privlevel None-privilege
11 * Copyright (c) 2018 Samsung Electronics Co., Ltd All Rights Reserved
12 * PROPRIETARY/CONFIDENTIAL
13 * This software is the confidential and proprietary
14 * information of SAMSUNG ELECTRONICS ("Confidential Information"). You shall
15 * not disclose such Confidential Information and shall use it only in
16 * accordance with the terms of the license agreement you entered into with
17 * SAMSUNG ELECTRONICS. SAMSUNG make no representations or warranties about the
18 * suitability of the software, either express or implied, including but not
19 * limited to the implied warranties of merchantability, fitness for a
20 * particular purpose, or non-infringement. SAMSUNG shall not be liable for any
21 * damages suffered by licensee as a result of using, modifying or distributing
22 * this software or its derivatives.
24 #ifndef __PLUSPLAYER_ESPLUSPLAYER__H__
25 #define __PLUSPLAYER_ESPLUSPLAYER__H__
27 #include <boost/core/noncopyable.hpp>
35 #include "plusplayer/drm.h"
36 #include "plusplayer/elementary_stream.h"
37 #include "plusplayer/es_eventlistener.h"
38 #include "plusplayer/espacket.h"
39 #include "plusplayer/external_drm.h"
40 #include "plusplayer/types/buffer.h"
41 #include "plusplayer/types/display.h"
42 #include "plusplayer/types/error.h"
43 #include "plusplayer/types/submitdata.h"
45 namespace plusplayer {
48 * @brief Enumerations for es player state.
51 kNone, // Player is created, but not opened
52 kIdle, // Player is opened, but not prepared or player is stopped
53 kReady, // Player is ready to play(start)
54 kPlaying, // Player is playing media
55 kPaused, // Player is paused while playing media
58 * @brief Enumerations for espacket submit status.
60 enum class PacketSubmitStatus {
61 kNotPrepared, // not prepared to get packet
62 kInvalidPacket, // invalid packet
63 kOutOfMemory, // out of memory on device
64 kFull, // buffer already full
65 kSuccess // submit succeeded
68 * @brief Enumerations for adaptive info type.
70 enum class PlayerAdaptiveInfo {
73 kDroppedVideoFramesForCatchup,
74 kDroppedAudioFramesForCatchup,
78 * @brief Enumerations for low latency mode
80 enum PlayerLowLatencyMode {
81 kLowLatencyModeNone = 0x0000,
83 * @description to support audio fast decoding/rendering
85 kLowLatencyModeAudio = 0x0001,
87 * @description to support video fast decoding/rendering
88 * only this value is set, it does not support seamless resolution change.
90 kLowLatencyModeVideo = 0x0010,
92 * @description to support video fast decoding/rendering and video
93 distortion concealment.
94 Video stream should be composed only of P and I frames.
95 For applications using the UDP protocol, packet loss can
96 occur. when video distortion by video packet loss is
97 detected, it is a function to conceal distortion by showing
98 previous vido frame. It is supported only in h.264 codec &
99 FHD or lower resolution.
101 kLowLatencyModeVideoDistortionConcealment = kLowLatencyModeVideo | 0x0020,
103 * @description to support video fast decoding/rendering and video
104 * with seamless resolution change.
106 kLowLatencyModeVideoWithSeamlessResolutionChange = 0x0040,
108 * @description to disable clock sync and a/v sync when rendering. it
109 * includes #kLowLatencyModeDisablePreroll.
111 kLowLatencyModeDisableAVSync = 0x0100,
113 * @description to disable preroll which means player doesn't wait for
114 * first buffer when state is changed to
115 * #EsState::kReady from #EsState::kIdle.
116 * It changes the state immediately.
117 * It's usually used for sparse stream. (e.g. video packet
118 * arrives but audio packet does't yet.)
120 kLowLatencyModeDisablePreroll = 0x0200,
122 * @description to set lower video quality
124 kLowLatencyModeDisableVideoQuality = 0x1000,
126 * @description to set game mode
128 kLowLatencyModeEnableGameMode = 0x2000
132 * @brief Enumerations for player audio codec type
134 enum PlayerAudioCodecType {
136 * @description hardware codec can only be selected, default type
138 kPlayerAudioCodecTypeHW,
140 * @description software codec can only be selected.
142 kPlayerAudioCodecTypeSW,
146 * @brief Enumerations for player video codec type
148 enum PlayerVideoCodecType {
150 * @description hardware codec can only be selected, default type
152 kPlayerVideoCodecTypeHW,
154 * @description software codec can only be selected.
156 kPlayerVideoCodecTypeSW,
158 * @description hardware codec using n-decoding mode can only be selected.
159 It must set display type to mixer type by display setting api.
161 kPlayerVideoCodecTypeHWNdecoding,
165 * @brief the interface of the playback class for elementary stream
167 class EsPlusPlayer : private boost::noncopyable {
169 using Ptr = std::unique_ptr<EsPlusPlayer>;
171 * @brief Create a esplusplayer object
172 * @remarks You must use this to get esplusplayer object
173 * @return Player object (unique_ptr<EsPlusPlayer>)
178 virtual ~EsPlusPlayer() {}
180 * @brief Make player get ready to set playback mode
181 * @remarks General call sequence to start playback:
182 * Open() -> SetStream() -> PrepareAsync() -> Start() -> Stop() ->
184 * @pre Player state must be kNone
185 * @post The player state will be EsState::kIdle
186 * @return @c True on success, otherwise @c False
189 virtual bool Open() { return false; }
191 * @brief Release all the player resources
192 * @pre The player state must be one of
193 * EsState::kIdle or EsState::kNone
194 * @post The player state will be kNone
195 * @return @c True on success, otherwise @c False
196 * @see EsPlusPlayer::Open()
198 virtual bool Close() { return false; }
201 * @brief Flush the specific buffered stream data and release TV resource
203 * @remark To activate, the stream must be set again.
204 * @pre The player must be set to at least #EsState::kReady
205 * @post The player state is same as before calling Deactivate().
206 * @return @c True on success, otherwise @c False.
207 * @see EsPlusPlayer::Deactivate().
209 virtual bool Deactivate(const StreamType type) { return false; }
212 * @brief Reprepare for the specific stream playback.
213 * @remark There must be active stream to prepare playback.
214 * @pre The player must be set to at least #EsState::kReady
215 * The StreamType must be deactivated in advance.
216 * Stream should be set in advance.
217 * @return @c True on success, otherwise @c False
220 Deactivate(StreamType::kVideo);
221 VideoStreamPtr video_stream = VideoStream::Create();
222 video_stream->SetMimeType(VideoMimeType::kH264);
223 video_stream->SetWidth(640);
224 video_stream->SetHeight(352);
225 video_stream->SetFramerate(30, 1);
226 SetStream(video_stream);
227 Activate(StreamType::kVideo);
229 * @see EsPlusPlayer::Activate()
231 virtual bool Activate(const StreamType type) { return false; }
234 * @brief Prepare the player for playback, asynchronously.
235 * @remarks EsEventListener::OnPrepareDone() will be called when prepare is
238 * @pre The player state must be set to #EsState::kIdle
239 * @post The player state will be #EsState::kReady
240 * @return @c true if async task is correctly started
241 * @see EsPlusPlayer::Open() \n
242 * EsPlusPlayer::Stop() \n
243 * EsPlusPlayer::SubmitPacket()
245 virtual bool PrepareAsync() { return false; }
247 * @brief Start playback
248 * @pre The player state should be #EsState::kReady
249 * @post The player state will be #EsState::kPlaying
250 * @return @c True on success, otherwise @c False
251 * @see EsPlusPlayer::Open() \n
252 * EsPlusPlayer::PrepareAsync() \n
253 * EsPlusPlayer::Stop() \n
254 * EsPlusPlayer::Close()
256 virtual bool Start() { return false; }
258 * @brief Stop playing media content
259 * @remarks EsPlusPlayer::Close() must be called once after player is
261 * @pre The player state must be all of #EsState except #EsState::kNone
262 * @post The player state will be #EsState::kIdle
263 * @return @c True on success, otherwise @c False
264 * @see EsPlusPlayer::Open() \n
265 * EsPlusPlayer::PrepareAsync() \n
266 * EsPlusPlayer::Start() \n
267 * EsPlusPlayer::Pause() \n
268 * EsPlusPlayer::Resume() \n
269 * EsPlusPlayer::Close()
271 virtual bool Stop() { return false; }
273 * @brief Pause playing media content
274 * @remarks You can resume playback by using EsPlusPlayer::Resume()
275 * @pre The player state must be one of #EsState::kReady or
276 * #EsState::kPlaying or #EsState::kPaused
277 * @post The player state will be #EsState::kPaused
278 * @return @c True on success, otherwise @c False
279 * @see EsPlusPlayer::Start() \n
280 * EsPlusPlayer::Resume()
282 virtual bool Pause() { return false; }
284 * @brief Resume a media content
285 * @pre The player state must be one of #EsState::kPlaying or
287 * @post The player state will be #EsState::kPlaying
288 * @return @c True on success, otherwise @c False
289 * @see EsPlusPlayer::Start() \n
290 * EsPlusPlayer::Pause()
292 virtual bool Resume() { return false; }
294 * @brief SetPlaybackRate.
295 * @remarks Set playback rate from 0.0 to 2.0.
296 * @param [in] rate : The playback rate from 0.0 to 2.0. EsPlayer isn't
297 * support trick play.
298 * @param [in] audio_mute : The audio is mute on/off,true: mute on, false:
300 * @pre The source and feeder have to push the data as fast as playback
302 * @return @c True if set playback rate is finished without any problem
305 virtual bool SetPlaybackRate(const double rate, bool audio_mute) {
309 * @brief Seek for playback, asynchronously.
310 * @remarks EsEventListener::OnSeekDone() will be called if seek operation
311 * is finished \n Seek result can be succeeded or not at this moment. \n
312 * @param [in] time_millisecond : the absolute position(playingtime) of
313 * the stream in milliseconds
314 * @pre The player state must be one of #EsState::kReady,
315 * #EsState::kPlaying or #EsState::kPaused
316 * @return @c True if seek operation is started without any problem
318 * @see EsEventListener::OnSeekDone() \n
319 * EsPlusPlayer::SubmitPacket()
321 virtual bool Seek(const uint64_t time_millisecond) { return false; }
323 * @brief Set the video display
324 * @remarks We are not supporting changing display.
325 * @remarks This API have to be called before calling the
326 * EsPlusPlayer::PrepareAsync() to reflect the display type.
327 * @param [in] type : display type
328 * @param [in] obj : The handle to display window
329 * @pre The player state must be set to #EsState::kIdle
330 * @return @c True on success, otherwise @c False
331 * @see DisplayType \n
332 * EsPlusPlayer::SetDisplayMode() \n
333 * EsPlusPlayer::SetDisplayRoi() \n
334 * EsPlusPlayer::SetDisplayVisible()
336 virtual bool SetDisplay(const DisplayType& type, void* obj) { return false; }
338 * @brief Set the video display
339 * @remarks We are not supporting changing display.
340 * @remarks This API have to be called before calling the
341 * EsPlusPlayer::PrepareAsync() to reflect the display type.
342 * @param [in] type : display type
343 * @param [in] ecore_wl2_window : The ecore wayland window handle
344 * @param [in] x : x param of display window
345 * @param [in] y : y param of display window
346 * @param [in] w : width of display window
347 * @param [in] h : height of display window
348 * @pre The player state must be set to #EsState::kIdle
349 * @return @c True on success, otherwise @c False
350 * @see DisplayType \n
351 * EsPlusPlayer::SetDisplayMode() \n
352 * EsPlusPlayer::SetDisplayRoi() \n
353 * EsPlusPlayer::SetDisplayVisible()
355 virtual bool SetDisplay(const DisplayType& type, void* ecore_wl2_window,
356 const int x, const int y, const int w, const int h) {
360 * @brief Set the video display
361 * @remarks We are not supporting changing display.
362 * @remarks This API have to be called before calling the
363 * EsPlusPlayer::PrepareAsync() to reflect the display type.
364 * @param [in] type : display type
365 * @param [in] surface_id : resource id of window.
366 * @param [in] x : x param of display window
367 * @param [in] y : y param of display window
368 * @param [in] w : width of display window
369 * @param [in] h : height of display window
370 * @pre The player state must be set to #EsState::kIdle
371 * @return @c True on success, otherwise @c False
372 * @see DisplayType \n
373 * EsPlusPlayer::SetDisplayMode() \n
374 * EsPlusPlayer::SetDisplayRoi() \n
375 * EsPlusPlayer::SetDisplayVisible()
377 virtual bool SetDisplay(const DisplayType& type, unsigned int surface_id,
378 const int x, const int y, const int w, const int h) {
382 * @brief Set the video display mode
383 * @param [in] mode : display mode
384 * @pre The player state can be all of #EsState except #EsState::kNone
385 * @return @c True on success, otherwise @c False
387 * @see EsPlusPlayer::SetDisplay()
388 * @see EsPlusPlayer::SetDisplayRoi()
389 * @see EsPlusPlayer::SetDisplayVisible()
391 virtual bool SetDisplayMode(const DisplayMode& mode) { return false; }
393 * @brief Set the ROI(Region Of Interest) area of display
394 * @remarks The minimum value of width and height are 1.
395 * @param [in] roi : Roi Geometry
396 * @pre The player state can be all of #EsState except #EsState::kNone
397 * \n Before set display ROI, #DisplayMode::kDstRoi must be set with
398 * EsPlusPlayer::SetDisplayMode().
399 * @return @c True on success, otherwise @c False
400 * @see DisplayMode \n
401 * EsPlusPlayer::SetDisplay() \n
402 * EsPlusPlayer::SetDisplayMode() \n
403 * EsPlusPlayer::SetDisplayVisible()
405 virtual bool SetDisplayRoi(const Geometry& roi) { return false; }
408 * @brief Set scaled area ratio of display
409 * @param [in] area : Crop ratio of src area
410 * @pre The player state can be all of #EsState except #EsState::kNone
411 * @return @c True on success, otherwise @c False
412 * @remark The minimum value of input are 0,maximun is 1.
414 virtual bool SetVideoRoi(const CropArea& area) { return false; }
417 * @brief Set the rotate angle of display
418 * @remarks The default value is 0.
419 * @param [in] rotate : Rotate angle.
420 * @pre The player state can be all of #EsState except #EsState::kNone
421 * @return @c True on success, otherwise @c False
422 * @see EsPlusPlayer::SetDisplay()
424 virtual bool SetDisplayRotate(const DisplayRotation& rotate) { return false; }
427 * @brief Get the rotate angle of display
428 * @remarks The default value is 0.
429 * @param [out] rotate : Stored rotate angle value.
430 * @pre The player state can be all of #EsState except #EsState::kNone
431 * @return @c True on success, otherwise @c False
432 * @see EsPlusPlayer::SetDisplayRotate()
434 virtual bool GetDisplayRotate(DisplayRotation* rotate) { return false; }
437 * @brief Set the visibility of the video display
438 * @param [in] is_visible : The visibility of the display
439 * (@c true = visible, @c false = non-visible)
440 * @pre The player state can be all of #EsState except #EsState::kNone
441 * @return @c True on success, otherwise @c False
442 * @see EsPlusPlayer::SetDisplay()
444 virtual bool SetDisplayVisible(bool is_visible) { return false; }
447 * @deprecated Use SetSubmitDataType instead.
448 * @brief Set whether to send decrypted es packets in the trust zone
449 * @remarks This API have to be called before calling the
450 * EsPlusPlayer::PrepareAsync() \n If is_using_tz is set to true, use
451 * EsPlusPlayer::SubmitTrustZonePacket() to send decrypted packets \n
452 * @param [in] is_using_tz : whether to use trust zone memory
453 * (@c true = if decrypted packets are sent in trust zone, @c false
455 * @pre The player state must be set to #EsState::kIdle
456 * @return @c True on success, otherwise @c False
457 * @see EsPlusPlayer::SubmitTrustZonePacket()
459 virtual bool SetTrustZoneUse(bool is_using_tz) { return false; }
461 * @brief Set whether to send decrypted es packets in the trust zone or
462 * encrypted es packets
463 * @remarks This API have to be called before calling the
464 * EsPlusPlayer::PrepareAsync() \n
465 * If type is kCleanData, Use SubmitPacket() \n
466 * If type is kTrustZoneData, Use SubmitTrustZonePacket() \n
467 * If type is kEncryptedData, Use SubmitEncryptedPacket()
468 * @param [in] type : whether to use trust zone memory or encrypted data
469 * @pre The player state must be set to #EsState::kIdle
470 * @return @c True on success, otherwise @c False
471 * @see EsPlusPlayer::SubmitPacket() \n
472 * EsPlusPlayer::SubmitTrustZonePacket() \n
473 * EsPlusPlayer::SubmitEncryptedPacket() \\n
476 virtual bool SetSubmitDataType(SubmitDataType type) { return false; }
478 * @brief Set audio stream to have contents information
479 * @remarks This API have to be called before calling the
480 * EsPlusPlayer::PrepareAsync()
481 * @param [in] stream : audio stream object
482 * @pre The player state must be set to #EsState::kIdle
483 * @return @c True on success, otherwise @c False
486 virtual bool SetStream(const AudioStreamPtr& stream) { return false; }
488 * @brief Set video stream to have contents information
489 * @remarks This API have to be called before calling the
490 * EsPlusPlayer::PrepareAsync()
491 * @param [in] stream : video stream object
492 * @pre The player state must be set to #EsState::kIdle
493 * @return @c True on success, otherwise @c False
496 virtual bool SetStream(const VideoStreamPtr& stream) { return false; }
498 * @brief Submit es packet to decode audio or video
499 * @remarks Amount of packets for at least one decoded frame must be
500 * submitted after EsPlusPlayer::PrepareAsync() or EsPlusPlayer::Seek() for
501 * calling the EsPlusPlayer::OnPrepareDone() or EsPlusPlayer::OnSeekDone() \n
502 * User can submit es packets when EsPlusPlayer::OnReadyToPrepare()
503 * or EsPlusPlayer::OnReadyToSeek() is called \n
504 * To use this api, Must set SubmitDataType::kCleanData using
505 * SetSubmitDataType() or Don't set any SubmitDataType \n
506 * This api must be called from a different thread than other apis
507 * @param [in] packet : es packet object
508 * @pre The player state can be all of #EsState except #EsState::kNone
509 * @return @c PacketSubmitStatus::kSuccess : succeed to submit es packet
510 * @c otherwise : fail to submit es packet
511 * @see SetSubmitDataType() \n
514 * OnReadyToPrepare \n
518 virtual PacketSubmitStatus SubmitPacket(const EsPacketPtr& packet) {
519 return PacketSubmitStatus::kNotPrepared;
522 * @brief Submit es packet to decode audio or video in the trust zone
523 * @remarks Amount of decrypted packets for at least one decoded frame must
524 * be submitted after EsPlusPlayer::PrepareAsync() or EsPlusPlayer::Seek() for
525 * calling the EsPlusPlayer::OnPrepareDone() or EsPlusPlayer::OnSeekDone() \n
526 * User can submit es packets when EsPlusPlayer::OnReadyToPrepare()
527 * or EsPlusPlayer::OnReadyToSeek() is called \n
528 * EsPlusPlayer::SetTrustZoneUse() must be set to true \n
529 * To use this api, Must set SubmitDataType::kTrustZoneData using
530 * SetSubmitDataType() \n
531 * This api must be called from a different thread than other apis.
532 * @param [in] packet : es packet object
533 * [in] tz_handle : a handle for es packet in the trust zone
534 * @pre The player state can be all of #EsState except #EsState::kNone
535 * @return @c PacketSubmitStatus::kSuccess : succeed to submit es packet
536 * @c otherwise : fail to submit es packet
537 * @see SetSubmitDataType() \n
540 * OnReadyToPrepare \n
544 virtual PacketSubmitStatus SubmitTrustZonePacket(const EsPacketPtr& packet,
545 uint32_t tz_handle = 0) {
546 return PacketSubmitStatus::kNotPrepared;
549 * @brief Submit encrypted es packet to decode audio or video
550 * @remarks Amount of encrypted packets for at least one decoded frame must
551 * be submitted after EsPlusPlayer::PrepareAsync() or EsPlusPlayer::Seek() for
552 * calling the EsPlusPlayer::OnPrepareDone() or EsPlusPlayer::OnSeekDone()
553 * User can submit es packets when EsPlusPlayer::OnReadyToPrepare()
554 * or EsPlusPlayer::OnReadyToSeek() is called \n
555 * EsPlusPlayer::SetDrm() must be set to an appropriate drm type \n
556 * To use this api, Must set SubmitDataType::kEncryptedData using
557 * SetSubmitDataType() \n
558 * This api must be called from a different thread than other apis.
559 * @param [in] packet : encrypted es packet object
560 * [in] drm_info : information for decryption
561 * @pre The player state can be all of #EsState except #EsState::kNone
562 * @return @c PacketSubmitStatus::kSuccess : succeed to submit es packet
563 * @c PacketSubmitStatus::kFull, PacketSubmitStatus::kNotPrepared :
564 * fail to submit es packet
565 * @see SetSubmitDataType() \n
568 * OnReadyToPrepare \n
572 virtual PacketSubmitStatus SubmitEncryptedPacket(
573 const EsPacketPtr& packet, const drm::EsPlayerEncryptedInfo& drm_info) {
574 return PacketSubmitStatus::kNotPrepared;
577 * @brief Get current state of player
578 * @return current #EsState of player
580 virtual EsState GetState() { return EsState::kNone; }
582 * @brief Get the current playing time of the associated media.
583 * @param [out] time_in_milliseconds : current playing time in
585 * @pre The player must be one of #EsState::kPlaying or
587 * @return @c True on success, otherwise @c False
588 * ("time_in_milliseconds" will be 0)
590 virtual bool GetPlayingTime(uint64_t* time_in_milliseconds) { return false; }
592 * @brief Get the adaptive info from the plugins
593 * @param [in] adaptive_type : App wanted get info type
594 * @param [out] padaptive_info : return value of requested(such as dropped
596 * @pre The player must be one of #EsState::kPlaying or
597 * #EsState::kPaused or #EsState::kReady
598 * @return @c True on success, otherwise @c False
600 virtual bool GetAdaptiveInfo(void* padaptive_info,
601 const PlayerAdaptiveInfo& adaptive_type) {
605 * @brief Set on mute of the audio sound
606 * @param [in] is_mute : On mute of the sound
607 * (@c true = mute, @c false = non-mute)
608 * @pre The player state can be all of #EsState except #EsState::kNone
609 * @return @c True on success, otherwise @c False
611 virtual bool SetAudioMute(bool is_mute) { return false; }
614 * @brief Set decoded video frame buffer type.
615 * @param [in] type : A type of decoded video frame buffer.
616 * @pre The player state must be set to #EsState::kIdle
618 virtual bool SetVideoFrameBufferType(DecodedVideoFrameBufferType type) {
623 * @brief Register eventlistener to player
624 * @param [in] listener : listener object
625 * @param [in] userdata : listener object's userdata to be returned via
626 * notification without any modification
627 * @pre The player state can be all of #EsState except #EsState::kNone
628 * @see EsEventListener
630 virtual void RegisterListener(EsEventListener* listener,
631 EsEventListener::UserData userdata) {
635 * @brief Set volume to player
636 * @param [in] volume : volume level
637 * @pre The player state can be all of #EsState except #EsState::kNone
638 * @return @c True on success, otherwise @c False
640 virtual bool SetVolume(const int& volume) { return false; }
642 * @brief Get volume to player
643 * @param [out] volume : volume ptr
644 * @pre The player state can be all of #EsState except #EsState::kNone
645 * @return @c True on success, otherwise @c False
647 virtual bool GetVolume(int* volume) { return false; }
649 * @brief Flush the data in pipeline
650 * @param [in] type : can be kAudio/kVideo
651 * @pre The player state can greater than #EsState::kIdle
652 * @return @c True on success, otherwise @c False
654 virtual bool Flush(const StreamType& type) { return false; }
656 * @brief Set the buffer size
657 * @param [in] option : A type of Buffer Option
658 * @pre The player state must be set to #EsState::kIdle
659 * @return @c True on success, otherwise @c False
661 virtual void SetBufferSize(const BufferOption& option, uint64_t size) {
665 * @brief Provided api for setting low latency mode
666 * @remarks This API have to be called before calling the
667 * EsPlusPlayer::PrepareAsync()
668 * @param [in] mode : one of the low latency mode to set.
669 * @pre The player state must be set to #EsState::kIdle
670 * @return @c True on success, otherwise @c False
672 virtual bool SetLowLatencyMode(const PlayerLowLatencyMode& mode) {
677 * @brief Provided api for setting unlimited max buffer mode
678 * @remarks The player does not limit es packet transmission although in
679 * buffer overrun status.
680 * @pre The player state must be set to #EsState::kIdle
681 * @return @c True on success, otherwise @c False
683 virtual bool SetUnlimitedMaxBufferMode() { return false; }
685 * @brief Provided api for setting audio codec type
686 * @pre The player state must be set to #EsState::kIdle.
687 * @return @c True on success, otherwise @c False
689 virtual bool SetAudioCodecType(const PlayerAudioCodecType& type) {
693 * @brief Provided api for setting video codec type
694 * @pre The player state must be set to #EsState::kIdle.
695 * @return @c True on success, otherwise @c False
697 virtual bool SetVideoCodecType(const PlayerVideoCodecType& type) {
701 * @brief Provided api for setting render time offset
702 * @param [in] type : stream type
703 * @param [in] offset : offset (milisecond).
704 * @pre The player state must be set to #EsState::kReady,
705 * #EsState::kPaused or #EsState::kPlaying.
706 * It have to be set to low latency mode.
707 * @see EsPlusPlayer::SetLowLatencyMode()
708 * @return @c True on success, otherwise @c False
710 virtual bool SetRenderTimeOffset(const StreamType type, int64_t offset) {
714 * @brief Provided api for getting render time offset
715 * @param [in] type : stream type
716 * @param [out] offset : offset ptr (milisecond).
717 * @pre The player state must be set to #EsState::kReady,
718 * #EsState::kPaused or #EsState::kPlaying.
719 * It have to be set to low latency mode.
720 * @see EsPlusPlayer::SetLowLatencyMode()
721 * @return @c True on success, otherwise @c False
723 virtual bool GetRenderTimeOffset(const StreamType type, int64_t* offset) {
727 * @brief Get the decoded video packet.
728 * @param [out] packet
729 * @return GetDecodedVideoFrameStatus
731 virtual GetDecodedVideoFrameStatus GetDecodedPacket(
732 DecodedVideoPacket& packet) {
733 return GetDecodedVideoFrameStatus::kUnknown;
736 * @brief Return the decoded video packet.
738 * @return @c True on success, otherwise @c False
740 virtual bool ReturnDecodedPacket(const DecodedVideoPacket& packet) {
744 * @brief Provided api for enabling video hole
745 * @return @c True on success, otherwise @c False
747 virtual bool EnableVideoHole(bool value) { return false; }
750 EsPlusPlayer() noexcept {};
751 }; // class EsPlusPlayer
753 } // namespace plusplayer
755 #endif // __PLUSPLAYER_ESPLUSPLAYER__H__