xine-lib 1.2.13-20230125hg15249
Data Structures | Macros | Typedefs | Functions | Variables
w32codec.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <inttypes.h>
#include <string.h>
#include "wine/msacm.h"
#include "wine/driver.h"
#include "wine/avifmt.h"
#include "wine/vfw.h"
#include "wine/mmreg.h"
#include "wine/ldt_keeper.h"
#include "wine/win32.h"
#include "wine/wineacm.h"
#include "wine/loader.h"
#include "DirectShow/guids.h"
#include "DirectShow/DS_AudioDecoder.h"
#include "DirectShow/DS_VideoDecoder.h"
#include "dmo/DMO_AudioDecoder.h"
#include "dmo/DMO_VideoDecoder.h"
#include <xine/xine_internal.h>
#include <xine/video_out.h>
#include <xine/audio_out.h>
#include <xine/buffer.h>
#include <xine/xineutils.h>
#include "group_w32.h"
#include "common.c"

Data Structures

struct  w32v_decoder_s
 
struct  w32a_decoder_s
 

Macros

#define NOAVIFILE_HEADERS
 
#define LOG_MODULE   "w32codec"
 
#define LOG_VERBOSE
 
#define VIDEOBUFSIZE   128*1024
 
#define DRIVER_STD   0
 
#define DRIVER_DS   1
 
#define DRIVER_DMO   2
 
#define MAXSAMPLE   255
 
#define CENTERSAMPLE   128
 
#define SCALEBITS   16
 
#define FIX(x)   ( (int32_t) ( (x) * (1<<SCALEBITS) + 0.5 ) )
 
#define ONE_HALF   ( (int32_t) (1<< (SCALEBITS-1)) )
 
#define CBCR_OFFSET   (CENTERSAMPLE << SCALEBITS)
 
#define R_Y_OFF   0 /* offset to R => Y section */
 
#define G_Y_OFF   (1*(MAXSAMPLE+1)) /* offset to G => Y section */
 
#define B_Y_OFF   (2*(MAXSAMPLE+1)) /* etc. */
 
#define R_CB_OFF   (3*(MAXSAMPLE+1))
 
#define G_CB_OFF   (4*(MAXSAMPLE+1))
 
#define B_CB_OFF   (5*(MAXSAMPLE+1))
 
#define R_CR_OFF   B_CB_OFF /* B=>Cb, R=>Cr are the same */
 
#define G_CR_OFF   (6*(MAXSAMPLE+1))
 
#define B_CR_OFF   (7*(MAXSAMPLE+1))
 
#define TABLE_SIZE   (8*(MAXSAMPLE+1))
 
#define HAS_SLOW_MULT   1
 
#define IMGFMT_YUY2   mmioFOURCC('Y','U','Y','2')
 
#define IMGFMT_YV12   mmioFOURCC('Y','V','1','2')
 
#define IMGFMT_32RGB   mmioFOURCC( 32,'R','G','B')
 
#define IMGFMT_24RGB   mmioFOURCC( 24,'R','G','B')
 
#define IMGFMT_16RGB   mmioFOURCC( 16,'R','G','B')
 
#define IMGFMT_15RGB   mmioFOURCC( 15,'R','G','B')
 

Typedefs

typedef struct w32v_decoder_s w32v_decoder_t
 
typedef struct w32a_decoder_s w32a_decoder_t
 

Functions

static void w32v_init_rgb_ycc (void)
 
static int get_vids_codec_n_name (w32v_decoder_t *this, int buf_type)
 
static const char * get_vids_codec_name (w32v_decoder_t *this, int buf_type, int n)
 
static void w32v_init_codec (w32v_decoder_t *this, int buf_type)
 
static void w32v_init_ds_dmo_codec (w32v_decoder_t *this, int buf_type)
 
static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf)
 
static void w32v_flush (video_decoder_t *this_gen)
 
static void w32v_reset (video_decoder_t *this_gen)
 
