xine-lib: xine-lib-1.2.12/src/combined/ffmpeg/ff_mpeg_parser.c File Reference

xine-lib 1.2.12

Macros | Functions | Variables
ff_mpeg_parser.c File Reference
`#include "ff_mpeg_parser.h"`
`#include <stdint.h>`
`#include <stdlib.h>`
`#include <xine/xine_internal.h>`

## Macros
#define | LOG_MODULE "mpeg_parser"
#define | LOG_VERBOSE
#define | BUFFER_SIZE (1194 * 1024) /* libmpeg2's buffer size */
#define | I_TYPE 1
#define | P_TYPE 2
#define | B_TYPE 3
#define | D_TYPE 4

## Functions
void | mpeg_parser_init (mpeg_parser_t *parser, size_t padding_size)
void | mpeg_parser_dispose (mpeg_parser_t *parser)
void | mpeg_parser_reset (mpeg_parser_t *parser)
static void | parse_header_picture (mpeg_parser_t *parser, uint8_t *buffer)
static double | get_aspect_ratio (mpeg_parser_t *parser)
static int | parse_chunk (mpeg_parser_t *parser, int code, uint8_t *buffer, int len)
static uint8_t * | copy_chunk (mpeg_parser_t *parser, uint8_t *current, uint8_t *end)
uint8_t * | mpeg_parser_decode_data (mpeg_parser_t *parser, uint8_t *current, uint8_t *end, int *flush)

## Variables
static const int | frame_rate_tab [][2]

## Macro Definition Documentation

## ◆ B_TYPE

#define B_TYPE 3

## ◆ BUFFER_SIZE

#define BUFFER_SIZE (1194 * 1024) /* libmpeg2's buffer size */

## ◆ D_TYPE

#define D_TYPE 4

## ◆ I_TYPE

#define I_TYPE 1

## ◆ LOG_MODULE

#define LOG_MODULE "mpeg_parser"

## ◆ LOG_VERBOSE

#define LOG_VERBOSE

## ◆ P_TYPE

#define P_TYPE 2

## Function Documentation

## ◆ copy_chunk()

static uint8_t * copy_chunk | ( | mpeg_parser_t * | parser,
|  | uint8_t * | current,
|  | uint8_t * | end
| ) |  |
| inlinestatic

References BUFFER_SIZE, mpeg_parser_s::chunk_buffer, mpeg_parser_s::chunk_ptr, mpeg_parser_s::code, lprintf, NULL, and mpeg_parser_s::shift.

Referenced by mpeg_parser_decode_data().

## ◆ get_aspect_ratio()

static double get_aspect_ratio | ( | mpeg_parser_t * | parser | ) |
| static

References mpeg_parser_s::aspect_ratio_info, mpeg_parser_s::height, mpeg_parser_s::is_mpeg1, and mpeg_parser_s::width.

Referenced by mpeg_parser_decode_data().

## ◆ mpeg_parser_decode_data()

uint8_t * mpeg_parser_decode_data | ( | mpeg_parser_t * | parser,
|  | uint8_t * | current,
|  | uint8_t * | end,
|  | int * | flush
| ) |  |

References mpeg_parser_s::buffer_size, mpeg_parser_s::chunk_buffer, mpeg_parser_s::chunk_ptr, mpeg_parser_s::chunk_start, mpeg_parser_s::code, code, copy_chunk(), mpeg_parser_s::frame_aspect_ratio, get_aspect_ratio(), mpeg_parser_s::has_sequence, NULL, and parse_chunk().

Referenced by ff_handle_mpeg12_buffer().

## ◆ mpeg_parser_dispose()

void mpeg_parser_dispose | ( | mpeg_parser_t * | parser | ) |

References mpeg_parser_s::chunk_buffer, and NULL.

Referenced by ff_dispose().

## ◆ mpeg_parser_init()

void mpeg_parser_init | ( | mpeg_parser_t * | parser,
|  | size_t | padding_size
| ) |  |

References BUFFER_SIZE, mpeg_parser_s::chunk_buffer, and mpeg_parser_reset().

Referenced by ff_init_mpeg12_mode().

## ◆ mpeg_parser_reset()

void mpeg_parser_reset | ( | mpeg_parser_t * | parser | ) |

References mpeg_parser_s::aspect_ratio_info, mpeg_parser_s::buffer_size, mpeg_parser_s::chunk_buffer, mpeg_parser_s::chunk_ptr, mpeg_parser_s::chunk_start, mpeg_parser_s::code, mpeg_parser_s::frame_aspect_ratio, mpeg_parser_s::frame_duration, mpeg_parser_s::has_sequence, mpeg_parser_s::height, mpeg_parser_s::in_slice, mpeg_parser_s::is_mpeg1, mpeg_parser_s::is_sequence_needed, mpeg_parser_s::picture_coding_type, mpeg_parser_s::rate_code, mpeg_parser_s::shift, and mpeg_parser_s::width.

Referenced by ff_reset(), and mpeg_parser_init().

## ◆ parse_chunk()

static int parse_chunk | ( | mpeg_parser_t * | parser,
|  | int | code,
|  | uint8_t * | buffer,
|  | int | len
| ) |  |
| static

References mpeg_parser_s::aspect_ratio_info, B_TYPE, mpeg_parser_s::chunk_buffer, mpeg_parser_s::chunk_ptr, mpeg_parser_s::code, code, mpeg_parser_s::frame_duration, frame_rate_tab, mpeg_parser_s::has_sequence, mpeg_parser_s::height, height, I_TYPE, mpeg_parser_s::in_slice, mpeg_parser_s::is_mpeg1, mpeg_parser_s::is_sequence_needed, lprintf, P_TYPE, parse_header_picture(), mpeg_parser_s::picture_coding_type, mpeg_parser_s::rate_code, mpeg_parser_s::width, and width.

Referenced by mpeg_parser_decode_data().

## ◆ parse_header_picture()

static void parse_header_picture | ( | mpeg_parser_t * | parser,
|  | uint8_t * | buffer
| ) |  |
| static

References mpeg_parser_s::picture_coding_type.

Referenced by parse_chunk().

## Variable Documentation

## ◆ frame_rate_tab

const int frame_rate_tab[][2]
| static

Initial value:
= {
{ 1, 1},
{24000, 1001},
{ 24, 1},
{ 25, 1},
{30000, 1001},
{ 30, 1},
{ 50, 1},
{60000, 1001},
{ 60, 1},
{ 15, 1},
{ 5, 1},
{ 10, 1},
{ 12, 1},
{ 15, 1},
{ 1, 1},
}

Referenced by parse_chunk().