/*
 * Copyright 2010 Trident Microsystems (Far East) Ltd. All rights reserved.
 * All prior copyright rights in this work and the accompanying software
 * products transferred to Trident Microsystems (Far East) Ltd. by written
 * agreement.
 */
/*****************************************************************************/
/* Copyright (c) 2010 NXP B.V.  All rights are reserved.                     */
/*                                                                           */
/* Redistribution and use in source and binary forms, with or without        */
/* modification, are permitted provided that the following conditions        */
/* are met:                                                                  */
/*                                                                           */
/* Redistributions of source code must retain the above copyright            */
/* notice, this list of conditions and the following disclaimer.             */
/*                                                                           */
/* Redistributions in binary form must reproduce the above copyright         */
/* notice, this list of conditions and the following disclaimer in the       */
/* documentation and/or other materials provided with the distribution.      */
/*                                                                           */
/* Neither the name of NXP nor the names of its                              */
/* contributors may be used to endorse or promote products derived from      */
/* this software without specific prior written permission.                  */
/*                                                                           */
/* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS       */
/* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT         */
/* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR     */
/* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT      */
/* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,     */
/* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT          */
/* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,     */
/* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY     */
/* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT       */
/* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE         */
/* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH          */
/* DAMAGE.                                                                   */
/*                                                                           */
/*****************************************************************************/

/*############################################################
 *
 * Module name  : tmSystemFormats.h  %version: SOUsb225#2 % 
 *
 * Last Update  : %date_modified: Tue Jul  8 18:07:52 2003 %
 *
 *
 * Description: This header file contains the standard enumerations, types, and
 * structures used for the DVP audio and video software streams.
 *
 * TriMedia audio and video format definitions. The definitions in this file are
 * fundamental to the TM Software Streaming Architecture (TSSA).
 *
 * Document ref: DVP Coding Guidelines Specification
 *
 *############################################################
 */

#ifndef TMSYSTEMFORMATS_H
#define TMSYSTEMFORMATS_H

//-----------------------------------------------------------------------------
// Standard include files:
//-----------------------------------------------------------------------------
//

//-----------------------------------------------------------------------------
// Project include files:
//-----------------------------------------------------------------------------
//
#ifndef TMNXTYPES_H
#include "tmNxTypes.h"                    // DVP Standard data types/defines
#endif

#ifdef __cplusplus
extern "C"
{
#endif

//-----------------------------------------------------------------------------
// Types and defines:
//-----------------------------------------------------------------------------
//

/* System format type definitions */

typedef enum tmSystemTypeFormat {
    stfGeneric              = (Int) 0xffffffffu,
    stfNone                 = (Int) 0x80000000u,
    stfMPEG1System          = 0x00000001,
    stfMPEG2Program         = 0x00000002,
    stfMPEG2Transport       = 0x00000004,
    stfQuicktimeMovie       = 0x00000008, //DOCNEEDED0
    stfDVD                  = 0x00000010, //DOCNEEDED1
//{{SSGSVL
    stfDVC                  = 0x00000020, //DOCNEEDED2
    stfWMT                  = 0x00000040, //DOCNEEDED3
    stfReal                 = 0x00000080  //DOCNEEDED4
//}}
} tmSystemTypeFormat_t;                      /* can be OR'ed */

typedef enum tmControlTypeFormat {
    ctfGeneric              = (Int) 0xffffffffu,
    ctfNone                 = (Int) 0x80000000u
} tmControlTypeFormat_t;                         /* can be OR'ed */

typedef enum tmOtherTypeFormat {
    otfGeneric              = (Int) 0xffffffffu,
    otfNone                 = (Int) 0x80000000u
} tmOtherTypeFormat_t;                           /* can be OR'ed */

//{{SSGSVL
typedef enum tmSystemSubtypeMicrosoft {
    ssmsV7 = 0x00000001, //DOCNEEDED5
    ssmsV8 = 0x00000002, //DOCNEEDED6
    ssmsV9 = 0x00000004  //DOCNEEDED7
} tmSystemSubtypeMicrosoft_t;
//}}

/* Subtypes to identify the MPEG2 transport stream System Type Format  */
typedef enum tmMPEG2TransportStreamFormat {
    tsfGeneric              = (Int) 0xffffffffu,
    tsfNone                 = (Int) 0x80000000u,
    tsfStandard             = 0x00000001,     /* regular mpeg2 standard, 188 bytes packets */
    tsfTM2TimeStamped       = 0x00000002,     /* includes time stamps in the stream, see TM2 */
    tsfStandard204          = 0x00000004,     /* 204 byte transport stream packets (BS-Dig) */
    tsf32bTimeStamped       = 0x00000008      /* 32bit timestamped transport stream (192 byte packets) */ //DOCNEEDED7.5
} tmMPEG2TransportStreamFormat_t;             /* can be OR'ed */

/* TODO: Do we need more description of MPEG 4 streams?
 * Maybe not because we don't handle them as TSSA streams */

//DOCNEEDED8
typedef enum tmSSIAnalogConnection {
    sacNoConnection         = 0x00,
    sacConnectToPOTS        = 0x01,
    sacConnectToISDN        = 0x02,
    sacConnectToOTHER       = 0x80
} tmSSIAnalogConnection_t;

//{{DVI
//DOCNEEDED9
typedef enum tmDrawDrawableType
{
    gdtSolid                = 0,    // pseudo drawable: just a solid color
    gdtVideo                = 1,    // in video memory
    gdtSystem               = 2     // in system memory
} tmDrawDrawableType_t;

#define TM_DRAW_VALID_DRAWABLE_TYPE(type)                                      \
(                                                                              \
    (type) >= gdtSolid &&                                                      \
    (type) <= gdtSystem                                                        \
)                                                                              \

/* subclass of tmAvFormat_t */
typedef
    struct tmDrawFormat
    {
        tmAvFormatVARIABLES;

        /* dataClass of avdcDraw means we're looking at a tmDrawFormat_t */
        /* dataType is tmVideoTypeFormat_t and selects what's in dataSubType */
        /*
           If dataType is...     then dataSubType is...
              vtfYUV                tmVideoYUVFormat_t
              vtfRGB                tmVideoRGBFormat_t
              vtfCLUT               tmVideoCLUTFormat_t
              vtfAlpha              tmVideoAlphaFormat_t
        */

        tmDrawDrawableType_t  drawableType;// solid or memory

        tmXY_t                shape;      // width and height of drawable

                                          // up to 4 strides, one for each plane
        Int32                 stride [4]; // in bits; negative stride is ok
    }
    tmDrawFormat_t, *ptmDrawFormat_t;
//}}

#ifdef __cplusplus
}
#endif

#endif
