Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
fa94ffd5
Commit
fa94ffd5
authored
Nov 19, 2002
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
all: Use BITMAPINFOHEADER everywhere (Needed because of endian issue).
parent
4961a874
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
29 deletions
+57
-29
modules/demux/asf/asf.c
modules/demux/asf/asf.c
+29
-6
modules/demux/mp4/mp4.c
modules/demux/mp4/mp4.c
+28
-23
No files found.
modules/demux/asf/asf.c
View file @
fa94ffd5
...
...
@@ -2,7 +2,7 @@
* asf.c : ASFv01 file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: asf.c,v 1.
6 2002/11/15 18:10:26
fenrir Exp $
* $Id: asf.c,v 1.
7 2002/11/19 17:23:21
fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -266,11 +266,34 @@ static int Activate( vlc_object_t * p_this )
}
if
(
p_sp
->
i_type_specific_data_length
>
11
)
{
p_stream
->
p_es
->
p_demux_data
=
malloc
(
p_sp
->
i_type_specific_data_length
-
11
);
memcpy
(
p_stream
->
p_es
->
p_demux_data
,
p_sp
->
p_type_specific_data
+
11
,
p_sp
->
i_type_specific_data_length
-
11
);
BITMAPINFOHEADER
*
p_bih
;
int
i_size
;
uint8_t
*
p_data
;
i_size
=
p_sp
->
i_type_specific_data_length
-
11
;
p_bih
=
malloc
(
i_size
);
p_stream
->
p_es
->
p_demux_data
=
(
void
*
)
p_bih
;
p_data
=
p_sp
->
p_type_specific_data
+
11
;
p_bih
->
biSize
=
GetDWLE
(
p_data
);
p_bih
->
biWidth
=
GetDWLE
(
p_data
+
4
);
p_bih
->
biHeight
=
GetDWLE
(
p_data
+
8
);
p_bih
->
biPlanes
=
GetDWLE
(
p_data
+
12
);
p_bih
->
biBitCount
=
GetDWLE
(
p_data
+
14
);
p_bih
->
biCompression
=
GetDWLE
(
p_data
+
16
);
p_bih
->
biSizeImage
=
GetDWLE
(
p_data
+
20
);
p_bih
->
biXPelsPerMeter
=
GetDWLE
(
p_data
+
24
);
p_bih
->
biYPelsPerMeter
=
GetDWLE
(
p_data
+
28
);
p_bih
->
biClrUsed
=
GetDWLE
(
p_data
+
32
);
p_bih
->
biClrImportant
=
GetDWLE
(
p_data
+
36
);
if
(
i_size
>
sizeof
(
BITMAPINFOHEADER
)
)
{
memcpy
(
(
uint8_t
*
)
p_stream
->
p_es
->
p_demux_data
+
sizeof
(
BITMAPINFOHEADER
),
p_data
+
sizeof
(
BITMAPINFOHEADER
),
i_size
-
sizeof
(
BITMAPINFOHEADER
)
);
}
}
}
...
...
modules/demux/mp4/mp4.c
View file @
fa94ffd5
...
...
@@ -2,7 +2,7 @@
* mp4.c : MP4 file input module for vlc
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: mp4.c,v 1.
5 2002/11/17 06:46:56
fenrir Exp $
* $Id: mp4.c,v 1.
6 2002/11/19 17:23:21
fenrir Exp $
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
* This program is free software; you can redistribute it and/or modify
...
...
@@ -30,7 +30,7 @@
#include <vlc/vlc.h>
#include <vlc/input.h>
#include "codecs.h"
#include "libmp4.h"
#include "mp4.h"
...
...
@@ -901,8 +901,9 @@ static void MP4_StartDecoder( input_thread_t *p_input,
int
i_decoder_specific_info_len
;
uint8_t
*
p_decoder_specific_info
;
uint8_t
*
p_init
;
uint8_t
*
p_init
;
BITMAPINFOHEADER
*
p_bih
;
MP4_Box_t
*
p_esds
;
...
...
@@ -1047,31 +1048,35 @@ static void MP4_StartDecoder( input_thread_t *p_input,
case
(
VIDEO_ES
):
/* now create a bitmapinfoheader_t for decoder and
add information found in p_esds */
p_init
=
malloc
(
40
+
i_decoder_specific_info_len
);
memset
(
p_init
,
0
,
40
+
i_decoder_specific_info_len
);
MP4_Set4BytesLE
(
p_init
,
40
+
i_decoder_specific_info_len
);
if
(
p_sample
->
data
.
p_sample_vide
->
i_width
)
{
MP4_Set4BytesLE
(
p_init
+
4
,
p_sample
->
data
.
p_sample_vide
->
i_width
);
}
else
p_init
=
malloc
(
sizeof
(
BITMAPINFOHEADER
)
+
i_decoder_specific_info_len
);
p_bih
=
(
BITMAPINFOHEADER
*
)
p_init
;
p_bih
->
biSize
=
sizeof
(
BITMAPINFOHEADER
)
+
i_decoder_specific_info_len
;
p_bih
->
biWidth
=
p_sample
->
data
.
p_sample_vide
->
i_width
;
p_bih
->
biHeight
=
p_sample
->
data
.
p_sample_vide
->
i_height
;
p_bih
->
biPlanes
=
1
;
// FIXME
p_bih
->
biBitCount
=
0
;
// FIXME
p_bih
->
biCompression
=
0
;
// FIXME
p_bih
->
biSizeImage
=
0
;
// FIXME
p_bih
->
biXPelsPerMeter
=
0
;
// FIXME
p_bih
->
biYPelsPerMeter
=
0
;
// FIXME
p_bih
->
biClrUsed
=
0
;
// FIXME
p_bih
->
biClrImportant
=
0
;
// FIXME
if
(
p_bih
->
biWidth
==
0
)
{
/
* use display size */
MP4_Set4BytesLE
(
p_init
+
4
,
p_demux_track
->
i_width
)
;
/
/ fall on display size
p_bih
->
biWidth
=
p_demux_track
->
i_width
;
}
if
(
p_
sample
->
data
.
p_sample_vide
->
i_height
)
if
(
p_
bih
->
biHeight
==
0
)
{
MP4_Set4BytesLE
(
p_init
+
8
,
p_sample
->
data
.
p_sample_vide
->
i_height
);
}
else
{
MP4_Set4BytesLE
(
p_init
+
8
,
p_demux_track
->
i_height
);
// fall on display size
p_bih
->
biHeight
=
p_demux_track
->
i_height
;
}
if
(
i_decoder_specific_info_len
)
{
memcpy
(
p_init
+
40
,
memcpy
(
p_init
+
sizeof
(
BITMAPINFOHEADER
)
,
p_decoder_specific_info
,
i_decoder_specific_info_len
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment