Debian Codegraph @

Xpjproject/pjmedia/include/pjmedia-videodev/videodev.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_VIDEODEV_H__
19 #define __PJMEDIA_VIDEODEV_VIDEODEV_H__
20
21 /**
22 * @file videodev.h
23 * @brief Video device API.
24 */
25 #include <pjmedia/videodev.h>
26
27
28 PJ_BEGIN_DECL
29
30 /**
31 * @defgroup video_device_reference Video Device API Reference
32 * @ingroup video_subsystem_api
33 * @brief API Reference
34 * @{
35 */
36
37
38 /**
39 * Initialize the video device subsystem. This will register all supported
40 * video device factories to the video device subsystem. This function may be
41 * called more than once, but each call to this function must have the
42 * corresponding #pjmedia_vid_dev_subsys_shutdown() call.
43 *
44 * @param pf The pool factory.
45 *
46 * @return PJ_SUCCESS on successful operation or the appropriate
47 * error code.
48 */
49 PJ_DECL(pj_status_t) pjmedia_vid_dev_subsys_init(pj_pool_factory *pf);
50
51
52 /**
53 * Get the pool factory registered to the video device subsystem.
54 *
55 * @return The pool factory.
56 */
57 PJ_DECL(pj_pool_factory*) pjmedia_vid_dev_subsys_get_pool_factory(void);
58
59
60 /**
61 * Shutdown the video device subsystem. This will destroy all video device
62 * factories registered in the video device subsystem. Note that currently
63 * opened video streams may or may not be closed, depending on the
64 * implementation of the video device factories.
65 *
66 * @return PJ_SUCCESS on successful operation or the appropriate
67 * error code.
68 */
69 PJ_DECL(pj_status_t) pjmedia_vid_dev_subsys_shutdown(void);
70
71
72 /**
73 * Register a supported video device factory to the video device subsystem.
74 * Application can either register a function to create the factory, or
75 * an instance of an already created factory.
76 *
77 * This function can only be called after calling
78 * #pjmedia_vid_dev_subsys_init().
79 *
80 * @param vdf The factory creation function. Either vdf or factory
81 * argument must be specified.
82 * @param factory Factory instance. Either vdf or factory
83 * argument must be specified.
84 *
85 * @return PJ_SUCCESS on successful operation or the appropriate
86 * error code.
87 */
88 PJ_DECL(pj_status_t)
89 pjmedia_vid_register_factory(pjmedia_vid_dev_factory_create_func_ptr vdf,
90 pjmedia_vid_dev_factory *factory);
91
92
93 /**
94 * Unregister a video device factory from the video device subsystem. This
95 * function can only be called after calling #pjmedia_vid_dev_subsys_init().
96 * Devices from this factory will be unlisted. If a device from this factory
97 * is currently in use, then the behavior is undefined.
98 *
99 * @param vdf The video device factory. Either vdf or factory argument
100 * must be specified.
101 * @param factory The factory instance. Either vdf or factory argument
102 * must be specified.
103 *
104 * @return PJ_SUCCESS on successful operation or the appropriate
105 * error code.
106 */
107 PJ_DECL(pj_status_t)
108 pjmedia_vid_unregister_factory(pjmedia_vid_dev_factory_create_func_ptr vdf,
109 pjmedia_vid_dev_factory *factory);
110
111
112 /**
113 * @}
114 */
115
116 PJ_END_DECL
117
118
119 #endif /* __PJMEDIA_VIDEODEV_VIDEODEV_H__ */