Commit ee1cc51e authored by Rafaël Carré's avatar Rafaël Carré Committed by Jean-Baptiste Kempf

dmo: use VLC BITMAPINFO types

close #5950
(cherry picked from commit 22466842)
Signed-off-by: default avatarKO Myung-Hun <komh@chollian.net>
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent e9febc4c
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include <vlc_common.h> #include <vlc_common.h>
#include <vlc_plugin.h> #include <vlc_plugin.h>
#include <vlc_codec.h> #include <vlc_codec.h>
#include <vlc_codecs.h>
#include <vlc_aout.h> #include <vlc_aout.h>
#ifndef WIN32 #ifndef WIN32
...@@ -420,7 +421,7 @@ static int DecOpen( decoder_t *p_dec ) ...@@ -420,7 +421,7 @@ static int DecOpen( decoder_t *p_dec )
} }
else else
{ {
BITMAPINFOHEADER *p_bih; VLC_BITMAPINFOHEADER *p_bih;
int i_size = sizeof(VIDEOINFOHEADER) + p_dec->fmt_in.i_extra; int i_size = sizeof(VIDEOINFOHEADER) + p_dec->fmt_in.i_extra;
p_vih = malloc( i_size ); p_vih = malloc( i_size );
...@@ -436,7 +437,7 @@ static int DecOpen( decoder_t *p_dec ) ...@@ -436,7 +437,7 @@ static int DecOpen( decoder_t *p_dec )
p_bih->biBitCount = p_dec->fmt_in.video.i_bits_per_pixel; p_bih->biBitCount = p_dec->fmt_in.video.i_bits_per_pixel;
p_bih->biPlanes = 1; p_bih->biPlanes = 1;
p_bih->biSize = i_size - sizeof(VIDEOINFOHEADER) + p_bih->biSize = i_size - sizeof(VIDEOINFOHEADER) +
sizeof(BITMAPINFOHEADER); sizeof(VLC_BITMAPINFOHEADER);
p_vih->rcSource.left = p_vih->rcSource.top = 0; p_vih->rcSource.left = p_vih->rcSource.top = 0;
p_vih->rcSource.right = p_dec->fmt_in.video.i_width; p_vih->rcSource.right = p_dec->fmt_in.video.i_width;
...@@ -496,7 +497,7 @@ static int DecOpen( decoder_t *p_dec ) ...@@ -496,7 +497,7 @@ static int DecOpen( decoder_t *p_dec )
} }
else else
{ {
BITMAPINFOHEADER *p_bih; VLC_BITMAPINFOHEADER *p_bih;
DMO_MEDIA_TYPE mt; DMO_MEDIA_TYPE mt;
unsigned i_chroma = VLC_CODEC_YUYV; unsigned i_chroma = VLC_CODEC_YUYV;
int i_bpp = 16; int i_bpp = 16;
...@@ -542,7 +543,7 @@ static int DecOpen( decoder_t *p_dec ) ...@@ -542,7 +543,7 @@ static int DecOpen( decoder_t *p_dec )
(p_dec->fmt_in.video.i_bits_per_pixel + 7) / 8; (p_dec->fmt_in.video.i_bits_per_pixel + 7) / 8;
p_bih->biPlanes = 1; /* http://msdn.microsoft.com/en-us/library/dd183376%28v=vs.85%29.aspx */ p_bih->biPlanes = 1; /* http://msdn.microsoft.com/en-us/library/dd183376%28v=vs.85%29.aspx */
p_bih->biSize = sizeof(BITMAPINFOHEADER); p_bih->biSize = sizeof(VLC_BITMAPINFOHEADER);
dmo_output_type.majortype = MEDIATYPE_Video; dmo_output_type.majortype = MEDIATYPE_Video;
dmo_output_type.formattype = FORMAT_VideoInfo; dmo_output_type.formattype = FORMAT_VideoInfo;
...@@ -1108,7 +1109,7 @@ static int EncoderSetVideoType( encoder_t *p_enc, IMediaObject *p_dmo ) ...@@ -1108,7 +1109,7 @@ static int EncoderSetVideoType( encoder_t *p_enc, IMediaObject *p_dmo )
int i, i_selected, i_err; int i, i_selected, i_err;
DMO_MEDIA_TYPE dmo_type; DMO_MEDIA_TYPE dmo_type;
VIDEOINFOHEADER vih, *p_vih; VIDEOINFOHEADER vih, *p_vih;
BITMAPINFOHEADER *p_bih; VLC_BITMAPINFOHEADER *p_bih;
/* FIXME */ /* FIXME */
p_enc->fmt_in.video.i_bits_per_pixel = p_enc->fmt_in.video.i_bits_per_pixel =
...@@ -1142,7 +1143,7 @@ static int EncoderSetVideoType( encoder_t *p_enc, IMediaObject *p_dmo ) ...@@ -1142,7 +1143,7 @@ static int EncoderSetVideoType( encoder_t *p_enc, IMediaObject *p_dmo )
p_bih->biSizeImage = p_enc->fmt_in.video.i_width * p_bih->biSizeImage = p_enc->fmt_in.video.i_width *
p_enc->fmt_in.video.i_height * p_enc->fmt_in.video.i_bits_per_pixel /8; p_enc->fmt_in.video.i_height * p_enc->fmt_in.video.i_bits_per_pixel /8;
p_bih->biPlanes = 3; p_bih->biPlanes = 3;
p_bih->biSize = sizeof(BITMAPINFOHEADER); p_bih->biSize = sizeof(VLC_BITMAPINFOHEADER);
vih.rcSource.left = vih.rcSource.top = 0; vih.rcSource.left = vih.rcSource.top = 0;
vih.rcSource.right = p_enc->fmt_in.video.i_width; vih.rcSource.right = p_enc->fmt_in.video.i_width;
......
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