Browse Source

modules: remove write-only video format i_bits_per_pixel

pull/162/head
Steve Lhomme 3 years ago
parent
commit
cf2613a72c
  1. 1
      modules/access/screen/mac.c
  2. 1
      modules/access/screen/wayland.c
  3. 1
      modules/access/vnc.c
  4. 1
      modules/codec/arib/libaribcaption.c
  5. 5
      modules/codec/dmo/dmo.c
  6. 1
      modules/codec/kate.c
  7. 1
      modules/codec/libass.c
  8. 1
      modules/codec/qsv.c
  9. 3
      modules/codec/schroedinger.c
  10. 7
      modules/codec/zvbi.c
  11. 1
      modules/demux/avformat/demux.c
  12. 3
      modules/demux/mp4/essetup.c
  13. 11
      modules/demux/ogg.c
  14. 10
      modules/demux/rawvid.c
  15. 1
      modules/demux/smooth/playlist/CodecParameters.cpp
  16. 2
      modules/hw/nvdec/nvdec.c
  17. 1
      modules/text_renderer/svg.c
  18. 98
      src/misc/es_format.c

1
modules/access/screen/mac.c

@ -130,7 +130,6 @@ int screen_InitCapture(demux_t *p_demux)
p_sys->fmt.video.i_width = rect.size.width;
p_sys->fmt.video.i_visible_height =
p_sys->fmt.video.i_height = rect.size.height;
p_sys->fmt.video.i_bits_per_pixel = 32;
p_sys->fmt.video.i_chroma = VLC_CODEC_RGB32;
p_sys->fmt.video.i_rmask = 0x00ff0000;
p_sys->fmt.video.i_gmask = 0x0000ff00;

1
modules/access/screen/wayland.c

