Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
a53dd0f3
Commit
a53dd0f3
authored
Apr 02, 2001
by
Richard Shepherd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vout_beos now uses double buffering for YCbCr overlay.
This (for some reason) improves audio/video sync
parent
f6c80a75
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
14 deletions
+37
-14
plugins/beos/vout_beos.cpp
plugins/beos/vout_beos.cpp
+37
-14
No files found.
plugins/beos/vout_beos.cpp
View file @
a53dd0f3
...
...
@@ -2,7 +2,7 @@
* vout_beos.cpp: beos video output display method
*****************************************************************************
* Copyright (C) 2000, 2001 VideoLAN
* $Id: vout_beos.cpp,v 1.2
3 2001/03/25 17:09:14
richards Exp $
* $Id: vout_beos.cpp,v 1.2
4 2001/04/02 22:40:07
richards Exp $
*
* Authors: Jean-Marc Dressler <polux@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
...
...
@@ -129,6 +129,14 @@ int32 DrawingThread(void *data)
w
->
Lock
();
if
(
w
->
fDirty
)
{
if
(
w
->
fUsingOverlay
)
{
rgb_color
key
;
w
->
view
->
SetViewOverlay
(
w
->
bitmap
[
w
->
i_buffer_index
],
w
->
bitmap
[
w
->
i_buffer_index
]
->
Bounds
(),
w
->
Bounds
(),
&
key
,
B_FOLLOW_ALL
,
B_OVERLAY_FILTER_HORIZONTAL
|
B_OVERLAY_FILTER_VERTICAL
|
B_OVERLAY_TRANSFER_CHANNEL
);
w
->
view
->
SetViewColor
(
key
);
}
else
w
->
view
->
DrawBitmap
(
w
->
bitmap
[
w
->
i_buffer_index
],
w
->
bitmap
[
w
->
i_buffer_index
]
->
Bounds
(),
w
->
Bounds
());
w
->
fDirty
=
false
;
}
...
...
@@ -158,13 +166,15 @@ VideoWindow::VideoWindow(BRect frame, const char *name, vout_thread_t *p_video_o
view
=
new
VLCView
(
Bounds
());
AddChild
(
view
);
bitmap
[
0
]
=
new
BBitmap
(
Bounds
(),
B_BITMAP_WILL_OVERLAY
|
B_BITMAP_RESERVE_OVERLAY_CHANNEL
,
B_YCbCr422
);
bitmap
[
1
]
=
new
BBitmap
(
Bounds
(),
B_BITMAP_WILL_OVERLAY
,
B_YCbCr422
);
fUsingOverlay
=
true
;
i_screen_depth
=
16
;
p_vout
->
b_YCbr
=
true
;
if
(
bitmap
[
0
]
->
InitCheck
()
!=
B_OK
)
if
(
(
bitmap
[
0
]
->
InitCheck
()
!=
B_OK
)
||
(
bitmap
[
1
]
->
InitCheck
()
!=
B_OK
)
)
{
delete
bitmap
[
0
];
delete
bitmap
[
1
];
p_vout
->
b_YCbr
=
false
;
fUsingOverlay
=
false
;
BScreen
*
screen
;
...
...
@@ -190,8 +200,6 @@ VideoWindow::VideoWindow(BRect frame, const char *name, vout_thread_t *p_video_o
bitmap
[
1
]
=
new
BBitmap
(
Bounds
(),
B_RGB32
);
i_screen_depth
=
32
;
}
memset
(
bitmap
[
0
]
->
Bits
(),
0
,
bitmap
[
0
]
->
BitsLength
());
memset
(
bitmap
[
1
]
->
Bits
(),
0
,
bitmap
[
1
]
->
BitsLength
());
SetTitle
(
VOUT_TITLE
" (BBitmap output)"
);
}
...
...
@@ -204,15 +212,16 @@ VideoWindow::VideoWindow(BRect frame, const char *name, vout_thread_t *p_video_o
SetTitle
(
VOUT_TITLE
" (Overlay output)"
);
GetSizeLimits
(
&
minWidth
,
&
maxWidth
,
&
minHeight
,
&
maxHeight
);
SetSizeLimits
((
float
)
Bounds
().
IntegerWidth
(),
maxWidth
,
(
float
)
Bounds
().
IntegerHeight
(),
maxHeight
);
memset
(
bitmap
[
0
]
->
Bits
(),
0
,
bitmap
[
0
]
->
BitsLength
());
}
else
//
else
{
fDrawThreadID
=
spawn_thread
(
DrawingThread
,
"drawing_thread"
,
B_DISPLAY_PRIORITY
,
(
void
*
)
this
);
resume_thread
(
fDrawThreadID
);
}
memset
(
bitmap
[
0
]
->
Bits
(),
0
,
bitmap
[
0
]
->
BitsLength
());
memset
(
bitmap
[
1
]
->
Bits
(),
0
,
bitmap
[
1
]
->
BitsLength
());
i_bytes_per_pixel
=
bitmap
[
0
]
->
BytesPerRow
()
/
bitmap
[
0
]
->
Bounds
().
IntegerWidth
();
fRowBytes
=
bitmap
[
0
]
->
BytesPerRow
();
fDirty
=
false
;
...
...
@@ -225,13 +234,13 @@ VideoWindow::~VideoWindow()
Hide
();
Sync
();
if
(
!
fUsingOverlay
)
{
//
if(!fUsingOverlay)
//
{
teardownwindow
=
true
;
wait_for_thread
(
fDrawThreadID
,
&
result
);
delete
bitmap
[
0
];
delete
bitmap
[
1
];
}
//
}
}
...
...
@@ -430,7 +439,7 @@ int vout_Init( vout_thread_t *p_vout )
p_vout
->
p_sys
->
i_width
=
p_vout
->
i_width
;
p_vout
->
p_sys
->
i_height
=
p_vout
->
i_height
;
if
(
p_win
->
fUsingOverlay
)
/*
if(p_win->fUsingOverlay)
{
if(p_win->bitmap[0] != NULL)
{
...
...
@@ -447,7 +456,13 @@ int vout_Init( vout_thread_t *p_vout )
vout_SetBuffers( p_vout, (byte_t *)p_win->bitmap[0]->Bits(),
(byte_t *)p_win->bitmap[1]->Bits());
}
}*/
if
((
p_win
->
bitmap
[
0
]
!=
NULL
)
&&
(
p_win
->
bitmap
[
1
]
!=
NULL
))
{
vout_SetBuffers
(
p_vout
,
(
byte_t
*
)
p_win
->
bitmap
[
0
]
->
Bits
(),
(
byte_t
*
)
p_win
->
bitmap
[
1
]
->
Bits
());
}
return
(
0
);
}
...
...
@@ -491,6 +506,8 @@ if( (p_vout->i_width != p_vout->p_sys->i_width) ||
{
p_win
->
Lock
();
p_win
->
view
->
ClearViewOverlay
();
delete
p_win
->
bitmap
[
0
];
delete
p_win
->
bitmap
[
1
];
p_vout
->
p_sys
->
i_width
=
p_vout
->
i_width
;
p_vout
->
p_sys
->
i_height
=
p_vout
->
i_height
;;
p_win
->
GetSizeLimits
(
&
minWidth
,
&
maxWidth
,
&
minHeight
,
&
maxHeight
);
...
...
@@ -499,9 +516,12 @@ if( (p_vout->i_width != p_vout->p_sys->i_width) ||
p_win
->
bitmap
[
0
]
=
new
BBitmap
(
p_win
->
Bounds
(),
B_BITMAP_WILL_OVERLAY
|
B_BITMAP_RESERVE_OVERLAY_CHANNEL
,
B_YCbCr422
);
p_win
->
bitmap
[
0
]
=
new
BBitmap
(
p_win
->
Bounds
(),
B_BITMAP_WILL_OVERLAY
,
B_YCbCr422
);
memset
(
p_win
->
bitmap
[
0
]
->
Bits
(),
0
,
p_win
->
bitmap
[
0
]
->
BitsLength
());
memset
(
p_win
->
bitmap
[
1
]
->
Bits
(),
0
,
p_win
->
bitmap
[
1
]
->
BitsLength
());
p_win
->
view
->
SetViewOverlay
(
p_win
->
bitmap
[
0
],
p_win
->
bitmap
[
0
]
->
Bounds
(),
p_win
->
Bounds
(),
&
key
,
B_FOLLOW_ALL
,
B_OVERLAY_FILTER_HORIZONTAL
|
B_OVERLAY_FILTER_VERTICAL
);
B_OVERLAY_FILTER_HORIZONTAL
|
B_OVERLAY_FILTER_VERTICAL
|
B_OVERLAY_TRANSFER_CHANNEL
);
p_win
->
view
->
SetViewColor
(
key
);
p_win
->
Unlock
();
vout_SetBuffers
(
p_vout
,
(
byte_t
*
)
p_win
->
bitmap
[
0
]
->
Bits
(),
...
...
@@ -523,6 +543,9 @@ void vout_Display( vout_thread_t *p_vout )
VideoWindow
*
p_win
=
p_vout
->
p_sys
->
p_window
;
p_win
->
i_buffer_index
=
p_vout
->
i_buffer_index
;
if
(
p_win
->
fUsingOverlay
)
p_vout
->
i_buffer_index
=
p_vout
->
i_buffer_index
&
1
;
else
p_vout
->
i_buffer_index
=
++
p_vout
->
i_buffer_index
&
1
;
p_win
->
fDirty
=
true
;
}
...
...
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