/usr/include/pjmedia/vid_port.h is in libpjproject-dev 2.1.0.0.ast20130823-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 | /* $Id: vid_port.h 4168 2012-06-18 05:59:08Z ming $ */
/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __PJMEDIA_VIDPORT_H__
#define __PJMEDIA_VIDPORT_H__
/**
* @file pjmedia/videoport.h Video media port
* @brief Video media port
*/
#include <pjmedia-videodev/videodev.h>
#include <pjmedia/port.h>
/**
* @defgroup PJMEDIA_VIDEO_PORT Video media port
* @ingroup PJMEDIA_PORT_CLOCK
* @brief Video media port
* @{
*/
PJ_BEGIN_DECL
/**
* This structure describes the parameters to create a video port
*/
typedef struct pjmedia_vid_port_param
{
/**
* Video stream parameter.
*/
pjmedia_vid_dev_param vidparam;
/**
* Specify whether the video port should use active or passive interface.
* If active interface is selected, the video port will perform as
* a media clock, automatically calls pjmedia_port_get_frame() and
* pjmedia_port_put_frame() of its slave port (depending on the direction
* that is specified when opening the video stream). If passive interface
* is selected, application can retrieve the media port of this video
* port by calling pjmedia_vid_port_get_passive_port(), and subsequently
* calls pjmedia_port_put_frame() or pjmedia_port_get_frame() to that
* media port.
*
* Default: PJ_TRUE
*/
pj_bool_t active;
} pjmedia_vid_port_param;
/**
* Opaque data type for video port.
*/
typedef struct pjmedia_vid_port pjmedia_vid_port;
/**
* Initialize the parameter with the default values. Note that this typically
* would only fill the structure to zeroes unless they have different default
* values.
*
* @param prm The parameter.
*/
PJ_DECL(void) pjmedia_vid_port_param_default(pjmedia_vid_port_param *prm);
/**
* Create a video port with the specified parameter. When video port opens
* the video stream with different parameter than the requested values in
* the \a prm.vidparam argument, it will automatically do the necessary
* conversion.
*
* @param pool Pool to allocate memory from.
* @param prm The video port parameter.
* @param p_vp Pointer to receive the result.
*
* @return PJ_SUCCESS if video port has been created
* successfully, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjmedia_vid_port_create(pj_pool_t *pool,
const pjmedia_vid_port_param *prm,
pjmedia_vid_port **p_vp);
/**
* Set the callbacks of the video port's underlying video stream.
*
* @param vid_port The video port.
* @param cb Pointer to structure containing video stream
* callbacks.
* @param user_data Arbitrary user data, which will be given back in the
* callbacks.
*/
PJ_DECL(void) pjmedia_vid_port_set_cb(pjmedia_vid_port *vid_port,
const pjmedia_vid_dev_cb *cb,
void *user_data);
/**
* Return the underlying video stream of the video port.
*
* @param vid_port The video port.
*
* @return The video stream.
*/
PJ_DECL(pjmedia_vid_dev_stream*)
pjmedia_vid_port_get_stream(pjmedia_vid_port *vid_port);
/**
* Return the (passive) media port of the video port. This operation
* is only valid for video ports created with passive interface selected.
* Retrieving the media port for active video ports may raise an
* assertion.
*
* @param vid_port The video port.
*
* @return The media port instance, or NULL.
*/
PJ_DECL(pjmedia_port*)
pjmedia_vid_port_get_passive_port(pjmedia_vid_port *vid_port);
/**
* Get a clock source from the video port.
*
* @param vid_port The video port.
*
* @return The clock source.
*/
PJ_DECL(pjmedia_clock_src *)
pjmedia_vid_port_get_clock_src( pjmedia_vid_port *vid_port );
/**
* Set a clock source for the video port.
*
* @param vid_port The video port.
* @param clocksrc The clock source.
*
* @return PJ_SUCCESS on success or the appropriate error code.
*/
PJ_DECL(pj_status_t)
pjmedia_vid_port_set_clock_src( pjmedia_vid_port *vid_port,
pjmedia_clock_src *clocksrc );
/**
* Connect the video port to a downstream (slave) media port. This operation
* is only valid for video ports created with active interface selected.
* Connecting a passive video port may raise an assertion.
*
* @param vid_port The video port.
* @param port A downstream media port to be connected to
* this video port.
* @param destroy Specify if the downstream media port should also be
* destroyed by this video port when the video port
* is destroyed.
*
* @return PJ_SUCCESS on success or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjmedia_vid_port_connect(pjmedia_vid_port *vid_port,
pjmedia_port *port,
pj_bool_t destroy);
/**
* Disconnect the video port from its downstream (slave) media port, if any.
* This operation is only valid for video ports created with active interface
* selected, and assertion may be triggered if this is invoked on a passive
* video port.
*
* @param vid_port The video port.
*
* @return PJ_SUCCESS on success or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjmedia_vid_port_disconnect(pjmedia_vid_port *vid_port);
/**
* Retrieve the media port currently connected as downstream media port of the
* specified video port. This operation is only valid for video ports created
* with active interface selected, and assertion may be triggered if this is
* invoked on a passive video port.
*
* @param vid_port The video port.
*
* @return Media port currently connected to the video port,
* if any.
*/
PJ_DECL(pjmedia_port*)
pjmedia_vid_port_get_connected_port(pjmedia_vid_port *vid_port);
/**
* Start the video port.
*
* @param vid_port The video port.
*
* @return PJ_SUCCESS on success or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjmedia_vid_port_start(pjmedia_vid_port *vid_port);
/**
* Query whether the video port has been started.
*
* @param vid_port The video port.
*
* @return PJ_TRUE if the video port has been started.
*/
PJ_DECL(pj_bool_t) pjmedia_vid_port_is_running(pjmedia_vid_port *vid_port);
/**
* Stop the video port.
*
* @param vid_port The video port.
*
* @return PJ_SUCCESS on success or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjmedia_vid_port_stop(pjmedia_vid_port *vid_port);
/**
* Destroy the video port, along with its video stream. If the video port is
* an active one, this may also destroy the downstream media port, if the
* destroy flag is set when the media port is connected.
*
* @param vid_port The video port.
*/
PJ_DECL(void) pjmedia_vid_port_destroy(pjmedia_vid_port *vid_port);
PJ_END_DECL
/**
* @}
*/
#endif /* __PJMEDIA_VIDPORT_H__ */
|