static int OpenDecoder( vlc_object_t *p_this ) { /* HACK: Don't use this codec if we don't have an a52 audio filter */ if( !module_exists( "a52tofloat32" ) ) return VLC_EGENERIC; return OpenCommon( p_this, false ); }
static int OpenPacketizer( vlc_object_t *p_this ) { decoder_t *p_dec = (decoder_t *)p_this; int ret = OpenCommon( p_dec, true ); if( ret == VLC_SUCCESS ) p_dec->pf_packetize = SendFrame; return ret; }
static int OpenDecoder( vlc_object_t *p_this ) { decoder_t *p_dec = (decoder_t *)p_this; int ret = OpenCommon( p_dec, false ); if( ret == VLC_SUCCESS ) { p_dec->pf_decode = DecodeFrame; p_dec->pf_flush = Flush; } return ret; }
static int Open(vout_display_t *vd, const vout_display_cfg_t *cfg, video_format_t *fmtp, vlc_video_context *context) { if (fmtp->i_chroma == VLC_CODEC_ANDROID_OPAQUE) return VLC_EGENERIC; /* There are two cases: * 1. the projection_mode is PROJECTION_MODE_RECTANGULAR * 2. gles2 vout failed */ fmtp->projection_mode = PROJECTION_MODE_RECTANGULAR; (void) context; return OpenCommon(vd, cfg, fmtp); }
static int OpenOpaque(vout_display_t *vd, const vout_display_cfg_t *cfg, video_format_t *fmtp, vlc_video_context *context) { if (fmtp->i_chroma != VLC_CODEC_ANDROID_OPAQUE) return VLC_EGENERIC; if (!vd->obj.force && (fmtp->projection_mode != PROJECTION_MODE_RECTANGULAR || fmtp->orientation != ORIENT_NORMAL)) { /* Let the gles2 vout handle orientation and projection */ return VLC_EGENERIC; } (void) context; return OpenCommon(vd, cfg, fmtp); }
XnStatus SimKinect::OpenDevice(const char* csXmlFile, EnumerationErrors& errors) { XnStatus nRetVal = XN_STATUS_OK; if (record_file !=NULL) { nRetVal = context.Init(); CHECK_RC(nRetVal, "Init"); xnSetPlayerRepeat(player,0); nRetVal = context.OpenFileRecording(record_file,player); if (nRetVal != XN_STATUS_OK) { printf("Can't open recording %s: %s\n", record_file, xnGetStatusString(nRetVal)); return nRetVal; } } else { nRetVal = context.InitFromXmlFile(csXmlFile, script_node, &errors); XN_IS_STATUS_OK(nRetVal); } OpenCommon(); return (XN_STATUS_OK); }
/** * It opens an imem access. */ static int OpenAccess(vlc_object_t *object) { access_t *access = (access_t *)object; imem_sys_t *sys; if (OpenCommon(object, &sys, access->psz_path)) return VLC_EGENERIC; if (var_InheritInteger(object, "imem-cat") != 4) { CloseCommon(sys); return VLC_EGENERIC; } /* */ access_InitFields(access); access->pf_control = ControlAccess; access->pf_read = NULL; access->pf_block = Block; access->pf_seek = NULL; access->p_sys = (access_sys_t*)sys; access->info.i_size = var_InheritInteger(object, "imem-size"); return VLC_SUCCESS; }
static int OpenPacketizer( vlc_object_t *p_this ) { return OpenCommon( p_this, true ); }
static int OpenDecoder( vlc_object_t *p_this ) { return OpenCommon( p_this, false ); }
/** * Open the video filter */ static int OpenVideo( vlc_object_t *p_this ) { return OpenCommon( p_this, false ); }
/** * Open the sub source */ static int OpenSub( vlc_object_t *p_this ) { return OpenCommon( p_this, true ); }
static int Open( vlc_object_t *p_this ) { return OpenCommon( p_this, p_this->obj.force ); }
/** * It opens an imem access_demux. */ static int OpenDemux(vlc_object_t *object) { demux_t *demux = (demux_t *)object; imem_sys_t *sys; if (OpenCommon(object, &sys, demux->psz_path)) return VLC_EGENERIC; /* ES format */ es_format_t fmt; es_format_Init(&fmt, UNKNOWN_ES, 0); fmt.i_id = var_InheritInteger(object, "imem-id"); fmt.i_group = var_InheritInteger(object, "imem-group"); char *tmp = var_InheritString(object, "imem-codec"); if (tmp) fmt.i_codec = vlc_fourcc_GetCodecFromString(UNKNOWN_ES, tmp); free(tmp); const int cat = var_InheritInteger(object, "imem-cat"); switch (cat) { case 1: { fmt.i_cat = AUDIO_ES; fmt.audio.i_channels = var_InheritInteger(object, "imem-channels"); fmt.audio.i_rate = var_InheritInteger(object, "imem-samplerate"); msg_Dbg(object, "Audio %4.4s %d channels %d Hz", (const char *)&fmt.i_codec, fmt.audio.i_channels, fmt.audio.i_rate); break; } case 2: { fmt.i_cat = VIDEO_ES; fmt.video.i_width = var_InheritInteger(object, "imem-width"); fmt.video.i_height = var_InheritInteger(object, "imem-height"); unsigned num, den; if (!var_InheritRational(object, &num, &den, "imem-dar") && num > 0 && den > 0) { if (fmt.video.i_width > 0 && fmt.video.i_height > 0) { fmt.video.i_sar_num = num * fmt.video.i_height; fmt.video.i_sar_den = den * fmt.video.i_width; } } if (!var_InheritRational(object, &num, &den, "imem-fps") && num > 0 && den > 0) { fmt.video.i_frame_rate = num; fmt.video.i_frame_rate_base = den; } msg_Dbg(object, "Video %4.4s %dx%d SAR %d:%d frame rate %u/%u", (const char *)&fmt.i_codec, fmt.video.i_width, fmt.video.i_height, fmt.video.i_sar_num, fmt.video.i_sar_den, fmt.video.i_frame_rate, fmt.video.i_frame_rate_base); break; } case 3: { fmt.i_cat = SPU_ES; fmt.subs.spu.i_original_frame_width = var_InheritInteger(object, "imem-width"); fmt.subs.spu.i_original_frame_height = var_InheritInteger(object, "imem-height"); msg_Dbg(object, "Subtitle %4.4s", (const char *)&fmt.i_codec); break; } default: if (cat != 4) msg_Err(object, "Invalid ES category"); es_format_Clean(&fmt); CloseCommon(sys); return VLC_EGENERIC; } fmt.psz_language = var_InheritString(object, "imem-language"); sys->es = es_out_Add(demux->out, &fmt); es_format_Clean(&fmt); if (!sys->es) { CloseCommon(sys); return VLC_EGENERIC; } /* */ demux->pf_control = ControlDemux; demux->pf_demux = Demux; demux->p_sys = (demux_sys_t*)sys; demux->info.i_update = 0; demux->info.i_title = 0; demux->info.i_seekpoint = 0; return VLC_SUCCESS; }