static void w32v_discontinuity (video_decoder_t *this_gen)
 
static void w32v_dispose (video_decoder_t *this_gen)
 
static const char * get_auds_codec_name (w32a_decoder_t *this, int buf_type)
 
static void w32a_reset (audio_decoder_t *this_gen)
 
static void w32a_discontinuity (audio_decoder_t *this_gen)
 
static int w32a_init_audio (w32a_decoder_t *this, uint8_t *buf, int bufsize, int buftype)
 
static void w32a_ensure_buffer_size (w32a_decoder_t *this, int size)
 
static void w32a_decode_audio (w32a_decoder_t *this, unsigned char *data, uint32_t size, int frame_end, int64_t pts)
 
static void w32a_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
 
static void w32a_dispose (audio_decoder_t *this_gen)
 
static video_decoder_topen_video_decoder_plugin (video_decoder_class_t *class_gen, xine_stream_t *stream)
 
static void init_routine (void)
 
void * w32v_init_class (xine_t *xine, const void *data)
 
static audio_decoder_topen_audio_decoder_plugin (audio_decoder_class_t *class_gen, xine_stream_t *stream)
 
void * w32a_init_class (xine_t *xine, const void *data)
 

Variables

static GUID CLSID_Voxware
 
static GUID CLSID_Acelp
 
static GUID wmv1_clsid
 
static GUID wmv2_clsid
 
static GUID wmv3_clsid
 
static GUID wmvdmo_clsid
 
static GUID dvsd_clsid
 
static GUID msmpeg4_clsid
 
static GUID mss1_clsid
 
static GUID wma3_clsid
 
static GUID wmav_clsid
 
static pthread_mutex_t win32_codec_mutex
 
static pthread_once_t once_control = PTHREAD_ONCE_INIT
 
static const char * win32_codec_name
 
static int32_t * rgb_ycc_tab
 

Macro Definition Documentation

◆ B_CB_OFF

#define B_CB_OFF   (5*(MAXSAMPLE+1))

◆ B_CR_OFF

#define B_CR_OFF   (7*(MAXSAMPLE+1))

◆ B_Y_OFF

#define B_Y_OFF   (2*(MAXSAMPLE+1)) /* etc. */

◆ CBCR_OFFSET

#define CBCR_OFFSET   (CENTERSAMPLE << SCALEBITS)

◆ CENTERSAMPLE

#define CENTERSAMPLE   128

Referenced by init_yuv_conversion().

◆ DRIVER_DMO

#define DRIVER_DMO   2

◆ DRIVER_DS

#define DRIVER_DS   1

◆ DRIVER_STD

#define DRIVER_STD   0

◆ FIX

#define FIX ( x)    ( (int32_t) ( (x) * (1<<SCALEBITS) + 0.5 ) )

◆ G_CB_OFF

#define G_CB_OFF   (4*(MAXSAMPLE+1))

◆ G_CR_OFF

#define G_CR_OFF   (6*(MAXSAMPLE+1))

◆ G_Y_OFF

#define G_Y_OFF   (1*(MAXSAMPLE+1)) /* offset to G => Y section */

◆ HAS_SLOW_MULT

#define HAS_SLOW_MULT   1

◆ IMGFMT_15RGB

#define IMGFMT_15RGB   mmioFOURCC( 15,'R','G','B')

◆ IMGFMT_16RGB

#define IMGFMT_16RGB   mmioFOURCC( 16,'R','G','B')

◆ IMGFMT_24RGB

#define IMGFMT_24RGB   mmioFOURCC( 24,'R','G','B')

◆ IMGFMT_32RGB

#define IMGFMT_32RGB   mmioFOURCC( 32,'R','G','B')

◆ IMGFMT_YUY2

#define IMGFMT_YUY2   mmioFOURCC('Y','U','Y','2')

◆ IMGFMT_YV12

#define IMGFMT_YV12   mmioFOURCC('Y','V','1','2')

◆ LOG_MODULE

