Esempio n. 1
0
static void *NewGAPIVideoOutput()
{
	GAPIPriv *priv;
	GF_VideoOutput *driv = (GF_VideoOutput *) gf_malloc(sizeof(GF_VideoOutput));
	memset(driv, 0, sizeof(GF_VideoOutput));
	GF_REGISTER_MODULE_INTERFACE(driv, GF_VIDEO_OUTPUT_INTERFACE, "GAPI Video Output", "gpac distribution")

	priv = (GAPIPriv *) gf_malloc(sizeof(GAPIPriv));
	memset(priv, 0, sizeof(GAPIPriv));
	priv->mx = gf_mx_new("GAPI");
	driv->opaque = priv;

#ifdef GPAC_USE_OGL_ES
	driv->hw_caps = GF_VIDEO_HW_OPENGL | GF_VIDEO_HW_OPENGL_OFFSCREEN | GF_VIDEO_HW_OPENGL_OFFSCREEN_ALPHA;
#endif
	/*rgb, yuv to do*/

	driv->Setup = GAPI_Setup;
	driv->Shutdown = GAPI_Shutdown;
	driv->Flush = GAPI_Flush;
	driv->ProcessEvent = GAPI_ProcessEvent;
	driv->Blit = NULL;
	driv->LockBackBuffer = GAPI_LockBackBuffer;
	driv->SetFullScreen = GAPI_SetFullScreen;
	return (void *)driv;
}
Esempio n. 2
0
static void *EPOC_vout_new()
{
	EPOCVideo *priv;
	GF_VideoOutput *driv;
	GF_SAFEALLOC(driv, GF_VideoOutput);
	GF_REGISTER_MODULE_INTERFACE(driv, GF_VIDEO_OUTPUT_INTERFACE, "EPOC Video Output", "gpac distribution")

	GF_SAFEALLOC(priv, EPOCVideo);
	driv->opaque = priv;

	/*alpha and keying to do*/
	driv->hw_caps = 0;
#ifdef GPAC_USE_OGL_ES
	/*no offscreen opengl with epoc at the moment*/
	driv->hw_caps |= GF_VIDEO_HW_OPENGL;
#endif

	driv->Setup = EVID_Setup;
	driv->Shutdown = EVID_Shutdown;
	driv->Flush = EVID_Flush;
	driv->ProcessEvent = EVID_ProcessEvent;
	driv->Blit = NULL;
	driv->LockBackBuffer = EVID_LockBackBuffer;
	driv->SetFullScreen = EVID_SetFullScreen;
	return (void *)driv;
}
Esempio n. 3
0
GF_BaseDecoder *NewISCodec(u32 PL)
{
	ISPriv *priv;
	GF_SceneDecoder *tmp;
	
	tmp = (GF_SceneDecoder*) malloc(sizeof(GF_SceneDecoder));
	if (!tmp) return NULL;
	memset(tmp, 0, sizeof(GF_SceneDecoder));

	priv = (ISPriv *) malloc(sizeof(ISPriv));
	memset(priv, 0, sizeof(ISPriv));

	priv->is_nodes = gf_list_new();
	priv->ddf = gf_list_new();

	tmp->privateStack = priv;

	tmp->AttachStream = IS_AttachStream;
	tmp->DetachStream = IS_DetachStream;
	tmp->GetCapabilities = IS_GetCapabilities;
	tmp->SetCapabilities = IS_SetCapabilities;
	tmp->ProcessData = IS_ProcessData;
	/*we don't use this...*/
	tmp->AttachScene = NULL;

	GF_REGISTER_MODULE_INTERFACE(tmp, GF_SCENE_DECODER_INTERFACE, "GPAC InputSensor Decoder", "gpac distribution")

#if GPAC_HTK_DEMO
	priv->th = gf_th_new();
#endif
	return (GF_BaseDecoder *) tmp;
}
Esempio n. 4
0
GF_EXPORT
GF_BaseInterface *LoadInterface(u32 InterfaceType)
{
 	GF_HYB_In *hyb_in;
	GF_InputService *plug;
	if (InterfaceType != GF_NET_CLIENT_INTERFACE) return NULL;

	GF_SAFEALLOC(plug, GF_InputService);
	GF_REGISTER_MODULE_INTERFACE(plug, GF_NET_CLIENT_INTERFACE, "GPAC HYBRID MEDIA Loader", "gpac distribution")
	plug->RegisterMimeTypes=	HYB_RegisterMimeTypes;
	plug->CanHandleURL=			HYB_CanHandleURL;
	plug->ConnectService=		HYB_ConnectService;
	plug->CloseService=			HYB_CloseService;
	plug->GetServiceDescriptor=	HYB_GetServiceDesc;
	plug->ConnectChannel=		HYB_ConnectChannel;
	plug->DisconnectChannel=	HYB_DisconnectChannel;
	plug->ServiceCommand=		HYB_ServiceCommand;
	plug->CanHandleURLInService=HYB_CanHandleURLInService;
	plug->ChannelGetSLP=		HYB_ChannelGetSLP;
	plug->ChannelReleaseSLP=	HYB_ChannelReleaseSLP;

	GF_SAFEALLOC(hyb_in, GF_HYB_In);
	plug->priv = hyb_in;

	return (GF_BaseInterface *)plug;
}
Esempio n. 5
0
void *NewLoaderInterface()
{
	IMGLoader *priv;
	GF_InputService *plug;
	GF_SAFEALLOC(plug, GF_InputService);
	if (!plug) return NULL;
	GF_REGISTER_MODULE_INTERFACE(plug, GF_NET_CLIENT_INTERFACE, "GPAC Image Reader", "gpac distribution")

	GF_SAFEALLOC(priv, IMGLoader);
	if (!priv) {
		gf_free(plug);
		return NULL;
	}
	plug->priv = priv;

	plug->RegisterMimeTypes = IMG_RegisterMimeTypes;
	plug->CanHandleURL = IMG_CanHandleURL;
	plug->CanHandleURLInService = NULL;
	plug->ConnectService = IMG_ConnectService;
	plug->CloseService = IMG_CloseService;
	plug->GetServiceDescriptor = IMG_GetServiceDesc;
	plug->ConnectChannel = IMG_ConnectChannel;
	plug->DisconnectChannel = IMG_DisconnectChannel;
	plug->ChannelGetSLP = IMG_ChannelGetSLP;
	plug->ChannelReleaseSLP = IMG_ChannelReleaseSLP;
	plug->ServiceCommand = IMG_ServiceCommand;

	return plug;
}
Esempio n. 6
0
GF_BaseDecoder *NewHEVCDec()
{
	GF_MediaDecoder *ifcd;
	HEVCDec *dec;

	GF_SAFEALLOC(ifcd, GF_MediaDecoder);
	if (!ifcd) return NULL;
	GF_SAFEALLOC(dec, HEVCDec);
	if (!dec) {
		gf_free(ifcd);
		return NULL;
	}
	GF_REGISTER_MODULE_INTERFACE(ifcd, GF_MEDIA_DECODER_INTERFACE, "HEVC Decoder", "gpac distribution")

	ifcd->privateStack = dec;

	/*setup our own interface*/
	ifcd->AttachStream = HEVC_AttachStream;
	ifcd->DetachStream = HEVC_DetachStream;
	ifcd->GetCapabilities = HEVC_GetCapabilities;
	ifcd->SetCapabilities = HEVC_SetCapabilities;
	ifcd->GetName = HEVC_GetCodecName;
	ifcd->CanHandleStream = HEVC_CanHandleStream;
	ifcd->ProcessData = HEVC_ProcessData;
	ifcd->GetOutputBuffer = HEVC_GetOutputBuffer;
	return (GF_BaseDecoder *) ifcd;
}
Esempio n. 7
0
GF_InputService *isor_client_load()
{
    ISOMReader *reader;
    GF_InputService *plug;
    GF_SAFEALLOC(plug, GF_InputService);
    GF_REGISTER_MODULE_INTERFACE(plug, GF_NET_CLIENT_INTERFACE, "GPAC IsoMedia Reader", "gpac distribution")
    plug->RegisterMimeTypes = ISOR_RegisterMimeTypes;
    plug->CanHandleURL = ISOR_CanHandleURL;
    plug->ConnectService = ISOR_ConnectService;
    plug->CloseService = ISOR_CloseService;
    plug->GetServiceDescriptor = ISOR_GetServiceDesc;
    plug->ConnectChannel = ISOR_ConnectChannel;
    plug->DisconnectChannel = ISOR_DisconnectChannel;
    plug->ServiceCommand = ISOR_ServiceCommand;
    plug->CanHandleURLInService = ISOR_CanHandleURLInService;
    /*we do support pull mode*/
    plug->ChannelGetSLP = ISOR_ChannelGetSLP;
    plug->ChannelReleaseSLP = ISOR_ChannelReleaseSLP;

    GF_SAFEALLOC(reader, ISOMReader);
    reader->channels = gf_list_new();
    reader->segment_mutex = gf_mx_new("ISO Segment");

    plug->priv = reader;
    return plug;
}
Esempio n. 8
0
GF_InputService *NewM2TSReader()
{
    M2TSIn *reader;
    GF_InputService *plug = gf_malloc(sizeof(GF_InputService));
    memset(plug, 0, sizeof(GF_InputService));
    GF_REGISTER_MODULE_INTERFACE(plug, GF_NET_CLIENT_INTERFACE, "GPAC MPEG-2 TS Reader", "gpac distribution")

    plug->CanHandleURL = M2TS_CanHandleURL;
    plug->CanHandleURLInService = M2TS_CanHandleURLInService;
    plug->ConnectService = M2TS_ConnectService;
    plug->CloseService = M2TS_CloseService;
    plug->GetServiceDescriptor = M2TS_GetServiceDesc;
    plug->ConnectChannel = M2TS_ConnectChannel;
    plug->DisconnectChannel = M2TS_DisconnectChannel;
    plug->ServiceCommand = M2TS_ServiceCommand;
    plug->RegisterMimeTypes = M2TS_RegisterMimeTypes;

    reader = gf_malloc(sizeof(M2TSIn));
    memset(reader, 0, sizeof(M2TSIn));
    plug->priv = reader;
    reader->ts = gf_m2ts_demux_new();
    reader->ts->on_event = M2TS_OnEvent;
    reader->ts->user = reader;
    reader->ts->demux_and_play = 1;
    reader->ts->th = gf_th_new("MPEG-2 TS Demux");

    reader->mx = gf_mx_new("MPEG2 Demux");

    return plug;
}
Esempio n. 9
0
GF_FontReader *ft_load()
{
	GF_FontReader *dr;
	FTBuilder *ftpriv;
	dr = gf_malloc(sizeof(GF_FontReader));
	memset(dr, 0, sizeof(GF_FontReader));
	GF_REGISTER_MODULE_INTERFACE(dr, GF_FONT_READER_INTERFACE, "FreeType Font Reader", "gpac distribution");

	ftpriv = gf_malloc(sizeof(FTBuilder));
	memset(ftpriv, 0, sizeof(FTBuilder));

	ftpriv->font_dirs = gf_list_new();

	ftpriv->loaded_fonts = gf_list_new();

	dr->udta = ftpriv;


	dr->init_font_engine = ft_init_font_engine;
	dr->shutdown_font_engine = ft_shutdown_font_engine;
	dr->set_font = ft_set_font;
	dr->get_font_info = ft_get_font_info;
	dr->get_glyphs = ft_get_glyphs;
	dr->load_glyph = ft_load_glyph;
	return dr;
}
Esempio n. 10
0
void *NewX11VideoOutput ()
{
	GF_VideoOutput *driv;
	XWindow *xWindow;
	GF_SAFEALLOC(driv, GF_VideoOutput);
	if (!driv) return NULL;
	GF_SAFEALLOC(xWindow, XWindow);
	if (!xWindow) {
		free(driv);
		return NULL;
	}
	GF_REGISTER_MODULE_INTERFACE(driv, GF_VIDEO_OUTPUT_INTERFACE, "X11 Video Output", "gpac distribution")

	driv->opaque = xWindow;

	driv->Flush = X11_Flush;
	driv->SetFullScreen = X11_SetFullScreen;
	driv->Setup = X11_Setup;
	driv->Shutdown = X11_Shutdown;
	driv->LockBackBuffer = X11_LockBackBuffer;
	driv->ProcessEvent = X11_ProcessEvent;
	driv->hw_caps = GF_VIDEO_HW_HAS_OPENGL;
	return (void *) driv;

}
Esempio n. 11
0
File: audio.c Progetto: Bevara/GPAC
void *SDL_NewAudio()
{
	SDLAudCtx *ctx;
	GF_AudioOutput *dr;


	ctx = gf_malloc(sizeof(SDLAudCtx));
	memset(ctx, 0, sizeof(SDLAudCtx));

	dr = gf_malloc(sizeof(GF_AudioOutput));
	memset(dr, 0, sizeof(GF_AudioOutput));
	GF_REGISTER_MODULE_INTERFACE(dr, GF_AUDIO_OUTPUT_INTERFACE, "SDL Audio Output", "gpac distribution");

	dr->opaque = ctx;

	dr->Setup = SDLAud_Setup;
	dr->Shutdown = SDLAud_Shutdown;
	dr->ConfigureOutput = SDLAud_ConfigureOutput;
	dr->SetVolume = SDLAud_SetVolume;
	dr->SetPan = SDLAud_SetPan;
	dr->Play = SDLAud_Play;
	dr->SetPriority = SDLAud_SetPriority;
	dr->GetAudioDelay = SDLAud_GetAudioDelay;
	dr->GetTotalBufferTime = SDLAud_GetTotalBufferTime;

	dr->QueryOutputSampleRate = SDLAud_QueryOutputSampleRate;
	/*always threaded*/
	dr->SelfThreaded = 1;
	ctx->audioBuff = NULL;
	ctx->volume = SDL_MIX_MAXVOLUME;
	return dr;
}
Esempio n. 12
0
GF_BaseDecoder *NewFAADDec()
{
	GF_MediaDecoder *ifce;
	FAADDec *dec;

	GF_SAFEALLOC(ifce, GF_MediaDecoder);
	if (!ifce) return NULL;
	GF_SAFEALLOC(dec, FAADDec);
	if (!dec) {
		gf_free(dec);
		return NULL;
	}
	GF_REGISTER_MODULE_INTERFACE(ifce, GF_MEDIA_DECODER_INTERFACE, "FAAD2 Decoder", "gpac distribution")

	ifce->privateStack = dec;

	/*setup our own interface*/
	ifce->AttachStream = FAAD_AttachStream;
	ifce->DetachStream = FAAD_DetachStream;
	ifce->GetCapabilities = FAAD_GetCapabilities;
	ifce->SetCapabilities = FAAD_SetCapabilities;
	ifce->ProcessData = FAAD_ProcessData;
	ifce->CanHandleStream = FAAD_CanHandleStream;
	ifce->GetName = FAAD_GetCodecName;
	return (GF_BaseDecoder *) ifce;
}
Esempio n. 13
0
	GF_VideoOutput *NewDektecVideoOutput()
	{
		GF_VideoOutput *driv = (GF_VideoOutput *) gf_malloc(sizeof(GF_VideoOutput));
		memset(driv, 0, sizeof(GF_VideoOutput));
		GF_REGISTER_MODULE_INTERFACE(driv, GF_VIDEO_OUTPUT_INTERFACE, "Dektec Video Output", "gpac distribution")

		DtDevice *dvc = new DtDevice;
		DtFrameBuffer *dtf = new DtFrameBuffer;
		if (!dtf || !dvc) {
			GF_LOG(GF_LOG_ERROR, GF_LOG_MODULE, ("[Dektec Out] DTA API couldn't be initialized.\n"));
			delete dvc;
			delete dtf;
			gf_free(driv);
			return NULL;
		}

		DtContext *dtc = new DtContext;
		memset(dtc, 0, sizeof(DtContext));
		dtc->dvc = dvc;
		dtc->dtf = dtf;
		driv->opaque = (void*)dtc;

		driv->Flush = Dektec_Flush;
		driv->LockBackBuffer = Dektec_LockBackBuffer;
		driv->Setup = Dektec_Setup;
		driv->Shutdown = Dektec_Shutdown;
		driv->ProcessEvent = Dektec_ProcessEvent;
		driv->Blit = Dektec_Blit;

		driv->hw_caps |= GF_VIDEO_HW_HAS_YUV_OVERLAY | GF_VIDEO_HW_HAS_YUV;

		return driv;
	}
