X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fcodec%2Fdmo%2Fdmo.c;h=7a9fa4e3661da9a4cc1fba0edd062dde813f662d;hb=6ee1e193fd896ab9a4729fde14f009d9ce629815;hp=f860fdfb35279aae050dfd42eb156d198ec549fc;hpb=4e34b354ce78690fff15543535e34e5ac99744c2;p=vlc diff --git a/modules/codec/dmo/dmo.c b/modules/codec/dmo/dmo.c index f860fdfb35..7a9fa4e366 100644 --- a/modules/codec/dmo/dmo.c +++ b/modules/codec/dmo/dmo.c @@ -18,19 +18,17 @@ * * 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. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. *****************************************************************************/ /***************************************************************************** * Preamble *****************************************************************************/ -#include -#include -#include #include -#include -#include +#include +#include +#include #ifndef WIN32 # define LOADER @@ -45,7 +43,7 @@ # include #endif -#include "codecs.h" +#include #include "dmo.h" //#define DMO_DEBUG 1 @@ -133,11 +131,15 @@ struct decoder_sys_t #endif }; +static const GUID guid_wvc1 = { 0xc9bfbccf, 0xe60e, 0x4588, { 0xa3, 0xdf, 0x5a, 0x03, 0xb1, 0xfd, 0x95, 0x85 } }; static const GUID guid_wmv9 = { 0x724bb6a4, 0xe526, 0x450f, { 0xaf, 0xfa, 0xab, 0x9b, 0x45, 0x12, 0x91, 0x11 } }; -static const GUID guid_wma9 = { 0x27ca0808, 0x01f5, 0x4e7a, { 0x8b, 0x05, 0x87, 0xf8, 0x07, 0xa2, 0x33, 0xd1 } }; static const GUID guid_wmv = { 0x82d353df, 0x90bd, 0x4382, { 0x8b, 0xc2, 0x3f, 0x61, 0x92, 0xb7, 0x6e, 0x34 } }; +static const GUID guid_wms = { 0x7bafb3b1, 0xd8f4, 0x4279, { 0x92, 0x53, 0x27, 0xda, 0x42, 0x31, 0x08, 0xde } }; +static const GUID guid_wmva ={ 0x03be3ac4, 0x84b7, 0x4e0e, { 0xa7, 0x8d, 0xd3, 0x52, 0x4e, 0x60, 0x39, 0x5a } }; + static const GUID guid_wma = { 0x874131cb, 0x4ecc, 0x443b, { 0x89, 0x48, 0x74, 0x6b, 0x89, 0x59, 0x5d, 0x20 } }; +static const GUID guid_wma9 = { 0x27ca0808, 0x01f5, 0x4e7a, { 0x8b, 0x05, 0x87, 0xf8, 0x07, 0xa2, 0x33, 0xd1 } }; static const GUID guid_wmv_enc = { 0x3181343b, 0x94a2, 0x4feb, { 0xad, 0xef, 0x30, 0xa1, 0xdd, 0xe6, 0x17, 0xb4 } }; static const GUID guid_wma_enc = { 0x70f598e9, 0xf4ab, 0x495a, { 0x99, 0xe2, 0xa7, 0xc4, 0xd3, 0xd8, 0x9a, 0xbf } }; @@ -152,8 +154,12 @@ typedef struct static const codec_dll decoders_table[] = { - /* WM3 */ + /* WVC1 */ + { VLC_FOURCC('W','V','C','1'), "wvc1dmod.dll", &guid_wvc1 }, + { VLC_FOURCC('w','v','c','1'), "wvc1dmod.dll", &guid_wvc1 }, + /* WMV3 */ { VLC_FOURCC('W','M','V','3'), "wmv9dmod.dll", &guid_wmv9 }, + { VLC_FOURCC('W','M','V','P'), "wmv9dmod.dll", &guid_wmv9 }, { VLC_FOURCC('w','m','v','3'), "wmv9dmod.dll", &guid_wmv9 }, /* WMV2 */ { VLC_FOURCC('W','M','V','2'), "wmvdmod.dll", &guid_wmv }, @@ -161,6 +167,12 @@ static const codec_dll decoders_table[] = /* WMV1 */ { VLC_FOURCC('W','M','V','1'), "wmvdmod.dll", &guid_wmv }, { VLC_FOURCC('w','m','v','1'), "wmvdmod.dll", &guid_wmv }, + /* Screen codecs */ + { VLC_FOURCC('M','S','S','1'), "wmsdmod.dll", &guid_wms }, + { VLC_FOURCC('M','S','S','2'), "wmsdmod.dll", &guid_wms }, + /* Windows Media Video Adv */ + { VLC_FOURCC('W','M','V','A'), "wmvadvd.dll", &guid_wmva }, + { VLC_FOURCC('W','V','P','2'), "wmvadvd.dll", &guid_wmva }, /* WMA 3 */ { VLC_FOURCC('W','M','A','3'), "wma9dmod.dll", &guid_wma9 }, @@ -170,6 +182,9 @@ static const codec_dll decoders_table[] = { VLC_FOURCC('W','M','A','2'), "wma9dmod.dll", &guid_wma9 }, { VLC_FOURCC('w','m','a','2'), "wma9dmod.dll", &guid_wma9 }, + /* WMA Speech */ + { VLC_FOURCC('w','m','a','s'), "wmspdmod.dll", &guid_wma }, + /* */ { 0, NULL, NULL } }; @@ -178,7 +193,7 @@ static const codec_dll encoders_table[] = { /* WMV2 */ { VLC_FOURCC('W','M','V','2'), "wmvdmoe.dll", &guid_wmv_enc }, - { VLC_FOURCC('w','m','v','1'), "wmvdmoe.dll", &guid_wmv_enc }, + { VLC_FOURCC('w','m','v','2'), "wmvdmoe.dll", &guid_wmv_enc }, /* WMV1 */ { VLC_FOURCC('W','M','V','1'), "wmvdmoe.dll", &guid_wmv_enc }, { VLC_FOURCC('w','m','v','1'), "wmvdmoe.dll", &guid_wmv_enc }, @@ -413,8 +428,17 @@ static int DecOpen( vlc_object_t *p_this ) p_dec->fmt_out.video.i_width = p_dec->fmt_in.video.i_width; p_dec->fmt_out.video.i_height = p_dec->fmt_in.video.i_height; p_dec->fmt_out.video.i_bits_per_pixel = i_bpp; - p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR * - p_dec->fmt_out.video.i_width / p_dec->fmt_out.video.i_height; + + /* If an aspect-ratio was specified in the input format then force it */ + if( p_dec->fmt_in.video.i_aspect ) + { + p_dec->fmt_out.video.i_aspect = p_dec->fmt_in.video.i_aspect; + } + else + { + p_dec->fmt_out.video.i_aspect = VOUT_ASPECT_FACTOR * + p_dec->fmt_out.video.i_width / p_dec->fmt_out.video.i_height; + } p_bih = &p_vih->bmiHeader; p_bih->biCompression = i_chroma; @@ -829,7 +853,7 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) { if( i_result != S_FALSE ) msg_Dbg( p_dec, "ProcessOutput(): failed" ); -#if DMO_DEBUG +#ifdef DMO_DEBUG else msg_Dbg( p_dec, "ProcessOutput(): no output" ); #endif @@ -838,13 +862,13 @@ static void *DecodeBlock( decoder_t *p_dec, block_t **pp_block ) return NULL; } -#if DMO_DEBUG +#ifdef DMO_DEBUG msg_Dbg( p_dec, "ProcessOutput(): success" ); #endif if( !block_out.i_buffer ) { -#if DMO_DEBUG +#ifdef DMO_DEBUG msg_Dbg( p_dec, "ProcessOutput(): no output (i_buffer_out == 0)" ); #endif p_out->vt->Release( (IUnknown *)p_out ); @@ -908,7 +932,7 @@ static void CopyPicture( decoder_t *p_dec, picture_t *p_pic, uint8_t *p_in ) for( i_line = 0; i_line < p_pic->p[i_plane].i_visible_lines; i_line++ ) { - p_dec->p_vlc->pf_memcpy( p_dst, p_src, i_width ); + p_dec->p_libvlc->pf_memcpy( p_dst, p_src, i_width ); p_src += i_width; p_dst += i_dst_stride; } @@ -988,7 +1012,7 @@ static int EncoderSetVideoType( encoder_t *p_enc, IMediaObject *p_dmo ) BITMAPINFOHEADER *p_bih; /* FIXME */ - p_enc->fmt_in.video.i_bits_per_pixel = + p_enc->fmt_in.video.i_bits_per_pixel = p_enc->fmt_out.video.i_bits_per_pixel = 12; /* Enumerate input format (for debug output) */ @@ -1192,7 +1216,7 @@ static int EncoderSetAudioType( encoder_t *p_enc, IMediaObject *p_dmo ) if( i_selected < 0 ) { - msg_Err( p_enc, "couldn't find a matching ouput" ); + msg_Err( p_enc, "couldn't find a matching output" ); return VLC_EGENERIC; } @@ -1423,7 +1447,7 @@ static block_t *EncodeBlock( encoder_t *p_enc, void *p_data ) for( i_line = 0; i_line < p_pic->p[i_plane].i_visible_lines; i_line++ ) { - p_enc->p_vlc->pf_memcpy( p_dst, p_src, i_width ); + p_enc->p_libvlc->pf_memcpy( p_dst, p_src, i_width ); p_dst += i_width; p_src += i_src_stride; } @@ -1466,7 +1490,7 @@ static block_t *EncodeBlock( encoder_t *p_enc, void *p_data ) return NULL; } -#if DMO_DEBUG +#ifdef DMO_DEBUG msg_Dbg( p_enc, "ProcessInput(): success" ); #endif @@ -1490,7 +1514,7 @@ static block_t *EncodeBlock( encoder_t *p_enc, void *p_data ) { if( i_result != S_FALSE ) msg_Dbg( p_enc, "ProcessOutput(): failed: %x", i_result ); -#if DMO_DEBUG +#ifdef DMO_DEBUG else msg_Dbg( p_enc, "ProcessOutput(): no output" ); #endif @@ -1502,7 +1526,7 @@ static block_t *EncodeBlock( encoder_t *p_enc, void *p_data ) if( !p_block_out->i_buffer ) { -#if DMO_DEBUG +#ifdef DMO_DEBUG msg_Dbg( p_enc, "ProcessOutput(): no output (i_buffer_out == 0)" ); #endif p_out->vt->Release( (IUnknown *)p_out ); @@ -1512,7 +1536,7 @@ static block_t *EncodeBlock( encoder_t *p_enc, void *p_data ) if( db.dwStatus & DMO_OUTPUT_DATA_BUFFERF_TIME ) { -#if DMO_DEBUG +#ifdef DMO_DEBUG msg_Dbg( p_enc, "ProcessOutput(): pts: "I64Fd", "I64Fd, i_pts, db.rtTimestamp / 10 ); #endif @@ -1522,7 +1546,7 @@ static block_t *EncodeBlock( encoder_t *p_enc, void *p_data ) if( db.dwStatus & DMO_OUTPUT_DATA_BUFFERF_TIMELENGTH ) { p_block_out->i_length = db.rtTimelength / 10; -#if DMO_DEBUG +#ifdef DMO_DEBUG msg_Dbg( p_enc, "ProcessOutput(): length: "I64Fd, p_block_out->i_length ); #endif