libavformat/spdif.c File Reference

IEC-61937 encapsulation of various formats, used by S/PDIF. More...

#include "avformat.h"
#include "libavcodec/ac3.h"
#include "libavcodec/dca.h"
#include "libavcodec/aac_parser.h"

Go to the source code of this file.

Data Structures

struct  IEC958Context

Defines

#define SYNCWORD1   0xF872
#define SYNCWORD2   0x4E1F
#define BURST_HEADER_SIZE   0x8

Enumerations

enum  IEC958DataType {
  IEC958_AC3 = 0x01, IEC958_MPEG1_LAYER1 = 0x04, IEC958_MPEG1_LAYER23 = 0x05, IEC958_MPEG2_EXT = 0x06,
  IEC958_MPEG2_AAC = 0x07, IEC958_MPEG2_LAYER1_LSF = 0x08, IEC958_MPEG2_LAYER2_LSF = 0x09, IEC958_MPEG2_LAYER3_LSF = 0x0A,
  IEC958_DTS1 = 0x0B, IEC958_DTS2 = 0x0C, IEC958_DTS3 = 0x0D, IEC958_MPEG2_AAC_LSF_2048 = 0x13,
  IEC958_MPEG2_AAC_LSF_4096 = 0x13 | 0x20
}

Functions

static void bswap_buf16 (uint16_t *dst, const uint16_t *src, int w)
static int spdif_header_ac3 (AVFormatContext *s, AVPacket *pkt)
static int spdif_header_dts (AVFormatContext *s, AVPacket *pkt)
static int spdif_header_mpeg (AVFormatContext *s, AVPacket *pkt)
static int spdif_header_aac (AVFormatContext *s, AVPacket *pkt)
static int spdif_write_header (AVFormatContext *s)
static int spdif_write_trailer (AVFormatContext *s)
static int spdif_write_packet (struct AVFormatContext *s, AVPacket *pkt)

Variables

static enum IEC958DataType mpeg_data_type [2][3]
static const uint16_t mpeg_pkt_offset [2][3]
AVOutputFormat spdif_muxer


Detailed Description

IEC-61937 encapsulation of various formats, used by S/PDIF.

Author:
Bartlomiej Wolowiec

Definition in file spdif.c.


Define Documentation

#define BURST_HEADER_SIZE   0x8

Definition at line 50 of file spdif.c.

Referenced by spdif_write_packet().

#define SYNCWORD1   0xF872

Definition at line 48 of file spdif.c.

Referenced by spdif_write_packet().

#define SYNCWORD2   0x4E1F

Definition at line 49 of file spdif.c.

Referenced by spdif_write_packet().


Enumeration Type Documentation

Enumerator:
IEC958_AC3  AC-3 data.
IEC958_MPEG1_LAYER1  MPEG-1 layer 1.
IEC958_MPEG1_LAYER23  MPEG-1 layer 2 or 3 data or MPEG-2 without extension.
IEC958_MPEG2_EXT  MPEG-2 data with extension.
IEC958_MPEG2_AAC  MPEG-2 AAC ADTS.
IEC958_MPEG2_LAYER1_LSF  MPEG-2, layer-1 low sampling frequency.
IEC958_MPEG2_LAYER2_LSF  MPEG-2, layer-2 low sampling frequency.
IEC958_MPEG2_LAYER3_LSF  MPEG-2, layer-3 low sampling frequency.
IEC958_DTS1  DTS type I (512 samples).
IEC958_DTS2  DTS type II (1024 samples).
IEC958_DTS3  DTS type III (2048 samples).
IEC958_MPEG2_AAC_LSF_2048  MPEG-2 AAC ADTS half-rate low sampling frequency.
IEC958_MPEG2_AAC_LSF_4096  MPEG-2 AAC ADTS quarter-rate low sampling frequency.

Definition at line 52 of file spdif.c.


Function Documentation

static void bswap_buf16 ( uint16_t *  dst,
const uint16_t *  src,
int  w 
) [static]

Definition at line 81 of file spdif.c.

Referenced by spdif_write_packet().

static int spdif_header_aac ( AVFormatContext s,
AVPacket pkt 
) [static]

Definition at line 184 of file spdif.c.

Referenced by spdif_write_header().

static int spdif_header_ac3 ( AVFormatContext s,
AVPacket pkt 
) [static]

Definition at line 99 of file spdif.c.

Referenced by spdif_write_header().

static int spdif_header_dts ( AVFormatContext s,
AVPacket pkt 
) [static]

Definition at line 109 of file spdif.c.

Referenced by spdif_write_header().

static int spdif_header_mpeg ( AVFormatContext s,
AVPacket pkt 
) [static]

Definition at line 161 of file spdif.c.

Referenced by spdif_write_header().

static int spdif_write_header ( AVFormatContext s  )  [static]

Definition at line 218 of file spdif.c.

static int spdif_write_packet ( struct AVFormatContext s,
AVPacket pkt 
) [static]

Definition at line 251 of file spdif.c.

static int spdif_write_trailer ( AVFormatContext s  )  [static]

Definition at line 244 of file spdif.c.


Variable Documentation

enum IEC958DataType mpeg_data_type[2][3] [static]

Initial value:

Definition at line 149 of file spdif.c.

Referenced by spdif_header_mpeg().

const uint16_t mpeg_pkt_offset[2][3] [static]

Initial value:

 {
    
    { 3072,    9216,   4608 }, 
    { 1536,    4608,   4608 }, 
}

Definition at line 155 of file spdif.c.

Referenced by spdif_header_mpeg().

Initial value:

 {
    "spdif",
    NULL_IF_CONFIG_SMALL("IEC958 - S/PDIF (IEC-61937)"),
    NULL,
    "spdif",
    sizeof(IEC958Context),
    CODEC_ID_AC3,
    CODEC_ID_NONE,
    spdif_write_header,
    spdif_write_packet,
    spdif_write_trailer,
}

Definition at line 295 of file spdif.c.


Generated on Fri Oct 26 02:36:55 2012 for FFmpeg by  doxygen 1.5.8