#define LOG_MODULE   "w32codec"

◆ LOG_VERBOSE

#define LOG_VERBOSE

◆ MAXSAMPLE

#define MAXSAMPLE   255

Referenced by w32v_init_rgb_ycc().

◆ NOAVIFILE_HEADERS

#define NOAVIFILE_HEADERS

◆ ONE_HALF

#define ONE_HALF   ( (int32_t) (1<< (SCALEBITS-1)) )

◆ R_CB_OFF

#define R_CB_OFF   (3*(MAXSAMPLE+1))

◆ R_CR_OFF

#define R_CR_OFF   B_CB_OFF /* B=>Cb, R=>Cr are the same */

Referenced by w32v_decode_data().

◆ R_Y_OFF

#define R_Y_OFF   0 /* offset to R => Y section */

◆ SCALEBITS

#define SCALEBITS   16

Referenced by w32v_decode_data().

◆ TABLE_SIZE

#define TABLE_SIZE   (8*(MAXSAMPLE+1))

Referenced by w32v_init_rgb_ycc().

◆ VIDEOBUFSIZE

#define VIDEOBUFSIZE   128*1024

Typedef Documentation

◆ w32a_decoder_t

◆ w32v_decoder_t

Function Documentation

◆ get_auds_codec_name()

static const char * get_auds_codec_name ( w32a_decoder_t * this,
int buf_type )
static

◆ get_vids_codec_n_name()

static int get_vids_codec_n_name ( w32v_decoder_t * this,
int buf_type )
static

◆ get_vids_codec_name()

static const char * get_vids_codec_name ( w32v_decoder_t * this,
int buf_type,
int n )
static

◆ init_routine()

static void init_routine ( void )
static

◆ open_audio_decoder_plugin()

static audio_decoder_t * open_audio_decoder_plugin ( audio_decoder_class_t * class_gen,
xine_stream_t * stream )
static

◆ open_video_decoder_plugin()

static video_decoder_t * open_video_decoder_plugin ( video_decoder_class_t * class_gen,
xine_stream_t * stream )
static

◆ w32a_decode_audio()

static void w32a_decode_audio ( w32a_decoder_t * this,
unsigned char * data,
uint32_t size,
int frame_end,
int64_t pts )
static

◆ w32a_decode_data()

static void w32a_decode_data ( audio_decoder_t * this_gen,
buf_element_t * buf )
static

◆ w32a_discontinuity()

static void w32a_discontinuity ( audio_decoder_t * this_gen)
static

◆ w32a_dispose()

static void w32a_dispose ( audio_decoder_t * this_gen)
static

◆ w32a_ensure_buffer_size()

static void w32a_ensure_buffer_size ( w32a_decoder_t * this,
int size )
static

◆ w32a_init_audio()

static int w32a_init_audio ( w32a_decoder_t * this,
uint8_t * buf,
int bufsize,
int buftype )
static

◆ w32a_init_class()

void * w32a_init_class ( xine_t * xine,
const void * data )

◆ w32a_reset()

static void w32a_reset ( audio_decoder_t * this_gen)
static

◆ w32v_decode_data()

static void w32v_decode_data ( video_decoder_t * this_gen,
buf_element_t * buf )
static

◆ w32v_discontinuity()

static void w32v_discontinuity ( video_decoder_t * this_gen)
static

◆ w32v_dispose()

static void w32v_dispose ( video_decoder_t * this_gen)
static

◆ w32v_flush()

static void w32v_flush ( video_decoder_t * this_gen)
static

◆ w32v_init_class()

void * w32v_init_class ( xine_t * xine,
const void * data )

◆ w32v_init_codec()

static void w32v_init_codec ( w32v_decoder_t * this,
int buf_type )
static

◆ w32v_init_ds_dmo_codec()

static void w32v_init_ds_dmo_codec ( w32v_decoder_t * this,
int buf_type )
static

◆ w32v_init_rgb_ycc()

static void w32v_init_rgb_ycc ( void )
static

