⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 exolmpegts.h

📁 pnx1500 mpeg2 ts stream demo
💻 H
字号:
/*
 * Copyright (c) 2004, 2005 Koninklijke Philips Electronics N V. Includes code
 * copyright (c) 2004 by VCom Electronics Inc; copyright transferred by verbal
 * agreement between Tim Meakin and Jonathan Coxhead, November 2004. All rights
 * reserved.
 *
 * This source code and any compilation or derivative thereof is the proprietary
 * information of Koninklijke Philips Electronics N V and is confidential in
 * nature. Under no circumstances is this software to be exposed to or placed
 * under an Open Source License of any type without the express written
 * permission of Koninklijke Philips Electronics N V.
 *
 * #############################################################################
 *
 * Module: %name: exolMpegTs.h % %version: 1 %
 *
 * %date_created: Fri Mar 11 12:34:59 2005 % %created_by: jcoxhead %
 *
 * %date_modified: Fri Jun 14 11:31:56 2002 %
 *
 * #############################################################################
 */

#ifndef EXOL_DEMUX_MPEG_TS_H
#define EXOL_DEMUX_MPEG_TS_H

#include <unistd.h>

#include "tmAvFormats.h"
#include "tmDbg.h"
#include "tmNxTypes.h"

//---------------------------------------------------------------------------
// Defines and Macros
//---------------------------------------------------------------------------
#define MIN(a,b)                  ((a) <= (b) ? (a) : (b))

#define ALIGN(address,N)          (((UInt32)(address) + (N - 1)) & ~(N - 1))

#define ERROR_FUNC(x, y)          (pinst->defaultSetup.errorFunc( pinst->parent, x, y ))

#define PROGRESS_FUNC(p, x, y)                                                 \
{                                                                              \
    if ( ((y)->progressCode & pinst->defaultSetup.progressReportFlags) != 0 )  \
                                  {                                            \
                                      (p)->defaultSetup.progressFunc((p)->parent,x,y);\
    }                                                                          \
                                  }

#define ERRCHK(sr)                                                             \
{                                                                              \
    tmErrorCode_t  rval = TM_OK;                                               \
    if ( (rval = (sr)) )                                                       \
    {                                                                          \
        printf( "Err=0x%x at line %d of %s\n", rval, __LINE__, __FILE__ );     \
        DBG_ASSERT2( (rval == TM_OK), ("ERRCHK: rval=0x%x at line %d of %s\n", \
                     rval, __LINE__, __FILE__) )                               \
        tmMain_EXIT( -1 );                                                     \
    }                                                                          \
}

#define EQ_ERRCHK(param, val)                                                  \
{                                                                              \
                                      if ( param == val )                      \
                                      {                                        \
                                          printf( "Error: Parameter equals value=%d at line %d of %s\n",\
                                                  val, __LINE__, __FILE__ );   \
                                          DBG_ASSERT2( (param != val),         \
                                                       ("ERRCHK2: Parameter equals value=%d at line %d of %s\n",\
                                                        val, __LINE__, __FILE__) )\
                                          tmMain_EXIT( -1 );                   \
                                      }                                        \
                                  }

#define NOT_EQ_ERRCHK(param, val)                                              \
{                                                                              \
                                      if ( param != val )                      \
                                      {                                        \
                                          printf( "Error: Parameter not equal to value=%d at line %d of %s\n",\
                                                  val, __LINE__, __FILE__ );   \
                                          DBG_ASSERT2( (param == val),         \
                     ("ERRCHK2: Parameter not equal to value=%d at line %d of" \
                      " %s\n", val, __LINE__, __FILE__) )                      \
                                          tmMain_EXIT( -1 );                   \
                                      }                                        \
                                  }

#define KB                                       1024
#define MB                                       (KB * KB)
#define SW_VERSION                               "v.1.0.0"
#define NROF_BYTES_PER_TIMESTAMP                 4
#define TP_PACKET_LENGTH                         188
#define TIMESTAMPED_TP_PACKET_LENGTH             (TP_PACKET_LENGTH + NROF_BYTES_PER_TIMESTAMP)
#define DIGITAL_TP_PACKET_LENGTH                 (TP_PACKET_LENGTH + 16)
#define MAX_TP_PACKET_LENGTH                     DIGITAL_TP_PACKET_LENGTH
#define NROF_AV_OUTPUTS                          DEMUXMPEGTS_NROF_AV_OUTPUTS
#define TASK_SMALL_SLEEP_MS                      10
#define ATSC_INCOMING_DATA_RATE                  (38.8107e6F / 8.0)  // Bytes per second
#define PCR_TO_PTS_DIFF_MIN                      7000   // Number of ticks of the MPEG-2 clock
#define PCR_TO_PTS_DIFF_MAX                      13000               // Number of ticks of the MPEG-2 clock
#define CLOCK_FREQUENCY                          27000000UL
#define MPEG2_CLK_FREQUENCY                      (CLOCK_FREQUENCY / 300)  // 90 kHz
#define NROF_SAMPLES_PER_AC3_AUDIO_PACKET        1536
#define NROF_SAMPLES_PER_MPEG_AUDIO_PACKET       1152
#define MAX_NROF_SAMPLES_PER_AUDIO_PACKET        NROF_SAMPLES_PER_AC3_AUDIO_PACKET
#define NROF_BYTES_PER_INPUT_AUDIO_SAMPLE        4                   // In apfStereo16 mode
#define NROF_BYTES_PER_AC3_INPUT_AUDIO_PACKET    (NROF_SAMPLES_PER_AC3_AUDIO_PACKET  * NROF_BYTES_PER_INPUT_AUDIO_SAMPLE)
#define NROF_BYTES_PER_MPEG_INPUT_AUDIO_PACKET   (NROF_SAMPLES_PER_MPEG_AUDIO_PACKET * NROF_BYTES_PER_INPUT_AUDIO_SAMPLE)
#define MAX_NROF_BYTES_PER_INPUT_AUDIO_PACKET    (MAX_NROF_SAMPLES_PER_AUDIO_PACKET  * NROF_BYTES_PER_INPUT_AUDIO_SAMPLE)
#define NROF_BYTES_PER_OUTPUT_AUDIO_SAMPLE       4                   // In apfStereo16 mode
#define NROF_OUTPUT_AUDIO_CHANNELS               2
#define MAX_NROF_BYTES_PER_OUTPUT_AUDIO_PACKET   (MAX_NROF_SAMPLES_PER_AUDIO_PACKET  * NROF_BYTES_PER_OUTPUT_AUDIO_SAMPLE *\
                                                  NROF_OUTPUT_AUDIO_CHANNELS)
#ifndef O_BINARY
#define O_BINARY                                 0
#endif

#define OPEN_FLAGS (O_BINARY | O_CREAT | O_TRUNC | O_WRONLY)

DBG_UNIT_EXTERN (dbgTsDemux)

//---------------------------------------------------------------------------
// Type Definitions
//---------------------------------------------------------------------------
typedef struct taskArgs
{
    Int       instance;
    UInt32    fullQ;
    UInt32    emptyQ;
    Char      fileName[80];
} taskArgs_t, *ptaskArgs_t;

//---------------------------------------------------------------------------
// Global Shared Data
//---------------------------------------------------------------------------
extern tmAvFormat_t    gDemuxInputFormat;


//---------------------------------------------------------------------------

#if defined(__cplusplus)
}
#endif

#endif  // __TS_DEMUX_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -