<commit_before>#!/usr/bin/python3
import logging
from gi.repository import Gst
from enum import Enum

from lib.config import Config

class CompositeModes(Enum):
	fullscreen = 0
	side_by_side_equal = 1
	side_by_side_preview = 2
	picture_in_picture = 3

class PadState(object):
	noScaleCaps = Gst.Caps.from_string('video/x-raw')

	def __init__(self):
		self.reset()

	def reset(self):
		self.alpha = 1.0
		self.xpos = 0
		self.ypos = 0
		self.zorder = 1
		self.scaleCaps = PadState.noScaleCaps

class VideoMix(object):
	log = logging.getLogger('VideoMix')

	def __init__(self):
		self.caps = Config.get('mix', 'videocaps')

		self.names = Config.getlist('mix', 'sources')
		self.log.info('Configuring Mixer for %u Sources', len(self.names))

		pipeline = """
			videomixer name=mix !<commit_msg>use compositor, the new videomixer!<commit_after>#!/usr/bin/python3
import logging
from gi.repository import Gst
from enum import Enum

from lib.config import Config

class CompositeModes(Enum):
	fullscreen = 0
	side_by_side_equal = 1
	side_by_side_preview = 2
	picture_in_picture = 3

class PadState(object):
	noScaleCaps = Gst.Caps.from_string('video/x-raw')

	def __init__(self):
		self.reset()

	def reset(self):
		self.alpha = 1.0
		self.xpos = 0
		self.ypos = 0
		self.zorder = 1
		self.scaleCaps = PadState.noScaleCaps

class VideoMix(object):
	log = logging.getLogger('VideoMix')

	def __init__(self):
		self.caps = Config.get('mix', 'videocaps')

		self.names = Config.getlist('mix', 'sources')
		self.log.info('Configuring Mixer for %u Sources', len(self.names))

		pipeline = """
			compositor name=mix !
{'fraction_non_alphanumeric': 0.12437810945273632, 'fraction_numerical': 0.012437810945273632, 'mean_word_length': 4.417508417508418, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2235219', 'n_tokens_mistral': 637, 'n_tokens_neox': 586, 'n_words': 134}