Esempio n. 14
0
void *NewALSAOutput()
{
	ALSAContext *ctx;
	GF_AudioOutput*driv;
	GF_SAFEALLOC(ctx, ALSAContext);
	if(!ctx) return NULL;

	GF_SAFEALLOC(driv, GF_AudioOutput);
	if(!driv) {
		free(ctx);
		return NULL;
	}
	driv->opaque = ctx;
	driv->SelfThreaded = 0;
	driv->Setup = ALSA_Setup;
	driv->Shutdown = ALSA_Shutdown;
	driv->ConfigureOutput = ALSA_ConfigureOutput;
	driv->GetAudioDelay = ALSA_GetAudioDelay;
	driv->SetVolume = ALSA_SetVolume;
	driv->SetPan = ALSA_SetPan;
	driv->SetPriority = ALSA_SetPriority;
	driv->QueryOutputSampleRate = ALSA_QueryOutputSampleRate;
	driv->WriteAudio = ALSA_WriteAudio;
	GF_REGISTER_MODULE_INTERFACE(driv, GF_AUDIO_OUTPUT_INTERFACE, "ALSA Audio Output", "gpac distribution");
	return driv;
}
Esempio n. 15
0
GF_InputService *RTP_Load()
{
	RTPClient *priv;
	GF_InputService *plug;
	GF_SAFEALLOC(plug, GF_InputService);
	memset(plug, 0, sizeof(GF_InputService));
	GF_REGISTER_MODULE_INTERFACE(plug, GF_NET_CLIENT_INTERFACE, "GPAC RTP/RTSP Client", "gpac distribution")

	plug->CanHandleURL = RP_CanHandleURL;
	plug->CanHandleURLInService = RP_CanHandleURLInService;
	plug->ConnectService = RP_ConnectService;
	plug->CloseService = RP_CloseService;
	plug->GetServiceDescriptor = RP_GetServiceDesc;
	plug->ConnectChannel = RP_ConnectChannel;
	plug->DisconnectChannel = RP_DisconnectChannel;
	plug->ServiceCommand = RP_ServiceCommand;
	plug->RegisterMimeTypes = RP_RegisterMimeTypes;

	/*PULL mode for embedded streams*/
	plug->ChannelGetSLP = RP_ChannelGetSLP;
	plug->ChannelReleaseSLP = RP_ChannelReleaseSLP;

	GF_SAFEALLOC(priv, RTPClient);
	priv->sessions = gf_list_new();
	priv->channels = gf_list_new();

	plug->priv = priv;

	priv->time_out = 30000;
	priv->mx = gf_mx_new("RTPDemux");
	priv->th = gf_th_new("RTPDemux");

	return plug;
}
Esempio n. 16
0
void *NewWAVRender()
{
	WAVContext *ctx;
	GF_AudioOutput *driv;
	ctx = malloc(sizeof(WAVContext));
	memset(ctx, 0, sizeof(WAVContext));
	ctx->num_buffers = 10;
	ctx->pan = 50;
	ctx->vol = 100;
	driv = malloc(sizeof(GF_AudioOutput));
	memset(driv, 0, sizeof(GF_AudioOutput));
	GF_REGISTER_MODULE_INTERFACE(driv, GF_AUDIO_OUTPUT_INTERFACE, "Windows MME Output", "gpac distribution")

	driv->opaque = ctx;

	driv->SelfThreaded = 0;
	driv->Setup = WAV_Setup;
	driv->Shutdown = WAV_Shutdown;
	driv->ConfigureOutput = WAV_ConfigureOutput;
	driv->GetAudioDelay = WAV_GetAudioDelay;
	driv->GetTotalBufferTime = WAV_GetTotalBufferTime;
	driv->SetVolume = WAV_SetVolume;
	driv->SetPan = WAV_SetPan;
	driv->Play = WAV_Play;
	driv->QueryOutputSampleRate = WAV_QueryOutputSampleRate;
	driv->WriteAudio = WAV_WriteAudio;

	return driv;
}
Esempio n. 17
0
void *NewRawAudioOutput()
{
	RawContext *ctx;
	GF_AudioOutput *driv;
	ctx = gf_malloc(sizeof(RawContext));
	memset(ctx, 0, sizeof(RawContext));
	driv = gf_malloc(sizeof(GF_AudioOutput));
	memset(driv, 0, sizeof(GF_AudioOutput));
	GF_REGISTER_MODULE_INTERFACE(driv, GF_AUDIO_OUTPUT_INTERFACE, "Raw Audio Output", "gpac distribution")

	driv->opaque = ctx;

	driv->SelfThreaded = 0;
	driv->Setup = RAW_AudioSetup;
	driv->Shutdown = RAW_AudioShutdown;
	driv->ConfigureOutput = RAW_ConfigureOutput;
	driv->GetAudioDelay = RAW_GetAudioDelay;
	driv->GetTotalBufferTime = RAW_GetTotalBufferTime;
	driv->SetVolume = RAW_SetVolume;
	driv->SetPan = RAW_SetPan;
	driv->Play = RAW_Play;
	driv->QueryOutputSampleRate = RAW_QueryOutputSampleRate;
	driv->WriteAudio = RAW_WriteAudio;
	return driv;
}
Esempio n. 18
0
GF_BaseInterface *isow_load_cache()
{
	ISOMReader *cache;
	GF_StreamingCache *plug;
	GF_SAFEALLOC(plug, GF_StreamingCache);
	if (!plug) return NULL;
	GF_REGISTER_MODULE_INTERFACE(plug, GF_STREAMING_MEDIA_CACHE, "GPAC IsoMedia Cache", "gpac distribution")

	GF_SAFEALLOC(cache, ISOMReader);
	if (!cache) {
		gf_free(plug);
		return NULL;
	}
	cache->channels = gf_list_new();
	plug->priv = cache;

	plug->Open = ISOW_Open;
	plug->Close = ISOW_Close;
	plug->Write = ISOW_Write;
	plug->ChannelGetSLP = ISOW_ChannelGetSLP;
	plug->ChannelReleaseSLP = ISOW_ChannelReleaseSLP;
	plug->ServiceCommand = ISOW_ServiceCommand;

	return (GF_BaseInterface *) plug;
}
Esempio n. 19
0
GF_BaseDecoder *NewVTBDec()
{
	GF_MediaDecoder *ifcd;
	VTBDec *dec;

	GF_SAFEALLOC(ifcd, GF_MediaDecoder);
	if (!ifcd) return NULL;
	GF_SAFEALLOC(dec, VTBDec);
	if (!dec) {
		gf_free(ifcd);
		return NULL;
	}
	GF_REGISTER_MODULE_INTERFACE(ifcd, GF_MEDIA_DECODER_INTERFACE, "VideoToolbox Decoder", "gpac distribution")

	ifcd->privateStack = dec;

	/*setup our own interface*/
	ifcd->AttachStream = VTBDec_AttachStream;
	ifcd->DetachStream = VTBDec_DetachStream;
	ifcd->GetCapabilities = VTBDec_GetCapabilities;
	ifcd->SetCapabilities = VTBDec_SetCapabilities;
	ifcd->GetName = VTBDec_GetCodecName;
	ifcd->CanHandleStream = VTBDec_CanHandleStream;
	ifcd->ProcessData = VTBDec_ProcessData;
	return (GF_BaseDecoder *) ifcd;
}
Esempio n. 20
0
GPAC_MODULE_EXPORT
GF_BaseInterface *LoadInterface(u32 InterfaceType)
{
	DCReader *read;
	GF_InputService *plug;
	if (InterfaceType != GF_NET_CLIENT_INTERFACE) return NULL;

	GF_SAFEALLOC(plug, GF_InputService);
	memset(plug, 0, sizeof(GF_InputService));
	GF_REGISTER_MODULE_INTERFACE(plug, GF_NET_CLIENT_INTERFACE, "GPAC Dummy Loader", "gpac distribution")

	plug->RegisterMimeTypes = DC_RegisterMimeTypes;
	plug->CanHandleURL = DC_CanHandleURL;
	plug->ConnectService = DC_ConnectService;
	plug->CloseService = DC_CloseService;
	plug->GetServiceDescriptor = DC_GetServiceDesc;
	plug->ConnectChannel = DC_ConnectChannel;
	plug->DisconnectChannel = DC_DisconnectChannel;
	plug->ServiceCommand = DC_ServiceCommand;
	plug->CanHandleURLInService = DC_CanHandleURLInService;
	plug->ChannelGetSLP = DC_ChannelGetSLP;
	plug->ChannelReleaseSLP = DC_ChannelReleaseSLP;
	GF_SAFEALLOC(read, DCReader);
	read->channels = gf_list_new();
	plug->priv = read;
	return (GF_BaseInterface *)plug;
}
Esempio n. 21
0
GF_VideoOutput *NewRawVideoOutput()
{
	AndroidContext *pCtx;
	GF_VideoOutput *driv = (GF_VideoOutput *) gf_malloc(sizeof(GF_VideoOutput));
        LOG( ANDROID_LOG_INFO, TAG, "Android Video Initialization in progress...");
	memset(driv, 0, sizeof(GF_VideoOutput));
	GF_REGISTER_MODULE_INTERFACE(driv, GF_VIDEO_OUTPUT_INTERFACE, "Android Video Output", "gpac distribution")

	pCtx = gf_malloc(sizeof(AndroidContext));
	memset(pCtx, 0, sizeof(AndroidContext));

	pCtx->texID = -1;
	pCtx->framebuff = -1;
	pCtx->depthbuff = -1;
	driv->opaque = pCtx;

	driv->Flush = droid_Flush;
	driv->LockBackBuffer = droid_LockBackBuffer;
	driv->Setup = droid_Setup;
	driv->Shutdown = droid_Shutdown;
	driv->ProcessEvent = droid_ProcessEvent;

	driv->max_screen_width = 1024;
	driv->max_screen_height = 1024;

	driv->hw_caps = GF_VIDEO_HW_OPENGL;// | GF_VIDEO_HW_OPENGL_OFFSCREEN_ALPHA;//GF_VIDEO_HW_DIRECT_ONLY;//

	LOG( ANDROID_LOG_INFO, TAG, "Android Video Init Done.\n");
	return (void *)driv;
}
Esempio n. 22
0
GF_EXPORT
GF_BaseInterface *LoadInterface(u32 InterfaceType)
{
    GF_MPD_In *mpdin;
    GF_InputService *plug;
    if (InterfaceType != GF_NET_CLIENT_INTERFACE) return NULL;

    GF_SAFEALLOC(plug, GF_InputService);
    GF_REGISTER_MODULE_INTERFACE(plug, GF_NET_CLIENT_INTERFACE, "GPAC MPD Loader", "gpac distribution")
    plug->RegisterMimeTypes = MPD_RegisterMimeTypes;
    plug->CanHandleURL = MPD_CanHandleURL;
    plug->ConnectService = MPD_ConnectService;
    plug->CloseService = MPD_CloseService;
    plug->GetServiceDescriptor = MPD_GetServiceDesc;
    plug->ConnectChannel = MPD_ConnectChannel;
    plug->DisconnectChannel = MPD_DisconnectChannel;
    plug->ServiceCommand = MPD_ServiceCommand;
    plug->CanHandleURLInService = MPD_CanHandleURLInService;
    plug->ChannelGetSLP = MPD_ChannelGetSLP;
    plug->ChannelReleaseSLP = MPD_ChannelReleaseSLP;
    GF_SAFEALLOC(mpdin, GF_MPD_In);
    plug->priv = mpdin;
	mpdin->plug = plug;
    return (GF_BaseInterface *)plug;
}
Esempio n. 23
0
/**
 *	function DirectFBNewVideo
 * 	- creates a DirectFb module
 **/
