本文整理汇总了C++中Player::AddSink方法的典型用法代码示例。如果您正苦于以下问题:C++ Player::AddSink方法的具体用法?C++ Player::AddSink怎么用?C++ Player::AddSink使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Player
的用法示例。
在下文中一共展示了Player::AddSink方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: in_file
TEST(PlayerTestTagsTest, tags_returned) {
ifstream in_file("./test/testdata/player_unittest_tags_expected.txt");
ASSERT_TRUE(in_file.good()) << "TESTING CODE FAILED... could not load data";
FileSrc *src = new FileSrc("./test/testdata/player_unittest_file.aac");
FakeSink *sink = new FakeSink();
map<const string, string> temp;
map<const string, string>::iterator it;
Player *player = new Player(src);
player->AddSink(sink);
player->RegisterTagsMapCallback(SaveTags, &temp);
player->Process();
string line;
while(getline(in_file, line)) {
it = temp.find(line);
ASSERT_TRUE(it != temp.end());
getline(in_file, line);
EXPECT_FALSE(line.compare(it->second));
}
delete player;
delete sink;
delete src;
}
示例2: FileSrc
TEST(PlayerTestAddSink, incrementation_of_sink_pads) {
FileSrc *src = new FileSrc("./test/testdata/player_unittest_file.aac");
FakeSink *sink1 = new FakeSink();
FakeSink *sink2 = new FakeSink();
FakeSink *sink3 = new FakeSink();
uint32_t result = 3;
Player *player = new Player(src);
EXPECT_EQ(sink1, player->AddSink(sink1));
EXPECT_EQ(sink2, player->AddSink(sink2));
EXPECT_EQ(sink3, player->AddSink(sink3));
EXPECT_EQ(result, sink1->num_src_pads());
delete player;
delete sink1;
delete sink2;
delete sink3;
delete src;
}
示例3: main
int main() {
FileSrc *src = new FileSrc("./test/testdata/player_unittest_file.aac");
OggSink *sink = new OggSink("./test/testdata/player_unittest_file.ogg");
Player *player = new Player(src);
player->AddSink(sink);
player->Process();
delete player;
delete src;
delete sink;
}
示例4: RingSrc
TEST(RingSrcTestIncrementRatio, incrementation_of_ratio) {
RingSrc *src = new RingSrc(0.2, 100);
FakeSink *sink = new FakeSink();
Player *player = new Player(src);
player->AddSink(sink);
src->IncrementRatio(player);
EXPECT_GT(sink->playback_speed(), 1.0);
delete player;
delete sink;
delete src;
}
示例5: in_file_er
TEST(PlayerTestOggTest, save_to_ogg_test) {
remove("./test/testdata/player_unittest_file_expected_results.ogg");
system("gst-launch-1.0 filesrc location=./test/testdata/player_unittest_file.aac \
! id3demux \
! aacparse \
! faad \
! audioconvert \
! pitch \
! vorbisenc \
! oggmux \
! filesink location=./test/testdata/player_unittest_file_expected_results.ogg \
1>/dev/null");
uint32_t size_er;
uint32_t size_r;
FileSrc *src = new FileSrc("./test/testdata/player_unittest_file.aac");
OggSink *sink = new OggSink("./test/testdata/player_unittest_file.ogg");
remove("./test/testdata/player_unittest_file.ogg");
Player *player = new Player(src);
player->AddSink(sink);
player->Process();
ifstream in_file_er("./test/testdata/player_unittest_file_expected_results.ogg", ifstream::binary);
ASSERT_TRUE(in_file_er.good()) << "TESTING CODE FAILED... could not load expected data";
ifstream in_file_r("./test/testdata/player_unittest_file.ogg", ifstream::binary);
ASSERT_TRUE(in_file_r.good()) << "TESTING CODE FAILED... could not load data";
in_file_er.seekg(0, ios::end);
size_er = in_file_er.tellg();
in_file_er.close();
in_file_r.seekg(0, ios::end);
size_r = in_file_r.tellg();
in_file_r.close();
ASSERT_EQ(size_er, size_r) << "TESTING CODE FAILED... file size mismatch";
delete player;
delete sink;
delete src;
}