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
c01dd91c
Commit
c01dd91c
authored
Feb 13, 2010
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add coordinates (VLC_VAR_COORDS) variable type
parent
0759e71b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
3 deletions
+40
-3
include/vlc_common.h
include/vlc_common.h
+4
-2
include/vlc_variables.h
include/vlc_variables.h
+25
-0
src/misc/objects.c
src/misc/objects.c
+5
-0
src/misc/variables.c
src/misc/variables.c
+6
-1
No files found.
include/vlc_common.h
View file @
c01dd91c
...
@@ -420,9 +420,10 @@ typedef union
...
@@ -420,9 +420,10 @@ typedef union
vlc_object_t
*
p_object
;
vlc_object_t
*
p_object
;
vlc_list_t
*
p_list
;
vlc_list_t
*
p_list
;
mtime_t
i_time
;
mtime_t
i_time
;
struct
{
int32_t
x
;
int32_t
y
;
}
coords
;
/* Make sure the structure is at least 64bits */
/* Make sure the structure is at least 64bits */
struct
{
char
a
,
b
,
c
,
d
,
e
,
f
,
g
,
h
;
}
padding
;
uint8_t
padding
[
8
]
;
}
vlc_value_t
;
}
vlc_value_t
;
...
@@ -456,6 +457,7 @@ struct vlc_list_t
...
@@ -456,6 +457,7 @@ struct vlc_list_t
#define VLC_VAR_ADDRESS 0x0070
#define VLC_VAR_ADDRESS 0x0070
#define VLC_VAR_MUTEX 0x0080
#define VLC_VAR_MUTEX 0x0080
#define VLC_VAR_LIST 0x0090
#define VLC_VAR_LIST 0x0090
#define VLC_VAR_COORDS 0x00A0
/**@}*/
/**@}*/
/*****************************************************************************
/*****************************************************************************
...
...
include/vlc_variables.h
View file @
c01dd91c
...
@@ -223,6 +223,16 @@ static inline int var_SetTime( vlc_object_t *p_obj, const char *psz_name, int64_
...
@@ -223,6 +223,16 @@ static inline int var_SetTime( vlc_object_t *p_obj, const char *psz_name, int64_
return
var_SetChecked
(
p_obj
,
psz_name
,
VLC_VAR_TIME
,
val
);
return
var_SetChecked
(
p_obj
,
psz_name
,
VLC_VAR_TIME
,
val
);
}
}
static
inline
int
var_SetCoords
(
vlc_object_t
*
obj
,
const
char
*
name
,
int32_t
x
,
int32_t
y
)
{
vlc_value_t
val
;
val
.
coords
.
x
=
x
;
val
.
coords
.
y
=
y
;
return
var_SetChecked
(
obj
,
name
,
VLC_VAR_COORDS
,
val
);
}
#define var_SetCoords(o,n,x,y) var_SetCoords(VLC_OBJECT(o),n,x,y)
/**
/**
* Set the value of a float variable
* Set the value of a float variable
*
*
...
@@ -323,6 +333,21 @@ static inline int64_t var_GetTime( vlc_object_t *p_obj, const char *psz_name )
...
@@ -323,6 +333,21 @@ static inline int64_t var_GetTime( vlc_object_t *p_obj, const char *psz_name )
return
0
;
return
0
;
}
}
static
inline
void
var_GetCoords
(
vlc_object_t
*
obj
,
const
char
*
name
,
int32_t
*
px
,
int32_t
*
py
)
{
vlc_value_t
val
;
if
(
likely
(
!
var_GetChecked
(
obj
,
name
,
VLC_VAR_COORDS
,
&
val
)))
{
*
px
=
val
.
coords
.
x
;
*
py
=
val
.
coords
.
y
;
}
else
*
px
=
*
py
=
0
;
}
#define var_GetCoords(o,n,x,y) var_GetCoords(VLC_OBJECT(o),n,x,y)
/**
/**
* Get a float value
* Get a float value
*
*
...
...
src/misc/objects.c
View file @
c01dd91c
...
@@ -751,6 +751,7 @@ static void DumpVariable (const void *data, const VISIT which, const int depth)
...
@@ -751,6 +751,7 @@ static void DumpVariable (const void *data, const VISIT which, const int depth)
MYCASE
(
VARIABLE
,
"variable"
);
MYCASE
(
VARIABLE
,
"variable"
);
MYCASE
(
FLOAT
,
"float"
);
MYCASE
(
FLOAT
,
"float"
);
MYCASE
(
TIME
,
"time"
);
MYCASE
(
TIME
,
"time"
);
MYCASE
(
COORDS
,
"coords"
);
MYCASE
(
ADDRESS
,
"address"
);
MYCASE
(
ADDRESS
,
"address"
);
MYCASE
(
MUTEX
,
"mutex"
);
MYCASE
(
MUTEX
,
"mutex"
);
MYCASE
(
LIST
,
"list"
);
MYCASE
(
LIST
,
"list"
);
...
@@ -786,6 +787,10 @@ static void DumpVariable (const void *data, const VISIT which, const int depth)
...
@@ -786,6 +787,10 @@ static void DumpVariable (const void *data, const VISIT which, const int depth)
case
VLC_VAR_TIME
:
case
VLC_VAR_TIME
:
printf
(
": %"
PRIi64
,
(
int64_t
)
p_var
->
val
.
i_time
);
printf
(
": %"
PRIi64
,
(
int64_t
)
p_var
->
val
.
i_time
);
break
;
break
;
case
VLC_VAR_COORDS
:
printf
(
": %"
PRId32
"x%"
PRId32
,
p_var
->
val
.
coords
.
x
,
p_var
->
val
.
coords
.
y
);
break
;
case
VLC_VAR_ADDRESS
:
case
VLC_VAR_ADDRESS
:
printf
(
": %p"
,
p_var
->
val
.
p_address
);
printf
(
": %p"
,
p_var
->
val
.
p_address
);
break
;
break
;
...
...
src/misc/variables.c
View file @
c01dd91c
...
@@ -157,7 +157,8 @@ int_ops = { CmpInt, DupDummy, FreeDummy, },
...
@@ -157,7 +157,8 @@ int_ops = { CmpInt, DupDummy, FreeDummy, },
list_ops
=
{
CmpAddress
,
DupList
,
FreeList
,
},
list_ops
=
{
CmpAddress
,
DupList
,
FreeList
,
},
mutex_ops
=
{
CmpAddress
,
DupDummy
,
FreeMutex
,
},
mutex_ops
=
{
CmpAddress
,
DupDummy
,
FreeMutex
,
},
string_ops
=
{
CmpString
,
DupString
,
FreeString
,
},
string_ops
=
{
CmpString
,
DupString
,
FreeString
,
},
time_ops
=
{
CmpTime
,
DupDummy
,
FreeDummy
,
};
time_ops
=
{
CmpTime
,
DupDummy
,
FreeDummy
,
},
coords_ops
=
{
NULL
,
DupDummy
,
FreeDummy
,
};
/*****************************************************************************
/*****************************************************************************
* Local prototypes
* Local prototypes
...
@@ -271,6 +272,10 @@ int var_Create( vlc_object_t *p_this, const char *psz_name, int i_type )
...
@@ -271,6 +272,10 @@ int var_Create( vlc_object_t *p_this, const char *psz_name, int i_type )
p_var
->
ops
=
&
time_ops
;
p_var
->
ops
=
&
time_ops
;
p_var
->
val
.
i_time
=
0
;
p_var
->
val
.
i_time
=
0
;
break
;
break
;
case
VLC_VAR_COORDS
:
p_var
->
ops
=
&
coords_ops
;
p_var
->
val
.
coords
.
x
=
p_var
->
val
.
coords
.
y
=
0
;
break
;
case
VLC_VAR_ADDRESS
:
case
VLC_VAR_ADDRESS
:
p_var
->
ops
=
&
addr_ops
;
p_var
->
ops
=
&
addr_ops
;
p_var
->
val
.
p_address
=
NULL
;
p_var
->
val
.
p_address
=
NULL
;
...
...
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