Debian Codegraph @

Xpjproject/pjmedia/include/pjmedia-videodev/avi_dev.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18 #ifndef __PJMEDIA_VIDEODEV_AVI_DEV_H__
19 #define __PJMEDIA_VIDEODEV_AVI_DEV_H__
20
21 /**
22 * @file avi_dev.h
23 * @brief AVI player virtual device
24 */
25 #include <pjmedia-videodev/videodev.h>
26 #include <pjmedia/avi_stream.h>
27
28 PJ_BEGIN_DECL
29
30 /**
31 * @defgroup avi_dev AVI Player Virtual Device
32 * @ingroup video_device_api
33 * @brief AVI player virtual device
34 * @{
35 * This describes a virtual capture device which takes its input from an AVI
36 * file.
37 */
38
39 /**
40 * Settings for the AVI player virtual device. This param corresponds to
41 * PJMEDIA_VID_DEV_CAP_AVI_PLAY capability of the video device/stream.
42 */
43 typedef struct pjmedia_avi_dev_param
44 {
45 /**
46 * Specifies the full path of the AVI file to be played.
47 */
48 pj_str_t path;
49
50 /**
51 * If this setting is specified when setting the device, this specifies
52 * the title to be assigned as the device name. If this setting not
53 * specified, the filename part of the path will be used.
54 */
55 pj_str_t title;
56
57 /**
58 * The underlying AVI streams created by the device. If the value is NULL,
59 * that means the device has not been configured yet. Application can use
60 * this field to retrieve the audio stream of the AVI. This setting is
61 * "get"-only and will be ignored in "set capability" operation.
62 */
63 pjmedia_avi_streams *avi_streams;
64
65 } pjmedia_avi_dev_param;
66
67
68 /**
69 * Reset pjmedia_avi_dev_param with the default settings. This mostly will
70 * reset all values to NULL or zero.
71 *
72 * @param p The parameter to be initialized.
73 */
74 PJ_DECL(void) pjmedia_avi_dev_param_default(pjmedia_avi_dev_param *p);
75
76
77 /**
78 * Create a AVI device factory, and register it to the video device
79 * subsystem. At least one factory needs to be created before an AVI
80 * device can be allocated and used, and normally only one factory is
81 * needed per application.
82 *
83 * @param pf Pool factory to be used.
84 * @param max_dev Number of devices to be reserved.
85 * @param p_ret Pointer to return the factory instance, to be
86 * used when allocating a virtual device.
87 *
88 * @return PJ_SUCCESS on success or the appropriate error code.
89 */
90 PJ_DECL(pj_status_t) pjmedia_avi_dev_create_factory(
91 pj_pool_factory *pf,
92 unsigned max_dev,
93 pjmedia_vid_dev_factory **p_ret);
94
95 /**
96 * Allocate one device ID to be used to play the specified AVI file in
97 * the parameter.
98 *
99 * @param f The factory.
100 * @param param The parameter, with at least the AVI file path
101 * set.
102 * @param p_id Optional pointer to receive device ID to play
103 * the file.
104 *
105 * @return PJ_SUCCESS or the appropriate error code.
106 *
107 */
108 PJ_DECL(pj_status_t) pjmedia_avi_dev_alloc(pjmedia_vid_dev_factory *f,
109 pjmedia_avi_dev_param *param,
110 pjmedia_vid_dev_index *p_id);
111
112 /**
113 * Retrieve the parameters set for the virtual device.
114 *
115 * @param id Device ID.
116 * @param param Structure to receive the settings.
117 *
118 * @return PJ_SUCCESS or the appropriate error code.
119 */
120 PJ_DECL(pj_status_t) pjmedia_avi_dev_get_param(pjmedia_vid_dev_index id,
121 pjmedia_avi_dev_param *param);
122
123 /**
124 * Free the resources associated with the virtual device.
125 *
126 * @param id The device ID.
127 *
128 * @return PJ_SUCCESS or the appropriate error code.
129 */
130 PJ_DECL(pj_status_t) pjmedia_avi_dev_free(pjmedia_vid_dev_index id);
131
132 /**
133 * @}
134 */
135
136 PJ_END_DECL
137
138
139 #endif /* __PJMEDIA_VIDEODEV_AVI_DEV_H__ */