1
/* $Id: avi_dev.h 4016 2012-04-04 05:05:50Z bennylp $ */
3
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
5
* This program is free software; you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License as published by
7
* the Free Software Foundation; either version 2 of the License, or
8
* (at your option) any later version.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
#ifndef PJMEDIA_VIDEODEV_AVI_DEV_H__
20
#define PJMEDIA_VIDEODEV_AVI_DEV_H__
24
* @brief AVI player virtual device
26
#include <pjmedia-videodev/videodev.h>
27
#include <pjmedia/avi_stream.h>
32
* @defgroup avi_dev AVI Player Virtual Device
33
* @ingroup video_device_api
34
* @brief AVI player virtual device
36
* This describes a virtual capture device which takes its input from an AVI
41
* Settings for the AVI player virtual device. This param corresponds to
42
* PJMEDIA_VID_DEV_CAP_AVI_PLAY capability of the video device/stream.
44
typedef struct pjmedia_avi_dev_param
47
* Specifies the full path of the AVI file to be played.
52
* If this setting is specified when setting the device, this specifies
53
* the title to be assigned as the device name. If this setting not
54
* specified, the filename part of the path will be used.
59
* The underlying AVI streams created by the device. If the value is NULL,
60
* that means the device has not been configured yet. Application can use
61
* this field to retrieve the audio stream of the AVI. This setting is
62
* "get"-only and will be ignored in "set capability" operation.
64
pjmedia_avi_streams *avi_streams;
66
} pjmedia_avi_dev_param;
70
* Reset pjmedia_avi_dev_param with the default settings. This mostly will
71
* reset all values to NULL or zero.
73
* @param p The parameter to be initialized.
75
PJ_DECL(void) pjmedia_avi_dev_param_default(pjmedia_avi_dev_param *p);
79
* Create a AVI device factory, and register it to the video device
80
* subsystem. At least one factory needs to be created before an AVI
81
* device can be allocated and used, and normally only one factory is
82
* needed per application.
84
* @param pf Pool factory to be used.
85
* @param max_dev Number of devices to be reserved.
86
* @param p_ret Pointer to return the factory instance, to be
87
* used when allocating a virtual device.
89
* @return PJ_SUCCESS on success or the appropriate error code.
91
PJ_DECL(pj_status_t) pjmedia_avi_dev_create_factory(
94
pjmedia_vid_dev_factory **p_ret);
97
* Allocate one device ID to be used to play the specified AVI file in
100
* @param param The parameter, with at least the AVI file path
102
* @param p_id Optional pointer to receive device ID to play
105
* @return PJ_SUCCESS or the appropriate error code.
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);
113
* Retrieve the parameters set for the virtual device.
115
* @param id Device ID.
116
* @param prm Structure to receive the settings.
118
* @return PJ_SUCCESS or the appropriate error code.
120
PJ_DECL(pj_status_t) pjmedia_avi_dev_get_param(pjmedia_vid_dev_index id,
121
pjmedia_avi_dev_param *param);
124
* Free the resources associated with the virtual device.
126
* @param id The device ID.
128
* @return PJ_SUCCESS or the appropriate error code.
130
PJ_DECL(pj_status_t) pjmedia_avi_dev_free(pjmedia_vid_dev_index id);
139
#endif /* PJMEDIA_VIDEODEV_AVI_DEV_H__ */