#NEWLINE# def parse_url( url ) : #NEWLINE# #INDENT# protocol = ffi . new ( 'int*' ) #NEWLINE# hostname = AVal ( '' ) #NEWLINE# port = ffi . new ( 'unsigned int*' ) #NEWLINE# playpath = AVal ( '' ) #NEWLINE# app = AVal ( '' ) #NEWLINE# res = librtmp . RTMP_ParseURL ( bytes ( url , 'utf8' ) , protocol , hostname . aval , port , playpath . aval , app . aval ) #NEWLINE# if ( res < 1 ) : #NEWLINE# #INDENT# result = RTMPURL ( 0 , '' , 0 , '' , '' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# result = RTMPURL ( protocol [ 0 ] , str ( hostname . value , 'utf8' ) , port [ 0 ] , str ( playpath . value , 'utf8' ) , str ( app . value , 'utf8' ) ) #NEWLINE# #UNINDENT# return result