Skip to content
Snippets Groups Projects
Commit 0bba87ef authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Adrien Béraud
Browse files

Revert "media_encoder: fixed unitTest"

This reverts commit 5d8d6252.

Reason for revert: <INSERT REASONING HERE>

Change-Id: I6bf7ed70695901cc9e115ea93155be720c71ee29
parent 9f191323
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,7 @@ private:
std::unique_ptr<MediaEncoder> encoder_;
std::unique_ptr<MediaIOHandle> ioHandle_;
std::vector<std::string> files_;
std::string cacheDir_;
};
CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(MediaEncoderTest, MediaEncoderTest::name());
......@@ -60,7 +61,8 @@ MediaEncoderTest::setUp()
DRing::init(DRing::InitFlag(DRing::DRING_FLAG_DEBUG | DRing::DRING_FLAG_CONSOLE_LOG));
libav_utils::ring_avcodec_init();
encoder_.reset(new MediaEncoder);
files_.push_back("test.mkv");
cacheDir_ = fileutils::get_cache_dir() + DIR_SEPARATOR_CH;
files_.push_back(cacheDir_ + "test.mkv");
}
void
......@@ -68,7 +70,7 @@ MediaEncoderTest::tearDown()
{
// clean up behind ourselves
for (const auto& file : files_)
fileutils::remove(file);
fileutils::remove(cacheDir_ + file);
DRing::fini();
}
......@@ -162,7 +164,8 @@ MediaEncoderTest::testMultiStream()
);
try {
encoder_->openFileOutput("test.mkv", options);
encoder_->openFileOutput(cacheDir_ + "test.mkv", options);
encoder_->setIOContext(ioHandle_);
int videoIdx = encoder_->addStream(*vp8Codec.get());
CPPUNIT_ASSERT(videoIdx >= 0);
CPPUNIT_ASSERT(encoder_->getStreamCount() == 1);
......@@ -170,8 +173,8 @@ MediaEncoderTest::testMultiStream()
CPPUNIT_ASSERT(audioIdx >= 0);
CPPUNIT_ASSERT(videoIdx != audioIdx);
CPPUNIT_ASSERT(encoder_->getStreamCount() == 2);
encoder_->setIOContext(ioHandle_);
encoder_->startIO();
int sentSamples = 0;
AVFrame* audio = nullptr;
AVFrame* video = nullptr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment