Exemplo n.º 1
0
def _build_encoding_output(output, output_path):
    # type: (Output, str) -> EncodingOutput
    """
    Builds an EncodingOutput object which defines where the output content (e.g. of a muxing) will be written to.
    Public read permissions will be set for the files written, so they can be accessed easily via HTTP.
    :param output: The output resource to be used by the EncodingOutput
    :param output_path: The path where the content will be written to
    """

    acl_entry = AclEntry(permission=AclPermission.PUBLIC_READ)

    return EncodingOutput(
        output_path=_build_absolute_path(relative_path=output_path),
        output_id=output.id,
        acl=[acl_entry])
Exemplo n.º 2
0
def build_encoding_output_with_absolute_path(output_id, output_path):
    # type: (str, str, str) -> EncodingOutput
    """
    Builds an EncodingOutput object which defines where the output content (e.g. of a muxing) will be written to.
    Public read permissions will be set for the files written, so they can be accessed easily via HTTP.

    :param output_id: The id of the output resource to be used by the EncodingOutput
    :param asset_name: The name or house identifier of the asset being processed
    :param output_path: The path where the content will be written to
    """

    acl_entry = AclEntry(permission=AclPermission.PUBLIC_READ)

    return EncodingOutput(output_path=output_path,
                          output_id=output_id,
                          acl=[acl_entry])