# shared.py - Shared data among session/threads
#
# Copyright 2007 Nokia
# Author: Daniel d'Andrada T. de Carvalho <daniel.carvalho@indt.org.br>
#
# This file is part of mediahandler-skeleton.
#
# mediahandler-skeleton is free software: you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# mediahandler-skeleton is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with mediahandler-proxy. If not, see <http://www.gnu.org/licenses/>.

__all__ = ["should_quit", "server_port", "video_filepath", "thumbnail_filepath",
           "init"]

import sys
import os

# shared variables
should_quit = False
server_port = None
video_filepath = None
thumbnail_filepath = None

def init():
    global server_port
    global video_filepath
    global thumbnail_filepath

    server_port = int(sys.argv[1])

    media_dir = os.path.dirname(__file__)

    video_filepath = os.path.join(media_dir, 'converted_video.mp4')
    thumbnail_filepath = os.path.join(media_dir, 'thumbnail.png')
