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
1b72149a
Commit
1b72149a
authored
May 27, 2008
by
Adrien Maglo
Committed by
Jean-Baptiste Kempf
May 28, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New vu meter visualization.
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
523ef308
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
145 additions
and
0 deletions
+145
-0
modules/visualization/visual/effects.c
modules/visualization/visual/effects.c
+140
-0
modules/visualization/visual/visual.c
modules/visualization/visual/visual.c
+1
-0
modules/visualization/visual/visual.h
modules/visualization/visual/visual.h
+2
-0
src/audio_output/input.c
src/audio_output/input.c
+2
-0
No files found.
modules/visualization/visual/effects.c
View file @
1b72149a
...
@@ -39,6 +39,10 @@
...
@@ -39,6 +39,10 @@
#define PEAK_SPEED 1
#define PEAK_SPEED 1
#define GRAD_ANGLE_MIN 0.2
#define GRAD_ANGLE_MAX 0.5
#define GRAD_INCR 0.01
/*****************************************************************************
/*****************************************************************************
* dummy_Run
* dummy_Run
*****************************************************************************/
*****************************************************************************/
...
@@ -828,3 +832,139 @@ int scope_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
...
@@ -828,3 +832,139 @@ int scope_Run(visual_effect_t * p_effect, aout_instance_t *p_aout,
}
}
return
0
;
return
0
;
}
}
/*****************************************************************************
* vuMeter_Run: scope effect
*****************************************************************************/
int
vuMeter_Run
(
visual_effect_t
*
p_effect
,
aout_instance_t
*
p_aout
,
aout_buffer_t
*
p_buffer
,
picture_t
*
p_picture
)
{
VLC_UNUSED
(
p_aout
);
int
i
,
j
;
float
*
p_sample
=
(
float
*
)
p_buffer
->
p_buffer
;
float
i_value_l
=
0
;
float
i_value_r
=
0
;
float
ch
;
/* Compute the peack values */
for
(
i
=
0
;
i
<
1024
;
i
++
)
{
ch
=
(
*
p_sample
++
)
*
256
;
if
(
ch
>
i_value_l
)
i_value_l
=
ch
;
ch
=
(
*
p_sample
++
)
*
256
;
if
(
ch
>
i_value_r
)
i_value_r
=
ch
;
}
i_value_l
=
abs
(
i_value_l
);
i_value_r
=
abs
(
i_value_r
);
/* Stay under maximum value admited */
if
(
i_value_l
>
200
*
M_PI_2
)
i_value_l
=
200
*
M_PI_2
;
if
(
i_value_r
>
200
*
M_PI_2
)
i_value_r
=
200
*
M_PI_2
;
float
*
i_value
;
if
(
!
p_effect
->
p_data
)
{
/* Allocate memory to save hand positions */
p_effect
->
p_data
=
(
void
*
)
malloc
(
2
*
sizeof
(
float
)
);
i_value
=
p_effect
->
p_data
;
i_value
[
0
]
=
i_value_l
;
i_value
[
1
]
=
i_value_r
;
}
else
{
/* Make the hands go down slowly if the current values are slower
than the previous */
i_value
=
p_effect
->
p_data
;
if
(
i_value_l
>
i_value
[
0
]
-
6
)
i_value
[
0
]
=
i_value_l
;
else
i_value
[
0
]
=
i_value
[
0
]
-
6
;
if
(
i_value_r
>
i_value
[
1
]
-
6
)
i_value
[
1
]
=
i_value_r
;
else
i_value
[
1
]
=
i_value
[
1
]
-
6
;
}
int
x
,
y
,
k
;
float
teta
;
float
teta_grad
;
for
(
j
=
0
;
j
<
2
;
j
++
)
{
/* Draw the two scales */
k
=
0
;
teta_grad
=
GRAD_ANGLE_MIN
;
for
(
teta
=
-
M_PI_4
;
teta
<=
M_PI_4
;
teta
=
teta
+
0
.
001
)
{
for
(
i
=
140
;
i
<=
150
;
i
++
)
{
y
=
i
*
cos
(
teta
)
+
20
;
x
=
i
*
sin
(
teta
)
+
150
+
240
*
j
;
/* Compute the last color for the gradation */
if
(
teta
>=
teta_grad
+
GRAD_INCR
&&
teta_grad
<=
GRAD_ANGLE_MAX
)
{
teta_grad
=
teta_grad
+
GRAD_INCR
;
k
=
k
+
5
;
}
*
(
p_picture
->
p
[
0
].
p_pixels
+
(
p_picture
->
p
[
0
].
i_lines
-
y
-
1
)
*
p_picture
->
p
[
0
].
i_pitch
+
x
)
=
0x45
;
*
(
p_picture
->
p
[
1
].
p_pixels
+
(
p_picture
->
p
[
1
].
i_lines
-
y
/
2
-
1
)
*
p_picture
->
p
[
1
].
i_pitch
+
x
/
2
)
=
0x0
;
*
(
p_picture
->
p
[
2
].
p_pixels
+
(
p_picture
->
p
[
2
].
i_lines
-
y
/
2
-
1
)
*
p_picture
->
p
[
2
].
i_pitch
+
x
/
2
)
=
0x4D
+
k
;
}
}
/* Draw the two hands */
teta
=
(
float
)
i_value
[
j
]
/
200
-
M_PI_4
;
for
(
i
=
0
;
i
<=
150
;
i
++
)
{
y
=
i
*
cos
(
teta
)
+
20
;
x
=
i
*
sin
(
teta
)
+
150
+
240
*
j
;
*
(
p_picture
->
p
[
0
].
p_pixels
+
(
p_picture
->
p
[
0
].
i_lines
-
y
-
1
)
*
p_picture
->
p
[
0
].
i_pitch
+
x
)
=
0xAD
;
*
(
p_picture
->
p
[
1
].
p_pixels
+
(
p_picture
->
p
[
1
].
i_lines
-
y
/
2
-
1
)
*
p_picture
->
p
[
1
].
i_pitch
+
x
/
2
)
=
0xFC
;
*
(
p_picture
->
p
[
2
].
p_pixels
+
(
p_picture
->
p
[
2
].
i_lines
-
y
/
2
-
1
)
*
p_picture
->
p
[
2
].
i_pitch
+
x
/
2
)
=
0xAC
;
}
/* Draw the hand bases */
for
(
teta
=
-
M_PI_2
;
teta
<=
M_PI_2
+
0
.
01
;
teta
=
teta
+
0
.
001
)
{
for
(
i
=
0
;
i
<
10
;
i
++
)
{
y
=
i
*
cos
(
teta
)
+
20
;
x
=
i
*
sin
(
teta
)
+
150
+
240
*
j
;
*
(
p_picture
->
p
[
0
].
p_pixels
+
(
p_picture
->
p
[
0
].
i_lines
-
y
-
1
)
*
p_picture
->
p
[
0
].
i_pitch
+
x
)
=
0xFF
;
*
(
p_picture
->
p
[
1
].
p_pixels
+
(
p_picture
->
p
[
1
].
i_lines
-
y
/
2
-
1
)
*
p_picture
->
p
[
1
].
i_pitch
+
x
/
2
)
=
0x80
;
*
(
p_picture
->
p
[
2
].
p_pixels
+
(
p_picture
->
p
[
2
].
i_lines
-
y
/
2
-
1
)
*
p_picture
->
p
[
2
].
i_pitch
+
x
/
2
)
=
0x80
;
}
}
}
return
0
;
}
modules/visualization/visual/visual.c
View file @
1b72149a
...
@@ -175,6 +175,7 @@ static struct
...
@@ -175,6 +175,7 @@ static struct
}
pf_effect_run
[]
=
}
pf_effect_run
[]
=
{
{
{
"scope"
,
scope_Run
},
{
"scope"
,
scope_Run
},
{
"vuMeter"
,
vuMeter_Run
},
{
"spectrum"
,
spectrum_Run
},
{
"spectrum"
,
spectrum_Run
},
{
"spectrometer"
,
spectrometer_Run
},
{
"spectrometer"
,
spectrometer_Run
},
{
"dummy"
,
dummy_Run
},
{
"dummy"
,
dummy_Run
},
...
...
modules/visualization/visual/visual.h
View file @
1b72149a
...
@@ -55,6 +55,8 @@ typedef struct aout_filter_sys_t
...
@@ -55,6 +55,8 @@ typedef struct aout_filter_sys_t
/* Prototypes */
/* Prototypes */
int
scope_Run
int
scope_Run
(
visual_effect_t
*
,
aout_instance_t
*
,
aout_buffer_t
*
,
picture_t
*
);
(
visual_effect_t
*
,
aout_instance_t
*
,
aout_buffer_t
*
,
picture_t
*
);
int
vuMeter_Run
(
visual_effect_t
*
,
aout_instance_t
*
,
aout_buffer_t
*
,
picture_t
*
);
int
dummy_Run
int
dummy_Run
(
visual_effect_t
*
,
aout_instance_t
*
,
aout_buffer_t
*
,
picture_t
*
);
(
visual_effect_t
*
,
aout_instance_t
*
,
aout_buffer_t
*
,
picture_t
*
);
int
random_Run
int
random_Run
...
...
src/audio_output/input.c
View file @
1b72149a
...
@@ -99,6 +99,8 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input )
...
@@ -99,6 +99,8 @@ int aout_InputNew( aout_instance_t * p_aout, aout_input_t * p_input )
var_Change
(
p_aout
,
"visual"
,
VLC_VAR_ADDCHOICE
,
&
val
,
&
text
);
var_Change
(
p_aout
,
"visual"
,
VLC_VAR_ADDCHOICE
,
&
val
,
&
text
);
val
.
psz_string
=
(
char
*
)
"spectrum"
;
text
.
psz_string
=
_
(
"Spectrum"
);
val
.
psz_string
=
(
char
*
)
"spectrum"
;
text
.
psz_string
=
_
(
"Spectrum"
);
var_Change
(
p_aout
,
"visual"
,
VLC_VAR_ADDCHOICE
,
&
val
,
&
text
);
var_Change
(
p_aout
,
"visual"
,
VLC_VAR_ADDCHOICE
,
&
val
,
&
text
);
val
.
psz_string
=
(
char
*
)
"vuMeter"
;
text
.
psz_string
=
_
(
"Vu meter"
);
var_Change
(
p_aout
,
"visual"
,
VLC_VAR_ADDCHOICE
,
&
val
,
&
text
);
/* Look for goom plugin */
/* Look for goom plugin */
if
(
module_Exists
(
VLC_OBJECT
(
p_aout
),
"goom"
)
)
if
(
module_Exists
(
VLC_OBJECT
(
p_aout
),
"goom"
)
)
...
...
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