void *DirectFBNewVideo()
{
	DirectFBVidCtx *ctx;
	GF_VideoOutput *driv;

	driv = gf_malloc(sizeof(GF_VideoOutput));
	memset(driv, 0, sizeof(GF_VideoOutput));
	GF_REGISTER_MODULE_INTERFACE(driv, GF_VIDEO_OUTPUT_INTERFACE, "DirectFB Video Output", "gpac distribution");

	ctx = gf_malloc(DirectFBVid_GetCtxSizeOf());
	memset(ctx, 0, DirectFBVid_GetCtxSizeOf());

	/* GF_VideoOutput */
	driv->opaque = ctx;
	driv->Setup = DirectFBVid_Setup;
	driv->Shutdown = DirectFBVid_Shutdown;
	driv->Flush = DirectFBVid_Flush;
	driv->SetFullScreen = DirectFBVid_SetFullScreen;
	driv->ProcessEvent = DirectFBVid_ProcessEvent;
	driv->LockBackBuffer = DirectFBVid_LockBackBuffer;
	driv->LockOSContext = NULL;
	driv->Blit = DirectFBVid_Blit;
	driv->hw_caps |= GF_VIDEO_HW_HAS_RGB | GF_VIDEO_HW_HAS_RGBA | GF_VIDEO_HW_HAS_YUV | GF_VIDEO_HW_HAS_STRETCH;

	return driv;
}
Esempio n. 24
0
void *NewX11VideoOutput ()
{
	GF_VideoOutput *driv;
	XWindow *xWindow;
	GF_SAFEALLOC(driv, GF_VideoOutput);
	if (!driv) return NULL;
	GF_SAFEALLOC(xWindow, XWindow);
	if (!xWindow) {
		gf_free(driv);
		return NULL;
	}
	GF_REGISTER_MODULE_INTERFACE(driv, GF_VIDEO_OUTPUT_INTERFACE, "X11 Video Output", "gpac distribution")

	driv->opaque = xWindow;

	driv->Flush = X11_Flush;
	driv->SetFullScreen = X11_SetFullScreen;
	driv->Setup = X11_Setup;
	driv->Shutdown = X11_Shutdown;
	driv->LockBackBuffer = X11_LockBackBuffer;
	driv->ProcessEvent = X11_ProcessEvent;
	driv->hw_caps = GF_VIDEO_HW_OPENGL;
	/*fixme - needs a better detection scheme*/
	driv->hw_caps |= GF_VIDEO_HW_OPENGL_OFFSCREEN | GF_VIDEO_HW_OPENGL_OFFSCREEN_ALPHA;
	return (void *) driv;

}
Esempio n. 25
0
void *New_FFMPEG_Demux()
{
	FFDemux *priv;
	GF_InputService *ffd = gf_malloc(sizeof(GF_InputService));
	memset(ffd, 0, sizeof(GF_InputService));

	GF_SAFEALLOC(priv, FFDemux);

	GF_LOG(GF_LOG_INFO, GF_LOG_CONTAINER, ("[FFMPEG Demuxer] Registering all ffmpeg plugins...\n") );
	/* register all codecs, demux and protocols */
	av_register_all();
	GF_LOG(GF_LOG_DEBUG, GF_LOG_CONTAINER, ("[FFMPEG Demuxer] Registering all ffmpeg plugins DONE.\n") );

	ffd->RegisterMimeTypes = FFD_RegisterMimeTypes;
	ffd->CanHandleURL = FFD_CanHandleURL;
	ffd->CloseService = FFD_CloseService;
	ffd->ConnectChannel = FFD_ConnectChannel;
	ffd->ConnectService = FFD_ConnectService;
	ffd->DisconnectChannel = FFD_DisconnectChannel;
	ffd->GetServiceDescriptor = FFD_GetServiceDesc;
	ffd->ServiceCommand = FFD_ServiceCommand;

	ffd->CanHandleURLInService = FFD_CanHandleURLInService;

	priv->thread = gf_th_new("FFMPEG Demux");
	priv->mx = gf_mx_new("FFMPEG Demux");

	GF_REGISTER_MODULE_INTERFACE(ffd, GF_NET_CLIENT_INTERFACE, "FFMPEG Demuxer", "gpac distribution");
	ffd->priv = priv;
	return ffd;
}
Esempio n. 26
0
GF_EXPORT
GF_BaseInterface *LoadInterface(u32 InterfaceType)
{
	if (InterfaceType == GF_NET_CLIENT_INTERFACE) {
		LibPlayerIn *read;
		GF_InputService *plug;
		GF_SAFEALLOC(plug, GF_InputService);
		memset(plug, 0, sizeof(GF_InputService));
		GF_REGISTER_MODULE_INTERFACE(plug, GF_NET_CLIENT_INTERFACE, "LibPlayer Input", "gpac distribution")

		plug->RegisterMimeTypes = LIBPLAYER_RegisterMimeTypes;
		plug->CanHandleURL = LIBPLAYER_CanHandleURL;
		plug->ConnectService = LIBPLAYER_ConnectService;
		plug->CloseService = LIBPLAYER_CloseService;
		plug->GetServiceDescriptor = LIBPLAYER_GetServiceDesc;
		plug->ConnectChannel = LIBPLAYER_ConnectChannel;
		plug->DisconnectChannel = LIBPLAYER_DisconnectChannel;
		plug->ServiceCommand = LIBPLAYER_ServiceCommand;
		plug->CanHandleURLInService = LIBPLAYER_CanHandleURLInService;

		GF_SAFEALLOC(read, LibPlayerIn);
		plug->priv = read;
		return (GF_BaseInterface *)plug;

	} else if (InterfaceType == GF_PRIVATE_MEDIA_DECODER_INTERFACE) {
		GF_PrivateMediaDecoder *ifce;

		GF_SAFEALLOC(ifce, GF_PrivateMediaDecoder);
		GF_REGISTER_MODULE_INTERFACE(ifce, GF_PRIVATE_MEDIA_DECODER_INTERFACE, "LibPlayer Decoder", "gpac distribution")

		/*setup our own interface*/
		ifce->AttachStream = LIBPLAYER_AttachStream;
		ifce->DetachStream = LIBPLAYER_DetachStream;
		ifce->GetCapabilities = LIBPLAYER_GetCapabilities;
		ifce->SetCapabilities = LIBPLAYER_SetCapabilities;
		ifce->Control = LIBPLAYER_Control;
		ifce->CanHandleStream = LIBPLAYER_CanHandleStream;
		ifce->GetName = LIBPLAYER_GetName;
		return (GF_BaseInterface *) ifce;
	}
	return NULL;
}
Esempio n. 27
0
void *SDL_NewVideo()
{
	SDLVidCtx *ctx;
	GF_VideoOutput *driv;
	
	driv = gf_malloc(sizeof(GF_VideoOutput));
	memset(driv, 0, sizeof(GF_VideoOutput));
	GF_REGISTER_MODULE_INTERFACE(driv, GF_VIDEO_OUTPUT_INTERFACE, "SDL Video Output", "gpac distribution");

	ctx = gf_malloc(sizeof(SDLVidCtx));
	memset(ctx, 0, sizeof(SDLVidCtx));
#ifdef	SDL_WINDOW_THREAD
	ctx->sdl_th = gf_th_new("SDLVideo");
#endif
	ctx->evt_mx = gf_mx_new("SDLEvents");
	
	driv->opaque = ctx;
	driv->Setup = SDLVid_Setup;
	driv->Shutdown = SDLVid_Shutdown;
	driv->SetFullScreen = SDLVid_SetFullScreen;
	driv->Flush = SDLVid_Flush;
	driv->ProcessEvent = SDLVid_ProcessEvent;
	/*no offscreen opengl with SDL*/
	driv->hw_caps |= GF_VIDEO_HW_OPENGL;

	/*no YUV hardware blitting in SDL (only overlays)*/
	driv->hw_caps |= GF_VIDEO_HW_HAS_YUV_OVERLAY | GF_VIDEO_HW_HAS_RGB | GF_VIDEO_HW_HAS_RGBA;
	driv->Blit = SDL_Blit;
	driv->LockBackBuffer = SDLVid_LockBackBuffer;
	driv->LockOSContext = NULL;

	/*color keying with overlays are not supported in SDL ...*/
#if 0
	/*get YUV overlay key*/
	opt = gf_modules_get_option((GF_BaseInterface *)driv, "Video", "OverlayColorKey");
	/*no set is the default*/
	if (!opt) {
		opt = "0101FE";
		gf_modules_set_option((GF_BaseInterface *)driv, "Video", "OverlayColorKey", "0101FE");
	}
	sscanf(opt, "%06x", &driv->overlay_color_key);
	if (driv->overlay_color_key) driv->overlay_color_key |= 0xFF000000;
	GF_LOG(GF_LOG_INFO, GF_LOG_MMIO, ("[SDL Out] YUV Overlays enabled - ColorKey enabled: %s (key %x)\n", 
									driv->overlay_color_key ? "Yes" : "No", driv->overlay_color_key
							));
#endif
#ifndef SDL_TEXTINPUTEVENT_TEXT_SIZE
	SDL_EnableUNICODE(1);
#else
	SDL_StartTextInput();
#endif /* SDL_TEXTINPUTEVENT_TEXT_SIZE */
	return driv;
}
Esempio n. 28
0
GF_TermExt *uir_new()
{
	GF_TermExt *dr;
	GF_UIRecord *uir;
	dr = (GF_TermExt*)gf_malloc(sizeof(GF_TermExt));
	memset(dr, 0, sizeof(GF_TermExt));
	GF_REGISTER_MODULE_INTERFACE(dr, GF_TERM_EXT_INTERFACE, "GPAC UI Recorder", "gpac distribution");

	GF_SAFEALLOC(uir, GF_UIRecord);
	dr->process = uir_process;
	dr->udta = uir;
	return dr;
}
Esempio n. 29
0
GF_TermExt *osd_new()
{
	GF_TermExt *dr;
	GF_OSD *osd;
	dr = (GF_TermExt*)gf_malloc(sizeof(GF_TermExt));
	memset(dr, 0, sizeof(GF_TermExt));
	GF_REGISTER_MODULE_INTERFACE(dr, GF_TERM_EXT_INTERFACE, "GPAC OnSscreen Display", "gpac distribution");

	GF_SAFEALLOC(osd, GF_OSD);
	dr->process = osd_process;
	dr->udta = osd;
	return dr;
}
Esempio n. 30
0
GF_TermExt *validator_new()
{
	GF_TermExt *dr;
	GF_Validator *validator;
	dr = (GF_TermExt*)gf_malloc(sizeof(GF_TermExt));
	memset(dr, 0, sizeof(GF_TermExt));
	GF_REGISTER_MODULE_INTERFACE(dr, GF_TERM_EXT_INTERFACE, "GPAC Test Validator", "gpac distribution");

	GF_SAFEALLOC(validator, GF_Validator);
	dr->process = validator_process;
	dr->udta = validator;
	return dr;
}