add new API for karaoke scenario
authorkw0530-kang <kw0530.kang@samsung.com>
Thu, 31 Oct 2024 06:03:49 +0000 (06:03 +0000)
committerkw0530-kang <kw0530.kang@samsung.com>
Thu, 31 Oct 2024 06:03:49 +0000 (06:03 +0000)
include/esplusplayer/esplusplayer.h
include/esplusplayer_capi/esplusplayer_internal.h
packaging/esplusplayer.spec
src/esplusplayer/include_internal/esplayer/esplayer.h
src/esplusplayer/src/esplayer.cpp
src/esplusplayer/src/esplusplayer_capi.cpp
src/plusplayer-core/include_internal/core/trackrendereradapter.h
src/plusplayer-core/src/trackrendereradapter.cpp
ut/include/esplusplayer/esreader.hpp

index 593af67f5a855f24bbf11c8392105ce05a935528..27698713281fb77f39a75465b009e9bee29eddc1 100755 (executable)
@@ -270,6 +270,7 @@ class EsPlusPlayer : private boost::noncopyable {
    * @pre       Player state must be kNone
    * @post      The player state will be EsState::kIdle
    * @return    @c True on success, otherwise @c False
+   * @exception None
    * @see       Close()
    */
   // LCOV_EXCL_START
@@ -280,6 +281,7 @@ class EsPlusPlayer : private boost::noncopyable {
    *            EsState::kIdle or EsState::kNone
    * @post      The player state will be kNone
    * @return    @c True on success, otherwise @c False
+   * @exception None
    * @see       EsPlusPlayer::Open()
    */
   virtual bool Close() { return false; }
@@ -288,9 +290,11 @@ class EsPlusPlayer : private boost::noncopyable {
    * @brief     Not play the specific stream anymore.
    * @remark    The submitted es packets will be dropped after deactivated.
    *            It recommands to stop feeding the specific stream's packets.
+   * @param     [in] type : stream type
    * @pre       The player must be set to at least #EsState::kReady
    * @post      The player state is same as before calling Deactivate().
    * @return    @c True on success, otherwise @c False.
+   * @exception None
    * @see       EsPlusPlayer::Deactivate().
    */
   virtual bool Deactivate(const StreamType type) { return false; }
@@ -302,10 +306,13 @@ class EsPlusPlayer : private boost::noncopyable {
    *            User has to submit the specific stream from the
    *            current playing time for activating.
    *            The video stream has to be submitted from Iframe.
+   * @param     [in] type : stream type
    * @pre       The player must be set to at least #EsState::kReady
    *            The StreamType must be deactivated in advance.
    *            Stream should be set in advance.
+   * @post      The player state is same as before calling Activate().
    * @return    @c True on success, otherwise @c False
+   * @exception None
    * @code
       PrepareAsync();
       Deactivate(StreamType::kVideo);
@@ -327,6 +334,7 @@ class EsPlusPlayer : private boost::noncopyable {
    * @pre       The player must be set to at least #EsState::kIdle
    * @post      The player state is same as before calling DeactivateAudio().
    * @return    @c True on success, otherwise @c False.
+   * @exception None
    * @see       EsPlusPlayer::DeactivateAudio()
    */
   virtual bool DeactivateAudio() { return false; }
@@ -337,7 +345,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * @pre       The player must be set to at least #EsState::kReady
    *            The audio stream must be deactivated in advance.
    *            Audio stream should be set in advance.
+   * @post      The player state is same as before calling ActivateAudio().
    * @return    @c True on success, otherwise @c False
+   * @exception None
    * @code
       VideoStreamPtr audio_stream = AudioStream::Create();
       audio_stream->SetMimeType(AudioMimeType::kAAC);
@@ -363,6 +373,7 @@ class EsPlusPlayer : private boost::noncopyable {
    * @pre       The player state must be set to #EsState::kIdle
    * @post      The player state will be #EsState::kReady
    * @return    @c true if async task is correctly started
+   * @exception  None
    * @see       EsPlusPlayer::Open() \n
    *            EsPlusPlayer::Stop() \n
    *            EsPlusPlayer::SubmitPacket()
@@ -373,6 +384,7 @@ class EsPlusPlayer : private boost::noncopyable {
    * @pre       The player state should be #EsState::kReady
    * @post      The player state will be #EsState::kPlaying
    * @return    @c True on success, otherwise @c False
+   * @exception None
    * @see       EsPlusPlayer::Open() \n
    *            EsPlusPlayer::PrepareAsync() \n
    *            EsPlusPlayer::Stop() \n
@@ -386,6 +398,7 @@ class EsPlusPlayer : private boost::noncopyable {
    * @pre       The player state must be all of #EsState except #EsState::kNone
    * @post      The player state will be #EsState::kIdle
    * @return    @c True on success, otherwise @c False
+   * @exception None
    * @see       EsPlusPlayer::Open() \n
    *            EsPlusPlayer::PrepareAsync() \n
    *            EsPlusPlayer::Start() \n
@@ -401,6 +414,7 @@ class EsPlusPlayer : private boost::noncopyable {
    * #EsState::kPlaying or #EsState::kPaused
    * @post      The player state will be #EsState::kPaused
    * @return    @c True on success, otherwise @c False
+   * @exception None
    * @see       EsPlusPlayer::Start() \n
    *            EsPlusPlayer::Resume()
    */
@@ -411,6 +425,7 @@ class EsPlusPlayer : private boost::noncopyable {
    * #EsState::kPaused
    * @post      The player state will be #EsState::kPlaying
    * @return    @c True on success, otherwise @c False
+   * @exception None
    * @see       EsPlusPlayer::Start() \n
    *            EsPlusPlayer::Pause()
    */
@@ -421,7 +436,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * priority to control resource.
    * @param     [in] app_info : application id, version, type
    * @pre       The player state must be set to #EsState::kIdle
+   * @post      The player state is same as before calling SetAppInfo()
    * @return    None
+   * @exception None
    */
   virtual void SetAppInfo(const PlayerAppInfo& app_info) { return; }
   /**
@@ -430,7 +447,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * priority to control resource.
    * @param     [in] app_info : application id, version, type, runtitle
    * @pre       The player state must be set to #EsState::kIdle
+   * @post      The player state is same as before calling SetAppInfoEx()
    * @return    None
+   * @exception None
    */
   virtual void SetAppInfoEx(const PlayerAppInfoEx& app_info) { return; }
   /**
@@ -442,8 +461,10 @@ class EsPlusPlayer : private boost::noncopyable {
    * mute off.
    * @pre       The source and feeder have to push the data as fast as playback
    * rate.
+   * @post      The player state is same as before calling SetPlaybackRate()
    * @return    @c True if set playback rate is finished without any problem
    * otherwise @c False
+   * @exception None
    */
   virtual bool SetPlaybackRate(const double rate, bool audio_mute) {
     return false;
@@ -456,8 +477,10 @@ class EsPlusPlayer : private boost::noncopyable {
    * the stream default in milliseconds, according to SetTimeUnitType.
    * @pre       The player state must be one of #EsState::kReady,
    * #EsState::kPlaying or #EsState::kPaused
+   * @post      None
    * @return    @c True if seek operation is started without any problem
    * otherwise @c False
+   * @exception None
    * @see       EsEventListener::OnSeekDone() \n
    *            EsPlusPlayer::SubmitPacket()
    */
@@ -470,7 +493,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * @param     [in] type : display type
    * @param     [in] obj : The handle to display window
    * @pre       The player state must be set to #EsState::kIdle
+   * @post      None
    * @return    @c True on success, otherwise @c False
+   * @exception None
    * @see       DisplayType \n
    *            EsPlusPlayer::SetDisplayMode() \n
    *            EsPlusPlayer::SetDisplayRoi() \n
@@ -510,7 +535,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * @param     [in] w : width of display window
    * @param     [in] h : height of display window
    * @pre       The player state must be set to #EsState::kIdle
+   * @post      None
    * @return    @c True on success, otherwise @c False
+   * @exception None
    * @see       DisplayType \n
    *            EsPlusPlayer::SetDisplayMode() \n
    *            EsPlusPlayer::SetDisplayRoi() \n
@@ -532,7 +559,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * @param     [in] w : width of display window
    * @param     [in] h : height of display window
    * @pre       The player state must be set to #EsState::kIdle
+   * @post      None
    * @return    @c True on success, otherwise @c False
+   * @exception None
    * @see       DisplayType \n
    *            EsPlusPlayer::SetDisplayMode() \n
    *            EsPlusPlayer::SetDisplayRoi() \n
@@ -555,7 +584,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * @param     [in] w : width of display window
    * @param     [in] h : height of display window
    * @pre       The player state must be set to #EsState::kIdle
+   * @post      None
    * @return    @c True on success, otherwise @c False
+   * @exception None
    * @see       DisplayType \n
    *            EsPlusPlayer::SetDisplayMode() \n
    *            EsPlusPlayer::SetDisplayRoi() \n
@@ -581,7 +612,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * @brief     Set the video display mode
    * @param     [in] mode : display mode
    * @pre       The player state can be all of #EsState except #EsState::kNone
+   * @post      None
    * @return    @c True on success, otherwise @c False
+   * @exception  None
    * @see       #DisplayMode
    * @see       EsPlusPlayer::SetDisplay()
    * @see       EsPlusPlayer::SetDisplayRoi()
@@ -595,7 +628,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * @pre       The player state can be all of #EsState except #EsState::kNone
    * \n Before set display ROI, #DisplayMode::kDstRoi must be set with
    * EsPlusPlayer::SetDisplayMode().
+   * @post      None
    * @return    @c True on success, otherwise @c False
+   * @exception  None
    * @see       DisplayMode \n
    *            EsPlusPlayer::SetDisplay() \n
    *            EsPlusPlayer::SetDisplayMode() \n
@@ -607,7 +642,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * @brief     Set scaled area ratio of display
    * @param     [in] area : Crop ratio of src area
    * @pre       The player state can be all of #EsState except #EsState::kNone
+   * @post      None
    * @return    @c True on success, otherwise @c False
+   * @exception  None
    * @remark    The minimum value of input are 0,maximun is 1.
    */
   virtual bool SetVideoRoi(const CropArea& area) { return false; }
@@ -617,7 +654,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * displayed).
    * @param     [in] rect : render rectangle.
    * @pre       Should be called after SetDisplay()
+   * @post      None
    * @return    @c True on success, otherwise @c False
+   * @exception  None
    * @remark    The minimum value of width and height are 1.
    */
   virtual bool ResizeRenderRect(const RenderRect& rect) { return false; }
@@ -627,7 +666,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * @remarks   The default value is 0.
    * @param     [in] rotate : Rotate angle.
    * @pre       The player state can be all of #EsState except #EsState::kNone
+   * @post      None
    * @return    @c True on success, otherwise @c False
+   * @exception  None
    * @see       EsPlusPlayer::SetDisplay()
    */
   virtual bool SetDisplayRotate(const DisplayRotation& rotate) { return false; }
@@ -637,7 +678,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * @remarks   The default value is 0.
    * @param     [out] rotate : Stored rotate angle value.
    * @pre       The player state can be all of #EsState except #EsState::kNone
+   * @post      None
    * @return    @c True on success, otherwise @c False
+   * @exception  None
    * @see       EsPlusPlayer::SetDisplayRotate()
    */
   virtual bool GetDisplayRotate(DisplayRotation* rotate) { return false; }
@@ -647,7 +690,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * @param     [in] is_visible : The visibility of the display
    *            (@c true = visible, @c false = non-visible)
    * @pre       The player state can be all of #EsState except #EsState::kNone
+   * @post      None
    * @return    @c True on success, otherwise @c False
+   * @exception  None
    * @see       EsPlusPlayer::SetDisplay()
    */
   virtual bool SetDisplayVisible(bool is_visible) { return false; }
@@ -662,7 +707,9 @@ class EsPlusPlayer : private boost::noncopyable {
    *            (@c true = if decrypted packets are sent in trust zone, @c false
    * = otherwise)
    * @pre       The player state must be set to #EsState::kIdle
+   * @post      None
    * @return    @c True on success, otherwise @c False
+   * @exception  None
    * @see       EsPlusPlayer::SubmitTrustZonePacket()
    */
   virtual bool SetTrustZoneUse(bool is_using_tz) { return false; }
@@ -676,7 +723,9 @@ class EsPlusPlayer : private boost::noncopyable {
    *            If type is kEncryptedData, Use SubmitEncryptedPacket()
    * @param     [in] type : whether to use trust zone memory or encrypted data
    * @pre       The player state must be set to #EsState::kIdle
+   * @post      None
    * @return    @c True on success, otherwise @c False
+   * @exception  None
    * @see       EsPlusPlayer::SubmitPacket() \n
    *            EsPlusPlayer::SubmitTrustZonePacket() \n
    *            EsPlusPlayer::SubmitEncryptedPacket() \\n
@@ -689,7 +738,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * EsPlusPlayer::PrepareAsync()
    * @param     [in] stream : audio stream object
    * @pre       The player state must be set to #EsState::kIdle
+   * @post      None
    * @return    @c True on success, otherwise @c False
+   * @exception  None
    * @see       AudioStream
    */
   virtual bool SetStream(const AudioStreamPtr& stream) { return false; }
@@ -699,7 +750,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * EsPlusPlayer::PrepareAsync()
    * @param     [in] stream : video stream object
    * @pre       The player state must be set to #EsState::kIdle
+   * @post      None
    * @return    @c True on success, otherwise @c False
+   * @exception  None
    * @see       VideoStream
    */
   virtual bool SetStream(const VideoStreamPtr& stream) { return false; }
@@ -715,8 +768,10 @@ class EsPlusPlayer : private boost::noncopyable {
    *            This api must be called from a different thread than other apis
    * @param     [in] packet : es packet object
    * @pre       The player state can be all of #EsState except #EsState::kNone
+   * @post      None
    * @return    @c PacketSubmitStatus::kSuccess : succeed to submit es packet
    *            @c otherwise : fail to submit es packet
+   * @exception  None
    * @see       SetSubmitDataType() \n
    *            EsPacket \n
    *            OnBufferStatus \n
@@ -739,10 +794,12 @@ class EsPlusPlayer : private boost::noncopyable {
    *            SetSubmitDataType() \n
    *            This api must be called from a different thread than other apis.
    * @param     [in] packet : es packet object
-   *            [in] tz_handle : a handle for es packet in the trust zone
+   * @param     [in] tz_handle : a handle for es packet in the trust zone
    * @pre       The player state can be all of #EsState except #EsState::kNone
+   * @post      None
    * @return    @c PacketSubmitStatus::kSuccess : succeed to submit es packet
    *            @c otherwise : fail to submit es packet
+   * @exception  None
    * @see       SetSubmitDataType() \n
    *            EsPacket \n
    *            OnBufferStatus \n
@@ -766,11 +823,13 @@ class EsPlusPlayer : private boost::noncopyable {
    *            SetSubmitDataType() \n
    *            This api must be called from a different thread than other apis.
    * @param     [in] packet : encrypted es packet object
-   *            [in] drm_info : information for decryption
+   * @param     [in] drm_info : information for decryption
    * @pre       The player state can be all of #EsState except #EsState::kNone
+   * @post      None
    * @return    @c PacketSubmitStatus::kSuccess : succeed to submit es packet
    *            @c PacketSubmitStatus::kFull, PacketSubmitStatus::kNotPrepared :
    * fail to submit es packet
+   * @exception  None
    * @see       SetSubmitDataType() \n
    *            EsPacket \n
    *            OnBufferStatus \n
@@ -793,8 +852,10 @@ class EsPlusPlayer : private boost::noncopyable {
    *                can be set by @SetTimeUnitType
    * @pre       The player must be one of #EsState::kPlaying or
    * #EsState::kPaused
+   * @post      None
    * @return    @c True on success, otherwise @c False
    *            ("time" will be 0)
+   * @exception  None
    */
   virtual bool GetPlayingTime(uint64_t* time) { return false; }
   /**
@@ -804,7 +865,9 @@ class EsPlusPlayer : private boost::noncopyable {
    *                   frames)
    * @pre       The player must be one of #EsState::kPlaying or
    * #EsState::kPaused or #EsState::kReady
+   * @post      None
    * @return    @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool GetAdaptiveInfo(void* padaptive_info,
                                const PlayerAdaptiveInfo& adaptive_type) {
@@ -815,7 +878,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * @param     [in] is_mute : On mute of the sound
    *            (@c true = mute, @c false = non-mute)
    * @pre       The player state can be all of #EsState except #EsState::kNone
+   * @post      None
    * @return    @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool SetAudioMute(bool is_mute) { return false; }
 
@@ -823,6 +888,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * @brief     Set decoded video frame buffer type.
    * @param     [in] type : A type of decoded video frame buffer.
    * @pre       The player state must be set to #EsState::kIdle
+   * @post      None
+   * @return    @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool SetVideoFrameBufferType(DecodedVideoFrameBufferType type) {
     return false;
@@ -842,7 +910,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * when request_framerate.num/request_framerate.den <
    * track_framerate.num/track_framerate.den, drop some decoded video frame.
    * @pre       The player state must be not #EsState::kNone
+   * @post      None
    * @return    @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool SetDecodedVideoFrameRate(const Rational& request_framerate) {
     return false;
@@ -854,7 +924,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * @param     [in] target_width : target width of scale.
    * @param     [in] target_height : target height of scale.
    * @pre       The player state must be set to #EsState::kIdle
+   * @post      None
    * @return    @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool SetVideoFrameBufferScaleResolution(
       const uint32_t& target_width, const uint32_t& target_height) {
@@ -877,28 +949,37 @@ class EsPlusPlayer : private boost::noncopyable {
    * @brief     Set volume value of player
    * @param     [in] volume : volume level
    * @pre       The player state can be all of #EsState except #EsState::kNone
+   * @post      None
    * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool SetVolume(const int& volume) { return false; }
   /**
    * @brief     Get volume value of player
    * @param     [out] volume : volume ptr
    * @pre       The player state can be all of #EsState except #EsState::kNone
+   * @post      None
    * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool GetVolume(int* volume) { return false; }
   /**
    * @brief     Flush the data in pipeline
    * @param     [in] type : can be kAudio/kVideo
    * @pre       The player state can greater than #EsState::kIdle
+   * @post      None
    * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool Flush(const StreamType& type) { return false; }
   /**
    * @brief     Set the type of buffer size.
    * @param     [in] option : A type of Buffer Option
+   * @param     [in] size   : A size of Buffer
    * @pre       The player state must be set to #EsState::kIdle
+   * @post      None
    * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool SetBufferSize(const BufferOption& option, uint64_t size) {
     return false;
@@ -909,7 +990,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * EsPlusPlayer::PrepareAsync()
    * @param     [in] mode : one of the low latency mode to set.
    * @pre       The player state must be set to #EsState::kIdle
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool SetLowLatencyMode(const PlayerLowLatencyMode& mode) {
     return false;
@@ -918,7 +1001,9 @@ class EsPlusPlayer : private boost::noncopyable {
   /**
    * @brief     Provided api for enabling video frame peek mode
    * @pre       The player state must be set to #EsState::kIdle.
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    * @see       RenderVideoFrame().
    */
   virtual bool SetVideoFramePeekMode() { return false; }
@@ -932,37 +1017,50 @@ class EsPlusPlayer : private boost::noncopyable {
    * @see       SetVideoFramePeekMode().
    */
   virtual bool RenderVideoFrame() { return false; }
+
   /**
    * @brief     Provided api for setting unlimited max buffer mode
    * @remarks   The player does not limit es packet transmission although in
    *            buffer overrun status.
    * @pre       The player state must be set to #EsState::kIdle
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool SetUnlimitedMaxBufferMode() { return false; }
+
   /**
    * @brief     Provided api to deliver fmm signal and getting fmm auto status
    * @remarks   The player just delivers fmm signal to system. It doesn't
    * gaurantee activating fmm mode. System refers to fmm signal when it decides
    * to activate fmm mode or not.
    * @pre       The player state can be all of #EsState except #EsState::kNone
+   * @post      None
    * @return    @c ErrorType::kNone = fmm auto mode on @c
    * ErrorType::kInvalidOperation = fmm audo mode off @c
    * ErrorType::kInvalidState = internal operation failed
+   * @exception  None
    */
   virtual ErrorType SetFmmMode() { return ErrorType::kNone; }
+  
   /**
    * @brief     Provided api for setting audio codec type
+   * @param     [in] type : type of audio codec
    * @pre       The player state must be set to #EsState::kIdle.
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool SetAudioCodecType(const PlayerAudioCodecType& type) {
     return false;
   }
   /**
    * @brief     Provided api for setting video codec type
+   * @param     [in] type : type of video codec
    * @pre       The player state must be set to #EsState::kIdle.
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool SetVideoCodecType(const PlayerVideoCodecType& type) {
     return false;
@@ -970,7 +1068,7 @@ class EsPlusPlayer : private boost::noncopyable {
   /**
    * @brief     Provided api for setting alternative video resource(sub decoder
    *            and sub scaler)
-   * @param     [in] is_set : set alternative video resource
+   * @param     [in] rsc_type : set alternative video resource
    *            (@c 0 [defualt] = set all video resources(decoder/scaler) to
    *                              main resources,
    *             @c 1 = set all video resources(decoder/scaler) to sub
@@ -978,7 +1076,9 @@ class EsPlusPlayer : private boost::noncopyable {
    *             @c 2 = set only decoder to sub resource,
    *             @c 3 = set only scaler to sub resource)
    * @pre       The player state can be all of #EsState except #EsState::kNone
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool SetAlternativeVideoResource(unsigned int rsc_type) {
     return false;
@@ -986,9 +1086,11 @@ class EsPlusPlayer : private boost::noncopyable {
   /**
    * @brief     Provided api for setting alternative audio resource(sub decoder
    *            and audio out)
-   * @param     [in] is_set : set alternative audio resource
+   * @param     [in] rsc_type : set alternative audio resource
    * @pre       The player state can be all of #EsState except #EsState::kNone
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool SetAlternativeAudioResource(
       const PlayerAudioResourceType rsc_type) {
@@ -1003,7 +1105,9 @@ class EsPlusPlayer : private boost::noncopyable {
    *            if other codec type is set, this api will return false.
    * @pre       The player state must be one of #EsState::kReady,
    *            #EsState::kPlaying, #EsState::kPaused.
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool SwitchAudioStreamOnTheFly(const AudioStreamPtr& stream) {
     return false;
@@ -1011,8 +1115,11 @@ class EsPlusPlayer : private boost::noncopyable {
 
   /**
    * @brief     Provided api for setting aifilter to video pipeline
+   * @param     [in] aifilter : set AI filter
    * @pre       The player state must be set to #EsState::kIdle.
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool SetAiFilter(void* aifilter) { return false; }
   /**
@@ -1023,7 +1130,9 @@ class EsPlusPlayer : private boost::noncopyable {
    *            #EsState::kPaused or #EsState::kPlaying.
    *            It have to be set to low latency mode.
    * @remark    esplusplayer_set_low_latency_mode().
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool SetRenderTimeOffset(const StreamType type, int64_t offset) {
     return false;
@@ -1036,7 +1145,9 @@ class EsPlusPlayer : private boost::noncopyable {
    *            #EsState::kPaused or #EsState::kPlaying.
    *            It have to be set to low latency mode.
    * @remark    esplusplayer_set_low_latency_mode().
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool GetRenderTimeOffset(const StreamType type, int64_t* offset) {
     return false;
@@ -1044,31 +1155,46 @@ class EsPlusPlayer : private boost::noncopyable {
 
   /**
    * @brief     Provided api for setting catch up speed level
+   * @param     [in] level : catch-up speed
    * @pre       The player state must be set to #EsState::kIdle,
    *            #EsState::kReady, #EsState::kPlaying or #EsState::kPaused
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool SetCatchUpSpeed(const CatchUpSpeed& level) { return false; }
+
   /**
    * @brief     Provided api for getting current video latency status
+   * @param     [in] status : video latency status
    * @pre       The player state must be one of #EsState::kReady,
    *            #EsState::kPlaying or #EsState::kPaused
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool GetVideoLatencyStatus(LatencyStatus* status) { return false; }
+
   /**
    * @brief     Provided api for getting current audio latency status
+   * @param     [in] status : audio latency status
    * @pre       The player state must be one of #EsState::kReady,
    *            #EsState::kPlaying or #EsState::kPaused
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool GetAudioLatencyStatus(LatencyStatus* status) { return false; }
+
   /**
    * @brief     Provided api for setting video mid latency threshold for low
    * latency playback
+   * @param     [in] threshold : video mid latency
    * @pre       The player state must be set to #EsState::kIdle,
    *            #EsState::kReady, #EsState::kPlaying or #EsState::kPaused
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool SetVideoMidLatencyThreshold(const unsigned int threshold) {
     return false;
@@ -1077,9 +1203,12 @@ class EsPlusPlayer : private boost::noncopyable {
   /**
    * @brief     Provided api for setting audio mid latency threshold for low
    * latency playback
+   * @param     [in] threshold : audio mid latency
    * @pre       The player state must be set to #EsState::kIdle,
    *            #EsState::kReady, #EsState::kPlaying or #EsState::kPaused
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool SetAudioMidLatencyThreshold(const unsigned int threshold) {
     return false;
@@ -1088,9 +1217,12 @@ class EsPlusPlayer : private boost::noncopyable {
   /**
    * @brief     Provided api for setting video high latency threshold for low
    * latency playback
+   * @param     [in] threshold : video high latency
    * @pre       The player state must be set to #EsState::kIdle,
    *            #EsState::kReady, #EsState::kPlaying or #EsState::kPaused
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool SetVideoHighLatencyThreshold(const unsigned int threshold) {
     return false;
@@ -1099,9 +1231,12 @@ class EsPlusPlayer : private boost::noncopyable {
   /**
    * @brief     Provided api for setting audio high latency threshold for low
    * latency playback
+   * @param     [in] threshold : audio high latency
    * @pre       The player state must be set to #EsState::kIdle,
    *            #EsState::kReady, #EsState::kPlaying or #EsState::kPaused
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool SetAudioHighLatencyThreshold(const unsigned int threshold) {
     return false;
@@ -1110,9 +1245,12 @@ class EsPlusPlayer : private boost::noncopyable {
   /**
    * @brief     Provided api for getting the maximum number of frames
    * @remark    It has to be set game mode, and multi channel pcm
+   * @param     [in] frame_count : pcm buffer size
    * @pre       The player state must be one of #EsState::kReady,
    *            #EsState::kPlaying or #EsState::kPaused
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool GetLowLatencyPcmBufferSize(uint64_t* frame_count) {
     return false;
@@ -1121,9 +1259,12 @@ class EsPlusPlayer : private boost::noncopyable {
   /**
    * @brief     Provided api for getting the number of currently queued frames
    * @remark    It has to be set game mode, and multi channel pcm
+   * @param     [in] frame_count : pcm current buffer level
    * @pre       The player state must be one of #EsState::kReady,
    *            #EsState::kPlaying or #EsState::kPaused
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool GetLowLatencyPcmCurrentBufferLevel(uint64_t* frame_count) {
     return false;
@@ -1132,9 +1273,12 @@ class EsPlusPlayer : private boost::noncopyable {
   /**
    * @brief     Provided api for getting the underrun counts in audio out
    * @remark    It has to be set game mode, and multi channel pcm
+   * @param     [in] underrun_count : the number of underrun
    * @pre       The player state must be one of #EsState::kReady,
    *            #EsState::kPlaying or #EsState::kPaused
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool GetLowLatencyPcmUnderrunCount(uint64_t* underrun_count) {
     return false;
@@ -1147,7 +1291,9 @@ class EsPlusPlayer : private boost::noncopyable {
    * @param     [in] easing_info : target_volume, duration(milisecond), easing
    * type
    * @pre       The player state can be all of #EsState except #EsState::kNone
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool InitAudioEasingInfo(const uint32_t init_volume,
                                    const uint32_t init_elapsed_time,
@@ -1160,9 +1306,12 @@ class EsPlusPlayer : private boost::noncopyable {
    * @param     [in] easing_info : target_volume, duration(milisecond), easing
    * type
    * @pre       The player state can be all of #EsState except #EsState::kNone
+   * @post      None
    * @remarks   This API have to be called after calling the
    * EsPlusPlayer::InitAudioEasingInfo()
-   * @return    @c True on success, otherwise @c False
+   * @post      None
+   * @return       @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool UpdateAudioEasingInfo(const AudioEasingInfo& easing_info) {
     return false;
@@ -1175,9 +1324,11 @@ class EsPlusPlayer : private boost::noncopyable {
    * @param     [out] easing_info : target_volume, duration(milisecond), easing
    * type
    * @pre       The player state can be all of #EsState except #EsState::kNone
+   * @post      None
    * @remarks   This API have to be called after calling the
    * EsPlusPlayer::InitAudioEasingInfo()
    * @return    @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool GetAudioEasingInfo(uint32_t* current_volume,
                                   uint32_t* elapsed_time,
@@ -1188,23 +1339,27 @@ class EsPlusPlayer : private boost::noncopyable {
   /**
    * @brief     Provided api for starting audio easing
    * @pre       The player state should be at least #EsState::kReady
+   * @post      None
    * @remarks   This API have to be called after calling the
    * EsPlusPlayer::InitAudioEasingInfo()
    * @return    @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool StartAudioEasing() { return false; }
 
   /**
    * @brief     Provided api for stopping audio easing
    * @pre       The player state can be all of #EsState except #EsState::kNone
+   * @post      None
    * @remarks   This API have to be called after calling the
    * EsPlusPlayer::InitAudioEasingInfo()
    * @return    @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool StopAudioEasing() { return false; }
 
   /**
-   * @brief     Get virtual render resource id.
+   * @brief     Get virtual remderer resource id.
    * @param     [in] type : The resource type of virtual id.
    * @param     [out] virtual_id : Stored virtual resource id value.
    * @pre       The player state should be #EsState::kReady, #EsState::kPlaying
@@ -1253,8 +1408,11 @@ class EsPlusPlayer : private boost::noncopyable {
 
   /**
    * @brief     Return the decoded video packet.
-   * @param     [in] packet
+   * @param     [in] packet : decoded video packet
+   * @pre       The player state must be set to #EsState::kIdle.
+   * @post      None
    * @return    @c True on success, otherwise @c False
+   * @exception  None
    */
   virtual bool ReturnDecodedPacket(const DecodedVideoPacket& packet) {
     return false;
@@ -1270,8 +1428,8 @@ class EsPlusPlayer : private boost::noncopyable {
   virtual bool SetAudioPreloading() { return false; }
 
   /**
-   * @brief     Set resource allocate policy.
-   * @param     [in] policy : The resource allocate policy.
+   * @brief     Set video scan type.
+   * @param     [in] type : video scan type
    * @pre       The player state must be set to #EsState::kIdle.
    * @post      None
    * @return    @c True on success, otherwise @c False
@@ -1288,8 +1446,10 @@ class EsPlusPlayer : private boost::noncopyable {
    * milliseconds
    * @pre         The player must be one of #EsState::kPlaying or
    * #EsState::kPaused
+   * @post      None
    * @return    @c True on success, otherwise @c False
    *              ("time_in_milliseconds" will be 0)
+   * @exception  None 
    */
   virtual bool GetDecodingTime(StreamType type, int32_t* time_in_milliseconds) {
     return false;
@@ -1342,6 +1502,15 @@ class EsPlusPlayer : private boost::noncopyable {
     return false;
   }
 
+  /**
+   * @brief     Set the mode of virtual mic
+   * @pre       The player state must be set to #EsState::kIdle.
+   * @post      None
+   * @return    @c True on success, otherwise @c False
+   * @exception  None
+   */
+  virtual bool SetVirtualMicMode() { return false; }
+
   // LCOV_EXCL_STOP
 
  protected:
index be89e0ed36b447d0cbd718d24d9ae82cdb57fa30..2a30c12f8ebdf93a5f1de335f97f613d96b5a962 100755 (executable)
@@ -67,7 +67,7 @@ int esplusplayer_set_surface_display(esplusplayer_handle handle,
  * @brief     Set a callback function to be invoked when the first buffer is
  *            output from a video decoder.
  * @param     [in] handle : esplusplayer handle.
- * @param     [in] callback : the callback function to register.
+ * @param     [in] first_video_decoding_done_cb : the callback function to register.
  * @param     [in] userdata : userdata of esplusplayer_decoder_underrun_cb()
  * @return    @c one of esplusplayer_error_type values will be returned.
  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_NONE or
@@ -84,7 +84,7 @@ int esplusplayer_set_first_video_decoding_done_cb(
  * @brief     Set a callback function to be invoked when buffer underrun is
  *            occurred from a video decoder.
  * @param     [in] handle : esplusplayer handle.
- * @param     [in] callback : the callback function to register.
+ * @param     [in] video_decoder_underrun_cb : the callback function to register.
  * @param     [in] userdata : userdata of esplusplayer_decoder_underrun_cb()
  * @return    @c one of esplusplayer_error_type values will be returned.
  * @pre       The player state must be set to #ESPLUSPLAYER_STATE_NONE or
@@ -159,6 +159,16 @@ int get_size_of_esplusplayer_video_stream_info(void);
  */
 int get_size_of_esplusplayer_drm_info(void);
 
+/**
+ * @brief     Set the mode of virtual mic
+ * @param     [in] handle : esplusplayer handle.
+ * @return    int 
+ * @pre       None
+ * @post      None
+ * @exception   None
+ */
+int esplusplayer_set_virtual_mic_mode(esplusplayer_handle handle);
+
 #ifdef __cplusplus
 }
 #endif
index 90a10c6171d9f6f5ed704d0386890cf69419c497..2015888cdb2d8fc2019dcad95c17dc7625675b61 100755 (executable)
@@ -7,7 +7,7 @@
 #echo "Product Type: %{_vd_cfg_product_type}"
 Name:       esplusplayer
 Summary:    new multimedia streaming player
-Version:    1.3.9
+Version:    1.4.0
 Release:    0
 Group:      Multimedia/Libraries
 License:    Apache-2.0
index 9a57424d2a292716d1771ae4a8de3f6dba7c686f..0c9d9e2903d7c8e75cf37becf60bc43d6858c0ac 100644 (file)
@@ -158,6 +158,7 @@ class EsPlayer : public EsPlusPlayer {
   bool GetVideoStreamRotationInfo(VideoRotation* rotation) override;
   bool SetSimpleMixOutBufferLevel(
       const PlayerSimpleMixOutBufferLevel level) override;
+  bool SetVirtualMicMode() override;
 
  private:
   using SubmitPacketOperator =
@@ -353,6 +354,7 @@ class EsPlayer : public EsPlusPlayer {
   EsPacketLogger es_packet_logger_;
   PlayerTimeUnitType time_unit_type = kPlayerTimeUnitTypeMs;
   VideoRotation video_rotate_ = VideoRotation::kVideoRotateNone;
+  std::uint32_t virtual_mic_mode_ = 0;
 };
 
 }  // namespace esplusplayer
index ba3750a3bc59b9b10cd8831d84229540cc3afa52..eb876a27d9b587602775ebb0fdbe3853e42d3c56 100755 (executable)
@@ -611,6 +611,8 @@ void EsPlayer::SetTrackRendererAttributes_() {
   trackrenderer_->SetAttribute(
       TrackRendererAdapter::Attribute::kPlayerTimeUnitType,
       static_cast<std::uint32_t>(time_unit_type));
+  trackrenderer_->SetAttribute(TrackRendererAdapter::Attribute::kVirtualMicMode,
+                              virtual_mic_mode_);
 }
 
 // LCOV_EXCL_START
@@ -2997,6 +2999,16 @@ bool EsPlayer::SetSimpleMixOutBufferLevel(
   return trackrenderer_->SetSimpleMixOutBufferLevel(converted_level);
 }
 
+bool EsPlayer::SetVirtualMicMode() {
+  if (state_manager_.GetState() != EsState::kIdle) {
+    LOG_ERROR_P(this, "Invalid State , current %d",
+                state_manager_.GetStateEnum());
+    return false;
+  }
+  virtual_mic_mode_ = 1;
+  return true;
+}
+
 kpi::EsCodecLoggerKeys EsPlayer::MakeKpiKeys_() {
   kpi::EsCodecLoggerKeys event_info;
   event_info.app_id = app_info_.id;
index e28a0b3ec8408a53a54989d20fecd48b4e37ebf8..ae9a70783ad6df51cf6bd59e70f81fc1a747f1e9 100644 (file)
@@ -1253,7 +1253,7 @@ static void esdump(esplusplayer_handle handle, esplusplayer_es_packet* packet) {
   ostream.write(reinterpret_cast<char*>(&tmp), sizeof(uint64_t));
   std::uint64_t size = (std::uint64_t)packet->buffer_size;
   ostream.write(reinterpret_cast<char*>(&size), sizeof(size));
-  ostream.write(reinterpret_cast<char*>(packet->buffer), packet->buffer_size);
+  ostream.write(reinterpret_cast<char*>(packet->buffer), static_cast<const std::streamsize>(packet->buffer_size));
   LOG_DEBUG("DUMP type:%d pkt pts: %" PRId64 "duration: %" PRId64 "size: %d",
             packet->type, packet->pts, packet->duration, packet->buffer_size);
 }
@@ -1397,7 +1397,7 @@ static void audio_es_dump(esplusplayer_handle handle,
   codec_extradata_stream.write(
       reinterpret_cast<char*>(&info->codec_data_length),
       sizeof(info->codec_data_length));
-  codec_extradata_stream.write(info->codec_data, info->codec_data_length);
+  codec_extradata_stream.write(info->codec_data, static_cast<const std::streamsize>(info->codec_data_length));
   codec_extradata_stream.close();
 }
 
@@ -1440,7 +1440,7 @@ static void video_es_dump(esplusplayer_handle handle,
   codec_extradata_stream.write(
       reinterpret_cast<char*>(&info->codec_data_length),
       sizeof(info->codec_data_length));
-  codec_extradata_stream.write(info->codec_data, info->codec_data_length);
+  codec_extradata_stream.write(info->codec_data,  static_cast<const std::streamsize>(info->codec_data_length));
   codec_extradata_stream.close();
 }
 #endif
@@ -2418,3 +2418,11 @@ int esplusplayer_set_simple_mix_out_buffer_level(
   return convert_return_type_(cast_(handle)->SetSimpleMixOutBufferLevel(
       static_cast<PlayerSimpleMixOutBufferLevel>(level)));
 }
+
+int esplusplayer_set_virtual_mic_mode(esplusplayer_handle handle) {
+  LOG_ENTER_P(cast_(handle))
+  if (is_null_(handle)) return ESPLUSPLAYER_ERROR_TYPE_INVALID_PARAMETER;
+
+  auto ret = cast_(handle)->SetVirtualMicMode();
+  return convert_return_type_(ret);
+}
index 6611a159394eab6f16fa1d0d7836e4685eacd68d..aa249cb1da89e2b6b575975983b95e79b97a1fc5 100644 (file)
@@ -74,6 +74,7 @@ class TrackRendererAdapter {
     kLateVideoFrameDropMode,    // std::uint32_t
     kVideoProgressiveMode,      // std::uint32_t
     kPlayerTimeUnitType,        // std::uint32_t
+    kVirtualMicMode,            // std::uint32_t
   };
 
   // TODO(js4716.chun):CHECK POINTS
index 46d196c9e84eff1afdf008b43710022f78b4e881..d9d9c5396c707c4403a8f6830ab95db1947c053d 100644 (file)
@@ -566,7 +566,9 @@ static const std::map<TrackRendererAdapter::Attribute, AttrInfo>
         {TrackRendererAdapter::Attribute::kVideoProgressiveMode,
          {ValueType::kUInt32, "video-progressive-mode"}},
         {TrackRendererAdapter::Attribute::kPlayerTimeUnitType,
-         {ValueType::kUInt32, "player-time-unit-type"}}};
+         {ValueType::kUInt32, "player-time-unit-type"}},
+        {TrackRendererAdapter::Attribute::kVirtualMicMode,
+         {ValueType::kUInt32, "virtual-mic-mode"}}};
 }  // namespace adapter_utils
 
 void TrackRendererAdapter::SetAttribute(
index 947b49291b0f57ce47a20ba8a312b31ae88eb823..02ae48cde0055c3ec588cf9841b85f7f22e9c92d 100644 (file)
@@ -135,7 +135,7 @@ class EsStreamReader {
     pkt.buffer_size = static_cast<uint32_t>(size);
     if (pkt.buffer_size == 0) return false;
     pkt.buffer = new char[pkt.buffer_size];
-    stream_.read(reinterpret_cast<char*>(pkt.buffer), pkt.buffer_size);
+    stream_.read(reinterpret_cast<char*>(pkt.buffer), static_cast<const std::streamsize>(pkt.buffer_size));
     pkt.matroska_color_info = nullptr;
     // std::cout << "Type: " << type_ << "  \tPts: " << pkt.pts << "
     // \tduration: " << pkt.duration << "  \tsize: " << size << std::endl;
@@ -194,7 +194,7 @@ private:
     stream.read(reinterpret_cast<char*>(&size), sizeof(size));
     if (size == 0) return false;
     data = new char[size];
-    stream.read(data, size);
+    stream.read(data, static_cast<const std::streamsize>(size));
     stream.close();
     return true;
   }