# Path: skema/omxil12.py
# def get_il_enum_from_string(string):
#     from skema import omxil12
#     for name, val in omxil12.__dict__.iteritems():
#         if name == string:
#             return val
#     raise AttributeError
# 
# Path: skema/omxil12.py
# def get_string_from_il_enum(enum, hint):
#     from skema import omxil12
#     for name, val in omxil12.__dict__.iteritems():
#         if enum == val:
#             if name.startswith(hint):
#                 return name
#     raise AttributeError
# 
# Path: skema/omxil12.py
# OMX_PARAM_CONTENTURITYPE = struct_OMX_PARAM_CONTENTURITYPE # OMX_Component.h: 126
# 
# Path: skema/omxil12.py
# def OMX_GetParameter(hComponent, nParamIndex, pComponentParameterStructure):
#     return ((cast(hComponent, POINTER(OMX_COMPONENTTYPE)).contents.GetParameter) (hComponent, nParamIndex, pComponentParameterStructure))
# 
# Path: skema/omxil12.py
# def OMX_SetParameter(hComponent, nParamIndex, pComponentParameterStructure):
#     return ((cast(hComponent, POINTER(OMX_COMPONENTTYPE)).contents.SetParameter) (hComponent, nParamIndex, pComponentParameterStructure))
# 
# Path: skema/utils.py
# def log_api(line):
#     log_line ()
#     logging.info("")
#     log_line ()
#     logging.info("")
#     l = "[" + line  +"]"
#     logging.info(l)
#     lansi = "[skema] " + bcolors.BOLD + l + bcolors.ENDC
#     printit (lansi)
# 
# Path: skema/utils.py
# def log_line(line="", tabs=0):
#     if (line == ""):
#         lansi = "[skema] "
#         l = ""
#     else:
#         l = ('\t' * tabs) + "[" + line + "]"
#         lansi = "[skema] " + bcolors.WARNING + l + bcolors.ENDC
#     logging.info(l)
#     printit (lansi)
# 
# Path: skema/utils.py
# def log_param(param, val, tabs=0):
#     l = ('\t' * tabs) + "[" + param + " -> '" + val + "']"
#     lansi = "[skema] " + bcolors.WARNING + l + bcolors.ENDC
#     logging.info(l)
#     printit (lansi)
# 
# Path: skema/utils.py
# def log_result(tag, err):
#     log_line ()
#     if (err == "OMX_ErrorNone"):
#         l = "[" + tag + " -> '" + err + "']"
#         lansi = "[skema] " + bcolors.OKGREEN + l + bcolors.ENDC
#         logging.info(l)
#     else:
#         l = "[" + tag + " -> '" + err + "']"
#         lansi = "[skema] " + bcolors.FAIL + l + bcolors.ENDC
#         logging.error(l)
# 
#     printit (lansi)


import os
import re
import pwd
import skema.tag
from skema.omxil12 import get_il_enum_from_string
from skema.omxil12 import get_string_from_il_enum
from skema.omxil12 import OMX_PARAM_CONTENTURITYPE
from skema.omxil12 import OMX_GetParameter
from skema.omxil12 import OMX_SetParameter
from skema.utils import log_api
from skema.utils import log_line
from skema.utils import log_param
from skema.utils import log_result
from ctypes import sizeof
from ctypes import byref
from ctypes import CDLL
from ctypes import cast
from ctypes import c_char_p

        handle = context.handles[alias]
        index = get_il_enum_from_string(indexstr)
        param_type = OMX_PARAM_CONTENTURITYPE
        param_struct = param_type()
        param_struct.nSize = sizeof(param_type)

        if (handle != None):
            omxerror = OMX_GetParameter(handle, index, byref(param_struct))
            interror = int(omxerror & 0xffffffff)
            err = get_string_from_il_enum(interror, "OMX_Error")

            for name, _ in param_type._fields_:
                for name2, val2 in element.items():
                    if (name != "contentURI"):
                        if (name2 == name):
                            setattr(param_struct, name, int(val2))
                    else:
                        libc = CDLL('libc.so.6')
                        libc.strcpy(cast(param_struct.contentURI, c_char_p),
                                    uristr)

            omxerror = OMX_SetParameter(handle, index, byref(param_struct))
            interror = int(omxerror & 0xffffffff)
            err = get_string_from_il_enum(interror, "OMX_Error")

            urifield = c_char_p()
            urifield = cast(param_struct.contentURI, c_char_p)

            log_line ()