@ -123,7 +123,6 @@ static void output_mode_cb(void *data, struct wl_output *output,
es_format_Init(&fmt, VIDEO_ES, VLC_CODEC_RGB32);
fmt.video.i_chroma = VLC_CODEC_RGB32;
fmt.video.i_bits_per_pixel = 32;
fmt.video.i_sar_num = fmt.video.i_sar_den = 1;
fmt.video.i_frame_rate = lroundf(1000.f * sys->rate);
fmt.video.i_frame_rate_base = 1000;

1
modules/access/vnc.c

@ -230,7 +230,6 @@ static rfbBool mallocFrameBufferHandler( rfbClient* p_client )
fmt.video.i_frame_rate_base = 1000;
fmt.video.i_frame_rate = 1000 * p_sys->f_fps;
fmt.video.i_bits_per_pixel = i_bits_per_pixel;
fmt.video.i_sar_num = fmt.video.i_sar_den = 1;
/* declare the new es */

1
modules/codec/arib/libaribcaption.c

@ -167,7 +167,6 @@ static void SubpictureUpdate(subpicture_t *p_subpic,
fmt.i_rmask = 0;
fmt.i_gmask = 0;
fmt.i_bmask = 0;
fmt.i_bits_per_pixel = 0;
fmt.i_x_offset = 0;
fmt.i_y_offset = 0;

5
modules/codec/dmo/dmo.c

@ -458,7 +458,6 @@ static int DecOpen( decoder_t *p_dec )
p_dec->fmt_out.i_codec = i_chroma == VLC_CODEC_YV12 ? VLC_CODEC_I420 : i_chroma;
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 = vlc_fourcc_GetChromaBPP(i_chroma);
/* If an aspect-ratio was specified in the input format then force it */
if( p_dec->fmt_in->video.i_sar_num > 0 &&
@ -1060,10 +1059,6 @@ static int EncoderSetVideoType( encoder_t *p_enc, IMediaObject *p_dmo )
VIDEOINFOHEADER vih, *p_vih;
BITMAPINFOHEADER *p_bih;
/* FIXME */
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) */
i = 0;
while( !IMediaObject_GetInputType( p_dmo, 0, i++, &dmo_type ) )

1
modules/codec/kate.c

@ -859,7 +859,6 @@ static void TigerUpdateSubpicture( subpicture_t *p_subpic,
/* create a full frame region - this will also tell Tiger the size of the frame */
video_format_t fmt = *p_fmt_dst;
fmt.i_chroma = VLC_CODEC_RGBA;
fmt.i_bits_per_pixel = 0;
fmt.i_width =
fmt.i_visible_width = p_fmt_src->i_width;
fmt.i_height =

1
modules/codec/libass.c

@ -433,7 +433,6 @@ static int SubpictureValidate( subpicture_t *p_subpic,
video_format_t fmt = *p_fmt_dst;
fmt.i_chroma = VLC_CODEC_RGBA;
fmt.i_bits_per_pixel = 0;
fmt.i_x_offset = 0;
fmt.i_y_offset = 0;
if( b_fmt_src || b_fmt_dst )

1
modules/codec/qsv.c

@ -622,7 +622,6 @@ static int Open(vlc_object_t *this)
enc->fmt_in.video.i_rmask = 0;
enc->fmt_in.video.i_gmask = 0;
enc->fmt_in.video.i_bmask = 0;
enc->fmt_in.video.i_bits_per_pixel = 12;
// require aligned pictures on input, a filter may be added before the encoder
enc->fmt_in.video.i_width = sys->params.mfx.FrameInfo.Width;
enc->fmt_in.video.i_height = sys->params.mfx.FrameInfo.Height;

3
modules/codec/schroedinger.c

@ -1021,17 +1021,14 @@ static bool SetEncChromaFormat( encoder_t *p_enc, uint32_t i_codec )
switch( i_codec ) {
case VLC_CODEC_I420:
p_enc->fmt_in.i_codec = i_codec;
p_enc->fmt_in.video.i_bits_per_pixel = 12;
p_sys->p_format->chroma_format = SCHRO_CHROMA_420;
break;
case VLC_CODEC_I422:
p_enc->fmt_in.i_codec = i_codec;
p_enc->fmt_in.video.i_bits_per_pixel = 16;
p_sys->p_format->chroma_format = SCHRO_CHROMA_422;
break;
case VLC_CODEC_I444:
p_enc->fmt_in.i_codec = i_codec;
p_enc->fmt_in.video.i_bits_per_pixel = 24;
p_sys->p_format->chroma_format = SCHRO_CHROMA_444;
break;
default:

7
modules/codec/zvbi.c

@ -538,15 +538,10 @@ static subpicture_t *Subpicture( decoder_t *p_dec, video_format_t *p_fmt,
}
video_format_Init(&fmt, b_text ? VLC_CODEC_TEXT : VLC_CODEC_RGBA);
if( b_text )
{
fmt.i_bits_per_pixel = 0;
}
else
if( !b_text )
{
fmt.i_width = fmt.i_visible_width = i_columns * 12;
fmt.i_height = fmt.i_visible_height = i_rows * 10;
fmt.i_bits_per_pixel = 32;
fmt.i_sar_num = fmt.i_sar_den = 0; /* let the vout set the correct AR */
}
fmt.i_x_offset = fmt.i_y_offset = 0;

1
modules/demux/avformat/demux.c

@ -495,7 +495,6 @@ int avformat_OpenDemux( vlc_object_t *p_this )
es_format_Init( &es_fmt, VIDEO_ES, fcc );
es_fmt.i_original_fourcc = CodecTagToFourcc( cp->codec_tag );
es_fmt.video.i_bits_per_pixel = cp->bits_per_coded_sample;
/* Special case for raw video data */
if( cp->codec_id == AV_CODEC_ID_RAWVIDEO )
{

3
modules/demux/mp4/essetup.c

@ -290,7 +290,6 @@ int SetupVideoES( demux_t *p_demux, const mp4_track_t *p_track, const MP4_Box_t
p_fmt->video.i_width = p_vide->i_width;
p_fmt->video.i_height = p_vide->i_height;
p_fmt->video.i_bits_per_pixel = p_vide->i_depth;
/* fall on display size */
if( p_fmt->video.i_width <= 0 )
@ -722,7 +721,6 @@ int SetupVideoES( demux_t *p_demux, const mp4_track_t *p_track, const MP4_Box_t
}
p_fmt->video.color_range = p_data->i_fullrange ? COLOR_RANGE_FULL : COLOR_RANGE_LIMITED;
p_fmt->video.i_bits_per_pixel = p_data->i_bit_depth;
CopyExtradata( p_data->p_codec_init_data,
p_data->i_codec_init_datasize,
@ -766,7 +764,6 @@ int SetupVideoES( demux_t *p_demux, const mp4_track_t *p_track, const MP4_Box_t
p_fmt->video.i_visible_width = p_fmt->video.i_width;
p_fmt->video.i_height = BOXDATA(p_strf)->bmiHeader.biHeight;
p_fmt->video.i_visible_height =p_fmt->video.i_height;
p_fmt->video.i_bits_per_pixel = BOXDATA(p_strf)->bmiHeader.biBitCount;
CopyExtradata( BOXDATA(p_strf)->p_extra,
BOXDATA(p_strf)->i_extra,
p_fmt );

11
modules/demux/ogg.c

@ -1866,11 +1866,7 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
p_stream->fmt.video.i_frame_rate = num;
p_stream->fmt.video.i_frame_rate_base = den;
date_Init( &p_stream->dts, num, den );
p_stream->fmt.video.i_bits_per_pixel =
GetWLE((oggpacket.packet+182));
if( !p_stream->fmt.video.i_bits_per_pixel )
/* hack, FIXME */
p_stream->fmt.video.i_bits_per_pixel = 24;
unsigned bpp = GetWLE((oggpacket.packet+182));
p_stream->fmt.video.i_width =
GetDWLE((oggpacket.packet+176));
p_stream->fmt.video.i_height =
@ -1886,7 +1882,7 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
p_stream->fmt.video.i_frame_rate_base,
p_stream->fmt.video.i_width,
p_stream->fmt.video.i_height,
p_stream->fmt.video.i_bits_per_pixel);
bpp);
if ( !p_stream->fmt.video.i_frame_rate ||
!p_stream->fmt.video.i_frame_rate_base )
@ -2018,7 +2014,6 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
date_Init( &p_stream->dts, num, den );
p_stream->fmt.video.i_frame_rate = num;
p_stream->fmt.video.i_frame_rate_base = den;
p_stream->fmt.video.i_bits_per_pixel = st->bits_per_sample;
p_stream->fmt.video.i_width = st->sh.video.width;
p_stream->fmt.video.i_height = st->sh.video.height;
p_stream->fmt.video.i_visible_width =
@ -2032,7 +2027,7 @@ static int Ogg_FindLogicalStreams( demux_t *p_demux )
p_stream->fmt.video.i_frame_rate_base,
p_stream->fmt.video.i_width,
p_stream->fmt.video.i_height,
p_stream->fmt.video.i_bits_per_pixel );
st->bits_per_sample );
}
/* Check for audio header (new format) */
else if( !strncmp( st->streamtype, "audio", 5 ) &&

10
modules/demux/rawvid.c

@ -340,16 +340,16 @@ valid:
p_sys->fmt_video.video.i_frame_rate_base );
date_Set( &p_sys->pcr, VLC_TICK_0 );
if( !p_sys->fmt_video.video.i_bits_per_pixel )
const vlc_chroma_description_t *dsc =
vlc_fourcc_GetChromaDescription(p_sys->fmt_video.video.i_chroma);
if (unlikely(dsc == NULL))
goto error;
if (dsc->plane_count == 0)
{
msg_Err( p_demux, "Unsupported chroma 0x%.8x (%4.4s)", i_chroma,
(char*)&i_chroma );
goto error;
}
const vlc_chroma_description_t *dsc =
vlc_fourcc_GetChromaDescription(p_sys->fmt_video.video.i_chroma);
if (unlikely(dsc == NULL))
goto error;
p_sys->frame_size = 0;
for (unsigned i=0; i<dsc->plane_count; i++)
{

1
modules/demux/smooth/playlist/CodecParameters.cpp

@ -120,7 +120,6 @@ void CodecParameters::initAndFillEsFmt(es_format_t *fmt) const
else if( fmt->i_codec == VLC_FOURCC( 'W', 'V', 'C', '1' ) )
{
fmt->i_codec = VLC_CODEC_VC1;
// fmt->video.i_bits_per_pixel = 0x18; // No clue why this was set in smooth streamfilter
}
FillExtradata(fmt, extradata);

2
modules/hw/nvdec/nvdec.c

@ -245,7 +245,6 @@ static int CUtoFMT(video_format_t *fmt, const CUVIDEOFORMAT *p_format)
// frame rate
fmt->i_frame_rate = p_format->frame_rate.numerator;
fmt->i_frame_rate_base = p_format->frame_rate.denominator;
fmt->i_bits_per_pixel = i_bpp;
return VLC_SUCCESS;
}
@ -964,7 +963,6 @@ static int OpenDecoder(vlc_object_t *p_this)
p_dec->fmt_out.video.i_sar_num = i_sar_num;
p_dec->fmt_out.video.i_sar_den = i_sar_den;
#undef ALIGN
p_dec->fmt_out.video.i_bits_per_pixel = i_depth_luma;
p_dec->fmt_out.video.i_frame_rate = p_dec->fmt_in->video.i_frame_rate;
p_dec->fmt_out.video.i_frame_rate_base = p_dec->fmt_in->video.i_frame_rate_base;

1
modules/text_renderer/svg.c

@ -252,7 +252,6 @@ static picture_t * svg_RenderPicture( filter_t *p_filter,
/* Create a new subpicture region */
video_format_t fmt;
video_format_Init( &fmt, VLC_CODEC_BGRA ); /* CAIRO_FORMAT_ARGB32 == VLC_CODEC_BGRA, go figure */
fmt.i_bits_per_pixel = 32;
fmt.i_chroma = VLC_CODEC_BGRA;
fmt.i_width = fmt.i_visible_width = dim.width;
fmt.i_height = fmt.i_visible_height = dim.height;

98
src/misc/es_format.c

@ -90,104 +90,6 @@ void video_format_Setup( video_format_t *p_fmt, vlc_fourcc_t i_chroma,
vlc_ureduce( &p_fmt->i_sar_num, &p_fmt->i_sar_den,
i_sar_num, i_sar_den, 0 );
video_format_FixRgb( p_fmt );
switch( p_fmt->i_chroma )
{
case VLC_CODEC_YUVA:
p_fmt->i_bits_per_pixel = 32;
break;
case VLC_CODEC_YUV420A:
p_fmt->i_bits_per_pixel = 20;
break;
case VLC_CODEC_YUV422A:
p_fmt->i_bits_per_pixel = 24;
break;
case VLC_CODEC_I444:
case VLC_CODEC_J444:
p_fmt->i_bits_per_pixel = 24;
break;
case VLC_CODEC_I422:
case VLC_CODEC_YUYV:
case VLC_CODEC_YVYU:
case VLC_CODEC_UYVY:
case VLC_CODEC_YUV2:
case VLC_CODEC_VYUY:
case VLC_CODEC_J422:
p_fmt->i_bits_per_pixel = 16;
break;
case VLC_CODEC_I440:
case VLC_CODEC_J440:
p_fmt->i_bits_per_pixel = 16;
break;
case VLC_CODEC_P010:
p_fmt->i_bits_per_pixel = 15;
break;
case VLC_CODEC_P016:
p_fmt->i_bits_per_pixel = 20;
break;
case VLC_CODEC_I411:
case VLC_CODEC_YV12:
case VLC_CODEC_I420:
case VLC_CODEC_J420:
case VLC_CODEC_NV12:
p_fmt->i_bits_per_pixel = 12;
break;
case VLC_CODEC_YV9:
case VLC_CODEC_I410:
p_fmt->i_bits_per_pixel = 9;
break;
case VLC_CODEC_Y211:
p_fmt->i_bits_per_pixel = 8;
break;
case VLC_CODEC_YUVP:
p_fmt->i_bits_per_pixel = 8;
break;
case VLC_CODEC_RGB32:
case VLC_CODEC_RGBA:
case VLC_CODEC_ARGB:
case VLC_CODEC_BGRA:
case VLC_CODEC_ABGR:
case VLC_CODEC_RGBX:
case VLC_CODEC_XRGB:
case VLC_CODEC_BGRX:
case VLC_CODEC_XBGR:
p_fmt->i_bits_per_pixel = 32;
break;
case VLC_CODEC_RGB24:
p_fmt->i_bits_per_pixel = 24;
break;
case VLC_CODEC_RGB15:
case VLC_CODEC_RGB16:
p_fmt->i_bits_per_pixel = 16;
break;
case VLC_CODEC_RGB8:
p_fmt->i_bits_per_pixel = 8;
break;
case VLC_CODEC_GREY:
case VLC_CODEC_RGBP:
p_fmt->i_bits_per_pixel = 8;
break;
case VLC_CODEC_GREY_10B:
case VLC_CODEC_GREY_10L:
p_fmt->i_bits_per_pixel = 10;
break;
case VLC_CODEC_GREY_12B:
case VLC_CODEC_GREY_12L:
p_fmt->i_bits_per_pixel = 12;
break;
case VLC_CODEC_XYZ12:
p_fmt->i_bits_per_pixel = 48;
break;
default:
p_fmt->i_bits_per_pixel = 0;
break;
}
}
void video_format_CopyCrop( video_format_t *p_dst, const video_format_t *p_src )

Loading…
Cancel
Save