コード例 #1
0
ファイル: source.py プロジェクト: zenny/obs-python
def register():
    #print(os.getcwd())
    #print(src)
    src = libobs.obs_source_info()
    print(src)
    print (src.id)
    src.create = MySource.create
    src.video_render = MySource.render
    src.video_tick = MySource.tick
    src.get_height = MySource.get_height
    src.get_width = MySource.get_width
    src.destroy = MySource.destroy
#    src.get_properties = MySource.get_properties
    
    libobs.obs_register_source(src)
    libobs.blog("###################################################################")
    print ("Registered MySource")
コード例 #2
0
ファイル: source.py プロジェクト: zenny/obs-python
 def render(self,effect):
     libobs.blog("render")
     rand = randint(0,255)
     self.SetColour(rand,
                    rand,
                    rand,
                    255)
     try:
         libobs.obs_enter_graphics()
         libobs.gs_texture_set_image(self.tex,self.pixelbuffer,self.width*self.bpp,False)
         libobs.gs_reset_blend_state()
         param = libobs.gs_effect_get_param_by_name(effect,"image")        
         libobs.gs_effect_set_texture(param,self.tex)
         libobs.gs_draw_sprite(self.tex,0,self.width,self.height)
     except:
         pass
     finally:
         libobs.obs_leave_graphics()
     print(param)
     print("render")
     pass
コード例 #3
0
def obslog(lvl, msg):
    obs.blog(lvl, "BROWSER_SOURCE_SCRIPT: " + msg)