Skip to content

Commit 1702846

Browse files
committed
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 adbfd70 commit 1702846

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
@@ -133,7 +133,7 @@ firstTuneWithWesterosSinkOff(false),
133133
decodeErrorMsgTimeMS(0), decodeErrorCBCount(0),
134134
progressiveBufferingEnabled(false), progressiveBufferingStatus(false), forwardAudioBuffers(false),
135135
enableSEITimeCode(true), firstVideoFrameReceived(false), firstAudioFrameReceived(false), NumberOfTracks(0), playbackQuality{},
136-
filterAudioDemuxBuffers(false),
136+
filterAudioDemuxBuffers(false), mp4DemuxPlayback(false),
137137
aSyncControl(), syncControl(), callbackControl(), seekPosition(0)
138138
{
139139
memset(videoRectangle, '\0', VIDEO_COORDINATES_SIZE);
@@ -1491,6 +1491,9 @@ void InterfacePlayerRDK::Stop(bool keepLastFrame)
14911491
interfacePlayerPriv->gstPrivateContext->videoMuted = false;
14921492
interfacePlayerPriv->gstPrivateContext->subtitleMuted = false;
14931493
interfacePlayerPriv->gstPrivateContext->audioVolume = 1.0;
1494+
1495+
// Reset mp4demux playback semantic shim on pipeline event reset
1496+
interfacePlayerPriv->gstPrivateContext->mp4DemuxPlayback = false;
14941497
}
14951498

14961499
void InterfacePlayerRDK::ResetGstEvents()
@@ -1503,7 +1506,6 @@ void InterfacePlayerRDK::ResetGstEvents()
15031506
interfacePlayerPriv->gstPrivateContext->stream[i].eosReached = false;
15041507
interfacePlayerPriv->gstPrivateContext->stream[i].firstBufferProcessed = false;
15051508
}
1506-
15071509
}
15081510

15091511
void InterfacePlayerRDK::SetPendingSeek(bool state)
@@ -1664,7 +1666,7 @@ bool InterfacePlayerRDK::Flush(double position, int rate, bool shouldTearDown, b
16641666
playRate = rate;
16651667
}
16661668

1667-
if ((stream->format == GST_FORMAT_ISO_BMFF) && (eGST_MEDIAFORMAT_PROGRESSIVE != static_cast<GstMediaFormat>(m_gstConfigParam->media)))
1669+
if ((stream->format == GST_FORMAT_ISO_BMFF || interfacePlayerPriv->gstPrivateContext->mp4DemuxPlayback) && (eGST_MEDIAFORMAT_PROGRESSIVE != static_cast<GstMediaFormat>(m_gstConfigParam->media)))
16681670
{
16691671
if ((interfacePlayerPriv->socInterface->IsSimulatorSink() || interfacePlayerPriv->gstPrivateContext->usingRialtoSink) && rate != GST_NORMAL_PLAY_RATE)
16701672
{
@@ -2485,8 +2487,10 @@ void InterfacePlayerPriv::SendGstEvents(int mediaType, GstClockTime pts, int ena
24852487
}
24862488
stream->pendingSeek = false;
24872489
}
2488-
2489-
enableOverride = SendQtDemuxOverrideEvent(mediaType, pts, enablePTSReStamp, vodTrickModeFPS); //need to change to priv
2490+
if (!gstPrivateContext->mp4DemuxPlayback)
2491+
{
2492+
enableOverride = SendQtDemuxOverrideEvent(mediaType, pts, enablePTSReStamp, vodTrickModeFPS); //need to change to priv
2493+
}
24902494
GstMediaType type = static_cast<GstMediaType>(mediaType);
24912495

24922496
if (type == eGST_MEDIATYPE_VIDEO)
@@ -2509,7 +2513,7 @@ void InterfacePlayerPriv::SendGstEvents(int mediaType, GstClockTime pts, int ena
25092513
}
25102514
}
25112515