# Path: skema/omxil12.py
# def get_il_enum_from_string(string):
#     from skema import omxil12
#     for name, val in omxil12.__dict__.iteritems():
#         if name == string:
#             return val
#     raise AttributeError
# 
# Path: skema/omxil12.py
# def get_string_from_il_enum(enum, hint):
#     from skema import omxil12
#     for name, val in omxil12.__dict__.iteritems():
#         if enum == val:
#             if name.startswith(hint):
#                 return name
#     raise AttributeError
# 
# Path: skema/omxil12.py
# OMX_PARAM_CONTENTURITYPE = struct_OMX_PARAM_CONTENTURITYPE # OMX_Component.h: 126
# 
# Path: skema/omxil12.py
# def OMX_GetParameter(hComponent, nParamIndex, pComponentParameterStructure):
#     return ((cast(hComponent, POINTER(OMX_COMPONENTTYPE)).contents.GetParameter) (hComponent, nParamIndex, pComponentParameterStructure))
# 
# Path: skema/omxil12.py
# def OMX_SetParameter(hComponent, nParamIndex, pComponentParameterStructure):
#     return ((cast(hComponent, POINTER(OMX_COMPONENTTYPE)).contents.SetParameter) (hComponent, nParamIndex, pComponentParameterStructure))
# 
# Path: skema/utils.py
# def log_api(line):
#     log_line ()
#     logging.info("")
#     log_line ()
#     logging.info("")
#     l = "[" + line  +"]"
#     logging.info(l)
#     lansi = "[skema] " + bcolors.BOLD + l + bcolors.ENDC
#     printit (lansi)
# 
# Path: skema/utils.py
# def log_line(line="", tabs=0):
#     if (line == ""):
#         lansi = "[skema] "
#         l = ""
#     else:
#         l = ('\t' * tabs) + "[" + line + "]"
#         lansi = "[skema] " + bcolors.WARNING + l + bcolors.ENDC
#     logging.info(l)
#     printit (lansi)
# 
# Path: skema/utils.py
# def log_param(param, val, tabs=0):
#     l = ('\t' * tabs) + "[" + param + " -> '" + val + "']"
#     lansi = "[skema] " + bcolors.WARNING + l + bcolors.ENDC
#     logging.info(l)
#     printit (lansi)
# 
# Path: skema/utils.py
# def log_result(tag, err):
#     log_line ()
#     if (err == "OMX_ErrorNone"):
#         l = "[" + tag + " -> '" + err + "']"
#         lansi = "[skema] " + bcolors.OKGREEN + l + bcolors.ENDC
#         logging.info(l)
#     else:
#         l = "[" + tag + " -> '" + err + "']"
#         lansi = "[skema] " + bcolors.FAIL + l + bcolors.ENDC
#         logging.error(l)
# 
#     printit (lansi)


# Path: skema/tags/OMX_SetContentURI.py
import os
import re
import pwd
import skema.tag
from skema.omxil12 import get_il_enum_from_string
from skema.omxil12 import get_string_from_il_enum
from skema.omxil12 import OMX_PARAM_CONTENTURITYPE
from skema.omxil12 import OMX_GetParameter
from skema.omxil12 import OMX_SetParameter
from skema.utils import log_api
from skema.utils import log_line
from skema.utils import log_param
from skema.utils import log_result
from ctypes import sizeof
from ctypes import byref
from ctypes import CDLL
from ctypes import cast
from ctypes import c_char_p


        handle = context.handles[alias]
        index = get_il_enum_from_string(indexstr)
        param_type = OMX_PARAM_CONTENTURITYPE
        param_struct = param_type()
        param_struct.nSize = sizeof(param_type)

        if (handle != None):
            omxerror = OMX_GetParameter(handle, index, byref(param_struct))
            interror = int(omxerror & 0xffffffff)
            err = get_string_from_il_enum(interror, "OMX_Error")

            for name, _ in param_type._fields_:
                for name2, val2 in element.items():
                    if (name != "contentURI"):
                        if (name2 == name):
                            setattr(param_struct, name, int(val2))
                    else:
                        libc = CDLL('libc.so.6')
                        libc.strcpy(cast(param_struct.contentURI, c_char_p),
                                    uristr)

            omxerror = OMX_SetParameter(handle, index, byref(param_struct))
            interror = int(omxerror & 0xffffffff)
            err = get_string_from_il_enum(interror, "OMX_Error")

            urifield = c_char_p()
            urifield = cast(param_struct.contentURI, c_char_p)

            log_line ()

            log_line ("%s" % param_struct.__class__.__name__, 1)