Skip to content

Commit 092ad05

Browse files
lashminthaVinish100
authored andcommitted
VPLAY-11143: AAMP mp4Demux Integration
Reason for change: Fix L1s with Mp4Demux Test Procedure: Test with useMp4Demux=true and validate all types of Linear, VOD content in all apps. Risks: Low Signed-off-by: lashmintha <[email protected]>
1 parent 72c6d26 commit 092ad05

16 files changed

+83
-5
lines changed

streamabstraction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#include "AampConfig.h"
4040
#include "SubtecFactory.hpp"
4141
#include "AampUtils.h"
42-
#include "AampMp4Demuxer.h"
42+
#include "mp4demux/AampMp4Demuxer.h"
4343

4444
// checks if current state is going to use IFRAME ( Fragment/Playlist )
4545
#define IS_FOR_IFRAME(rate, type) ((type == eTRACK_VIDEO) && (rate != AAMP_NORMAL_PLAY_RATE))

test/utests/fakes/FakeAampGstPlayer.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,3 +260,10 @@ void AAMPGstPlayer::NotifyInjectorToPause()
260260
void AAMPGstPlayer::NotifyInjectorToResume()
261261
{
262262
}
263+
void AAMPGstPlayer::SetStreamCaps(AampMediaType type, const AampCodecInfo &codecInfo)
264+
{
265+
}
266+
bool AAMPGstPlayer::SendSample(AampMediaType mediaType, AampMediaSample& sample)
267+
{
268+
return true;
269+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* If not stated otherwise in this file or this component's license file the
3+
* following copyright and licenses apply:
4+
*
5+
* Copyright 2025 RDK Management
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
20+
/**
21+
* @file FakeAampMp4Demuxer.cpp
22+
* @brief Implementation of Fake MP4 Demuxer for testing
23+
*
24+
* This file provides a simple fake implementation of AampMp4Demuxer for basic testing.
25+
* For more advanced testing scenarios, use the comprehensive fake in test/mocks/.
26+
*/
27+
28+
#include "mp4demux/AampMp4Demuxer.h"
29+
#include "AampLogManager.h"
30+
31+
/**
32+
* @brief Fake MP4 Demuxer constructor
33+
*/
34+
AampMp4Demuxer::AampMp4Demuxer(PrivateInstanceAAMP* aamp, AampMediaType type) :
35+
MediaProcessor(), mMp4Demux(nullptr), mAamp(aamp), mEnable(true), mMediaType(type)
36+
{
37+
AAMPLOG_INFO("FakeAampMp4Demuxer Constructor");
38+
// Don't create real Mp4Demux in fake - just set to nullptr
39+
}
40+
41+
/**
42+
* @brief Fake MP4 Demuxer destructor
43+
*/
44+
AampMp4Demuxer::~AampMp4Demuxer()
45+
{
46+
AAMPLOG_INFO("FakeAampMp4Demuxer Destructor");
47+
// No cleanup needed for fake
48+
}
49+
50+
bool AampMp4Demuxer::sendSegment(AampGrowableBuffer* pBuffer, double position, double duration,
51+
double fragmentPTSoffset, bool discontinuous, bool isInit,
52+
process_fcn_t processor, bool &ptsError)
53+
{
54+
ptsError = false;
55+
return true;
56+
}

test/utests/fakes/FakeFragmentCollector_MPD.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,4 +304,4 @@ void StreamAbstractionAAMP_MPD::clearFirstPTS(void)
304304
bool StreamAbstractionAAMP_MPD::ExtractAndAddSubtitleMediaHeader()
305305
{
306306
return false;
307-
}
307+
}

test/utests/mocks/MockStreamSink.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class MockStreamSink : public StreamSink
3333

3434
MOCK_METHOD(bool, Discontinuity, (AampMediaType));
3535

36+
MOCK_METHOD(bool, SendSample, (AampMediaType, AampMediaSample&));
37+
3638
};
3739

3840
#endif /* AAMP_MOCK_STREAM_SINK_H */

test/utests/tests/CacheFragmentTests/CacheFragmentTests.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ class MediaStreamContextTest : public ::testing::TestWithParam<TestParams>
151151
{eAAMPConfig_EnablePTSReStamp, false},
152152
{eAAMPConfig_LocalTSBEnabled, false},
153153
{eAAMPConfig_EnableIFrameTrackExtract, false},
154+
{eAAMPConfig_useRialtoSink, false},
155+
{eAAMPConfig_UseMp4Demux, false},
154156
{eAAMPConfig_EnableABR, true},
155157
};
156158

test/utests/tests/FragmentCollectorAdTests/AdSelectionTests.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ class AdSelectionTests : public ::testing::Test
323323
{eAAMPConfig_SuppressDecode, false},
324324
{eAAMPConfig_InterruptHandling, false},
325325
{eAAMPConfig_useRialtoSink, false},
326+
{eAAMPConfig_UseMp4Demux, false},
326327
};
327328

328329
BoolConfigSettings mBoolConfigSettings;

test/utests/tests/StreamAbstractionAAMP_MPD/AudioOnlyTests.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ class AudioOnlyTests : public ::testing::Test
9393
{eAAMPConfig_LocalTSBEnabled, false},
9494
{eAAMPConfig_EnableIFrameTrackExtract, false},
9595
{eAAMPConfig_useRialtoSink, false},
96+
{eAAMPConfig_UseMp4Demux, false},
9697
};
9798

9899
BoolConfigSettings mBoolConfigSettings;

test/utests/tests/StreamAbstractionAAMP_MPD/AudioTrackSelectionTests.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ class SelectAudioTrackTests : public ::testing::Test
9191
{eAAMPConfig_LocalTSBEnabled, false},
9292
{eAAMPConfig_EnableIFrameTrackExtract, false},
9393
{eAAMPConfig_useRialtoSink, false},
94+
{eAAMPConfig_UseMp4Demux, false},
9495
};
9596

9697
BoolConfigSettings mBoolConfigSettings;

test/utests/tests/StreamAbstractionAAMP_MPD/AudioTrackSwitchTests.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ class SwitchAudioTrackTests : public ::testing::Test
9292
{eAAMPConfig_LocalTSBEnabled, false},
9393
{eAAMPConfig_EnableIFrameTrackExtract, false},
9494
{eAAMPConfig_useRialtoSink, false},
95+
{eAAMPConfig_UseMp4Demux, false},
9596
};
9697

9798
BoolConfigSettings mBoolConfigSettings;

0 commit comments

Comments
 (0)