Skip to content

Commit 8303f3b

Browse files
varshnieLashminthaJ
authored andcommitted
VPLAY-11143: AAMP mp4Demux Integration
Reason for change:Removed isobmff format setting hack Procedure: As mentioned in the ticket Risks: Low Signed-off-by: varshnie <[email protected]>
1 parent d410907 commit 8303f3b

File tree

4 files changed

+33
-12
lines changed

4 files changed

+33
-12
lines changed

middleware/InterfacePlayerPriv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ struct GstPlayerPriv
227227
bool firstAudioFrameReceived; /**< flag that denotes if first audio frame was notified */
228228
int NumberOfTracks; /**< Indicates the number of tracks */
229229
GstPlaybackQualityStruct playbackQuality; /**< video playback quality info */
230+
bool mp4DemuxPlayback; /**< flag to denote mp4demux path needs BMFF-like semantics */
230231
struct CallbackData
231232
{
232233
gpointer instance;

middleware/InterfacePlayerRDK.cpp

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ firstTuneWithWesterosSinkOff(false),
135135
decodeErrorMsgTimeMS(0), decodeErrorCBCount(0),
136136
progressiveBufferingEnabled(false), progressiveBufferingStatus(false), forwardAudioBuffers(false),
137137
enableSEITimeCode(true), firstVideoFrameReceived(false), firstAudioFrameReceived(false), NumberOfTracks(0), playbackQuality{},
138-
filterAudioDemuxBuffers(false),
138+
filterAudioDemuxBuffers(false), mp4DemuxPlayback(false),
139139
aSyncControl(), syncControl(), callbackControl(), seekPosition(0)
140140
{
141141
memset(videoRectangle, '\0', VIDEO_COORDINATES_SIZE);
@@ -1493,6 +1493,9 @@ void InterfacePlayerRDK::Stop(bool keepLastFrame)
14931493
interfacePlayerPriv->gstPrivateContext->videoMuted = false;
14941494
interfacePlayerPriv->gstPrivateContext->subtitleMuted = false;
14951495
interfacePlayerPriv->gstPrivateContext->audioVolume = 1.0;
1496+
1497+
// Reset mp4demux playback semantic shim on pipeline event reset
1498+
interfacePlayerPriv->gstPrivateContext->mp4DemuxPlayback = false;
14961499
}
14971500

14981501
void InterfacePlayerRDK::ResetGstEvents()
@@ -1505,7 +1508,6 @@ void InterfacePlayerRDK::ResetGstEvents()
15051508
interfacePlayerPriv->gstPrivateContext->stream[i].eosReached = false;
15061509
interfacePlayerPriv->gstPrivateContext->stream[i].firstBufferProcessed = false;
15071510
}
1508-
15091511
}
15101512

15111513
void InterfacePlayerRDK::SetPendingSeek(bool state)
@@ -1666,7 +1668,7 @@ bool InterfacePlayerRDK::Flush(double position, int rate, bool shouldTearDown, b
16661668
playRate = rate;
16671669
}
16681670

1669-
if ((stream->format == GST_FORMAT_ISO_BMFF) && (eGST_MEDIAFORMAT_PROGRESSIVE != static_cast<GstMediaFormat>(m_gstConfigParam->media)))
1671+
if ((stream->format == GST_FORMAT_ISO_BMFF || interfacePlayerPriv->gstPrivateContext->mp4DemuxPlayback) && (eGST_MEDIAFORMAT_PROGRESSIVE != static_cast<GstMediaFormat>(m_gstConfigParam->media)))
16701672
{
16711673
if ((interfacePlayerPriv->socInterface->IsSimulatorSink() || interfacePlayerPriv->gstPrivateContext->usingRialtoSink) && rate != GST_NORMAL_PLAY_RATE)
16721674
{
@@ -2487,8 +2489,10 @@ void InterfacePlayerPriv::SendGstEvents(int mediaType, GstClockTime pts, int ena
24872489
}
24882490
stream->pendingSeek = false;
24892491
}
2490-
2491-
enableOverride = SendQtDemuxOverrideEvent(mediaType, pts, enablePTSReStamp, vodTrickModeFPS); //need to change to priv
2492+
if (!gstPrivateContext->mp4DemuxPlayback)
2493+
{
2494+
enableOverride = SendQtDemuxOverrideEvent(mediaType, pts, enablePTSReStamp, vodTrickModeFPS); //need to change to priv
2495+
}
24922496
GstMediaType type = static_cast<GstMediaType>(mediaType);
24932497

24942498
if (type == eGST_MEDIATYPE_VIDEO)
@@ -2511,7 +2515,7 @@ void InterfacePlayerPriv::SendGstEvents(int mediaType, GstClockTime pts, int ena
25112515
}
25122516
}
25132517

