Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Steve Lhomme
VLC
Commits
64052e01
Commit
64052e01
authored
Aug 28, 2008
by
Rémi Denis-Courmont
Browse files
snapshost: avoid vlc_object_get (this is still a really ugly hack)
parent
111ce502
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/control/mediacontrol_audio_video.c
View file @
64052e01
...
...
@@ -84,7 +84,7 @@ mediacontrol_snapshot( mediacontrol_Instance *self,
vlc_object_release
(
p_input
);
RAISE_NULL
(
mediacontrol_InternalException
,
"Out of memory"
);
}
snprintf
(
path
,
255
,
"object:%
d
"
,
p_cache
->
i_object_id
);
snprintf
(
path
,
255
,
"object:%
ju
"
,
(
uintmax_t
)(
uintptr_t
)
p_cache
);
var_SetString
(
p_vout
,
"snapshot-path"
,
path
);
var_SetString
(
p_vout
,
"snapshot-format"
,
"png"
);
...
...
src/video_output/vout_intf.c
View file @
64052e01
...
...
@@ -456,28 +456,19 @@ int vout_Snapshot( vout_thread_t *p_vout, picture_t *p_pic )
val
.
psz_string
=
0
;
}
/* Embedded snapshot : if snapshot-path == object:object
-id
, then
/* Embedded snapshot : if snapshot-path == object:object
_ptr
, then
create a snapshot_t* and store it in
object
(object-id)
->p_private, then unlock and signal the
object
_ptr
->p_private, then unlock and signal the
waiting object.
*/
if
(
val
.
psz_string
&&
!
strncmp
(
val
.
psz_string
,
"object:"
,
7
)
)
uintmax_t
i_id
;
if
(
val
.
psz_string
&&
sscanf
(
val
.
psz_string
,
"object:%ju"
,
&
i_id
)
>
0
)
{
int
i_id
;
vlc_object_t
*
p_dest
;
vlc_object_t
*
p_dest
=
(
vlc_object_t
*
)(
uintptr_t
)
i_id
;
block_t
*
p_block
;
snapshot_t
*
p_snapshot
;
int
i_size
;
/* Destination object-id is following object: */
i_id
=
atoi
(
&
val
.
psz_string
[
7
]
);
p_dest
=
(
vlc_object_t
*
)
vlc_object_get
(
i_id
);
if
(
!
p_dest
)
{
msg_Err
(
p_vout
,
"Cannot find calling object"
);
image_HandlerDelete
(
p_image
);
return
VLC_EGENERIC
;
}
/* Object must be locked. We will unlock it once we get the
snapshot and written it to p_private */
p_dest
->
p_private
=
NULL
;
...
...
Write
Preview
Supports
Markdown
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