Commit eae999f6 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen
Browse files

MediaPlayer: Expose libvlc_media_player_select_tracks

parent 95598551
......@@ -136,6 +136,13 @@ int main(int ac, char** av)
std::this_thread::sleep_for( std::chrono::milliseconds(500) );
#if LIBVLC_VERSION_INT >= LIBVLC_VERSION(4, 0, 0, 0)
auto tracks = mp.tracks( VLC::MediaTrack::Type::Video );
std::cout << "Got " << tracks.size() << " tracks" << std::endl;
mp.selectTracks( VLC::MediaTrack::Type::Video, tracks );
std::this_thread::sleep_for( std::chrono::milliseconds(1000) );
#endif
// Showing that copying an object shares the associated eventmanager
auto mp2 = mp;
expected = true;
......
......@@ -1859,6 +1859,17 @@ public:
return res;
}
void selectTracks( MediaTrack::Type type, const std::vector<MediaTrack>& tracks )
{
std::vector<const libvlc_media_track_t*> ctracks{};
ctracks.reserve( tracks.size() );
for ( const auto& mt : tracks )
ctracks.push_back( mt.get() );
libvlc_media_player_select_tracks( *this,
static_cast<libvlc_track_type_t>( type ),
ctracks.data(),
ctracks.size() );
}
#endif
private:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment