Upgrade to Pro — share decks privately, control downloads, hide ads and more …

OBSのプラグイン作ってみた

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.

 OBSのプラグイン作ってみた

社内LTでOpen Broadcast Softwareのプラグインを作成してみたことを発表しました。

Avatar for Soichiro Yoshimura

Soichiro Yoshimura

August 15, 2014
Tweet

More Decks by Soichiro Yoshimura

Other Decks in Technology

Transcript

  1. OBSとは C++で書かれていて でホストされている オープンソースな生放送配信ツール github H264 ACCの配信、録画 Intel のQuick Sync

    Videoに対応しており高速 シーンや映像ソースの切替やレイアウトが自由 デフォルトで、Twitch, Youtubeなどの有名サービスに連携配信(連携はない けどニコ生でも利用は可) 様々なエンジンで動くゲームのウインドウのキャプチャに対応 プラグイン機能
  2. だがここ最近、ScalaとRubyという記述量が少ない 言語しか触ってなくて読む量が多くなるC++がキツ かった... / / - - - - -

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - / / l o g w i n d o w x = ( f u l l s c r e e n X / 2 ) - ( 6 0 0 / 2 ) ; y = ( f u l l s c r e e n Y / 2 ) - ( 5 0 0 / 2 ) ; i n t l o g P o s X = G l o b a l C o n f i g - > G e t I n t ( T E X T ( " G e n e r a l " ) , T E X T ( " L o g P o s X " ) , - 9 9 9 9 ) ; i n t l o g P o s Y = G l o b a l C o n f i g - > G e t I n t ( T E X T ( " G e n e r a l " ) , T E X T ( " L o g P o s Y " ) , - 9 9 9 9 ) ; i n t l o g S i z e X = G l o b a l C o n f i g - > G e t I n t ( T E X T ( " G e n e r a l " ) , T E X T ( " L o g S i z e X " ) , 6 0 0 ) ; i n t l o g S i z e Y = G l o b a l C o n f i g - > G e t I n t ( T E X T ( " G e n e r a l " ) , T E X T ( " L o g S i z e Y " ) , 5 0 0 ) ; b I n s i d e M o n i t o r s = f a l s e ; f o r ( U I N T i = 0 ; i < m o n i t o r s . n u m ( ) ; i + + ) = " " { = " " i f ( = " " l o g p o s x = " " > = m o n i t o r s [ i ] . r e c t . l e f t & & l o g P o s X < m o n i t o r s [ i ] . r e c l o g P o s Y > = m o n i t o r s [ i ] . r e c t . t o p & & l o g P o s Y < m o n i t o r s [ i ] . r e c t . b o t t o m ) { b I n s i d e M o n i t o r s = t r u e ; b r e a k ; } } < / m o n i t o r s . n u m ( ) ; >
  3. ログが出力されて設定画面だけが表示されるプラ グインを作った c l a s s M y S

    e t t t i n g P a n e l : A b s t r a c t W P F S e t t i n g s P a n e { p u b l i c o v e r r i d e s t r i n g C a t e g o r y { g e t { r e t u r n " ニコニコ生放送" ; } } p u b l i c o v e r r i d e b o o l H a s D e f a u l t s ( ) { r e t u r n f a l s e ; } p u b l i c o v e r r i d e v o i d S e t D e f a u l t s ( ) { t h r o w n e w N o t I m p l e m e n t e d E x c e p t i o n ( ) ; } }