]> git.sesse.net Git - vlc/blob - src/video_output/snapshot.h
Use var_Inherit* instead of var_CreateGet*.
[vlc] / src / video_output / snapshot.h
1 /*****************************************************************************
2  * snapshot.h : vout internal snapshot
3  *****************************************************************************
4  * Copyright (C) 2009 Laurent Aimar
5  * $Id$
6  *
7  * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org>
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
22  *****************************************************************************/
23
24 #if defined(__PLUGIN__) || defined(__BUILTIN__) || !defined(__LIBVLC__)
25 # error This header file can only be included from LibVLC.
26 #endif
27
28 #ifndef _VOUT_INTERNAL_SNAPSHOT_H
29 #define _VOUT_INTERNAL_SNAPSHOT_H
30
31 #include <vlc_picture.h>
32
33 typedef struct {
34     vlc_mutex_t lock;
35     vlc_cond_t  wait;
36
37         bool        is_available;
38         int         request_count;
39         picture_t   *picture;
40
41 } vout_snapshot_t;
42
43 /* */
44 void vout_snapshot_Init(vout_snapshot_t *);
45 void vout_snapshot_Clean(vout_snapshot_t *);
46
47 void vout_snapshot_End(vout_snapshot_t *);
48
49 /* */
50 picture_t *vout_snapshot_Get(vout_snapshot_t *, mtime_t timeout);
51
52 /**
53  * It tells if they are pending snapshot request
54  */
55 bool vout_snapshot_IsRequested(vout_snapshot_t *);
56
57 /**
58  * It set the picture used to create the snapshots.
59  *
60  * The given picture is only copied and not released.
61  * If p_fmt is non NULL it will override the format of the p_picture (mainly
62  * used because of aspect/crop problems).
63  */
64 void vout_snapshot_Set(vout_snapshot_t *, const video_format_t *, const picture_t *);
65
66 /**
67  * This function will return the directory used for snapshots
68  */
69 char *vout_snapshot_GetDirectory(void);
70
71 typedef struct {
72     bool is_sequential;
73     int  sequence;
74     char *path;
75     char *format;
76     char *prefix_fmt;
77 } vout_snapshot_save_cfg_t;
78
79 /**
80  * This function will write an image to the disk an return the file name created.
81  */
82 int vout_snapshot_SaveImage(char **name, int *sequential,
83                             const block_t *image,
84                             vlc_object_t *object,
85                             const vout_snapshot_save_cfg_t *cfg);
86
87 #endif
88