◆ w32v_reset()

static void w32v_reset ( video_decoder_t * this_gen)
static

Variable Documentation

◆ CLSID_Acelp

GUID CLSID_Acelp
static
Initial value:
=
{
0x4009f700, 0xaeba, 0x11d1,
{ 0x83, 0x44, 0x00, 0xc0, 0x4f, 0xb9, 0x2e, 0xb7 }
}

Referenced by get_auds_codec_name().

◆ CLSID_Voxware

GUID CLSID_Voxware
static
Initial value:
=
{
0x73f7a062, 0x8829, 0x11d1,
{ 0xb5, 0x50, 0x00, 0x60, 0x97, 0x24, 0x2d, 0x8d }
}

Referenced by get_auds_codec_name().

◆ dvsd_clsid

GUID dvsd_clsid
static
Initial value:
=
{
0xB1B77C00, 0xC3E4, 0x11CF,
{0xAF, 0x79, 0x00, 0xAA, 0x00, 0xB6, 0x7A, 0x42}
}

Referenced by get_vids_codec_name().

◆ msmpeg4_clsid

GUID msmpeg4_clsid
static
Initial value:
=
{
0x82CCd3E0, 0xF71A, 0x11D0,
{ 0x9f, 0xe5, 0x00, 0x60, 0x97, 0x78, 0xea, 0x66}
}

Referenced by get_vids_codec_name().

◆ mss1_clsid

GUID mss1_clsid
static
Initial value:
=
{
0x3301a7c4, 0x0a8d, 0x11d4,
{ 0x91, 0x4d, 0x00, 0xc0, 0x4f, 0x61, 0x0d, 0x24 }
}

Referenced by get_vids_codec_name().

◆ once_control

pthread_once_t once_control = PTHREAD_ONCE_INIT
static

Referenced by w32a_init_class(), and w32v_init_class().

◆ rgb_ycc_tab

int32_t* rgb_ycc_tab
static

◆ win32_codec_mutex

pthread_mutex_t win32_codec_mutex
static

◆ win32_codec_name

const char* win32_codec_name
static

◆ wma3_clsid

GUID wma3_clsid
static
Initial value:
=
{
0x27ca0808, 0x01f5, 0x4e7a,
{ 0x8b, 0x05, 0x87, 0xf8, 0x07, 0xa2, 0x33, 0xd1 }
}

Referenced by get_auds_codec_name().

◆ wmav_clsid

GUID wmav_clsid
static
Initial value:
=
{
0x874131cb, 0x4ecc, 0x443b,
{ 0x89, 0x48, 0x74, 0x6b, 0x89, 0x59, 0x5d, 0x20 }
}

Referenced by get_auds_codec_name().

◆ wmv1_clsid

GUID wmv1_clsid
static
Initial value:
=
{
0x4facbba1, 0xffd8, 0x4cd7,
{0x82, 0x28, 0x61, 0xe2, 0xf6, 0x5c, 0xb1, 0xae}
}

Referenced by get_vids_codec_name().

◆ wmv2_clsid

GUID wmv2_clsid
static
Initial value:
=
{
0x521fb373, 0x7654, 0x49f2,
{0xbd, 0xb1, 0x0c, 0x6e, 0x66, 0x60, 0x71, 0x4f}
}

Referenced by get_vids_codec_name().

◆ wmv3_clsid

GUID wmv3_clsid
static
Initial value:
=
{
0x724bb6a4, 0xe526, 0x450f,
{0xaf, 0xfa, 0xab, 0x9b, 0x45, 0x12, 0x91, 0x11}
}

Referenced by get_vids_codec_name().

◆ wmvdmo_clsid

GUID wmvdmo_clsid
static
Initial value:
=
{
0x82d353df, 0x90bd, 0x4382,
{0x8b, 0xc2, 0x3f, 0x61, 0x92, 0xb7, 0x6e, 0x34}
}

Referenced by get_vids_codec_name().