Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
32329d4f
Commit
32329d4f
authored
Jul 01, 2004
by
Sigmund Augdal Helberg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Doxygenized some functions in vout_pictures.c. Prepared for new chroma
fourcc YUVA to be used in subpicture rendering
parent
cd071db6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
49 deletions
+80
-49
include/vlc_video.h
include/vlc_video.h
+1
-0
src/video_output/vout_pictures.c
src/video_output/vout_pictures.c
+76
-48
src/video_output/vout_pictures.h
src/video_output/vout_pictures.h
+3
-1
No files found.
include/vlc_video.h
View file @
32329d4f
...
...
@@ -165,6 +165,7 @@ struct picture_heap_t
#define Y_PLANE 0
#define U_PLANE 1
#define V_PLANE 2
#define A_PLANE 3
/* Shortcuts */
#define Y_PIXELS p[Y_PLANE].p_pixels
...
...
src/video_output/vout_pictures.c
View file @
32329d4f
...
...
@@ -41,13 +41,13 @@
*****************************************************************************/
static
void
CopyPicture
(
vout_thread_t
*
,
picture_t
*
,
picture_t
*
);
/**
***************************************************************************
*
vout_DisplayPicture: d
isplay a picture
*
****************************************************************************
/**
*
D
isplay a picture
*
* Remove the reservation flag of a picture, which will cause it to be ready
* for display. The picture won't be displayed until vout_DatePicture has been
* called.
*
****************************************************************************
/
*/
void
vout_DisplayPicture
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
)
{
vlc_mutex_lock
(
&
p_vout
->
picture_lock
);
...
...
@@ -68,13 +68,16 @@ void vout_DisplayPicture( vout_thread_t *p_vout, picture_t *p_pic )
vlc_mutex_unlock
(
&
p_vout
->
picture_lock
);
}
/**
***************************************************************************
*
vout_DatePicture: d
ate a picture
*
****************************************************************************
/**
*
D
ate a picture
*
* Remove the reservation flag of a picture, which will cause it to be ready
* for display. The picture won't be displayed until vout_DisplayPicture has
* been called.
*****************************************************************************/
* \param p_vout The vout in question
* \param p_pic The picture to date
* \param date The date to display the picture
*/
void
vout_DatePicture
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
,
mtime_t
date
)
{
...
...
@@ -97,15 +100,15 @@ void vout_DatePicture( vout_thread_t *p_vout,
vlc_mutex_unlock
(
&
p_vout
->
picture_lock
);
}
/**
***************************************************************************
*
vout_CreatePicture: a
llocate a picture in the video output heap.
*
****************************************************************************
/**
*
A
llocate a picture in the video output heap.
*
* This function creates a reserved image in the video output heap.
* A null pointer is returned if the function fails. This method provides an
* already allocated zone of memory in the picture data fields.
* It needs locking since several pictures can be created by several producers
* threads.
*
****************************************************************************
/
*/
picture_t
*
vout_CreatePicture
(
vout_thread_t
*
p_vout
,
vlc_bool_t
b_progressive
,
vlc_bool_t
b_top_field_first
,
...
...
@@ -208,13 +211,13 @@ picture_t *vout_CreatePicture( vout_thread_t *p_vout,
return
(
NULL
);
}
/**
***************************************************************************
*
vout_DestroyPicture: r
emove a permanent or reserved picture from the heap
*
****************************************************************************
/**
*
R
emove a permanent or reserved picture from the heap
*
* This function frees a previously reserved picture or a permanent
* picture. It is meant to be used when the construction of a picture aborted.
* Note that the picture will be destroyed even if it is linked !
*
****************************************************************************
/
*/
void
vout_DestroyPicture
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
)
{
vlc_mutex_lock
(
&
p_vout
->
picture_lock
);
...
...
@@ -236,12 +239,12 @@ void vout_DestroyPicture( vout_thread_t *p_vout, picture_t *p_pic )
vlc_mutex_unlock
(
&
p_vout
->
picture_lock
);
}
/**
***************************************************************************
*
vout_LinkPicture: i
ncrement reference counter of a picture
*
****************************************************************************
/**
*
I
ncrement reference counter of a picture
*
* This function increments the reference counter of a picture in the video
* heap. It needs a lock since several producer threads can access the picture.
*
****************************************************************************
/
*/
void
vout_LinkPicture
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
)
{
vlc_mutex_lock
(
&
p_vout
->
picture_lock
);
...
...
@@ -249,11 +252,11 @@ void vout_LinkPicture( vout_thread_t *p_vout, picture_t *p_pic )
vlc_mutex_unlock
(
&
p_vout
->
picture_lock
);
}
/**
***************************************************************************
*
vout_UnlinkPicture: d
ecrement reference counter of a picture
*
****************************************************************************
/**
*
D
ecrement reference counter of a picture
*
* This function decrement the reference counter of a picture in the video heap
*
****************************************************************************
/
*/
void
vout_UnlinkPicture
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
)
{
vlc_mutex_lock
(
&
p_vout
->
picture_lock
);
...
...
@@ -276,13 +279,13 @@ void vout_UnlinkPicture( vout_thread_t *p_vout, picture_t *p_pic )
vlc_mutex_unlock
(
&
p_vout
->
picture_lock
);
}
/**
***************************************************************************
*
vout_RenderPicture: r
ender a picture
*
****************************************************************************
/**
*
R
ender a picture
*
* This function chooses whether the current picture needs to be copied
* before rendering, does the subpicture magic, and tells the video output
* thread which direct buffer needs to be displayed.
*
****************************************************************************
/
*/
picture_t
*
vout_RenderPicture
(
vout_thread_t
*
p_vout
,
picture_t
*
p_pic
,
subpicture_t
*
p_subpic
)
{
...
...
@@ -374,12 +377,12 @@ picture_t * vout_RenderPicture( vout_thread_t *p_vout, picture_t *p_pic,
return
&
p_vout
->
p_picture
[
0
];
}
/**
***************************************************************************
*
vout_PlacePicture: c
alculate image window coordinates
*
****************************************************************************
/**
*
C
alculate image window coordinates
*
* This function will be accessed by plugins. It calculates the relative
* position of the output window and the image window.
*
****************************************************************************
/
*/
void
vout_PlacePicture
(
vout_thread_t
*
p_vout
,
unsigned
int
i_width
,
unsigned
int
i_height
,
unsigned
int
*
pi_x
,
unsigned
int
*
pi_y
,
...
...
@@ -449,13 +452,13 @@ void vout_PlacePicture( vout_thread_t *p_vout,
}
}
/**
***************************************************************************
*
vout_AllocatePicture: a
llocate a new picture in the heap.
*
****************************************************************************
/**
*
A
llocate a new picture in the heap.
*
* This function allocates a fake direct buffer in memory, which can be
* used exactly like a video buffer. The video output thread then manages
* how it gets displayed.
*
****************************************************************************
/
*/
void
vout_AllocatePicture
(
vlc_object_t
*
p_this
,
picture_t
*
p_pic
,
vlc_fourcc_t
i_chroma
,
int
i_width
,
int
i_height
,
int
i_aspect
)
...
...
@@ -488,12 +491,17 @@ void vout_AllocatePicture( vlc_object_t *p_this, picture_t *p_pic,
}
}
/**
***************************************************************************
*
vout_InitFormat: i
nitialise the video format fields given chroma/size.
*
****************************************************************************
/**
*
I
nitialise the video format fields given chroma/size.
*
* This function initializes all the video_frame_format_t fields given the
* static properties of a picture (chroma and size).
*****************************************************************************/
* \param p_format Pointer to the format structure to initialize
* \param i_chroma Chroma to set
* \param i_width Width to set
* \param i_height Height to set
* \param i_aspect Aspect ratio
*/
void
vout_InitFormat
(
video_frame_format_t
*
p_format
,
vlc_fourcc_t
i_chroma
,
int
i_width
,
int
i_height
,
int
i_aspect
)
{
...
...
@@ -560,12 +568,18 @@ void vout_InitFormat( video_frame_format_t *p_format, vlc_fourcc_t i_chroma,
}
}
/**
***************************************************************************
*
vout_InitPicture: i
nitialise the picture_t fields given chroma/size.
*
****************************************************************************
/**
*
I
nitialise the picture_t fields given chroma/size.
*
* This function initializes most of the picture_t fields given a chroma and
* size. It makes the assumption that stride == width.
*****************************************************************************/
* \param p_this The calling object
* \param p_pic Pointer to the picture to initialize
* \param i_chroma The chroma fourcc to set
* \param i_width The width of the picture
* \param i_height The height of the picture
* \param i_aspect The aspect ratio of the picture
*/
void
vout_InitPicture
(
vlc_object_t
*
p_this
,
picture_t
*
p_pic
,
vlc_fourcc_t
i_chroma
,
int
i_width
,
int
i_height
,
int
i_aspect
)
...
...
@@ -732,6 +746,20 @@ void vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic,
p_pic->p_heap->i_bmask = 0x0000ff; */
p_pic
->
i_planes
=
1
;
break
;
case
FOURCC_YUVA
:
p_pic
->
p
[
Y_PLANE
].
i_lines
=
i_height
;
p_pic
->
p
[
Y_PLANE
].
i_pitch
=
i_width
;
p_pic
->
p
[
Y_PLANE
].
i_visible_pitch
=
p_pic
->
p
[
Y_PLANE
].
i_pitch
;
p_pic
->
p
[
U_PLANE
].
i_lines
=
i_height
;
p_pic
->
p
[
U_PLANE
].
i_pitch
=
i_width
;
p_pic
->
p
[
U_PLANE
].
i_visible_pitch
=
p_pic
->
p
[
U_PLANE
].
i_pitch
;
p_pic
->
p
[
V_PLANE
].
i_lines
=
i_height
;
p_pic
->
p
[
V_PLANE
].
i_pitch
=
i_width
;
p_pic
->
p
[
V_PLANE
].
i_visible_pitch
=
p_pic
->
p
[
V_PLANE
].
i_pitch
;
p_pic
->
p
[
A_PLANE
].
i_lines
=
i_height
;
p_pic
->
p
[
A_PLANE
].
i_pitch
=
i_width
;
p_pic
->
p
[
A_PLANE
].
i_visible_pitch
=
p_pic
->
p
[
A_PLANE
].
i_pitch
;
p_pic
->
i_planes
=
4
;
default:
msg_Err
(
p_this
,
"unknown chroma type 0x%.8x (%4.4s)"
,
...
...
@@ -741,12 +769,12 @@ void vout_InitPicture( vlc_object_t *p_this, picture_t *p_pic,
}
}
/**
***************************************************************************
*
vout_ChromaCmp: c
ompare two chroma values
*
****************************************************************************
/**
*
C
ompare two chroma values
*
* This function returns 1 if the two fourcc values given as argument are
* the same format (eg. UYVY/UYNV) or almost the same format (eg. I420/YV12)
*
****************************************************************************
/
*/
int
vout_ChromaCmp
(
vlc_fourcc_t
i_chroma
,
vlc_fourcc_t
i_amorhc
)
{
/* If they are the same, they are the same ! */
...
...
src/video_output/vout_pictures.h
View file @
32329d4f
...
...
@@ -2,7 +2,7 @@
* vout_pictures.h : picture management definitions
*****************************************************************************
* Copyright (C) 2002-2004 VideoLAN
* $Id
: vout_pictures.h,v 1.6 2004/02/27 14:01:35 fenrir Exp
$
* $Id$
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
...
...
@@ -88,3 +88,5 @@
/* Planar 4:4:4, Y:U:V */
#define FOURCC_I444 VLC_FOURCC('I','4','4','4')
/* Planar 4:4:4:4 Y:U:V:A */
#define FOURCC_YUVA VLC_FOURCC('Y','U','V','A')
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