Ignore:
Timestamp:
Mar 10, 2016 5:02:07 AM (8 years ago)
Author:
ming
Message:

Fixed #1907: Remove pjmedia* circular dependency

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia-videodev/videodev.h

    r5125 r5255  
    2424 * @brief Video device API. 
    2525 */ 
    26 #include <pjmedia-videodev/config.h> 
    27 #include <pjmedia-videodev/errno.h> 
    28 #include <pjmedia/event.h> 
    29 #include <pjmedia/frame.h> 
    30 #include <pjmedia/format.h> 
    31 #include <pj/pool.h> 
     26#include <pjmedia/videodev.h> 
    3227 
    3328 
     
    3530 
    3631/** 
    37  * @defgroup video_device_reference Video Device API Reference 
    38  * @ingroup video_device_api 
     32 * @defgroup video_device_reference Video Subsystem API Reference 
     33 * @ingroup video_subsystem_api 
    3934 * @brief API Reference 
    4035 * @{ 
    4136 */ 
    4237  
    43 /** 
    44  * Type for device index. 
    45  */ 
    46 typedef pj_int32_t pjmedia_vid_dev_index; 
    47  
    48 /** 
    49  * Enumeration of window handle type. 
    50  */ 
    51 typedef enum pjmedia_vid_dev_hwnd_type 
    52 { 
    53     /** 
    54      * Type none. 
    55      */ 
    56     PJMEDIA_VID_DEV_HWND_TYPE_NONE, 
    57  
    58     /** 
    59      * Native window handle on Windows. 
    60      */ 
    61     PJMEDIA_VID_DEV_HWND_TYPE_WINDOWS, 
    62  
    63     /** 
    64      * Native view on iOS. 
    65      */ 
    66     PJMEDIA_VID_DEV_HWND_TYPE_IOS, 
    67  
    68     /** 
    69      * Native window handle on Android. 
    70      */ 
    71     PJMEDIA_VID_DEV_HWND_TYPE_ANDROID 
    72  
    73 } pjmedia_vid_dev_hwnd_type; 
    74  
    75 /** 
    76  * Type for window handle. 
    77  */ 
    78 typedef struct pjmedia_vid_dev_hwnd 
    79 { 
    80     /** 
    81      * The window handle type. 
    82      */ 
    83     pjmedia_vid_dev_hwnd_type type; 
    84  
    85     /** 
    86      * The window handle. 
    87      */ 
    88     union 
    89     { 
    90         struct { 
    91             void    *hwnd;      /**< HWND       */ 
    92         } win; 
    93         struct { 
    94             void    *window;    /**< Window     */ 
    95             void    *display;   /**< Display    */ 
    96         } x11; 
    97         struct { 
    98             void    *window;    /**< Window     */ 
    99         } cocoa; 
    100         struct { 
    101             void    *window;    /**< Window     */ 
    102         } ios; 
    103         struct { 
    104             void    *window;    /**< Native window */ 
    105         } android; 
    106         void        *window; 
    107     } info; 
    108  
    109 } pjmedia_vid_dev_hwnd; 
    110  
    111 /** 
    112  * Parameter for switching device with PJMEDIA_VID_DEV_CAP_SWITCH capability. 
    113  * Initialize this with pjmedia_vid_dev_switch_param_default() 
    114  */ 
    115 typedef struct pjmedia_vid_dev_switch_param 
    116 { 
    117     /** 
    118      * Target device ID to switch to. Once the switching is successful, the 
    119      * video stream will use this device and the old device will be closed. 
    120      */ 
    121     pjmedia_vid_dev_index target_id; 
    122  
    123 } pjmedia_vid_dev_switch_param; 
    124  
    125  
    126 /** 
    127  * Enumeration of window flags. 
    128  */ 
    129 typedef enum pjmedia_vid_dev_wnd_flag 
    130 { 
    131     /** 
    132      * Window with border. 
    133      */ 
    134     PJMEDIA_VID_DEV_WND_BORDER = 1, 
    135  
    136     /** 
    137      * Window can be resized. 
    138      */ 
    139     PJMEDIA_VID_DEV_WND_RESIZABLE = 2 
    140  
    141 } pjmedia_vid_dev_wnd_flag; 
    142  
    143  
    144 /** 
    145  * Device index constants. 
    146  */ 
    147 enum pjmedia_vid_dev_std_index 
    148 { 
    149     /** 
    150      * Constant to denote default capture device 
    151      */ 
    152     PJMEDIA_VID_DEFAULT_CAPTURE_DEV = -1, 
    153  
    154     /** 
    155      * Constant to denote default render device 
    156      */ 
    157     PJMEDIA_VID_DEFAULT_RENDER_DEV = -2, 
    158  
    159     /** 
    160      * Constant to denote invalid device index. 
    161      */ 
    162     PJMEDIA_VID_INVALID_DEV = -3 
    163 }; 
    164  
    165  
    166 /** 
    167  * This enumeration identifies various video device capabilities. These video 
    168  * capabilities indicates what features are supported by the underlying 
    169  * video device implementation. 
    170  * 
    171  * Applications get these capabilities in the #pjmedia_vid_dev_info structure. 
    172  * 
    173  * Application can also set the specific features/capabilities when opening 
    174  * the video stream by setting the \a flags member of #pjmedia_vid_dev_param 
    175  * structure. 
    176  * 
    177  * Once video stream is running, application can also retrieve or set some 
    178  * specific video capability, by using #pjmedia_vid_dev_stream_get_cap() and 
    179  * #pjmedia_vid_dev_stream_set_cap() and specifying the desired capability. The 
    180  * value of the capability is specified as pointer, and application needs to 
    181  * supply the pointer with the correct value, according to the documentation 
    182  * of each of the capability. 
    183  */ 
    184 typedef enum pjmedia_vid_dev_cap 
    185 { 
    186     /** 
    187      * Support for video formats. The value of this capability 
    188      * is represented by #pjmedia_format structure. 
    189      */ 
    190     PJMEDIA_VID_DEV_CAP_FORMAT = 1, 
    191  
    192     /** 
    193      * Support for video input scaling 
    194      */ 
    195     PJMEDIA_VID_DEV_CAP_INPUT_SCALE = 2, 
    196  
    197     /** 
    198      * Support for returning the native window handle of the video window. 
    199      * For renderer, this means the window handle of the renderer window, 
    200      * while for capture, this means the window handle of the native preview, 
    201      * only if the device supports  PJMEDIA_VID_DEV_CAP_INPUT_PREVIEW 
    202      * capability. 
    203      * 
    204      * The value of this capability is pointer to pjmedia_vid_dev_hwnd 
    205      * structure. 
    206      */ 
    207     PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW = 4, 
    208  
    209     /** 
    210      * Support for resizing video output. This capability SHOULD be  
    211      * implemented by renderer, to alter the video output dimension on the fly. 
    212      * Value is pjmedia_rect_size.  
    213      */ 
    214     PJMEDIA_VID_DEV_CAP_OUTPUT_RESIZE = 8, 
    215  
    216     /** 
    217      * Support for setting the video window's position. 
    218      * Value is pjmedia_coord specifying the window's new coordinate. 
    219      */ 
    220     PJMEDIA_VID_DEV_CAP_OUTPUT_POSITION = 16, 
    221  
    222     /** 
    223      * Support for setting the video output's visibility. 
    224      * The value of this capability is a pj_bool_t containing boolean 
    225      * PJ_TRUE or PJ_FALSE. 
    226      */ 
    227     PJMEDIA_VID_DEV_CAP_OUTPUT_HIDE = 32, 
    228  
    229     /** 
    230      * Support for native preview capability in capture devices. Value is 
    231      * pj_bool_t. With native preview, capture device can be instructed to 
    232      * show or hide a preview window showing video directly from the camera 
    233      * by setting this capability to PJ_TRUE or PJ_FALSE. Once the preview 
    234      * is started, application may use PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW 
    235      * capability to query the video window. 
    236      * 
    237      * The value of this capability is a pj_bool_t containing boolean 
    238      * PJ_TRUE or PJ_FALSE. 
    239      */ 
    240     PJMEDIA_VID_DEV_CAP_INPUT_PREVIEW = 64, 
    241  
    242     /** 
    243      * Support for changing video orientation. For a renderer device, 
    244      * changing video orientation in will potentially affect the size of 
    245      * render window, i.e: width and height swap. For a capture device, 
    246      * the video will be rotated but the size of the video frame 
    247      * will stay the same, so the video may be resized or stretched. 
    248      * 
    249      * The value of this capability is pjmedia_orient. 
    250      */ 
    251     PJMEDIA_VID_DEV_CAP_ORIENTATION = 128, 
    252  
    253     /** 
    254      * Support for fast switching to another device. A video stream with this 
    255      * capability allows replacing of its underlying device with another 
    256      * device, saving the user from opening a new video stream and gets a much 
    257      * faster and smoother switching action. 
    258      * 
    259      * Note that even when this capability is supported by a device, it may 
    260      * not be able to switch to arbitrary device. Application must always 
    261      * check the return value of the operation to verify that switching has 
    262      * occurred. 
    263      * 
    264      * This capability is currently write-only (i.e. set-only). 
    265      * 
    266      * The value of this capability is pointer to pjmedia_vid_dev_switch_param 
    267      * structure. 
    268      */ 
    269     PJMEDIA_VID_DEV_CAP_SWITCH = 256, 
    270  
    271     /** 
    272      * Support for setting the output video window's flags. 
    273      * The value of this capability is a bitmask combination of 
    274      * #pjmedia_vid_dev_wnd_flag. 
    275      */ 
    276     PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW_FLAGS = 512, 
    277  
    278     /** 
    279      * End of standard capability 
    280      */ 
    281     PJMEDIA_VID_DEV_CAP_MAX = 16384 
    282  
    283 } pjmedia_vid_dev_cap; 
    284  
    285 /** 
    286  * Device information structure returned by #pjmedia_vid_dev_get_info(). 
    287  */ 
    288 typedef struct pjmedia_vid_dev_info 
    289 { 
    290     /** The device ID */ 
    291     pjmedia_vid_dev_index id; 
    292  
    293     /** The device name */ 
    294     char name[64]; 
    295  
    296     /** The underlying driver name */ 
    297     char driver[32]; 
    298  
    299     /**  
    300      * The supported direction of the video device, i.e. whether it supports  
    301      * capture only, render only, or both. 
    302      */ 
    303     pjmedia_dir dir; 
    304  
    305     /** 
    306      * Specify whether the device supports callback. Devices that implement 
    307      * "active interface" will actively call the callbacks to give or ask for 
    308      * video frames. If the device doesn't support callback, application 
    309      * must actively request or give video frames from/to the device by using 
    310      * pjmedia_vid_dev_stream_get_frame()/pjmedia_vid_dev_stream_put_frame(). 
    311      */ 
    312     pj_bool_t has_callback; 
    313  
    314     /** Device capabilities, as bitmask combination of #pjmedia_vid_dev_cap */ 
    315     unsigned caps; 
    316  
    317     /** Number of video formats supported by this device */ 
    318     unsigned fmt_cnt; 
    319  
    320     /**  
    321      * Array of supported video formats. Some fields in each supported video 
    322      * format may be set to zero or of "unknown" value, to indicate that the 
    323      * value is unknown or should be ignored. When these value are not set 
    324      * to zero, it indicates that the exact format combination is being used.  
    325      */ 
    326     pjmedia_format fmt[PJMEDIA_VID_DEV_INFO_FMT_CNT]; 
    327  
    328 } pjmedia_vid_dev_info; 
    329  
    330  
    331 /** Forward declaration for pjmedia_vid_dev_stream */ 
    332 typedef struct pjmedia_vid_dev_stream pjmedia_vid_dev_stream; 
    333  
    334 typedef struct pjmedia_vid_dev_cb 
    335 { 
    336     /** 
    337     * This callback is called by capturer stream when it has captured the 
    338     * whole packet worth of video samples. 
    339     * 
    340     * @param stream        The video stream. 
    341     * @param user_data     User data associated with the stream. 
    342     * @param frame         Captured frame. 
    343     * 
    344     * @return              Returning non-PJ_SUCCESS will cause the video 
    345     *                      stream to stop 
    346     */ 
    347     pj_status_t (*capture_cb)(pjmedia_vid_dev_stream *stream, 
    348                               void *user_data, 
    349                               pjmedia_frame *frame); 
    350  
    351     /** 
    352     * This callback is called by renderer stream when it needs additional 
    353     * data to be rendered by the device. Application must fill in the whole 
    354     * of output buffer with video samples. 
    355     * 
    356     * The frame argument contains the following values: 
    357     *  - timestamp         Rendering timestamp, in samples. 
    358     *  - buf               Buffer to be filled out by application. 
    359     *  - size              The size requested in bytes, which will be equal 
    360     *                      to the size of one whole packet. 
    361     * 
    362     * @param stream        The video stream. 
    363     * @param user_data     User data associated with the stream. 
    364     * @param frame         Video frame, which buffer is to be filled in by 
    365     *                      the application. 
    366     * 
    367     * @return              Returning non-PJ_SUCCESS will cause the video  
    368     *                      stream to stop 
    369     */ 
    370     pj_status_t (*render_cb)(pjmedia_vid_dev_stream *stream, 
    371                              void *user_data, 
    372                              pjmedia_frame *frame); 
    373  
    374 } pjmedia_vid_dev_cb; 
    375  
    376  
    377 /** 
    378  * This structure specifies the parameters to open the video stream. 
    379  */ 
    380 typedef struct pjmedia_vid_dev_param 
    381 { 
    382     /** 
    383      * The video direction. This setting is mandatory. 
    384      */ 
    385     pjmedia_dir dir; 
    386  
    387     /** 
    388      * The video capture device ID. This setting is mandatory if the video 
    389      * direction includes input/capture direction. 
    390      */ 
    391     pjmedia_vid_dev_index cap_id; 
    392  
    393     /** 
    394      * The video render device ID. This setting is mandatory if the video 
    395      * direction includes output/render direction. 
    396      */ 
    397     pjmedia_vid_dev_index rend_id; 
    398  
    399     /**  
    400      * Video clock rate. This setting is mandatory if the video 
    401      * direction includes input/capture direction 
    402      */ 
    403     unsigned clock_rate; 
    404  
    405     /** 
    406      * Video frame rate. This setting is mandatory if the video 
    407      * direction includes input/capture direction 
    408      */ 
    409 //    pjmedia_ratio frame_rate; 
    410  
    411     /** 
    412      * This flags specifies which of the optional settings are valid in this 
    413      * structure. The flags is bitmask combination of pjmedia_vid_dev_cap. 
    414      */ 
    415     unsigned flags; 
    416  
    417     /** 
    418      * Set the video format. This setting is mandatory. 
    419      */ 
    420     pjmedia_format fmt; 
    421  
    422     /** 
    423      * Window for the renderer to display the video. This setting is optional, 
    424      * and will only be used if PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW is set in  
    425      * the flags. 
    426      */ 
    427     pjmedia_vid_dev_hwnd window; 
    428  
    429     /** 
    430      * Video display size. This setting is optional, and will only be used  
    431      * if PJMEDIA_VID_DEV_CAP_OUTPUT_RESIZE is set in the flags. 
    432      */ 
    433     pjmedia_rect_size disp_size; 
    434  
    435     /** 
    436      * Video window position. This setting is optional, and will only be used 
    437      * if PJMEDIA_VID_DEV_CAP_OUTPUT_POSITION is set in the flags. 
    438      */ 
    439     pjmedia_coord window_pos; 
    440  
    441     /** 
    442      * Video window's visibility. This setting is optional, and will only be 
    443      * used if PJMEDIA_VID_DEV_CAP_OUTPUT_HIDE is set in the flags. 
    444      */ 
    445     pj_bool_t window_hide; 
    446  
    447     /** 
    448      * Enable built-in preview. This setting is optional and is only used 
    449      * if PJMEDIA_VID_DEV_CAP_INPUT_PREVIEW capability is supported and 
    450      * set in the flags. 
    451      */ 
    452     pj_bool_t native_preview; 
    453  
    454     /** 
    455      * Video orientation. This setting is optional and is only used if 
    456      * PJMEDIA_VID_DEV_CAP_ORIENTATION capability is supported and is 
    457      * set in the flags. 
    458      */ 
    459     pjmedia_orient orient; 
    460  
    461     /** 
    462      * Video window flags. This setting is optional, and will only be used 
    463      * if PJMEDIA_VID_DEV_CAP_OUTPUT_WINDOW_FLAGS is set in the flags. 
    464      */ 
    465     unsigned window_flags; 
    466  
    467 } pjmedia_vid_dev_param; 
    468  
    469  
    470 /** Forward declaration for video device factory */ 
    471 typedef struct pjmedia_vid_dev_factory pjmedia_vid_dev_factory; 
    472  
    473 /* typedef for factory creation function */ 
    474 typedef pjmedia_vid_dev_factory* 
    475 (*pjmedia_vid_dev_factory_create_func_ptr)(pj_pool_factory*); 
    476  
    477 /** 
    478  * Initialize pjmedia_vid_dev_switch_param. 
    479  * 
    480  * @param p         Parameter to be initialized. 
    481  */ 
    482 PJ_INLINE(void) 
    483 pjmedia_vid_dev_switch_param_default(pjmedia_vid_dev_switch_param *p) 
    484 { 
    485     pj_bzero(p, sizeof(*p)); 
    486     p->target_id = PJMEDIA_VID_INVALID_DEV; 
    487 } 
    488  
    489 /** 
    490  * Get string info for the specified capability. 
    491  * 
    492  * @param cap       The capability ID. 
    493  * @param p_desc    Optional pointer which will be filled with longer 
    494  *                  description about the capability. 
    495  * 
    496  * @return          Capability name. 
    497  */ 
    498 PJ_DECL(const char*) pjmedia_vid_dev_cap_name(pjmedia_vid_dev_cap cap, 
    499                                               const char **p_desc); 
    500  
    501  
    502 /** 
    503  * Set a capability field value in #pjmedia_vid_dev_param structure. This will 
    504  * also set the flags field for the specified capability in the structure. 
    505  * 
    506  * @param param     The structure. 
    507  * @param cap       The video capability which value is to be set. 
    508  * @param pval      Pointer to value. Please see the type of value to 
    509  *                  be supplied in the pjmedia_vid_dev_cap documentation. 
    510  * 
    511  * @return          PJ_SUCCESS on successful operation or the appropriate 
    512  *                  error code. 
    513  */ 
    514 PJ_DECL(pj_status_t) 
    515 pjmedia_vid_dev_param_set_cap(pjmedia_vid_dev_param *param, 
    516                               pjmedia_vid_dev_cap cap, 
    517                               const void *pval); 
    518  
    519  
    520 /** 
    521  * Get a capability field value from #pjmedia_vid_dev_param structure. This 
    522  * function will return PJMEDIA_EVID_INVCAP error if the flag for that 
    523  * capability is not set in the flags field in the structure. 
    524  * 
    525  * @param param     The structure. 
    526  * @param cap       The video capability which value is to be retrieved. 
    527  * @param pval      Pointer to value. Please see the type of value to 
    528  *                  be supplied in the pjmedia_vid_dev_cap documentation. 
    529  * 
    530  * @return          PJ_SUCCESS on successful operation or the appropriate 
    531  *                  error code. 
    532  */ 
    533 PJ_DECL(pj_status_t) 
    534 pjmedia_vid_dev_param_get_cap(const pjmedia_vid_dev_param *param, 
    535                               pjmedia_vid_dev_cap cap, 
    536                               void *pval); 
    53738 
    53839/** 
     
    611112 
    612113/** 
    613  * Refresh the list of video devices installed in the system. This function 
    614  * will only refresh the list of videoo device so all active video streams will 
    615  * be unaffected. After refreshing the device list, application MUST make sure 
    616  * to update all index references to video devices (i.e. all variables of type 
    617  * pjmedia_vid_dev_index) before calling any function that accepts video device 
    618  * index as its parameter. 
    619  * 
    620  * @return              PJ_SUCCESS on successful operation or the appropriate 
    621  *                      error code. 
    622  */ 
    623 PJ_DECL(pj_status_t) pjmedia_vid_dev_refresh(void); 
    624  
    625  
    626 /** 
    627  * Get the number of video devices installed in the system. 
    628  * 
    629  * @return          The number of video devices installed in the system. 
    630  */ 
    631 PJ_DECL(unsigned) pjmedia_vid_dev_count(void); 
    632  
    633  
    634 /** 
    635  * Get device information. 
    636  * 
    637  * @param id        The video device ID. 
    638  * @param info      The device information which will be filled in by this 
    639  *                  function once it returns successfully. 
    640  * 
    641  * @return          PJ_SUCCESS on successful operation or the appropriate 
    642  *                  error code. 
    643  */ 
    644 PJ_DECL(pj_status_t) pjmedia_vid_dev_get_info(pjmedia_vid_dev_index id, 
    645                                               pjmedia_vid_dev_info *info); 
    646  
    647  
    648 /** 
    649  * Lookup device index based on the driver and device name. 
    650  * 
    651  * @param drv_name  The driver name. 
    652  * @param dev_name  The device name. 
    653  * @param id        Pointer to store the returned device ID. 
    654  * 
    655  * @return          PJ_SUCCESS if the device can be found. 
    656  */ 
    657 PJ_DECL(pj_status_t) pjmedia_vid_dev_lookup(const char *drv_name, 
    658                                             const char *dev_name, 
    659                                             pjmedia_vid_dev_index *id); 
    660  
    661  
    662 /** 
    663  * Initialize the video device parameters with default values for the 
    664  * specified device. 
    665  * 
    666  * @param id        The video device ID. 
    667  * @param param     The video device parameters which will be initialized 
    668  *                  by this function once it returns successfully. 
    669  * 
    670  * @return          PJ_SUCCESS on successful operation or the appropriate 
    671  *                  error code. 
    672  */ 
    673 PJ_DECL(pj_status_t) 
    674 pjmedia_vid_dev_default_param(pj_pool_t *pool, 
    675                               pjmedia_vid_dev_index id, 
    676                               pjmedia_vid_dev_param *param); 
    677  
    678  
    679 /** 
    680  * Open video stream object using the specified parameters. If stream is 
    681  * created successfully, this function will return PJ_SUCCESS and the 
    682  * stream pointer will be returned in the p_strm argument. 
    683  * 
    684  * The opened stream may have been opened with different size and fps 
    685  * than the requested values in the \a param argument. Application should 
    686  * check the actual size and fps that the stream was opened with by inspecting 
    687  * the values in the \a param argument and see if they have changed. Also 
    688  * if the device ID in the \a param specifies default device, it may be 
    689  * replaced with the actual device ID upon return. 
    690  * 
    691  * @param param         On input, it specifies the video device parameters 
    692  *                      to be used for the stream. On output, this will be 
    693  *                      set to the actual video device parameters used to 
    694  *                      open the stream. 
    695  * @param cb            Pointer to structure containing video stream 
    696  *                      callbacks. 
    697  * @param user_data     Arbitrary user data, which will be given back in the 
    698  *                      callbacks. 
    699  * @param p_strm        Pointer to receive the video stream. 
    700  * 
    701  * @return              PJ_SUCCESS on successful operation or the appropriate 
    702  *                      error code. 
    703  */ 
    704 PJ_DECL(pj_status_t) pjmedia_vid_dev_stream_create( 
    705                                             pjmedia_vid_dev_param *param, 
    706                                             const pjmedia_vid_dev_cb *cb, 
    707                                             void *user_data, 
    708                                             pjmedia_vid_dev_stream **p_strm); 
    709  
    710 /** 
    711  * Get the running parameters for the specified video stream. 
    712  * 
    713  * @param strm      The video stream. 
    714  * @param param     Video stream parameters to be filled in by this 
    715  *                  function once it returns successfully. 
    716  * 
    717  * @return          PJ_SUCCESS on successful operation or the appropriate 
    718  *                  error code. 
    719  */ 
    720 PJ_DECL(pj_status_t) pjmedia_vid_dev_stream_get_param( 
    721                                             pjmedia_vid_dev_stream *strm, 
    722                                             pjmedia_vid_dev_param *param); 
    723  
    724 /** 
    725  * Get the value of a specific capability of the video stream. 
    726  * 
    727  * @param strm      The video stream. 
    728  * @param cap       The video capability which value is to be retrieved. 
    729  * @param value     Pointer to value to be filled in by this function 
    730  *                  once it returns successfully.  Please see the type 
    731  *                  of value to be supplied in the pjmedia_vid_dev_cap 
    732  *                  documentation. 
    733  * 
    734  * @return          PJ_SUCCESS on successful operation or the appropriate 
    735  *                  error code. 
    736  */ 
    737 PJ_DECL(pj_status_t) pjmedia_vid_dev_stream_get_cap( 
    738                                             pjmedia_vid_dev_stream *strm, 
    739                                             pjmedia_vid_dev_cap cap, 
    740                                             void *value); 
    741  
    742 /** 
    743  * Set the value of a specific capability of the video stream. 
    744  * 
    745  * @param strm      The video stream. 
    746  * @param cap       The video capability which value is to be set. 
    747  * @param value     Pointer to value. Please see the type of value to 
    748  *                  be supplied in the pjmedia_vid_dev_cap documentation. 
    749  * 
    750  * @return          PJ_SUCCESS on successful operation or the appropriate 
    751  *                  error code. 
    752  */ 
    753 PJ_DECL(pj_status_t) pjmedia_vid_dev_stream_set_cap( 
    754                                             pjmedia_vid_dev_stream *strm, 
    755                                             pjmedia_vid_dev_cap cap, 
    756                                             const void *value); 
    757  
    758 /** 
    759  * Start the stream. 
    760  * 
    761  * @param strm      The video stream. 
    762  * 
    763  * @return          PJ_SUCCESS on successful operation or the appropriate 
    764  *                  error code. 
    765  */ 
    766 PJ_DECL(pj_status_t) pjmedia_vid_dev_stream_start( 
    767                                             pjmedia_vid_dev_stream *strm); 
    768  
    769 /** 
    770  * Query whether the stream has been started. 
    771  * 
    772  * @param strm      The video stream 
    773  * 
    774  * @return          PJ_TRUE if the video stream has been started. 
    775  */ 
    776 PJ_DECL(pj_bool_t) pjmedia_vid_dev_stream_is_running(pjmedia_vid_dev_stream *strm); 
    777  
    778  
    779 /** 
    780  * Request one frame from the stream. Application needs to call this function 
    781  * periodically only if the stream doesn't support "active interface", i.e. 
    782  * the pjmedia_vid_dev_info.has_callback member is PJ_FALSE. 
    783  * 
    784  * @param strm      The video stream. 
    785  * @param frame     The video frame to be filled by the device. 
    786  * 
    787  * @return          PJ_SUCCESS on successful operation or the appropriate 
    788  *                  error code. 
    789  */ 
    790 PJ_DECL(pj_status_t) pjmedia_vid_dev_stream_get_frame( 
    791                                             pjmedia_vid_dev_stream *strm, 
    792                                             pjmedia_frame *frame); 
    793  
    794 /** 
    795  * Put one frame to the stream. Application needs to call this function 
    796  * periodically only if the stream doesn't support "active interface", i.e. 
    797  * the pjmedia_vid_dev_info.has_callback member is PJ_FALSE. 
    798  * 
    799  * @param strm      The video stream. 
    800  * @param frame     The video frame to put to the device. 
    801  * 
    802  * @return          PJ_SUCCESS on successful operation or the appropriate 
    803  *                  error code. 
    804  */ 
    805 PJ_DECL(pj_status_t) pjmedia_vid_dev_stream_put_frame( 
    806                                             pjmedia_vid_dev_stream *strm, 
    807                                             const pjmedia_frame *frame); 
    808  
    809 /** 
    810  * Stop the stream. 
    811  * 
    812  * @param strm      The video stream. 
    813  * 
    814  * @return          PJ_SUCCESS on successful operation or the appropriate 
    815  *                  error code. 
    816  */ 
    817 PJ_DECL(pj_status_t) pjmedia_vid_dev_stream_stop( 
    818                                             pjmedia_vid_dev_stream *strm); 
    819  
    820 /** 
    821  * Destroy the stream. 
    822  * 
    823  * @param strm      The video stream. 
    824  * 
    825  * @return          PJ_SUCCESS on successful operation or the appropriate 
    826  *                  error code. 
    827  */ 
    828 PJ_DECL(pj_status_t) pjmedia_vid_dev_stream_destroy( 
    829                                             pjmedia_vid_dev_stream *strm); 
    830  
    831  
    832 /** 
    833114 * @} 
    834115 */ 
Note: See TracChangeset for help on using the changeset viewer.