Commit 40a4073e authored by Gildas Bazin's avatar Gildas Bazin

* modules/codec/dmo: "DirectX Media Object" decoder plugin (win32 only).

   This plugin allows using DMO filters to decode some media types (eg. WMV3).
parent 74487d9c
......@@ -889,7 +889,7 @@ dnl
dnl default modules
dnl
VLC_ADD_PLUGINS([dummy rc telnet logger gestures memcpy hotkeys netsync])
VLC_ADD_PLUGINS([mpgv mpga m4v h264 ps pva avi asf aac mp4 rawdv nsv real aiff mjpeg])
VLC_ADD_PLUGINS([mpgv mpga m4v h264 ps pva avi asf aac mp4 rawdv nsv real aiff mjpeg demuxdump])
VLC_ADD_PLUGINS([cvdsub svcdsub spudec dvbsub mpeg_audio lpcm a52 dts cinepak])
VLC_ADD_PLUGINS([deinterlace invert adjust wall transform distort clone crop motionblur])
VLC_ADD_PLUGINS([float32tos16 float32tos8 float32tou16 float32tou8 a52tospdif dtstospdif fixed32tofloat32 fixed32tos16 s16tofixed32 s16tofloat32 s16tofloat32swab s8tofloat32 u8tofixed32 u8tofloat32])
......@@ -921,6 +921,8 @@ if test "${SYS}" != "mingw32"; then
VLC_ADD_PLUGINS([screensaver])
else
VLC_ADD_PLUGINS([ntservice])
VLC_ADD_PLUGINS([dmo])
VLC_ADD_LDFLAGS([dmo],[-lole32])
fi
dnl
......@@ -1270,6 +1272,12 @@ then
AC_MSG_ERROR([cannot find ${with_dvdread}/include/dvdread/dvd_reader.h])
fi
fi
dnl Temporary hack (yeah, sure ;)
if test "${SYS}" = "mingw32" || test "${SYS}" = "darwin"; then
VLC_ADD_LDFLAGS([dvdread],[-ldvdcss])
fi
fi
dnl
......@@ -3782,6 +3790,7 @@ AC_CONFIG_FILES([
modules/audio_output/Makefile
modules/codec/Makefile
modules/codec/cmml/Makefile
modules/codec/dmo/Makefile
modules/codec/ffmpeg/Makefile
modules/codec/ffmpeg/postprocessing/Makefile
modules/codec/ogt/Makefile
......
......@@ -4,7 +4,7 @@
* Copyright (C) 1999-2001 VideoLAN
* $Id$
*
* Author: Gildas Bazin <gbazin@netcourrier.com>
* Author: Gildas Bazin <gbazin@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -120,11 +120,29 @@ typedef struct {
} BITMAPINFO, *LPBITMAPINFO;
#endif
/* dvb_spuinfo_t exports the id of the selected track to the decoder */
typedef struct
#ifdef HAVE_ATTRIBUTE_PACKED
__attribute__((__packed__))
#endif
{
unsigned int i_id;
} dvb_spuinfo_t;
int left, top, right, bottom;
} RECT32;
typedef int64_t REFERENCE_TIME;
typedef struct
#ifdef HAVE_ATTRIBUTE_PACKED
__attribute__((__packed__))
#endif
{
RECT32 rcSource;
RECT32 rcTarget;
uint32_t dwBitRate;
uint32_t dwBitErrorRate;
REFERENCE_TIME AvgTimePerFrame;
BITMAPINFOHEADER bmiHeader;
//int reserved[3];
} VIDEOINFOHEADER;
/* WAVE format wFormatTag IDs */
#define WAVE_FORMAT_UNKNOWN 0x0000 /* Microsoft Corporation */
......@@ -207,25 +225,26 @@ wave_format_tag_to_fourcc[] =
{ WAVE_FORMAT_UNKNOWN, VLC_FOURCC( 'u', 'n', 'd', 'f' ), "Unknown" }
};
static inline void wf_tag_to_fourcc( uint16_t i_tag,
vlc_fourcc_t *fcc, char **ppsz_name )
static inline void wf_tag_to_fourcc( uint16_t i_tag, vlc_fourcc_t *fcc,
char **ppsz_name )
{
int i;
for( i = 0; wave_format_tag_to_fourcc[i].i_tag != 0; i++ )
{
if( wave_format_tag_to_fourcc[i].i_tag == i_tag )
{
break;
}
if( wave_format_tag_to_fourcc[i].i_tag == i_tag ) break;
}
if( fcc )
{
*fcc = wave_format_tag_to_fourcc[i].i_fourcc;
}
if( ppsz_name )
if( fcc ) *fcc = wave_format_tag_to_fourcc[i].i_fourcc;
if( ppsz_name ) *ppsz_name = wave_format_tag_to_fourcc[i].psz_name;
}
static inline void fourcc_to_wf_tag( vlc_fourcc_t fcc, uint16_t *pi_tag )
{
int i;
for( i = 0; wave_format_tag_to_fourcc[i].i_tag != 0; i++ )
{
*ppsz_name = wave_format_tag_to_fourcc[i].psz_name;
if( wave_format_tag_to_fourcc[i].i_fourcc == fcc ) break;
}
if( pi_tag ) *pi_tag = wave_format_tag_to_fourcc[i].i_tag;
}
/**
......@@ -252,6 +271,7 @@ typedef struct es_sys_t
vlc_bool_t b_forced_subs;
unsigned int palette[16];
unsigned int colors[4];
} subtitle_data_t;
#endif /* "codecs.h" */
SOURCES_dmo = dmo.c dmo.h buffer.c
/*****************************************************************************
* buffer.c : DirectMedia Object decoder module for vlc
*****************************************************************************
* Copyright (C) 2002, 2003 VideoLAN
* $Id$
*
* Author: Gildas Bazin <gbazin@videolan.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <vlc/vlc.h>
#include <vlc/decoder.h>
#include <vlc/vout.h>
#include <objbase.h>
#include "codecs.h"
#include "dmo.h"
static long STDCALL QueryInterface( IUnknown *This,
const GUID *riid, void **ppv )
{
CMediaBuffer *p_mb = (CMediaBuffer *)This;
if( !memcmp( riid, &IID_IUnknown, sizeof(GUID) ) ||
!memcmp( riid, &IID_IMediaBuffer, sizeof(GUID) ) )
{
p_mb->i_ref++;
*ppv = (void *)This;
return NOERROR;
}
else
{
*ppv = NULL;
return E_NOINTERFACE;
}
}
static long STDCALL AddRef( IUnknown *This )
{
CMediaBuffer *p_mb = (CMediaBuffer *)This;
return p_mb->i_ref++;
}
static long STDCALL Release( IUnknown *This )
{
CMediaBuffer *p_mb = (CMediaBuffer *)This;
p_mb->i_ref--;
if( p_mb->i_ref == 0 )
{
if( p_mb->b_own ) block_Release( p_mb->p_block );
free( p_mb->vt );
free( p_mb );
}
return 0;
}
static long STDCALL SetLength( IMediaBuffer *This, uint32_t cbLength )
{
CMediaBuffer *p_mb = (CMediaBuffer *)This;
if( cbLength > p_mb->i_max_size ) return E_INVALIDARG;
p_mb->p_block->i_buffer = cbLength;
return S_OK;
}
static long STDCALL GetMaxLength( IMediaBuffer *This, uint32_t *pcbMaxLength )
{
CMediaBuffer *p_mb = (CMediaBuffer *)This;
if( !pcbMaxLength ) return E_POINTER;
*pcbMaxLength = p_mb->i_max_size;
return S_OK;
}
static long STDCALL GetBufferAndLength( IMediaBuffer *This,
char **ppBuffer, uint32_t *pcbLength )
{
CMediaBuffer *p_mb = (CMediaBuffer *)This;
if( !ppBuffer && !pcbLength ) return E_POINTER;
if( ppBuffer ) *ppBuffer = p_mb->p_block->p_buffer;
if( pcbLength ) *pcbLength = p_mb->p_block->i_buffer;
return S_OK;
}
CMediaBuffer *CMediaBufferCreate( block_t *p_block, int i_max_size,
vlc_bool_t b_own )
{
CMediaBuffer *p_mb = (CMediaBuffer *)malloc( sizeof(CMediaBuffer) );
if( !p_mb ) return NULL;
p_mb->vt = (IMediaBuffer_vt *)malloc( sizeof(IMediaBuffer_vt) );
if( !p_mb->vt )
{
free( p_mb );
return NULL;
}
p_mb->i_ref = 1;
p_mb->p_block = p_block;
p_mb->i_max_size = i_max_size;
p_mb->b_own = b_own;
p_mb->vt->QueryInterface = QueryInterface;
p_mb->vt->AddRef = AddRef;
p_mb->vt->Release = Release;
p_mb->vt->SetLength = SetLength;
p_mb->vt->GetMaxLength = GetMaxLength;
p_mb->vt->GetBufferAndLength = GetBufferAndLength;
return p_mb;
}
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment