Transcoder: Add HDR -> SDR unit test using sample plugin.
This commits adds a unit test that force enables loading
sample HDR plugin loading and tries to transcode and HDR10
video. If the codec supports the conversion the test checks
that the transcoded video is SDR. If the codec does not
support the conversion the test checks that transcoding
returns unsupported.
Bug: 180011717
Test: atest HdrTranscodeTests
Change-Id: I9cb26589d320744670b619faa4b35ce5c0541e91
diff --git a/media/libmediatranscoding/transcoder/tests/VideoTrackTranscoderTests.cpp b/media/libmediatranscoding/transcoder/tests/VideoTrackTranscoderTests.cpp
index 4ede97f..1f9ec77 100644
--- a/media/libmediatranscoding/transcoder/tests/VideoTrackTranscoderTests.cpp
+++ b/media/libmediatranscoding/transcoder/tests/VideoTrackTranscoderTests.cpp
@@ -27,7 +27,7 @@
#include <media/VideoTrackTranscoder.h>
#include <utils/Timers.h>
-#include "TrackTranscoderTestUtils.h"
+#include "TranscoderTestUtils.h"
namespace android {
@@ -94,7 +94,7 @@
TEST_F(VideoTrackTranscoderTests, SampleSoundness) {
LOG(DEBUG) << "Testing SampleSoundness";
- std::shared_ptr<TestCallback> callback = std::make_shared<TestCallback>();
+ auto callback = std::make_shared<TestTrackTranscoderCallback>();
auto transcoder = VideoTrackTranscoder::create(callback);
EXPECT_EQ(mMediaSampleReader->selectTrack(mTrackIndex), AMEDIA_OK);
@@ -139,7 +139,7 @@
TEST_F(VideoTrackTranscoderTests, PreserveBitrate) {
LOG(DEBUG) << "Testing PreserveBitrate";
- std::shared_ptr<TestCallback> callback = std::make_shared<TestCallback>();
+ auto callback = std::make_shared<TestTrackTranscoderCallback>();
std::shared_ptr<MediaTrackTranscoder> transcoder = VideoTrackTranscoder::create(callback);
auto destFormat = TrackTranscoderTestUtils::getDefaultVideoDestinationFormat(
@@ -171,7 +171,7 @@
// VideoTrackTranscoder needs a valid destination format.
TEST_F(VideoTrackTranscoderTests, NullDestinationFormat) {
LOG(DEBUG) << "Testing NullDestinationFormat";
- std::shared_ptr<TestCallback> callback = std::make_shared<TestCallback>();
+ auto callback = std::make_shared<TestTrackTranscoderCallback>();
std::shared_ptr<AMediaFormat> nullFormat;
auto transcoder = VideoTrackTranscoder::create(callback);
@@ -181,7 +181,7 @@
TEST_F(VideoTrackTranscoderTests, LingeringEncoder) {
OneShotSemaphore semaphore;
- auto callback = std::make_shared<TestCallback>();
+ auto callback = std::make_shared<TestTrackTranscoderCallback>();
auto transcoder = VideoTrackTranscoder::create(callback);
EXPECT_EQ(mMediaSampleReader->selectTrack(mTrackIndex), AMEDIA_OK);