2514-
if (stream->format == GST_FORMAT_ISO_BMFF)
2518+
if (stream->format == GST_FORMAT_ISO_BMFF || gstPrivateContext->mp4DemuxPlayback)
25152519
{
25162520
// There is a possibility that only single protection event is queued for multiple type
25172521
// since they are encrypted using same id. Hence check if protection event is queued for
@@ -3258,7 +3262,7 @@ void InterfacePlayerPriv::SendNewSegmentEvent(int type, GstClockTime startPts ,G
32583262
{
32593263
GstMediaType mediaType = static_cast<GstMediaType>(type);
32603264
gst_media_stream* stream = &gstPrivateContext->stream[mediaType];
3261-
if (stream->format == GST_FORMAT_ISO_BMFF)
3265+
if (stream->format == GST_FORMAT_ISO_BMFF || gstPrivateContext->mp4DemuxPlayback)
32623266
{
32633267
GstSegment segment;
32643268
gst_segment_init(&segment, GST_FORMAT_TIME);
@@ -3635,7 +3639,7 @@ bool InterfacePlayerRDK::CheckDiscontinuity(int mediaType, int streamFormat , bo
36353639
else
36363640
{
36373641
MW_LOG_DEBUG("stream->format %d, stream->firstBufferProcessed %d", stream->format , stream->firstBufferProcessed);
3638-
if(m_gstConfigParam->enablePTSReStamp && (Format == GST_FORMAT_ISO_BMFF) && ( !codecChange ))
3642+
if(m_gstConfigParam->enablePTSReStamp && (Format == GST_FORMAT_ISO_BMFF || interfacePlayerPriv->gstPrivateContext->mp4DemuxPlayback) && ( !codecChange ))
36393643
{
36403644
unblockDiscProcess = true;
36413645
ret = true;
@@ -5355,9 +5359,9 @@ void InterfacePlayerRDK::SetStreamCaps(GstMediaType type, const CodecInfo &codec
53555359
{
53565360
GstCaps *caps = GetCaps(codecInfo.codecFormat);
53575361
gst_media_stream *stream = &interfacePlayerPriv->gstPrivateContext->stream[type];
5358-
// Hack to workaround different checks in InterfacePlayerRDK for format validity
5359-
// Especially in SendGstEvents() where its checked before sending protection events
5360-
stream->format = GST_FORMAT_ISO_BMFF;
5362+
stream->format = codecInfo.codecFormat;
5363+
interfacePlayerPriv->gstPrivateContext->mp4DemuxPlayback = true;
5364+
MW_LOG_MIL("SetStreamCaps: mp4DemuxPlayback enabled for type=%d codec format=%d stream format=%d", (int)type, codecInfo.codecFormat, stream->format);
53615365
if (caps)
53625366
{
53635367
// Append some additional info to caps

priv_aamp.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14137,6 +14137,22 @@ void PrivateInstanceAAMP::GetStreamFormat(StreamOutputFormat &primaryOutputForma
1413714137
void PrivateInstanceAAMP::SetStreamCaps(AampMediaType type, AampCodecInfo &&codecInfo)
1413814138
{
1413914139
StreamSink *sink = AampStreamSinkManager::GetInstance().GetStreamSink(this);
14140+
switch (type)
14141+
{
14142+
case eMEDIATYPE_VIDEO:
14143+
mVideoFormat = static_cast<StreamOutputFormat>(codecInfo.mCodecFormat);
14144+
break;
14145+
case eMEDIATYPE_AUDIO:
14146+
mAudioFormat = static_cast<StreamOutputFormat>(codecInfo.mCodecFormat);
14147+
break;
14148+
case eMEDIATYPE_AUX_AUDIO:
14149+
// Explicitly mark aux path invalid unless actively configured
14150+
mAuxFormat = FORMAT_INVALID;
14151+
break;
14152+
default:
14153+
break;
14154+
}
14155+
AAMPLOG_INFO("SetStreamCaps: updated formats mVideoFormat=%d mAudioFormat=%d mAuxFormat=%d", mVideoFormat, mAudioFormat, mAuxFormat);
1414014156
if (sink)
1414114157
{
1414214158
sink->SetStreamCaps(type, std::move(codecInfo));

streamabstraction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4160,7 +4160,7 @@ void StreamAbstractionAAMP::InitializeMediaProcessor(bool passThroughMode)
41604160
}
41614161
else
41624162
{
4163-
track->playContext = std::make_shared<ElementaryProcessor>(aamp);
4163+
track->playContext = nullptr;
41644164
}
41654165
}
41664166
}

0 commit comments

Comments
 (0)