FFmpeg
Data Structures | Macros | Functions | Variables
psxstr.c File Reference
#include "libavutil/channel_layout.h"
#include "libavutil/internal.h"
#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "demux.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  StrChannel
 
struct  StrDemuxContext
 

Macros

#define RIFF_TAG   MKTAG('R', 'I', 'F', 'F')
 
#define CDXA_TAG   MKTAG('C', 'D', 'X', 'A')
 
#define RAW_CD_SECTOR_SIZE   2352
 
#define RAW_CD_SECTOR_DATA_SIZE   2304
 
#define VIDEO_DATA_CHUNK_SIZE   0x7E0
 
#define VIDEO_DATA_HEADER_SIZE   0x38
 
#define RIFF_HEADER_SIZE   0x2C
 
#define CDXA_TYPE_MASK   0x0E
 
#define CDXA_TYPE_DATA   0x08
 
#define CDXA_TYPE_AUDIO   0x04
 
#define CDXA_TYPE_VIDEO   0x02
 
#define CDXA_TYPE_EMPTY   0x00
 
#define STR_MAGIC   (0x80010160)
 

Functions

static int str_probe (const AVProbeData *p)
 
static int str_read_header (AVFormatContext *s)
 
static int str_read_packet (AVFormatContext *s, AVPacket *ret_pkt)
 
static int str_read_close (AVFormatContext *s)
 

Variables

static const uint8_t sync_header [12] = {0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00}
 
const FFInputFormat ff_str_demuxer
 

Detailed Description

PSX STR file demuxer by Mike Melanson (melan.nosp@m.son@.nosp@m.pcisy.nosp@m.s.ne.nosp@m.t) This module handles streams that have been ripped from Sony Playstation CD games. This demuxer can handle either raw STR files (which are just concatenations of raw compact disc sectors) or STR files with 0x2C-byte RIFF headers, followed by CD sectors.

Definition in file psxstr.c.

Macro Definition Documentation

◆ RIFF_TAG

#define RIFF_TAG   MKTAG('R', 'I', 'F', 'F')

Definition at line 39 of file psxstr.c.

◆ CDXA_TAG

#define CDXA_TAG   MKTAG('C', 'D', 'X', 'A')

Definition at line 40 of file psxstr.c.

◆ RAW_CD_SECTOR_SIZE

#define RAW_CD_SECTOR_SIZE   2352

Definition at line 42 of file psxstr.c.

◆ RAW_CD_SECTOR_DATA_SIZE

#define RAW_CD_SECTOR_DATA_SIZE   2304

Definition at line 43 of file psxstr.c.

◆ VIDEO_DATA_CHUNK_SIZE

#define VIDEO_DATA_CHUNK_SIZE   0x7E0

Definition at line 44 of file psxstr.c.

◆ VIDEO_DATA_HEADER_SIZE

#define VIDEO_DATA_HEADER_SIZE   0x38

Definition at line 45 of file psxstr.c.

◆ RIFF_HEADER_SIZE

#define RIFF_HEADER_SIZE   0x2C

Definition at line 46 of file psxstr.c.

◆ CDXA_TYPE_MASK

#define CDXA_TYPE_MASK   0x0E

Definition at line 48 of file psxstr.c.

◆ CDXA_TYPE_DATA

#define CDXA_TYPE_DATA   0x08

Definition at line 49 of file psxstr.c.

◆ CDXA_TYPE_AUDIO

#define CDXA_TYPE_AUDIO   0x04

Definition at line 50 of file psxstr.c.

◆ CDXA_TYPE_VIDEO

#define CDXA_TYPE_VIDEO   0x02

Definition at line 51 of file psxstr.c.

◆ CDXA_TYPE_EMPTY

#define CDXA_TYPE_EMPTY   0x00

Definition at line 52 of file psxstr.c.

◆ STR_MAGIC

#define STR_MAGIC   (0x80010160)

Definition at line 54 of file psxstr.c.

Function Documentation

◆ str_probe()

static int str_probe ( const AVProbeData p)
static

Definition at line 73 of file psxstr.c.

◆ str_read_header()

static int str_read_header ( AVFormatContext s)
static

Definition at line 131 of file psxstr.c.

◆ str_read_packet()

static int str_read_packet ( AVFormatContext s,
AVPacket ret_pkt 
)
static

Definition at line 159 of file psxstr.c.

◆ str_read_close()

static int str_read_close ( AVFormatContext s)
static

Definition at line 294 of file psxstr.c.

Variable Documentation

◆ sync_header

const uint8_t sync_header[12] = {0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00}
static

Definition at line 71 of file psxstr.c.

Referenced by str_probe().

◆ ff_str_demuxer

const FFInputFormat ff_str_demuxer
Initial value:
= {
.p.name = "psxstr",
.p.long_name = NULL_IF_CONFIG_SMALL("Sony Playstation STR"),
.p.flags = AVFMT_NO_BYTE_SEEK,
.priv_data_size = sizeof(StrDemuxContext),
}

Definition at line 306 of file psxstr.c.

AVFMT_NO_BYTE_SEEK
#define AVFMT_NO_BYTE_SEEK
Format does not allow seeking by bytes.
Definition: avformat.h:487
read_close
static av_cold int read_close(AVFormatContext *ctx)
Definition: libcdio.c:143
str_read_packet
static int str_read_packet(AVFormatContext *s, AVPacket *ret_pkt)
Definition: psxstr.c:159
read_packet
static int read_packet(void *opaque, uint8_t *buf, int buf_size)
Definition: avio_read_callback.c:41
str_probe
static int str_probe(const AVProbeData *p)
Definition: psxstr.c:73
StrDemuxContext
Definition: psxstr.c:65
read_header
static int read_header(FFV1Context *f)
Definition: ffv1dec.c:550
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:106
str_read_header
static int str_read_header(AVFormatContext *s)
Definition: psxstr.c:131
read_probe
static int read_probe(const AVProbeData *p)
Definition: cdg.c:30
str_read_close
static int str_read_close(AVFormatContext *s)
Definition: psxstr.c:294