00001 /***************************************************************************** 00002 * snapshot.h : vout internal snapshot 00003 ***************************************************************************** 00004 * Copyright (C) 2009 Laurent Aimar 00005 * $Id: ccdef2af6c95cba606f312b2166b14beb5b111ad $ 00006 * 00007 * Authors: Laurent Aimar <fenrir _AT_ videolan _DOT_ org> 00008 * 00009 * This program is free software; you can redistribute it and/or modify it 00010 * under the terms of the GNU Lesser General Public License as published by 00011 * the Free Software Foundation; either version 2.1 of the License, or 00012 * (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU Lesser General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU Lesser General Public License 00020 * along with this program; if not, write to the Free Software Foundation, 00021 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. 00022 *****************************************************************************/ 00023 00024 #ifndef LIBVLC_VOUT_INTERNAL_SNAPSHOT_H 00025 #define LIBVLC_VOUT_INTERNAL_SNAPSHOT_H 00026 00027 #include <vlc_picture.h> 00028 00029 typedef struct { 00030 vlc_mutex_t lock; 00031 vlc_cond_t wait; 00032 00033 bool is_available; 00034 int request_count; 00035 picture_t *picture; 00036 00037 } vout_snapshot_t; 00038 00039 /* */ 00040 void vout_snapshot_Init(vout_snapshot_t *); 00041 void vout_snapshot_Clean(vout_snapshot_t *); 00042 00043 void vout_snapshot_End(vout_snapshot_t *); 00044 00045 /* */ 00046 picture_t *vout_snapshot_Get(vout_snapshot_t *, mtime_t timeout); 00047 00048 /** 00049 * It tells if they are pending snapshot request 00050 */ 00051 bool vout_snapshot_IsRequested(vout_snapshot_t *); 00052 00053 /** 00054 * It set the picture used to create the snapshots. 00055 * 00056 * The given picture is only copied and not released. 00057 * If p_fmt is non NULL it will override the format of the p_picture (mainly 00058 * used because of aspect/crop problems). 00059 */ 00060 void vout_snapshot_Set(vout_snapshot_t *, const video_format_t *, const picture_t *); 00061 00062 /** 00063 * This function will return the directory used for snapshots 00064 */ 00065 char *vout_snapshot_GetDirectory(void); 00066 00067 typedef struct { 00068 bool is_sequential; 00069 int sequence; 00070 char *path; 00071 char *format; 00072 char *prefix_fmt; 00073 } vout_snapshot_save_cfg_t; 00074 00075 /** 00076 * This function will write an image to the disk an return the file name created. 00077 */ 00078 int vout_snapshot_SaveImage(char **name, int *sequential, 00079 const block_t *image, 00080 vlc_object_t *object, 00081 const vout_snapshot_save_cfg_t *cfg); 00082 00083 #endif
1.7.1