/* constructor */ static tsk_object_t* _tdav_producer_video_v4l2_ctor(tsk_object_t *self, va_list * app) { tdav_producer_video_v4l2_t *p_v4l2 = (tdav_producer_video_v4l2_t *)self; if (p_v4l2) { /* init base */ tmedia_producer_init(TMEDIA_PRODUCER(p_v4l2)); TMEDIA_PRODUCER(p_v4l2)->video.chroma = tmedia_chroma_yuv420p; /* init self with default values*/ p_v4l2->fd = -1; TMEDIA_PRODUCER(p_v4l2)->video.fps = 15; TMEDIA_PRODUCER(p_v4l2)->video.width = 352; TMEDIA_PRODUCER(p_v4l2)->video.height = 288; tsk_safeobj_init(p_v4l2); } return self; }
/** Initialize Audio producer * @param self The producer to initialize */ int tdav_producer_audio_init(tdav_producer_audio_t* self) { int ret; if(!self){ TSK_DEBUG_ERROR("Invalid parameter"); return -1; } /* base */ if((ret = tmedia_producer_init(TMEDIA_PRODUCER(self)))){ return ret; } /* self (should be update by prepare() by using the codec's info)*/ self->bits_per_sample = TDAV_BITS_PER_SAMPLE_DEFAULT; self->channels = TDAV_CHANNELS_DEFAULT; self->rate = TDAV_RATE_DEFAULT; self->ptime = TDAV_PTIME_DEFAULT; return 0; }
/** Initialize Audio producer * @param self The producer to initialize */ int tdav_producer_audio_init(tdav_producer_audio_t* self) { int ret; if(!self){ TSK_DEBUG_ERROR("Invalid parameter"); return -1; } /* base */ if((ret = tmedia_producer_init(TMEDIA_PRODUCER(self)))){ return ret; } /* self (should be update by prepare() by using the codec's info)*/ TMEDIA_PRODUCER(self)->audio.bits_per_sample = TDAV_BITS_PER_SAMPLE_DEFAULT; TMEDIA_PRODUCER(self)->audio.channels = TDAV_CHANNELS_DEFAULT; TMEDIA_PRODUCER(self)->audio.rate = TDAV_RATE_DEFAULT; TMEDIA_PRODUCER(self)->audio.ptime = TDAV_PTIME_DEFAULT; TMEDIA_PRODUCER(self)->audio.gain = TSK_MIN(tmedia_defaults_get_audio_producer_gain(), TDAV_AUDIO_GAIN_MAX); return 0; }