2512-
if (stream->format == GST_FORMAT_ISO_BMFF)
2516+
if (stream->format == GST_FORMAT_ISO_BMFF || gstPrivateContext->mp4DemuxPlayback)
25132517
{
25142518
// There is a possibility that only single protection event is queued for multiple type
25152519
// since they are encrypted using same id. Hence check if protection event is queued for
@@ -3256,7 +3260,7 @@ void InterfacePlayerPriv::SendNewSegmentEvent(int type, GstClockTime startPts ,G
32563260
{
32573261
GstMediaType mediaType = static_cast<GstMediaType>(type);
32583262
gst_media_stream* stream = &gstPrivateContext->stream[mediaType];
3259-
if (stream->format == GST_FORMAT_ISO_BMFF)
3263+
if (stream->format == GST_FORMAT_ISO_BMFF || gstPrivateContext->mp4DemuxPlayback)
32603264
{
32613265
GstSegment segment;
32623266
gst_segment_init(&segment, GST_FORMAT_TIME);
@@ -3633,7 +3637,7 @@ bool InterfacePlayerRDK::CheckDiscontinuity(int mediaType, int streamFormat , bo
36333637
else
36343638
{
36353639
MW_LOG_DEBUG("stream->format %d, stream->firstBufferProcessed %d", stream->format , stream->firstBufferProcessed);
3636-
if(m_gstConfigParam->enablePTSReStamp && (Format == GST_FORMAT_ISO_BMFF) && ( !codecChange ))
3640+
if(m_gstConfigParam->enablePTSReStamp && (Format == GST_FORMAT_ISO_BMFF || interfacePlayerPriv->gstPrivateContext->mp4DemuxPlayback) && ( !codecChange ))
36373641
{
36383642
unblockDiscProcess = true;
36393643
ret = true;
@@ -5353,9 +5357,9 @@ void InterfacePlayerRDK::SetStreamCaps(GstMediaType type, const CodecInfo &codec
53535357
{
53545358
GstCaps *caps = GetCaps(codecInfo.codecFormat);
53555359
gst_media_stream *stream = &interfacePlayerPriv->gstPrivateContext->stream[type];
5356-
// Hack to workaround different checks in InterfacePlayerRDK for format validity
5357-
// Especially in SendGstEvents() where its checked before sending protection events
5358-
stream->format = GST_FORMAT_ISO_BMFF;
5360+
stream->format = codecInfo.codecFormat;
5361+
interfacePlayerPriv->gstPrivateContext->mp4DemuxPlayback = true;
5362+
MW_LOG_MIL("SetStreamCaps: mp4DemuxPlayback enabled for type=%d codec format=%d stream format=%d", (int)type, codecInfo.codecFormat, stream->format);
53595363
if (caps)
53605364
{
53615365
// Append some additional info to caps

priv_aamp.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14112,6 +14112,22 @@ void PrivateInstanceAAMP::GetStreamFormat(StreamOutputFormat &primaryOutputForma
1411214112
void PrivateInstanceAAMP::SetStreamCaps(AampMediaType type, AampCodecInfo &&codecInfo)
1411314113
{
1411414114
StreamSink *sink = AampStreamSinkManager::GetInstance().GetStreamSink(this);
14115+
switch (type)
14116+
{
14117+
case eMEDIATYPE_VIDEO:
14118+
mVideoFormat = static_cast<StreamOutputFormat>(codecInfo.mCodecFormat);
14119+
break;
14120+
case eMEDIATYPE_AUDIO:
14121+
mAudioFormat = static_cast<StreamOutputFormat>(codecInfo.mCodecFormat);
14122+
break;
14123+
case eMEDIATYPE_AUX_AUDIO:
14124+
// Explicitly mark aux path invalid unless actively configured
14125+
mAuxFormat = FORMAT_INVALID;
14126+
break;
14127+
default:
14128+
break;
14129+
}
14130+
AAMPLOG_INFO("SetStreamCaps: updated formats mVideoFormat=%d mAudioFormat=%d mAuxFormat=%d", mVideoFormat, mAudioFormat, mAuxFormat);
1411514131
if (sink)
1411614132
{
1411714133
sink->SetStreamCaps(type, std::move(codecInfo));

streamabstraction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4130,7 +4130,7 @@ void StreamAbstractionAAMP::InitializeMediaProcessor(bool passThroughMode)
41304130
}
41314131
else
41324132
{
4133-
track->playContext = std::make_shared<ElementaryProcessor>(aamp);
4133+
track->playContext = nullptr;
41344134
}
41354135
}
41364136
}

0 commit comments

Comments
 (0)