VPLAY-13208 [VIPA] [Linear]- Progress Bar Point jumping to the End Wh…#1363
VPLAY-13208 [VIPA] [Linear]- Progress Bar Point jumping to the End Wh…#1363anjali-syna wants to merge 11 commits intodev_sprint_25_2from
Conversation
…ile performing Trick Play/Seek Reason for change: Progress Bar Point jumping to the end and playing from live play position while performing Trick Play/Seek in Linear channels. This issue is seen only in one platform. In the problematic scenario, aamp is receiving many underflows callbacks - GstPlayer_OnGstBufferUnderflowCb, from rialtomsevideosink0, due to which EOS flow is triggered from VideoDecoderPtsCheckerForEOS, as 'video-pts' property is not supported in RialtoMSEVideoSink. Changes: * Modifying aamp's underflow EOS implementation to fallback to gst_element_query_position, if 'video-pts' property is not supported. This stops the trick-play false-EOS, both VideoDecoderPtsCheckerForEOS and GstPlayer_OnGstBufferUnderflowCb compare real playback positions in the absence of video-pts property, so a mid-underflow position change prevents NotifyEOS() from firing. Test Procedure: Refer JIRA ticket Risks: low
…ile performing Trick Play/Seek Reason for change: Progress Bar Point jumping to the end and playing from live play position while performing Trick Play/Seek in Linear channels. This issue is seen only in one platform. In the problematic scenario, aamp is receiving many underflows callbacks - GstPlayer_OnGstBufferUnderflowCb, from rialtomsevideosink0, due to which EOS flow is triggered from VideoDecoderPtsCheckerForEOS, as 'video-pts' property is not supported in RialtoMSEVideoSink. Changes: * Modifying aamp's underflow EOS implementation to fallback to gst_element_query_position, if 'video-pts' property is not supported. This stops the trick-play false-EOS, both VideoDecoderPtsCheckerForEOS and GstPlayer_OnGstBufferUnderflowCb compare real playback positions in the absence of video-pts property, so a mid-underflow position change prevents NotifyEOS() from firing. Test Procedure: Refer JIRA ticket Risks: low
Signed-off-by: anjali-syna <206662904+anjali-syna@users.noreply.github.com>
| * | ||
| * @return Video PTS in nanoseconds, or -1 on error. | ||
| */ | ||
| long long SocInterface::GetVideoPts(GstElement *video_sink, GstElement *video_dec, bool isWesteros) |
There was a problem hiding this comment.
Did you consider std::optional for the method instead or returning -1 ? it would avoid the need of the magic -1
Might be too bigger change in the various call sites
| * Once probed against a non-NULL video sink/decoder, the result is | ||
| * reused for the lifetime of this SocInterface instance to avoid | ||
| * repeated g_object_class_find_property() calls on hot paths. */ | ||
| bool mVideoPtsPropertyChecked = false; |
There was a problem hiding this comment.
Do these need to be protected for thread safety ? Is it possible that the GST signal handling thread, and the AAMP player thread could access the method at same time ?
maybe:
std::once_flag mVideoPtsPropertyChecked
std::atomic mVideoPtsPropertySupported
| */ | ||
| bool SocInterface::IsVideoPtsPropertySupported(GstElement *element) | ||
| { | ||
| if(!mVideoPtsPropertyChecked) |
There was a problem hiding this comment.
with std::once_flag you could remove this check, and inside the scope of element
std::call_once(mVideoPtsPropertyChecked, lambda fn to find the property, set the supported flag, and log
| gint64 currentPTS = 0; | ||
| if(video_dec) | ||
| { | ||
| if(!IsVideoPtsPropertySupported(video_dec)) |
There was a problem hiding this comment.
This sequence is duplicated in both cpp files
If(!IsVideo..
g_object_get()
Is it worth moving into a protected helper in SicInterface.h
std::optional ReadVideoPts(GstElement *element); // null when no PTS
| * Fall back to gst_element_query_position and convert ms to 90 kHz | ||
| * ticks (1 ms = 90 ticks) so that callers relying on PTS units | ||
| * (90 kHz) keep working. */ | ||
| MW_LOG_INFO("InterfacePlayerRDK - 'video-pts' property is not supported on this platform; Fall back to gst_element_query_position"); |
There was a problem hiding this comment.
Could this flood the logs on a platform where video-pts isn't supported ?
There was a problem hiding this comment.
Modified it as TRACE.
| MW_LOG_INFO("InterfacePlayerRDK - 'video-pts' property is not supported on this platform; Fall back to gst_element_query_position"); | ||
| currentPTS = MPEG_PTS_TICKS_PER_MS * GetVideoPosition(); | ||
| } | ||
| return (long long)currentPTS; |
There was a problem hiding this comment.
existing code; modified now.
| } | ||
|
|
||
| MW_LOG_INFO("InterfacePlayerRDK: position(ms) = %" G_GINT64_FORMAT , GST_TIME_AS_MSECONDS(position)); | ||
| return (long long)(GST_TIME_AS_MSECONDS(position)); |
| * Used to convert a millisecond playback position into 90 kHz ticks | ||
| * when the 'video-pts' property is not exposed by the platform. | ||
| */ | ||
| static constexpr long long MPEG_PTS_TICKS_PER_MS = 90LL; |
There was a problem hiding this comment.
I'd be surprised if there isn't already a define for this somewhere ?
Would
inline constexpr
be better ?
| /* The 'video-pts' property is not exposed on this platform. | ||
| * Signal to the caller so it can fall back to | ||
| * gst_element_query_position. */ | ||
| return -1; |
There was a problem hiding this comment.
Can we avoid the early return, same with SocInterface
| if(!IsVideoPtsPropertySupported(video_dec)) | ||
| { | ||
| /* The 'video-pts' property is not exposed on this platform. | ||
| * Signal to the caller so it can fall back to |
There was a problem hiding this comment.
I'd remove this bit of the comment, as it assumes the caller's intention
| * | ||
| * @return true if 'video-pts' is exposed on the element, false otherwise. | ||
| */ | ||
| virtual bool IsVideoPtsPropertySupported(GstElement *element); |
There was a problem hiding this comment.
Should this alsobe marked as nodiscard ?
| } | ||
| bool SocInterface::IsVideoPtsPropertySupported(GstElement *element) | ||
| { | ||
| if(!mVideoPtsPropertyChecked) |
There was a problem hiding this comment.
Do we need all this logic in the fake? The same comment applies to SocInterface::GetVideoPts() fake. Ideally the fakes would contain no logic at all, although there is already logic in the existing ones :(
…ile performing Trick Play/Seek
Reason for change: Progress Bar Point jumping to the end and playing
from live play position while performing Trick Play/Seek in Linear channels.
This issue is seen only in one platform. In the problematic scenario,
aamp is receiving many underflows callbacks - GstPlayer_OnGstBufferUnderflowCb,
from rialtomsevideosink0, due to which EOS flow is triggered from
VideoDecoderPtsCheckerForEOS, as 'video-pts' property is not supported in
RialtoMSEVideoSink.
Changes:
Test Procedure: Refer JIRA ticket
Risks: low