summaryrefslogtreecommitdiff
path: root/src/libw32dll
diff options
context:
space:
mode:
authorMiguel Freitas <miguelfreitas@users.sourceforge.net>2003-08-04 03:47:09 +0000
committerMiguel Freitas <miguelfreitas@users.sourceforge.net>2003-08-04 03:47:09 +0000
commited3497a1e20f74c28afc2124480c60fbdbf37fab (patch)
tree6ae75337cac3aa191151001085ed21d12e11385c /src/libw32dll
parentb0f659b58e295ab3c4b1bac9ed59e9cb3f29f308 (diff)
downloadxine-lib-ed3497a1e20f74c28afc2124480c60fbdbf37fab.tar.gz
xine-lib-ed3497a1e20f74c28afc2124480c60fbdbf37fab.tar.bz2
support for arbitrary aspect ratios
patch by Philip Jgenstedt CVS patchset: 5243 CVS date: 2003/08/04 03:47:09
Diffstat (limited to 'src/libw32dll')
-rw-r--r--src/libw32dll/qt_decoder.c8
-rw-r--r--src/libw32dll/w32codec.c9
2 files changed, 11 insertions, 6 deletions
diff --git a/src/libw32dll/qt_decoder.c b/src/libw32dll/qt_decoder.c
index 38c014cc0..fadcdae6d 100644
--- a/src/libw32dll/qt_decoder.c
+++ b/src/libw32dll/qt_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: qt_decoder.c,v 1.20 2003/05/10 04:26:18 tmmm Exp $
+ * $Id: qt_decoder.c,v 1.21 2003/08/04 03:47:10 miguelfreitas Exp $
*
* quicktime video/audio decoder plugin, using win32 dlls
* most of this code comes directly from MPlayer
@@ -688,6 +688,7 @@ typedef struct qtv_decoder_s {
HINSTANCE qtml_dll;
xine_bmiheader bih;
+ double ratio;
int codec_initialized;
@@ -1024,6 +1025,7 @@ static void qtv_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
#endif
memcpy (&this->bih, buf->content, sizeof (xine_bmiheader));
+ this->ratio = (double)this->bih.biWidth / (double)this->bih.biHeight;
/* video decoder only handles SVQ3 at this point */
this->stream->meta_info[XINE_META_INFO_VIDEOCODEC] =
@@ -1086,7 +1088,7 @@ static void qtv_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
img = this->stream->video_out->get_frame (this->stream->video_out,
this->bih.biWidth,
this->bih.biHeight,
- 42,
+ this->ratio,
XINE_IMGFMT_YUY2,
VO_BOTH_FIELDS);
@@ -1232,7 +1234,7 @@ static decoder_info_t qtv_dec_info = {
plugin_info_t xine_plugin_info[] = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_DECODER | PLUGIN_MUST_PRELOAD, 14, "qtv", XINE_VERSION_CODE, &qtv_dec_info, qtv_init_class },
+ { PLUGIN_VIDEO_DECODER | PLUGIN_MUST_PRELOAD, 15, "qtv", XINE_VERSION_CODE, &qtv_dec_info, qtv_init_class },
{ PLUGIN_AUDIO_DECODER | PLUGIN_MUST_PRELOAD, 13, "qta", XINE_VERSION_CODE, &qta_dec_info, qta_init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/libw32dll/w32codec.c b/src/libw32dll/w32codec.c
index 442ccf1b2..5742846a1 100644
--- a/src/libw32dll/w32codec.c
+++ b/src/libw32dll/w32codec.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: w32codec.c,v 1.124 2003/07/16 00:25:38 tmattern Exp $
+ * $Id: w32codec.c,v 1.125 2003/08/04 03:47:10 miguelfreitas Exp $
*
* routines for using w32 codecs
* DirectShow support by Miguel Freitas (Nov/2001)
@@ -141,6 +141,7 @@ typedef struct w32v_decoder_s {
int decoder_ok;
BITMAPINFOHEADER *bih, o_bih;
+ double ratio;
char scratch1[16]; /* some codecs overflow o_bih */
HIC hic;
int yuv_supported ;
@@ -709,6 +710,8 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
memcpy ( this->bih, buf->content, buf->size );
this->video_step = buf->decoder_info[1];
+ this->ratio = (double)this->bih->biWidth/(double)this->bih->biHeight;
+
this->stream->stream_info[XINE_STREAM_INFO_VIDEO_WIDTH] = this->bih->biWidth;
this->stream->stream_info[XINE_STREAM_INFO_VIDEO_HEIGHT] = this->bih->biHeight;
this->stream->stream_info[XINE_STREAM_INFO_FRAME_DURATION] = this->video_step;
@@ -783,7 +786,7 @@ static void w32v_decode_data (video_decoder_t *this_gen, buf_element_t *buf) {
img = this->stream->video_out->get_frame (this->stream->video_out,
this->bih->biWidth,
this->bih->biHeight,
- 42,
+ this->ratio,
IMGFMT_YUY2,
VO_BOTH_FIELDS);
@@ -1621,7 +1624,7 @@ static decoder_info_t dec_info_audio = {
plugin_info_t xine_plugin_info[] = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_VIDEO_DECODER | PLUGIN_MUST_PRELOAD, 14, "win32v", XINE_VERSION_CODE, &dec_info_video, init_video_decoder_class },
+ { PLUGIN_VIDEO_DECODER | PLUGIN_MUST_PRELOAD, 15, "win32v", XINE_VERSION_CODE, &dec_info_video, init_video_decoder_class },
{ PLUGIN_AUDIO_DECODER | PLUGIN_MUST_PRELOAD, 13, "win32a", XINE_VERSION_CODE, &dec_info_audio, init_audio_decoder_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};