Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
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-gpu
Commits
c9aee938
Commit
c9aee938
authored
Nov 26, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove block_t->p_sys, which is not really needed either.
parent
3de41162
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
37 deletions
+28
-37
include/vlc_block.h
include/vlc_block.h
+0
-5
modules/access/screen/win32.c
modules/access/screen/win32.c
+8
-8
src/misc/block.c
src/misc/block.c
+20
-24
No files found.
include/vlc_block.h
View file @
c9aee938
...
...
@@ -99,11 +99,6 @@ struct block_t
* Don't mess with it now, if you need it the ask on ML
*/
void
(
*
pf_release
)
(
block_t
*
);
/* Following fields are private, user should never touch it */
/* XXX never touch that OK !!! the first that access that will
* have Subversion account removed ;) XXX */
block_sys_t
*
p_sys
;
};
/****************************************************************************
...
...
modules/access/screen/win32.c
View file @
c9aee938
...
...
@@ -157,6 +157,7 @@ int screen_CloseCapture( demux_t *p_demux )
struct
block_sys_t
{
block_t
self
;
HBITMAP
hbmp
;
};
...
...
@@ -170,7 +171,7 @@ static block_t *CaptureBlockNew( demux_t *p_demux )
{
demux_sys_t
*
p_sys
=
p_demux
->
p_sys
;
screen_data_t
*
p_data
=
p_sys
->
p_data
;
block_t
*
p_block
;
block_
sys_
t
*
p_block
;
void
*
p_buffer
;
int
i_buffer
;
HBITMAP
hbmp
;
...
...
@@ -204,17 +205,16 @@ static block_t *CaptureBlockNew( demux_t *p_demux )
DeleteObject
(
hbmp
);
return
NULL
;
}
memset
(
p_block
,
0
,
sizeof
(
block_t
)
);
p_block
->
p_sys
=
(
block_sys_t
*
)(
(
uint8_t
*
)
p_block
+
sizeof
(
block_t
)
);
memset
(
&
p_block
->
self
,
0
,
sizeof
(
block_t
->
self
)
);
/* Fill all fields */
i_buffer
=
(
p_sys
->
fmt
.
video
.
i_bits_per_pixel
+
7
)
/
8
*
p_sys
->
fmt
.
video
.
i_width
*
p_sys
->
fmt
.
video
.
i_height
;
p_block
->
p_next
=
NULL
;
p_block
->
i_buffer
=
i_buffer
;
p_block
->
p_buffer
=
p_buffer
;
p_block
->
pf_release
=
CaptureBlockRelease
;
p_block
->
p_sys
->
hbmp
=
hbmp
;
p_block
->
self
.
p_next
=
NULL
;
p_block
->
self
.
i_buffer
=
i_buffer
;
p_block
->
self
.
p_buffer
=
p_buffer
;
p_block
->
self
.
pf_release
=
CaptureBlockRelease
;
p_block
->
hbmp
=
hbmp
;
return
p_block
;
}
...
...
src/misc/block.c
View file @
c9aee938
...
...
@@ -33,6 +33,7 @@
/* private */
struct
block_sys_t
{
block_t
self
;
size_t
i_allocated_buffer
;
uint8_t
p_allocated_buffer
[
0
];
};
...
...
@@ -47,40 +48,35 @@ block_t *__block_New( vlc_object_t *p_obj, size_t i_size )
* 16 -> align on 16
* 2 * BLOCK_PADDING_SIZE -> pre + post padding
*/
block_sys_t
*
p_sys
;
const
size_t
i_alloc
=
i_size
+
2
*
BLOCK_PADDING_SIZE
+
16
;
block_t
*
p_block
=
malloc
(
sizeof
(
block_t
)
+
sizeof
(
block_sys_t
)
+
i_alloc
);
block_sys_t
*
p_sys
=
malloc
(
sizeof
(
*
p_sys
)
+
i_alloc
);
if
(
p_
block
==
NULL
)
if
(
p_
sys
==
NULL
)
return
NULL
;
/* Fill opaque data */
p_sys
=
(
block_sys_t
*
)(
(
uint8_t
*
)
p_block
+
sizeof
(
block_t
)
);
p_sys
->
i_allocated_buffer
=
i_alloc
;
/* Fill all fields */
p_
block
->
p_next
=
NULL
;
p_
block
->
p_prev
=
NULL
;
p_
block
->
i_flags
=
0
;
p_
block
->
i_pts
=
0
;
p_
block
->
i_dts
=
0
;
p_
block
->
i_length
=
0
;
p_
block
->
i_rate
=
0
;
p_
block
->
i_buffer
=
i_size
;
p_
block
->
p_buffer
=
p_
sys
->
self
.
p_next
=
NULL
;
p_
sys
->
self
.
p_prev
=
NULL
;
p_
sys
->
self
.
i_flags
=
0
;
p_
sys
->
self
.
i_pts
=
0
;
p_
sys
->
self
.
i_dts
=
0
;
p_
sys
->
self
.
i_length
=
0
;
p_
sys
->
self
.
i_rate
=
0
;
p_
sys
->
self
.
i_buffer
=
i_size
;
p_
sys
->
self
.
p_buffer
=
&
p_sys
->
p_allocated_buffer
[
BLOCK_PADDING_SIZE
+
16
-
((
uintptr_t
)
p_sys
->
p_allocated_buffer
%
16
)];
p_
block
->
pf_release
=
BlockRelease
;
p_
sys
->
self
.
pf_release
=
BlockRelease
;
/* Is ok, as no comunication between p_vlc */
p_block
->
p_sys
=
p_sys
;
return
p_block
;
return
&
p_sys
->
self
;
}
block_t
*
block_Realloc
(
block_t
*
p_block
,
ssize_t
i_prebody
,
size_t
i_body
)
{
block_sys_t
*
p_sys
=
(
block_sys_t
*
)
p_block
;
ssize_t
i_buffer_size
;
if
(
p_block
->
pf_release
!=
BlockRelease
)
...
...
@@ -103,16 +99,16 @@ block_t *block_Realloc( block_t *p_block, ssize_t i_prebody, size_t i_body )
return
NULL
;
}
if
(
p_block
->
p_buffer
-
i_prebody
>
p_
block
->
p_
sys
->
p_allocated_buffer
&&
p_block
->
p_buffer
-
i_prebody
<
p_
block
->
p_
sys
->
p_allocated_buffer
+
p_
block
->
p_
sys
->
i_allocated_buffer
)
if
(
p_block
->
p_buffer
-
i_prebody
>
p_sys
->
p_allocated_buffer
&&
p_block
->
p_buffer
-
i_prebody
<
p_sys
->
p_allocated_buffer
+
p_sys
->
i_allocated_buffer
)
{
p_block
->
p_buffer
-=
i_prebody
;
p_block
->
i_buffer
+=
i_prebody
;
i_prebody
=
0
;
}
if
(
p_block
->
p_buffer
+
i_body
<
p_
block
->
p_
sys
->
p_allocated_buffer
+
p_
block
->
p_
sys
->
i_allocated_buffer
)
if
(
p_block
->
p_buffer
+
i_body
<
p_sys
->
p_allocated_buffer
+
p_sys
->
i_allocated_buffer
)
{
p_block
->
i_buffer
=
i_buffer_size
;
i_body
=
0
;
...
...
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