<s> import gi <EOL> gi . require_version ( '<STR_LIT>' , '<STR_LIT:1.0>' ) <EOL> from gi . repository import GObject , Gst <EOL> GObject . threads_init ( ) <EOL> Gst . init ( None ) <EOL> appsrc = Gst . ElementFactory . make ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> filesink = Gst . ElementFactory . make ( "<STR_LIT>" , "<STR_LIT>" ) <EOL> filesink . set_property ( "<STR_LIT:location>" , "<STR_LIT>" ) <EOL> pipeline = Gst . Pipeline ( ) <EOL> pipeline . add ( appsrc ) <EOL> pipeline . add ( filesink ) <EOL> appsrc . link ( filesink ) <EOL> pipeline . set_state ( Gst . State . PLAYING ) <EOL> data = "<STR_LIT>" * <NUM_LIT:12> <EOL> print "<STR_LIT>" % data <EOL> buf = Gst . Buffer . new_allocate ( None , len ( data ) , None ) <EOL> buf . fill ( <NUM_LIT:0> , data ) <EOL> appsrc . emit ( "<STR_LIT>" , buf ) <EOL> pipeline . send_event ( Gst . Event . new_eos ( ) ) <EOL> result = open ( "<STR_LIT>" ) . read ( ) <EOL> print "<STR_LIT>" % result </s>
