MCPcopy Create free account
hub / github.com/cinder/Cinder / load

Method load

src/cinder/linux/GstPlayer.cpp:692–731  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

690}
691
692void GstPlayer::load( const std::string& path )
693{
694 // If we are already using a custom pipeline we have to reset for now.
695 if( mUsingCustomPipeline ) {
696 resetCustomPipeline();
697 }
698
699 // Construct and link the elements of our pipeline if this is our first run..
700 if( ! mGstData.pipeline ) {
701 constructPipeline();
702 }
703
704 // Prepare for (re)loading....
705 setPipelineState( GST_STATE_READY );
706
707 // Reset the buffers after we have reached GST_STATE_READY.
708 resetVideoBuffers();
709
710 std::string uriPath;
711 if( path.find( "://", 0 ) == std::string::npos ) {
712 GError* err = nullptr;
713 gchar* uri = gst_filename_to_uri( path.c_str(), &err );
714 uriPath = std::string( static_cast<const char*>( uri ) );
715 g_free( uri );
716 if( err ) {
717 g_free( err );
718 }
719 mGstData.isStream = false;
720 }
721 else {
722 mGstData.isStream = true;
723 }
724
725 // set the new movie path
726 const gchar* uri = ( ! uriPath.empty() ) ? uriPath.c_str() : path.c_str();
727 g_object_set( G_OBJECT ( mGstData.pipeline ), "uri", uri, nullptr );
728
729 // and preroll.
730 setPipelineState( GST_STATE_PAUSED );
731}
732
733void GstPlayer::play()
734{

Callers 10

scheduleEventMethod · 0.45
findEndTimeAndValueMethod · 0.45
setLoopBeginMethod · 0.45
setLoopEndMethod · 0.45
processMethod · 0.45
readImplMethod · 0.45
initFromUrlMethod · 0.45
initFromPathMethod · 0.45
createCvPixelBufferFunction · 0.45
createGWorldFunction · 0.45

Calls 4

stringFunction · 0.85
findMethod · 0.45
c_strMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected