Ignore:
Timestamp:
Sep 27, 2006 10:49:55 PM (18 years ago)
Author:
bennylp
Message:

Added pjmedia_snd_stream_get_info() function.

NOTE SOUND DEVICE IMPLEMENTORS: YOU'LL NEED TO IMPLEMENT THIS

FUNCTION TOO *

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/dsound.c

    r732 r744  
    9090{ 
    9191    pjmedia_dir             dir;                /**< Sound direction.       */ 
     92    int                     play_id;            /**< Playback dev id.       */ 
     93    int                     rec_id;             /**< Recording dev id.      */ 
    9294    pj_pool_t              *pool;               /**< Memory pool.           */ 
    9395   
     
    102104    unsigned                clock_rate;         /**< Clock rate.            */ 
    103105    unsigned                samples_per_frame;  /**< Samples per frame.     */ 
     106    unsigned                bits_per_sample;    /**< Bits per sample.       */ 
     107    unsigned                channel_count;      /**< Channel count.         */ 
    104108 
    105109    pj_thread_t            *thread;             /**< Thread handle.         */ 
     
    720724    strm = pj_pool_zalloc(pool, sizeof(pjmedia_snd_stream)); 
    721725    strm->dir = dir; 
     726    strm->play_id = play_id; 
     727    strm->rec_id = rec_id; 
    722728    strm->pool = pool; 
    723729    strm->rec_cb = rec_cb; 
     
    726732    strm->clock_rate = clock_rate; 
    727733    strm->samples_per_frame = samples_per_frame; 
     734    strm->bits_per_sample = bits_per_sample; 
     735    strm->channel_count = channel_count; 
    728736    strm->buffer = pj_pool_alloc(pool, samples_per_frame * BYTES_PER_SAMPLE); 
    729737    if (!strm->buffer) { 
     
    828836 
    829837/* 
     838 * Get stream info. 
     839 */ 
     840PJ_DEF(pj_status_t) pjmedia_snd_stream_get_info(pjmedia_snd_stream *strm, 
     841                                                pjmedia_snd_stream_info *pi) 
     842{ 
     843 
     844    PJ_ASSERT_RETURN(strm && pi, PJ_EINVAL); 
     845 
     846    pj_bzero(pi, sizeof(*pi)); 
     847    pi->dir = strm->dir; 
     848    pi->play_id = strm->play_id; 
     849    pi->rec_id = strm->rec_id; 
     850    pi->clock_rate = strm->clock_rate; 
     851    pi->channel_count = strm->channel_count; 
     852    pi->samples_per_frame = strm->samples_per_frame; 
     853    pi->bits_per_sample = strm->bits_per_sample; 
     854    pi->rec_latency = 0; 
     855    pi->play_latency = 0; 
     856 
     857    return PJ_SUCCESS; 
     858} 
     859 
     860 
     861/* 
    830862 * Start stream. 
    831863 */ 
Note: See TracChangeset for help on using the changeset viewer.