Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion InterfacePlayerPriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "InterfacePlayerRDK.h"
#include "GstUtils.h"

#define GST_ELEMENT_GET_STATE_RETRY_CNT_MAX 5
#define GST_ELEMENT_GET_STATE_RETRY_CNT_MAX 10
#define GST_TRACK_COUNT 3 /**< internal use - audio+video+sub track */
#define VIDEO_COORDINATES_SIZE 32
#define GST_TASK_ID_INVALID 0
Expand Down
25 changes: 22 additions & 3 deletions InterfacePlayerRDK.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1581,7 +1581,7 @@ bool InterfacePlayerRDK::IsUsingRialtoSink()
/**
* @brief Flush cached GstBuffers and set seek position & rate
*/
bool InterfacePlayerRDK::Flush(double position, int rate, bool shouldTearDown, bool isAppSeek)
bool InterfacePlayerRDK::Flush(double position, int rate, bool shouldTearDown, bool isAppSeek, bool keepPausedSeek)
{
Comment thread
rekhap2kandhavelan marked this conversation as resolved.
Comment on lines 1581 to 1585
GstState aud_current;
Comment on lines +1584 to 1586
GstState aud_pending;
Expand Down Expand Up @@ -1634,6 +1634,7 @@ bool InterfacePlayerRDK::Flush(double position, int rate, bool shouldTearDown, b
}
GstStateChangeReturn ret;
ret = gst_element_get_state(interfacePlayerPriv->gstPrivateContext->pipeline, &current, &pending, 100 * GST_MSECOND);

if ((current != GST_STATE_PLAYING && current != GST_STATE_PAUSED) || ret == GST_STATE_CHANGE_FAILURE)
{
MW_LOG_WARN("InterfacePlayerRDK: Pipeline state %s, ret %u", gst_element_state_get_name(current), ret);
Expand Down Expand Up @@ -3432,6 +3433,22 @@ bool InterfacePlayerRDK::Pause(bool pause , bool forceStopGstreamerPreBuffering)
*/
interfacePlayerPriv->gstPrivateContext->buffering_in_progress = false;
}

if (GST_STATE_PLAYING == nextState)
{
GstState curState, pendState;
if (GST_STATE_CHANGE_ASYNC ==
gst_element_get_state(interfacePlayerPriv->gstPrivateContext->pipeline,
&curState, &pendState, 0))
{
MW_LOG_WARN("InterfacePlayerRDK_Pause: resume during in-flight transition "
"(current=%s pending=%s) - settling before PLAYING",
gst_element_state_get_name(curState),
gst_element_state_get_name(pendState));
gst_element_get_state(interfacePlayerPriv->gstPrivateContext->pipeline,
&curState, &pendState, 300 * GST_MSECOND);
}
}

GstStateChangeReturn rc = SetStateWithWarnings(interfacePlayerPriv->gstPrivateContext->pipeline, nextState);
if (GST_STATE_CHANGE_ASYNC == rc)
Expand All @@ -3441,12 +3458,14 @@ bool InterfacePlayerRDK::Pause(bool pause , bool forceStopGstreamerPreBuffering)
/* wait a bit longer for the state change to conclude */
if (nextState != validateStateWithMsTimeout(this,nextState, 100))
{
MW_LOG_ERR("InterfacePlayerRDK_Pause - validateStateWithMsTimeout - FAILED GstState %d", nextState);
MW_LOG_ERR("InterfacePlayerRDK_Pause - validateStateWithMsTimeout - FAILED GstState %d ret-false", nextState);
retValue = false;
}
}
else if (GST_STATE_CHANGE_SUCCESS != rc)
{
MW_LOG_ERR("InterfacePlayerRDK_Pause - gst_element_set_state - FAILED rc %d", rc);
MW_LOG_ERR("InterfacePlayerRDK_Pause - gst_element_set_state - FAILED rc %d ret-false", rc);
retValue = false;
}

interfacePlayerPriv->gstPrivateContext->buffering_target_state = nextState;
Expand Down
3 changes: 2 additions & 1 deletion InterfacePlayerRDK.h
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,9 @@ class InterfacePlayerRDK
* @param[in] shouldTearDown Whether to tear down the pipeline.
* @param[in] GstState The desired GStreamer pipeline state.
* @param[in] gstMediaFormat The media format for the pipeline.
* @param[in] keepPausedSeek true only for an explicit seek-with-keepPaused request
*/
bool Flush(double position, int rate, bool shouldTearDown, bool isAppSeek);
bool Flush(double position, int rate, bool shouldTearDown, bool isAppSeek, bool keepPausedSeek);
Comment thread
rekhap2kandhavelan marked this conversation as resolved.
Comment on lines 717 to +721
/**
* @fn TimerAdd
* @param[in] funcPtr function to execute on timer expiry
Expand Down