Add media abstract layer.
This commit is contained in:
parent
6838fd98b7
commit
edd9503f12
|
@ -0,0 +1,98 @@
|
|||
/*
|
||||
* Copyright (C) 2009 Mamadou Diop.
|
||||
*
|
||||
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
|
||||
*
|
||||
* This file is part of Open Source Doubango Framework.
|
||||
*
|
||||
* DOUBANGO is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* DOUBANGO is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with DOUBANGO.
|
||||
*
|
||||
*/
|
||||
|
||||
/**@file tmedia.h
|
||||
* @brief Media.
|
||||
*
|
||||
* @author Mamadou Diop <diopmamadou(at)yahoo.fr>
|
||||
*
|
||||
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
|
||||
*/
|
||||
#ifndef TINYMEDIA_TMEDIA_H
|
||||
#define TINYMEDIA_TMEDIA_H
|
||||
|
||||
#include "tinymedia_config.h"
|
||||
|
||||
#include "tsk_params.h"
|
||||
|
||||
TMEDIA_BEGIN_DECLS
|
||||
|
||||
#define TMEDIA_VA_ARGS(name) tmedia_def_t, (const char*)name
|
||||
#define TMEDIA_CREATE(name) tsk_object_new(name))
|
||||
#define TMEDIA_CREATE_NULL() TSDP_HEADER_M_CREATE(tsk_null)
|
||||
|
||||
#define TMEDIA(self) ((tmedia_t*)(self))
|
||||
|
||||
typedef struct tmedia_s
|
||||
{
|
||||
TSK_DECLARE_OBJECT;
|
||||
|
||||
const struct tmedia_plugin_def_s* plugin;
|
||||
|
||||
char* name;
|
||||
uint32_t port;
|
||||
char* protocol;
|
||||
}
|
||||
tmedia_t;
|
||||
typedef tsk_list_t tmedias_L_t;
|
||||
|
||||
#define TMED_DECLARE_MEDIA tmedia_t media
|
||||
|
||||
typedef struct tmedia_plugin_def_s
|
||||
{
|
||||
const tsk_object_def_t* objdef;
|
||||
const char* name;
|
||||
|
||||
int (* set_params) (tmedia_t* , const tsk_params_L_t* );
|
||||
|
||||
int (* start) (tmedia_t* );
|
||||
int (* pause) (tmedia_t* );
|
||||
int (* stop) (tmedia_t* );
|
||||
|
||||
char* (* get_local_offer) (tmedia_t* );
|
||||
char* (* get_negotiated_offer) (tmedia_t* );
|
||||
int (* set_remote_offer) (tmedia_t* , const char* );
|
||||
}
|
||||
tmedia_plugin_def_t;
|
||||
|
||||
TINYMEDIA_API int tmedia_init(tmedia_t* self, const char* name);
|
||||
TINYMEDIA_API int tmedia_deinit(tmedia_t* self);
|
||||
|
||||
TINYMEDIA_API int tmedia_plugin_register(const tmedia_plugin_def_t* def);
|
||||
TINYMEDIA_API tmedia_t* tmedia_factory_create(const char* name);
|
||||
|
||||
TINYMEDIA_API int tmedia_set_params(tmedia_t* , const tsk_params_L_t* );
|
||||
|
||||
TINYMEDIA_API int tmedia_start(tmedia_t* );
|
||||
TINYMEDIA_API int tmedia_pause(tmedia_t* );
|
||||
TINYMEDIA_API int tmedia_stop(tmedia_t* );
|
||||
|
||||
TINYMEDIA_API char* tmedia_get_local_offer(tmedia_t* );
|
||||
TINYMEDIA_API char* tmedia_get_negotiated_offer(tmedia_t* );
|
||||
TINYMEDIA_API int tmedia_set_remote_offer(tmedia_t* , const char* );
|
||||
|
||||
TINYMEDIA_GEXTERN const void *tmedia_def_t;
|
||||
|
||||
TMEDIA_END_DECLS
|
||||
|
||||
|
||||
#endif /* TINYMEDIA_TMEDIA_H */
|
|
@ -0,0 +1,78 @@
|
|||
/*
|
||||
* Copyright (C) 2009 Mamadou Diop.
|
||||
*
|
||||
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
|
||||
*
|
||||
* This file is part of Open Source Doubango Framework.
|
||||
*
|
||||
* DOUBANGO is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* DOUBANGO is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with DOUBANGO.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef TINYMEDIA_CONFIG_H
|
||||
#define TINYMEDIA_CONFIG_H
|
||||
|
||||
#if HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef __SYMBIAN32__
|
||||
#undef _WIN32 /* Because of WINSCW */
|
||||
#endif
|
||||
|
||||
/* Windows (XP/Vista/7/CE and Windows Mobile) macro definition.
|
||||
*/
|
||||
#if defined(WIN32)|| defined(_WIN32) || defined(_WIN32_WCE)
|
||||
# define TMEDIA_UNDER_WINDOWS 1
|
||||
#endif
|
||||
|
||||
#if (TMEDIA_UNDER_WINDOWS || defined(__SYMBIAN32__)) && defined(TINYMEDIA_EXPORTS)
|
||||
# define TINYMEDIA_API __declspec(dllexport)
|
||||
# define TINYMEDIA_GEXTERN __declspec(dllexport)
|
||||
#elif (TMEDIA_UNDER_WINDOWS || defined(__SYMBIAN32__)) /*&& defined(TINYMEDIA_IMPORTS)*/
|
||||
# define TINYMEDIA_API __declspec(dllimport)
|
||||
# define TINYMEDIA_GEXTERN __declspec(dllimport)
|
||||
#else
|
||||
# define TINYMEDIA_API
|
||||
# define TINYMEDIA_GEXTERN extern
|
||||
#endif
|
||||
|
||||
/* Guards against C++ name mangling
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
# define TMEDIA_BEGIN_DECLS extern "C" {
|
||||
# define TMEDIA_END_DECLS }
|
||||
#else
|
||||
# define TMEDIA_BEGIN_DECLS
|
||||
# define TMEDIA_END_DECLS
|
||||
#endif
|
||||
|
||||
/* Disable some well-known warnings
|
||||
*/
|
||||
#ifdef _MSC_VER
|
||||
# define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
|
||||
/* Detecting C99 compilers
|
||||
*/
|
||||
#if (__STDC_VERSION__ == 199901L) && !defined(__C99__)
|
||||
# define __C99__
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#ifdef __SYMBIAN32__
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#endif // TINYMEDIA_CONFIG_H
|
|
@ -0,0 +1,242 @@
|
|||
/*
|
||||
* Copyright (C) 2009 Mamadou Diop.
|
||||
*
|
||||
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
|
||||
*
|
||||
* This file is part of Open Source Doubango Framework.
|
||||
*
|
||||
* DOUBANGO is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* DOUBANGO is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with DOUBANGO.
|
||||
*
|
||||
*/
|
||||
|
||||
/**@file tmedia.c
|
||||
* @brief Media.
|
||||
*
|
||||
* @author Mamadou Diop <diopmamadou(at)yahoo.fr>
|
||||
*
|
||||
* @date Created: Sat Nov 8 16:54:58 2009 mdiop
|
||||
*/
|
||||
#include "tinyMEDIA/tmedia.h"
|
||||
|
||||
#include "tsk_string.h"
|
||||
#include "tsk_memory.h"
|
||||
#include "tsk_debug.h"
|
||||
|
||||
#define TMED_MAX_PLUGINS 10
|
||||
const tmedia_plugin_def_t* __tmedia_plugins[TMED_MAX_PLUGINS] = {{0}};
|
||||
|
||||
int tmedia_init(tmedia_t* self, const char* name)
|
||||
{
|
||||
if(!self){
|
||||
return -1;
|
||||
}
|
||||
|
||||
tsk_strupdate(&self->name, name);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int tmedia_deinit(tmedia_t* self)
|
||||
{
|
||||
if(!self){
|
||||
return -1;
|
||||
}
|
||||
|
||||
TSK_FREE(self->name);
|
||||
TSK_FREE(self->protocol);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int tmedia_plugin_register(const tmedia_plugin_def_t* plugin)
|
||||
{
|
||||
size_t i;
|
||||
if(!plugin){
|
||||
return -1;
|
||||
}
|
||||
|
||||
for(i=0; i<TMED_MAX_PLUGINS; i++){
|
||||
if(!__tmedia_plugins[i]){
|
||||
__tmedia_plugins[i] = plugin;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
TSK_DEBUG_ERROR("There are already %d objects.", TMED_MAX_PLUGINS);
|
||||
return -2;
|
||||
}
|
||||
|
||||
tmedia_t* tmedia_factory_create(const char* name)
|
||||
{
|
||||
tmedia_t* ret = tsk_null;
|
||||
const tmedia_plugin_def_t* plugin;
|
||||
size_t i = 0;
|
||||
|
||||
while((i < TMED_MAX_PLUGINS) && (plugin = __tmedia_plugins[i++])){
|
||||
if(plugin->objdef && tsk_strequals(plugin->name, name)){
|
||||
if((ret = tsk_object_new(plugin->objdef, name))){
|
||||
ret->plugin = plugin;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int tmedia_set_params(tmedia_t* self, const tsk_params_L_t* params)
|
||||
{
|
||||
if(!self || !self->plugin){
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(!self->plugin->set_params){
|
||||
return -2;
|
||||
}
|
||||
else{
|
||||
return self->plugin->set_params(self, params);
|
||||
}
|
||||
}
|
||||
|
||||
int tmedia_start(tmedia_t* self)
|
||||
{
|
||||
if(!self || !self->plugin){
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(!self->plugin->start){
|
||||
return -2;
|
||||
}
|
||||
else{
|
||||
return self->plugin->start(self);
|
||||
}
|
||||
}
|
||||
int tmedia_pause(tmedia_t*self )
|
||||
{
|
||||
if(!self || !self->plugin){
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(!self->plugin->pause){
|
||||
return -2;
|
||||
}
|
||||
else{
|
||||
return self->plugin->pause(self);
|
||||
}
|
||||
}
|
||||
int tmedia_stop(tmedia_t* self)
|
||||
{
|
||||
if(!self || !self->plugin){
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(!self->plugin->stop){
|
||||
return -2;
|
||||
}
|
||||
else{
|
||||
return self->plugin->stop(self);
|
||||
}
|
||||
}
|
||||
|
||||
char* tmedia_get_local_offer(tmedia_t* self)
|
||||
{
|
||||
if(!self || !self->plugin){
|
||||
return tsk_null;
|
||||
}
|
||||
|
||||
if(!self->plugin->get_local_offer){
|
||||
return tsk_null;
|
||||
}
|
||||
else{
|
||||
return self->plugin->get_local_offer(self);
|
||||
}
|
||||
}
|
||||
|
||||
char* tmedia_get_negotiated_offer(tmedia_t* self)
|
||||
{
|
||||
if(!self || !self->plugin){
|
||||
return tsk_null;
|
||||
}
|
||||
|
||||
if(!self->plugin->get_negotiated_offer){
|
||||
return tsk_null;
|
||||
}
|
||||
else{
|
||||
return self->plugin->get_negotiated_offer(self);
|
||||
}
|
||||
}
|
||||
|
||||
int tmedia_set_remote_offer(tmedia_t* self, const char* offer)
|
||||
{
|
||||
if(!self || !self->plugin){
|
||||
return -1;
|
||||
}
|
||||
|
||||
if(!self->plugin->set_remote_offer){
|
||||
return -2;
|
||||
}
|
||||
else{
|
||||
return self->plugin->set_remote_offer(self, offer);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================
|
||||
// Media object definition
|
||||
//
|
||||
|
||||
static void* tmedia_create(tsk_object_t *self, va_list * app)
|
||||
{
|
||||
tmedia_t *media = self;
|
||||
if(media)
|
||||
{
|
||||
const char* name = va_arg(*app, const char*);
|
||||
|
||||
tmedia_init(media, name);
|
||||
}
|
||||
else{
|
||||
TSK_DEBUG_ERROR("Failed to create new media.");
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
static void* tmedia_destroy(tsk_object_t *self)
|
||||
{
|
||||
tmedia_t *media = self;
|
||||
if(media){
|
||||
tmedia_deinit(media);
|
||||
}
|
||||
else{
|
||||
TSK_DEBUG_ERROR("Null media.");
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
static int tmedia_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
static const tsk_object_def_t tmedia_def_s =
|
||||
{
|
||||
sizeof(tmedia_t),
|
||||
tmedia_create,
|
||||
tmedia_destroy,
|
||||
tmedia_cmp
|
||||
};
|
||||
|
||||
const void *tmedia_def_t = &tmedia_def_s;
|
||||
|
|
@ -0,0 +1,157 @@
|
|||
/*
|
||||
* Copyright (C) 2009 Mamadou Diop.
|
||||
*
|
||||
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
|
||||
*
|
||||
* This file is part of Open Source Doubango Framework.
|
||||
*
|
||||
* DOUBANGO is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* DOUBANGO is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with DOUBANGO.
|
||||
*
|
||||
*/
|
||||
#include "dummy.h"
|
||||
|
||||
#include "tsk_string.h"
|
||||
#include "tsk_memory.h"
|
||||
#include "tsk_debug.h"
|
||||
|
||||
|
||||
|
||||
int dummy_set_params(tmedia_t* self, const tsk_params_L_t* params)
|
||||
{
|
||||
dummy_t *dummy = DUMMY(self);
|
||||
TSK_DEBUG_INFO("dummy_set_params");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dummy_start(tmedia_t* self)
|
||||
{
|
||||
dummy_t *dummy = DUMMY(self);
|
||||
TSK_DEBUG_INFO("dummy_start");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dummy_pause(tmedia_t* self)
|
||||
{
|
||||
dummy_t *dummy = DUMMY(self);
|
||||
TSK_DEBUG_INFO("dummy_pause");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int dummy_stop(tmedia_t* self)
|
||||
{
|
||||
dummy_t *dummy = DUMMY(self);
|
||||
TSK_DEBUG_INFO("dummy_stop");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
char* dummy_get_local_offer(tmedia_t* self)
|
||||
{
|
||||
dummy_t *dummy = DUMMY(self);
|
||||
TSK_DEBUG_INFO("dummy_get_local_offer");
|
||||
|
||||
return tsk_strdup(dummy->local_sdp);
|
||||
}
|
||||
|
||||
char* dummy_get_negotiated_offer(tmedia_t* self)
|
||||
{
|
||||
dummy_t *dummy = DUMMY(self);
|
||||
TSK_DEBUG_INFO("dummy_get_negotiated_offer");
|
||||
|
||||
return tsk_strdup(dummy->negotiated_sdp);
|
||||
}
|
||||
|
||||
int dummy_set_remote_offer(tmedia_t* self, const char* offer)
|
||||
{
|
||||
dummy_t *dummy = DUMMY(self);
|
||||
TSK_DEBUG_INFO("dummy_set_remote_offer");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//========================================================
|
||||
// Dummy media object definition
|
||||
//
|
||||
static void* dummy_create(tsk_object_t *self, va_list * app)
|
||||
{
|
||||
dummy_t *dummy = self;
|
||||
if(dummy)
|
||||
{
|
||||
// Parameters include at least the media name
|
||||
tmedia_init(TMEDIA(dummy), va_arg(*app, const char*));
|
||||
|
||||
TMEDIA(dummy)->protocol = tsk_strdup("TCP/DUMMY");
|
||||
}
|
||||
else{
|
||||
TSK_DEBUG_ERROR("Failed to create new dummy media.");
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
static void* dummy_destroy(tsk_object_t *self)
|
||||
{
|
||||
dummy_t *dummy = self;
|
||||
if(dummy){
|
||||
tmedia_deinit(TMEDIA(dummy));
|
||||
TSK_FREE(dummy->local_sdp);
|
||||
TSK_FREE(dummy->remote_sdp);
|
||||
TSK_FREE(dummy->negotiated_sdp);
|
||||
}
|
||||
else{
|
||||
TSK_DEBUG_ERROR("Null dummy media.");
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
static int dummy_cmp(const tsk_object_t *obj1, const tsk_object_t *obj2)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
static const tsk_object_def_t dummy_def_s =
|
||||
{
|
||||
sizeof(dummy_t),
|
||||
dummy_create,
|
||||
dummy_destroy,
|
||||
dummy_cmp
|
||||
};
|
||||
|
||||
const tsk_object_def_t *dummy_def_t = &dummy_def_s;
|
||||
|
||||
//========================================================
|
||||
// Dummy media plugin definition
|
||||
//
|
||||
static const tmedia_plugin_def_t dummy_plugin_def_s =
|
||||
{
|
||||
&dummy_def_s,
|
||||
"dummy",
|
||||
|
||||
dummy_set_params,
|
||||
|
||||
dummy_start,
|
||||
dummy_pause,
|
||||
dummy_stop,
|
||||
|
||||
dummy_get_local_offer,
|
||||
dummy_get_negotiated_offer,
|
||||
dummy_set_remote_offer
|
||||
};
|
||||
const tmedia_plugin_def_t *dummy_plugin_def_t = &dummy_plugin_def_s;
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (C) 2009 Mamadou Diop.
|
||||
*
|
||||
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
|
||||
*
|
||||
* This file is part of Open Source Doubango Framework.
|
||||
*
|
||||
* DOUBANGO is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* DOUBANGO is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with DOUBANGO.
|
||||
*
|
||||
*/
|
||||
#ifndef TEST_MEDIA_DUMMY_H
|
||||
#define TEST_MEDIA_DUMMY_H
|
||||
|
||||
#include "tinyMEDIA/tmedia.h"
|
||||
|
||||
#define DUMMY(self) ((dummy_t*)(self))
|
||||
|
||||
typedef struct dummy_s
|
||||
{
|
||||
TMED_DECLARE_MEDIA;
|
||||
|
||||
char* local_sdp;
|
||||
char* remote_sdp;
|
||||
char* negotiated_sdp;
|
||||
}
|
||||
dummy_t;
|
||||
|
||||
const tsk_object_def_t *dummy_def_t;
|
||||
const tmedia_plugin_def_t *dummy_plugin_def_t;
|
||||
|
||||
|
||||
#endif /* TEST_MEDIA_DUMMY_H */
|
|
@ -0,0 +1,65 @@
|
|||
/*
|
||||
* Copyright (C) 2009 Mamadou Diop.
|
||||
*
|
||||
* Contact: Mamadou Diop <diopmamadou@yahoo.fr>
|
||||
*
|
||||
* This file is part of Open Source Doubango Framework.
|
||||
*
|
||||
* DOUBANGO is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* DOUBANGO is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with DOUBANGO.
|
||||
*
|
||||
*/
|
||||
#include "tinyMEDIA/tmedia.h"
|
||||
#include "dummy.h"
|
||||
|
||||
#include "tsk.h"
|
||||
|
||||
#ifdef _WIN32_WCE
|
||||
int _tmain(int argc, _TCHAR* argv[])
|
||||
#else
|
||||
int main()
|
||||
#endif
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
tmedia_t* dummy = tsk_null;
|
||||
char* str;
|
||||
|
||||
// Register dummy media
|
||||
tmedia_plugin_register(dummy_plugin_def_t);
|
||||
// ...if you have another one to register
|
||||
// ...and another
|
||||
// ...again and again
|
||||
|
||||
// Create dummy media
|
||||
if((dummy = tmedia_factory_create("dummy"))){
|
||||
|
||||
if((str = tmedia_get_local_offer(dummy))){
|
||||
TSK_FREE(str);
|
||||
}
|
||||
if((str = tmedia_get_negotiated_offer(dummy))){
|
||||
TSK_FREE(str);
|
||||
}
|
||||
tmedia_set_remote_offer(dummy, "sdp ...");
|
||||
|
||||
tmedia_start(dummy);
|
||||
tmedia_pause(dummy);
|
||||
tmedia_stop(dummy);
|
||||
|
||||
TSK_OBJECT_SAFE_FREE(dummy);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,197 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="test"
|
||||
ProjectGUID="{6ED4F246-C3B7-4DD5-9434-3A3F69CC0AD6}"
|
||||
RootNamespace="test"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(DOUBANGO_HOME)\thirdparties\win32\include";"$(SolutionDir)\include";"$(DOUBANGO_HOME)\tinySAK\src""
|
||||
PreprocessorDefinitions="DEBUG_LEVEL=DEBUG_LEVEL_INFO;WIN32;_DEBUG;_CONSOLE"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
WarnAsError="true"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="$(OutDir)\tinySAK.lib $(OutDir)\tinyMEDIA.lib"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
WarnAsError="true"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="1"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="source"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\dummy.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\test.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="include"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\dummy.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
|
@ -0,0 +1,44 @@
|
|||
|
||||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinyMEDIA", "tinyMEDIA.vcproj", "{52814B0D-7DCA-45B8-9A16-8B147040D619}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tinySAK", "..\tinySAK\tinySAK.vcproj", "{6BC9B796-10C6-4CF7-A6E4-E2DACCDA84DA}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test", "test\test.vcproj", "{6ED4F246-C3B7-4DD5-9434-3A3F69CC0AD6}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
|
||||
Release|Win32 = Release|Win32
|
||||
Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{52814B0D-7DCA-45B8-9A16-8B147040D619}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{52814B0D-7DCA-45B8-9A16-8B147040D619}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{52814B0D-7DCA-45B8-9A16-8B147040D619}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Win32
|
||||
{52814B0D-7DCA-45B8-9A16-8B147040D619}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{52814B0D-7DCA-45B8-9A16-8B147040D619}.Release|Win32.Build.0 = Release|Win32
|
||||
{52814B0D-7DCA-45B8-9A16-8B147040D619}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Win32
|
||||
{6BC9B796-10C6-4CF7-A6E4-E2DACCDA84DA}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{6BC9B796-10C6-4CF7-A6E4-E2DACCDA84DA}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{6BC9B796-10C6-4CF7-A6E4-E2DACCDA84DA}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
|
||||
{6BC9B796-10C6-4CF7-A6E4-E2DACCDA84DA}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
|
||||
{6BC9B796-10C6-4CF7-A6E4-E2DACCDA84DA}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
|
||||
{6BC9B796-10C6-4CF7-A6E4-E2DACCDA84DA}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{6BC9B796-10C6-4CF7-A6E4-E2DACCDA84DA}.Release|Win32.Build.0 = Release|Win32
|
||||
{6BC9B796-10C6-4CF7-A6E4-E2DACCDA84DA}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
|
||||
{6BC9B796-10C6-4CF7-A6E4-E2DACCDA84DA}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
|
||||
{6BC9B796-10C6-4CF7-A6E4-E2DACCDA84DA}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
|
||||
{6ED4F246-C3B7-4DD5-9434-3A3F69CC0AD6}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{6ED4F246-C3B7-4DD5-9434-3A3F69CC0AD6}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{6ED4F246-C3B7-4DD5-9434-3A3F69CC0AD6}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Win32
|
||||
{6ED4F246-C3B7-4DD5-9434-3A3F69CC0AD6}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{6ED4F246-C3B7-4DD5-9434-3A3F69CC0AD6}.Release|Win32.Build.0 = Release|Win32
|
||||
{6ED4F246-C3B7-4DD5-9434-3A3F69CC0AD6}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
|
@ -0,0 +1,201 @@
|
|||
<?xml version="1.0" encoding="Windows-1252"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9.00"
|
||||
Name="tinyMEDIA"
|
||||
ProjectGUID="{52814B0D-7DCA-45B8-9A16-8B147040D619}"
|
||||
RootNamespace="tinyMEDIA"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Win32"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories=""$(DOUBANGO_HOME)\thirdparties\win32\include";include;"$(DOUBANGO_HOME)\tinySAK\src""
|
||||
PreprocessorDefinitions="DEBUG_LEVEL=DEBUG_LEVEL_INFO;WIN32;_DEBUG;_WINDOWS;_USRDLL;TINYMEDIA_EXPORTS"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
WarnAsError="true"
|
||||
DebugInformationFormat="4"
|
||||
CompileAs="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="$(OutDir)\tinySAK.lib"
|
||||
LinkIncremental="2"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Win32"
|
||||
OutputDirectory="$(SolutionDir)$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="2"
|
||||
CharacterSet="1"
|
||||
WholeProgramOptimization="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
EnableIntrinsicFunctions="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;TINYMEDIA_EXPORTS"
|
||||
RuntimeLibrary="2"
|
||||
EnableFunctionLevelLinking="true"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
WarnAsError="true"
|
||||
DebugInformationFormat="3"
|
||||
CompileAs="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
LinkIncremental="1"
|
||||
GenerateDebugInformation="true"
|
||||
SubSystem="2"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
TargetMachine="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManifestTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCAppVerifierTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="headers(*.h)"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\include\tinymedia_config.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\include\tinymedia\tmedia.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="source(*.c)"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\src\tmedia.c"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
Loading…
Reference in New Issue